Trying to add a rightclick buff to Natural Beastlord Hunter

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Mattr35
a lesser mummy
a lesser mummy
Posts: 43
Joined: Wed Dec 29, 2004 12:27 am

Trying to add a rightclick buff to Natural Beastlord Hunter

Post by Mattr35 » Sat Jan 29, 2005 4:12 pm

I'm trying to add this right click NBH so I can use my clicky chest haste.

This works by itself:

Code: Select all

Sub Main
/declare t string local 
   /varset t ${Me.Buff["Celerity"]} 
   /if ( ${t.Equal[NULL]} ) {
/if ( !${Target.ID}!=${Me.ID} ) {
         	/target ${Me.Name}
      }
      /call rightclick "tunic of the khati sha"
   } 
/return


Sub RightClick(ItemName) 
  /if (!${Defined[ItemName]}) /call DisplayError "RightClickItem;No Parameter" 
  /declare ItemLoc int local ${FindItem[=${ItemName}].InvSlot.ID} 
  /if (!${ItemLoc}) /call DisplayError "RightClickItem;Error, ${ItemName} not found in inventory." 

  /if (${InvSlot[${ItemLoc}].Pack.ID}) /return 
|If the item is inside a pack just exit. Nothing happens if you click them. 
  /itemnotify ${ItemLoc} rightmouseup 
  /delay 2 
  :WaitForCast 
    /if (${Me.Casting.ID}) /goto :WaitForCast 
/return
But then I add it to the end of NBH (I renamed Sub Main to Sub Haste), and I use this to call it in Sub Downtimework:

Code: Select all

    /call Haste
    /if ( ${Macro.Return}==0 ) /return 0
It seems to either skip over this call, or when it does go to haste, does not do anything.

Any ideas? (I know this could be cleaned up A LOT since I'm just using this to right click a specific item). I've also tried to change swap.mac to swap.inc and call it that way, but no luck.

Matt

Zeus
a hill giant
a hill giant
Posts: 180
Joined: Wed Feb 19, 2003 10:03 am
Contact:

Post by Zeus » Sat Jan 29, 2005 6:36 pm

Try manually debugging and see if you can find if it's entering the function etc. And I'm not quite sure but since that function only has one return and it returns nothing won't that if always be true?

Mattr35
a lesser mummy
a lesser mummy
Posts: 43
Joined: Wed Dec 29, 2004 12:27 am

Post by Mattr35 » Sat Jan 29, 2005 9:22 pm

I saw what I was doing wrong.... I was never letting it get to that point in the macro before I stopped it...

Anyway, cleaned it up and just used spellcast.inc

Code: Select all

Sub Haste
/declare t string local 
   /varset t ${Me.Buff["Celerity"]} 
   /if ( ${t.Equal[NULL]} ) {
/if ( !${Target.ID}!=${Me.ID} ) {
         	/target ${Me.Name}
      }
      /call Cast "tunic of the khati sha" item
   } 
/return
Thanks, Matt