FindCombiner

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

FindCombiner

Post by eqsolro » Tue Sep 17, 2002 5:04 pm

edit: scrawled on the wall, rizwank loves code brackets

Code: Select all

#include routines.mac
| Test 1 

Sub Main 
/zapvars
/cleanup
/call FindCombiner Medicine
/if $return==99 /return

:StartHere 
/if $invpanel==FALSE /press i
/call xmain
/goto :Done

Sub xmain
/click right inv $return

:Done
/endmacro
This should open the Inventory .. and right click the Medicine Bag
ore im total wrong ?

( In /ident stands that the Medicine Bag Combine is Medicine )

User avatar
DeathSpiral
a ghoul
a ghoul
Posts: 95
Joined: Thu Aug 22, 2002 6:31 pm

Post by DeathSpiral » Tue Sep 17, 2002 5:16 pm

Code: Select all

| - base.mac -
| basis for any tradeskill macro

#include routines.mac
#define CombinerType medicine

sub Main
   /call FindCombiner CombinerType
   /if $return==99 /return
   /varset v80 $return

   /cleanup
   :CleaningLoop
      /if "$target()"=="TRUE" /goto :CleaningLoop
   /click left auto
   /click right inv $v80

   | Check to make sure the combiner is / can be made empty
   /varset v39 0
   /if "$cursor()"=="TRUE"  /click left auto
   :CleanCombiner
      /if $pack($v80,empty)==FALSE /call CleanContainer $v80
      /if n $v39==30 /goto :TooMuchStuff
      /varadd v39 1
      /if $pack($v80,empty)==FALSE /goto :CleanCombiner

   /if "$cursor()"=="TRUE" /click left auto

   | Do whatever you are going to do here, call a param, put the code
   | here, whatever

   /goto :End

   :TooMuchStuff
      /echo You have too much stuff on you!  Aborting...
      /mqlog You have too much stuff on you!  Aborting...

   :End
/return

sub CleanContainer
   /varcalc l0 $pack($p0,slots)-1
   /sendkey down shift
   /for l1 0 to $l0
      /if "$item($p0,$l1)"=="NULL" /goto :AlreadyClean
      /click left pack $p0 $l1
      :CleanContainerWait0
         /if "$cursor()"!="TRUE" /goto :CleanContainerWait0
      /doevents
      /click left auto
      :CleanContainerWait1
         /if "$cursor()"=="TRUE" /goto :CleanContainerWait1
      /doevents
   :AlreadyClean
    /next l1
    /sendkey up shift
/return
Obviously enough, you'll have to make some changes. I just went and ripped from a few posts and macros to put that together - its a little messy. Well, okay, maybe not a little... but you should get the general idea.
I am orc pawn, hear me yell for centurians...

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

Post by eqsolro » Wed Sep 18, 2002 2:28 am

Woot :)

I think ... i got it ... baaaah im on work ... and im full with new idears ;)

THY again