Page 1 of 1

READ THIS: If you use /if n $cursor(value)!=<value>

Posted: Thu Jun 27, 2002 12:26 am
by Domosan
If you are using that in your macros, that can get stuck in an infinite loop...here's how *smirk*

I had the macro running making cheese, and it put all the items into the container and was about to hit combine when my character drank 1 of the milks in the container (I know I know, REALLY bad timing on that), so it just sat in an infinite loop in the :AutoDropCheese area, because the cursor value was NULL which is !=143.

Here is the change I made in Cheese.mac:

Code: Select all

   :MakeCheese
      /varset v60 0
      /finditem "Rennet" 
      /click left pack $v80 0 

      /finditem "Bottle of Milk" 
      /click left pack $v80 1 

      /finditem "Bottle of Milk" 
      /click left pack $v80 2 

      /finditem "Dairy Spoon" 
      /click left pack $v80 3 
      /if $cursor(value)!=NULL /goto :AutoDropCheese 
      /if $find()==FALSE /endmacro 

      /if "$item($v80,0,name)"=="Rennet" /if "$item($v80,1,name)"=="Bottle of Milk" /if "$item($v80,2,name)"=="Bottle of Milk" /if "$item($v80,3,name)"=="Dairy Spoon" /goto :DoCombine
      /return

      :DoCombine 
      /click left pack $v80 combine 

      :AutoDropCheese
      /varcalc v61 $v60+1
      /varset v60 $v61
      /if n $v60>100 /return
      /if $cursor(value)!=143 /click left auto 
      /if $cursor(value)!=143 /goto :AutoDropCheese 
      /if $cursor(value)==143 /click left auto
   /goto :MakeCheese
/return 
I added a counter variable that makes the AutoDropCheese loop break if it's been in the loop for more than 10 seconds. That should be ample time for anyone's lag, and then it returns and continues on with the macro (SellBuy).

I know it was a fluke that it happened, but it CAN happen.

Domosan

Posted: Sat Jun 29, 2002 1:23 am
by L124RD
Salutations,
Simpler solution: place a pack full of food and drink in the first slot. place yer mixing bowl in the last slot. This is how mine is set up... don't have this problem...

Posted: Sat Jun 29, 2002 2:34 am
by Domosan
True -- but if you do that then you lose inventory slots that could be used for making profit :)

Posted: Sat Jun 29, 2002 4:49 pm
by L124RD
When i'm doing cheese i'm only buying a pack worth of stuff... that makes at most 20 stacks (i think) of cheese... My inventory is set up with all packs, minus one for the mixing bowl. With one filled with food, a mixing bowl, that leaves 47 slots for everything else to go into (48 - 1 for dairy spoon). I personally do not give a rip when it comes to slots on my cheese character, simply because she is a lvl 4 enchanter. THe only xp into level 4 was that from doing luclin faction quests. I've spent some money on cha items for her but other then that, she's mostly empty.