Page 1 of 1

Trying to add a rightclick buff to Natural Beastlord Hunter

Posted: Sat Jan 29, 2005 4:12 pm
by Mattr35
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

Posted: Sat Jan 29, 2005 6:36 pm
by Zeus
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?

Posted: Sat Jan 29, 2005 9:22 pm
by Mattr35
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