Having a problem with /finditem

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

GoatFoot
a lesser mummy
a lesser mummy
Posts: 68
Joined: Fri Jan 17, 2003 1:48 am

Having a problem with /finditem

Post by GoatFoot » Sun Oct 12, 2003 11:06 pm

What I want to do:
With inventory panel open, but no bags open, want to pick up 1 of a stack of items from the bag onto my cursor - basic stuff. This seems like it shouldn't be an issue. With /finditem, if an item is in a bag, the bag is opened and $getlasterror is set to FIND_PACKNOTOPEN. So.....

Code: Select all

|testfind.mac
Sub Main
  :getitem
     /sendkey down ctrl
     /finditem "@Param0"
     /sendkey up ctrl
     /echo $getlasterror
  /if "$getlasterror"~~"NOTOPEN" /goto :getitem
/return 

Tested with a stack of bat wings in pack 0

When the above is called as /mac testfind "bat wing", the macro enters an infinite loop - the cursor moves to and stays on pack 0, 'FIND_PACKNOTOPEN' is echoed continuously, and that's it.

It looks like "/finditem" does not like the ctrl key to be depressed when it needs to open a bag. testing this directly backs this up -- type /finditem "bat wing" - hold down ctrl - hit enter -- The cursor moves to pack 0, does not open bag.

As a point to note, ctrl+right click will fails to open a bag. Is this just an artifact of the EQ UI?

The work around is easy enough:

Code: Select all

Sub Main
  :getitem
     /sendkey down ctrl
     /finditem "@Param0"
     /sendkey up ctrl
     /echo $getlasterror
  [color=red]/if "$getlasterror"~~"NOTOPEN" {
     /finditem "@Param0"
     /goto :getitem
  }[/color]
/return