NPC give Quest Item 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

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

NPC give Quest Item macro

Post by bob_the_builder » Sat Nov 01, 2003 10:01 am

Think I did this one right except I have a click in it. Anyway to remove the /lclicktarget ? or is this acceptable macroing?

Code: Select all

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

Sub Main 
   /declare QuestItem local 
   
   :Finding 
      /doevents 
      /if n $count("@Param0")==0 /goto :Done 
      /finditem "@Param0" 

   :WaitFind 
      /doevents 
      /if "$cursor()"=="FALSE" /goto :WaitFind

   :GiveItem 
      /sendkey down ctrl 
      /for QuestItem 1 to 4 
         /doevents 
         /if n $count("@Param0")==0 /goto :Done 
         /finditem "@Param0" 
         /delay 5 
         /if "$cursor()"=="FALSE" /goto Done
         /lclicktarget 
         /click left npctrade $int($calc(@QuestItem-1)) 
         /delay 5 
      /next QuestItem 
      /sendkey up ctrl 
      /click left npctrade give 
      /delay 5 
   /goto :Giveitem
 
   :Done
      /doevents flush 
      /sendkey up shift 
      /endmacro 

/return
Bob

Joshjje
orc pawn
orc pawn
Posts: 18
Joined: Mon Oct 27, 2003 2:39 pm

...

Post by Joshjje » Sat Nov 01, 2003 10:45 am

Unless you are using an older version of MQ /lclicktarget and /rclicktarget have been removed and replaced by /click left|right target

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: NPC give Quest Item macro

Post by wassup » Sat Nov 01, 2003 11:16 am

If you don't have any reason for /doevents, why have them?

The only way to open the npc trade window is to give the npc an item.

I modified your code a little bit.

Code: Select all

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

Sub Main 
   /declare QuestItem local 
   :GiveItem
      /if n $count("@Param0")==0 /goto :Done 
      /sendkey down ctrl 
      /for QuestItem 0 to 3 
         /finditem "@Param0"
         :WaitForItem
         /if "$cursor()"=="FALSE" {
            /delay 0
            /goto :WaitForItem
         }
         /click left target
         :Wait
         /if $cursor()==TRUE {
            /delay 0
            /goto :Wait
         }
      /next QuestItem 
      /sendkey up ctrl 
      /click left npctrade give
      /delay 5
   /goto :GiveItem
  :Done
      /sendkey up shift 
      /endmacro 
/return