Problem with quest turnin macro.

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

OnyxSkyDV
a lesser mummy
a lesser mummy
Posts: 46
Joined: Wed Sep 18, 2002 1:02 pm

Problem with quest turnin macro.

Post by OnyxSkyDV » Tue Feb 03, 2004 7:17 pm

When I use the handin or questitem macro to turn in items to a quest npc in mass quantaties, it clicks the item on the noc, not the quest turnin window, so it ends up doing a turn in with a single stack of 4 items, instead of 4 unstacked items, and you get only one faction hit.

Can anyone help with this so that it will turn in 4 unstacked items instead?

Thanks!

Onyx

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Feb 04, 2004 8:05 am

I have no idea what you are asking. Post your code so we can look at it for errors.

OnyxSkyDV
a lesser mummy
a lesser mummy
Posts: 46
Joined: Wed Sep 18, 2002 1:02 pm

Clarification

Post by OnyxSkyDV » Wed Feb 04, 2004 10:45 am

Sorry, I noticed a typo that might have made it unclear.
This macro will turn a predetermined number of items into a NPC (not NOC) but from what I can tell the syntax does this by clicking on the npc, which ends up putting all 4 items in the first slot as opposed to 1 per open slot.

I am using the code Kagonis posted here http://macroquest2.com/phpBB2/viewtopic.php?t=3592

Thinking through this, it would seem the correct way would to be click on the npc with the item to bring up the quest turnin window for the first tiem, but then specify the 2nd,3rd,and 4th slot for the subsiquent turnins.

Is there a specific name for quest turn in window slots? That might be enough info for me to modify the code.

Thanks!

Here is the macro itself......

Code: Select all

| questitem.mac
| Useage: /macro QuestItem "bandages"
| Bob the Builder
| 11/1/03
|#turbo

| /mouseto plat|gold|silver|copper

Sub Main
   /declare QuestItem local
   /declare Timeout timer
   :GiveItem
      /if "$defined("Param1")"=="TRUE" /call Syntax
      /sendkey down ctrl
      /for QuestItem 1 to @Param1
         /if "@Param0"=="pp" {
            /mouseto plat
            /click left
         } else /if "@Param0"=="gp" {
            /mouseto gold
            /click left
         } else /if "@Param0"=="sp" {
            /mouseto silver
            /click left
         } else /if "@Param0"=="cp" {
            /mouseto copper
            /click left
         } else {
            /finditem "@Param0"
         }
         :WaitForItem
         /varset Timeout 5s
         /if "$cursor()"=="FALSE" {
            /if n @Timeout==0 /goto :Done
            /delay 0
            /goto :WaitForItem
         }
         /click left target
         :Wait
         /varset Timeout 10s
         /if $cursor()==TRUE {
            /if n @Timeout==0 /goto :Done
            /delay 0
            /goto :Wait
         }
      /next QuestItem
      /sendkey up ctrl
      /click left npctrade give
      /delay 5
      :ClearCursor
      /if $cursor()==TRUE {
         /if "$defined(@Param2)"=="TRUE" /if "@Param2"=="destroy" {
            /click left destroy
         } else {
            /click left auto
         }
         /delay 0
         /goto :ClearCursor
      }
   /goto :GiveItem
   :Done
      /sendkey up shift
      /endmacro
/return

Sub Syntax
   /echo Syntax: /macro handin <pp|gp|sp|cp|"Item Name"> <#> [destroy]
   /echo ..
   /echo Example: /macro handin gp 2 destroy
   /echo Will hand in 2 pieces of gold to the targeted NPC and then click give, and will destroy anything you get back on your cursor.
   /echo ..
   /echo Example: /macro handin "Batwing" 4
   /echo Will hand in 4 batwings to the targeted NPC and then click give, and will keep anything you get back on your cursor.
   /endmacro
/return

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Feb 04, 2004 12:29 pm

The problem is here:

Code: Select all

/click left target
Notice that no matter what is picked up and on the cursor it always clicks on the target, not the give window. By doing that the items will stack in the give window instead of going to seperate slots.

You need to iterate through the window. First click should be on the target, which will open the give window, second click to the second slot in the give window, and so on.

OnyxSkyDV
a lesser mummy
a lesser mummy
Posts: 46
Joined: Wed Sep 18, 2002 1:02 pm

Syntax

Post by OnyxSkyDV » Wed Feb 04, 2004 3:56 pm

Ya, as I mentioned in the post above, I figured that would be the correct way.

Can you tell the the syntax/name of the window slots? is it givewindow1 - 4?

OnyxSkyDV

GD
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jun 29, 2002 11:57 pm

Post by GD » Wed Feb 04, 2004 8:49 pm

Look at your locations.txt file and look for the name of the window, then use deductive reasoning.
Opinions are like assholes, everyone has one, but most of them stink.