how do I get this macro to loop...it works but stops...

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

Moderator: MacroQuest Developers

User avatar
Morath
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Oct 22, 2002 3:09 pm

how do I get this macro to loop...it works but stops...

Post by Morath » Sun Oct 27, 2002 11:59 am

This stops after one combine...what am I missing to loop it?

Code: Select all

| - Arrows.mac -
|
#turbo
#event CombineFail "You lacked the skills to fashion the items together."
#event CombineSuceed "You have fashioned the items together to create something new!"

Sub Main
   /call FindCombiner Fletching
   /varset v80 $return
   /if n $v80==99 /return

   /cleanup
   /click right inv $return
   :MakeArrows
      /sendkey down ctrl

      /finditem similar "Fletching"
      /click left pack $v80 0

      /finditem similar "Nock"
      /click left pack $v80 1

      /finditem similar "Shaft"
      /click left pack $v80 2

      /finditem similar "Arrowhead"
      /click left pack $v80 3

      /sendkey up ctrl
      /click left pack $return combine


      /if "$item($v80,0,name)"~~"Arrowhead" /if "$item($v80,1,name)"~~"Shaft" /if "$item($v80,2,name)"~~"Fletching" /if "$item($v80,3,name)"~~"nock" /goto :DoCombine 
      /sendkey up ctrl
      /return 

      :DoCombine 
      /varset v61 0 
      /doevents flush
      /varset t9 30s
      /click left pack $v80 combine 
      /goto :DropArrows 
      
      :DropArrows 
         /doevents
      /if n $v61==0 /if n $t9>0 /goto :DropArrows 
      /doevents flush
      /if $cursor()!=TRUE /if n $v61<2 /goto :MakeArrows
      :WaitCursor
	 /delay 0
      /if $cursor()!=TRUE /goto :WaitCursor
      /click left auto 
   /goto :MakeArrows 
/return

Sub Event_CombineFail 
   /varset v61 1
/return 

Sub Event_CombineSuceed 
   /varset v61 2 
/return 

Sub FindCombiner 
   /varset p2 99 
   /for v99 0 to 7 
      /if "$pack($v99,combine)"=="$p0" /varset p2 $v99 
   /next v99 
/return $p2 
Thx for help

Syn

Lurker_005
a lesser mummy
a lesser mummy
Posts: 51
Joined: Thu Oct 17, 2002 12:08 pm

Post by Lurker_005 » Sun Oct 27, 2002 1:12 pm

I like this from combine.mac better
:WaitCombine
/if $pack($v80,empty)==FALSE /goto :WaitCombine

:AutoDrop
/click left auto
/delay 1
/if "$cursor()"=="TRUE" /goto :AutoDrop


I see it will quit if the ingredients aren't correct. Like a wrong item, or extra items. Just check if the pack is empty before beginning, and take out the item check.