Help with the old cheese.mac

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

Moderator: MacroQuest Developers

Harika
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Sep 17, 2003 6:17 pm
Contact:

Help with the old cheese.mac

Post by Harika » Wed Sep 17, 2003 6:28 pm

Was just looking for some help on the OLD cheese.mac

I was looking over the entire 34 pages of cheese.mac and tried arround 30 different things to try to rig cheese so it would work for me, but to no avail, most of the time i enter "/macro cheese.mac 9999" I face granger(the first time I ran it I bought 4milk/2rennan) it faces away and it gets stuck on a loop with the mixing bowl open. been looking at the code, it all seams good unless some of the old commands no longer work exactly *perfectly.*
anyway, to the point, could somone assist me in getting that bugger to work again?
Im not looking for someone to do this for me, just help, i really want to learn.

Code: Select all

| - Cheese.mac - 
| 
| Written by: Plazmic 
| Edited by: L124RD 
#include routines.mac 

#chat say 

Sub Main 
   /afk I am baking, I do not wish to be disturbed 
   /filter skills none 
   /stand 
   /mqlog 
   /varcalc v50 $char(plat)*10+$char(gold) 
   /varset t0 3000 
   /varset t1 $p0 

   :StartLoop 
   /call FindCombiner Mixing 
   /if $return==99 /return 
   /varset v80 $return 

   /target Granger 
   /if "$target()"=="FALSE" /goto :nogranger 
   /cleanup 
   :cleanuploop0 
    /if "$target()"=="TRUE" /goto :cleanuploop0 
   /click left auto 
   /click right inv $v80 

   /varset v39 0 
   /if "$cursor()"=="TRUE" /click left auto 
   :cleanpack 
   /if $pack($v80,empty)==FALSE /call CleanPack 
   /if n $v39==30 /goto :toofull 
   /varadd v39 1 
   /if $pack($v80,empty)==FALSE /goto :cleanpack 

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

   /face loc -100,1167 

   /sendkey down ctrl 
   /call MakeCheese2 
   /sendkey up ctrl 

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

   /call SellBuy 

   /if $t0==0 /call LogStats 

/goto :StartLoop 

:TooFull 
   /echo You are too full on stuff, aborting macro. 
   /mqlog You are too full on stuff, aborting macro 
   /call Logoff 
/return 


Sub CleanPack 
   /varcalc v2 $pack($v80,slots)-1 
   /sendkey down shift 
   /for v1 0 to $v2 
      /if "$item($v80,$v1)"=="NULL" /goto :skipclean 
      /click left pack $v80 $v1 
      :cleanwait0 
       /if "$cursor()"!="TRUE" /goto :cleanwait0 
      /click left auto 
      :cleanwait1 
       /if "$cursor()"=="TRUE" /goto :cleanwait1 
  :skipclean 
   /next v1 
   /sendkey up shift 
/return 

Sub MakeCheese 

   :MakeCheese 

      /finditem "Rennet" 
      /click left pack $v80 0 
      /delay 1 

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

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

      /finditem "Dairy Spoon" 
      /click left pack $v80 3 
      /delay 1 

      /if n $pack($v80,space)>0 /return 

      /click left pack $v80 combine 
      /for v1 1 to 75 
         /if "$cursor()"=="TRUE" /goto :AutoDropCheese 
         /delay 1 
      /next v1 

   /goto :MakeCheese 

   :AutoDropCheese 

      /if "$cursor(name)"=="Dairy Spoon" /goto :AutoDropSpoon 
      /click left auto 
      /delay 1 
      /if "$cursor()"=="TRUE" /goto :AutoDropCheese 

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

   /goto :MakeCheese 

/return 

Sub MakeCheese2 

   :MakeCheese 

      /finditem "Rennet" 
       /if $find()==FALSE /return 
      :rennetwait0 
       /if "$cursor()"!="TRUE" /goto :rennetwait0 
      /click left pack $v80 0 
      :rennetwait1 
       /if "$cursor()"=="TRUE" /goto :rennetwait1 

      /finditem "Bottle of Milk" 
       /if $find()==FALSE /return 
      :milkwait0 
       /if "$cursor()"!="TRUE" /goto :milkwait0 
      /click left pack $v80 1 
      :milkwait1 
       /if "$cursor()"=="TRUE" /goto :milkwait1 

      /finditem "Bottle of Milk" 
       /if $find()==FALSE /return 
      :milkwait0 
       /if "$cursor()"!="TRUE" /goto :milkwait0 
      /click left pack $v80 2 
      :milkwait1 
       /if "$cursor()"=="TRUE" /goto :milkwait1 

      /finditem "Dairy Spoon" 
       /if $find()==FALSE /return 
      :spoonwait0 
       /if "$cursor()"!="TRUE" /goto :spoonwait0 
      /click left pack $v80 3 
      :spoonwait1 
       /if "$cursor()"=="TRUE" /goto :spoonwait1 

      /if n $pack($v80,space)>0 /return 

      /click left pack $v80 combine 
      :cheesewait 
       /if "$cursor()"=="TRUE" /goto :AutoDropCheese 
       /goto :cheesewait 

   /goto :MakeCheese 

   :AutoDropCheese 

      /if "$cursor(name)"=="Dairy Spoon" /goto :AutoDropSpoon 
      /click left auto 
      /goto :AutoDropCheese 

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

   /goto :MakeCheese 

/return 


Sub SellBuy 

   | Open merchant 
   /click left auto 
   /target Granger 
   /face 
   /press u 
   /varset v55 0 
   /doevents flush 
   :sellwait 
    /doevents 
    /if n $v55!=1 /goto :sellwait 

   /sendkey down shift 

   | Sell our cheese 
   :SellCheese 
      /finditem "Mature Cheese" 
      /if $find()==FALSE /goto :DoneSelling 
      /call buyitem 
   /goto :SellCheese 

   :DoneSelling 
   /varset v51 0 
   /finditem "Rennet" 
   /if $find()==TRUE /varset v51 1 
   /finditem "Bottle of Milk" 
   /if $find()==TRUE /if n $v80!=$find(pack) /goto :SkipMilk 

   | Buy Bottles of Milk 
   /click left merchant 9 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 

   | If we had Rennet left, buy extra milk 
   /if n $v51==0 /goto :SkipMilk 
   /call buyitem 
   :SkipMilk 

   | Buy Rennets 
   /click left merchant 10 
   /call buyitem 
   /call buyitem 

   /sendkey up shift 
   /cleanup 
   :cleanuploop1 
    /if "$target()"=="TRUE" /goto :cleanuploop1 

/return 


Sub LogStats 

   | Calc profit in gold 
   /varcalc v51 $char(plat)*10+$char(gold)-$v50 

   | calc plat/hr 
   /varcalc v52 $v51*360/$running 

   | Plat 
   /varcalc v53 $v51/10 

   | left over gold 
   /varcalc v54 $v51%10 

   /echo Profit: $v53.$v54pp, avg: $v52pp/hr 
   /mqlog Run time: $running sec, Profit: $v53.$v54pp, Average = $v52pp/hr 

   /varset t0 3000 

/return 

sub LogOff 
/sit 
/camp 
/afk 
/endmacro 
/return 

Sub BuyItem 
   /varcalc v98 $char(gold)*100+$char(silver)*10+$char(copper) 
   /click left merchant buy 
   :WaitBuy 
      /varcalc v97 $char(gold)*100+$char(silver)*10+$char(copper) 
   /if n $v98==$v97 /goto :WaitBuy 
/return 

Sub Event_Chat 
/if "$p0"=="say" /if "$p1"~~"Granger" /varset v55 1 
/return
btw: if its a delay issue(very possible scince im currently in Korea, any sugestions are welcome

Harika
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Sep 17, 2003 6:17 pm
Contact:

Post by Harika » Thu Sep 18, 2003 2:48 pm

so far....I have found 2 mistakes, I think:

Code: Select all

/call findcombiner mixing
EDIT: friend had a good idea...check routines.mac and what do you know, im an idiot... mixing need to be "mixing"?

Code: Select all

Sub event_chat 

the first one never has a Sub defined at any point in the macro.

the second never gets refered to at any point in the code, does it need to be referenced?

also, quick question: when useinf Sub <name> does the name have to start with a capitol letter?
(that is ofcourse assumeing that the rest of the mac calls it as lowwercase..)

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Thu Sep 18, 2003 10:25 pm

Quick look through your macro ... my guess is that you don't have all your bags open. Open all your bags, re-arrange them so that none are overlapping (including your combiner). Close them all. re-open all your bags and start the macro.

/finditem no longer opens bags. If you don't want to open all your bags as instructed above, check out:

http://macroquest2.com/phpBB2/viewtopic.php?t=3032

Harika
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Sep 17, 2003 6:17 pm
Contact:

Post by Harika » Fri Sep 19, 2003 5:59 pm

ok, this is what i have so far... im getting this error when I try to run "1cheese.mac"


[Sat Sep 20 06:49:25 2003] You are now A.F.K. (Away From Keyboard).
[Sat Sep 20 06:49:25 2003] Filtering of skills changed to: None
[Sat Sep 20 06:49:25 2003] Ending macro: Usage: /varset <v#|p#|l#|t#|a(#,#)> <value>
[Sat Sep 20 06:49:25 2003] 1cheese.mac@16 (Main): /varset t1 $p0
[Sat Sep 20 06:49:25 2003] Cleared the following: Timers Vars Arrays
[Sat Sep 20 06:49:25 2003] The current macro has ended.

Code: Select all

| - Cheese.mac - 
| 
| Written by: Plazmic 
| Edited by: L124RD 
#include routines.mac 

#chat say 

Sub Main 
   /afk I am baking, I do not wish to be disturbed 
   /filter skills none 
   /stand 
   /mqlog 
   /varcalc v50 $char(plat)*10+$char(gold) 
   /varset t0 3000 
   /varset t1 $p0 

   :StartLoop 
   /call FindCombiner Mixing 
   /if $return==99 /return 
   /varset v80 $return 

   /target Granger 
   /if "$target()"=="FALSE" /goto :TooFull
    
   :cleanuploop0 
    /if "$target()"=="TRUE" /goto :fuck 
   :fuck
   /click left auto 
   /click right inv $v80 

   /varset v39 0 
   /if "$cursor()"=="TRUE" /click left auto 
   :packclean 
   /if $pack($v80,empty)==FALSE /call CleanPack 
   /if n $v39==30 /goto :toofull 
   /varadd v39 1 
   /if $pack($v80,empty)==FALSE /goto :packclean 

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

   /face loc -100,1167 

   /sendkey down ctrl 
   /call MakeCheese2 
   /sendkey up ctrl 

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

   /call SellBuy 

   /if $t0==0 /call LogStats 

/goto StartLoop 

:TooFull 
   /echo Your not near granger or:
   /echo You are too full on stuff, aborting macro. 
   /mqlog You are too full on stuff, aborting macro.
   /call Logoff 
/return 


Sub CleanPack 
   /varcalc v2 $pack($v80,slots)-1 
   /sendkey down shift 
   /for v1 0 to $v2 
      /if "$item($v80,$v1)"=="NULL" /goto :skipclean 
      /click left pack $v80 $v1 
      
      :cleanwait0 
       /click left auto
       /if "$cursor()"!="TRUE" /goto :cleanwait0 
       /click left auto 
      
      :cleanwait1 
       /click left auto
       /if "$cursor()"=="TRUE" /goto :cleanwait1 
       /click left auto
:skipclean 
   /next v1 
   /sendkey up shift 
/return 

Sub MakeCheese 

   :MakeCheese 

      /finditem "Rennet" 
      /click left pack $v80 0 
      /delay 1 

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

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

      /finditem "Dairy Spoon" 
      /click left pack $v80 3 
      /delay 1 

      /if n $pack($v80,space)>0 /return 

      /click left pack $v80 combine 
      /for v1 1 to 75 
         /if "$cursor()"=="TRUE" /goto :AutoDropCheese 
         /delay 1 
      /next v1 

   /goto :MakeCheese 

   :AutoDropCheese 

      /if "$cursor(name)"=="Dairy Spoon" /goto :AutoDropSpoon 
      /click left auto 
      /delay 1 
      /if "$cursor()"=="TRUE" /goto :AutoDropCheese 

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

   /goto :MakeCheese 

/return 

Sub MakeCheese2 

   :MakeCheese 

      /finditem "Rennet" 
       /if $find()==FALSE /return 
      :rennetwait0 
       /if "$cursor()"!="TRUE" /goto :rennetwait0 
      /click left pack $v80 0 
      :rennetwait1 
       /if "$cursor()"=="TRUE" /goto :rennetwait1 

      /finditem "Bottle of Milk" 
       /if $find()==FALSE /return 
      :milkwait0 
       /if "$cursor()"!="TRUE" /goto :milkwait0 
      /click left pack $v80 1 
      :milkwait1 
       /if "$cursor()"=="TRUE" /goto :milkwait1 

      /finditem "Bottle of Milk" 
       /if $find()==FALSE /return 
      :milkwait2 
       /if "$cursor()"!="TRUE" /goto :milkwait2 
      /click left pack $v80 2 
      :milkwait3 
       /if "$cursor()"=="TRUE" /goto :milkwait3 

      /finditem "Dairy Spoon" 
       /if $find()==FALSE /return 
      :spoonwait0 
       /if "$cursor()"!="TRUE" /goto :spoonwait0 
      /click left pack $v80 3 
      :spoonwait1 
       /if "$cursor()"=="TRUE" /goto :spoonwait1 

      /if n $pack($v80,space)>0 /return 

      /click left pack $v80 combine 
      :cheesewait 
       /if "$cursor()"=="TRUE" /goto :AutoDropCheese 
       /goto :cheesewait 

   /goto :MakeCheese 

   :AutoDropCheese 

      /if "$cursor(name)"=="Dairy Spoon" /goto :AutoDropSpoon 
      /click left auto 
      /goto :AutoDropCheese 

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

   /goto :MakeCheese 

/return 


Sub SellBuy 

   | Open merchant 
   /click left auto 
   /target Granger 
   /face 
   /press u 
   /varset v55 0 
   /doevents flush 
   :sellwait 
    /doevents 
    /if n $v55!=1 /goto :sellwait 

   /sendkey down shift 

   | Sell our cheese 
   :SellCheese 
      /finditem "Mature Cheese" 
      /if $find()==FALSE /goto :DoneSelling 
      /call buyitem 
   /goto :SellCheese 

   :DoneSelling 
   /varset v51 0 
   /finditem "Rennet" 
   /if $find()==TRUE /varset v51 1 
   /finditem "Bottle of Milk" 
   /if $find()==TRUE /if n $v80!=$find(pack) /goto :SkipMilk 

   | Buy Bottles of Milk 
   /click left merchant 9 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 

   | If we had Rennet left, buy extra milk 
   /if n $v51==0 /goto :SkipMilk 
   /call buyitem 
   :SkipMilk 

   | Buy Rennets 
   /click left merchant 10 
   /call buyitem 
   /call buyitem 

   /sendkey up shift 
    
   :cleanuploop1 
    /if "$target()"=="TRUE" /goto :cleanuploop1 

/return 


Sub LogStats 

   | Calc profit in gold 
   /varcalc v51 $char(plat)*10+$char(gold)-$v50 

   | calc plat/hr 
   /varcalc v52 $v51*360/$running 

   | Plat 
   /varcalc v53 $v51/10 

   | left over gold 
   /varcalc v54 $v51%10 

   /echo Profit: $v53.$v54pp, avg: $v52pp/hr 
   /mqlog Run time: $running sec, Profit: $v53.$v54pp, Average = $v52pp/hr 

   /varset t0 3000 

/return 

sub LogOff 
/sit 
/camp 
/afk 
/endmacro 
/return 

Sub BuyItem 
   /varcalc v98 $char(gold)*100+$char(silver)*10+$char(copper) 
   /click left merchant buy 
   :WaitBuy 
      /varcalc v97 $char(gold)*100+$char(silver)*10+$char(copper) 
   /if n $v98==$v97 /goto :WaitBuy 
/return 

Sub Event_Chat 
/if "$p0"=="say" /if "$p1"~~"Granger" /varset v55 1 
/return 
[quote][/quote]

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

cheese mac

Post by funmonkey » Thu Sep 25, 2003 3:26 am

i cant think of anything to change. is it possible that the delays could actually bork it up?

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Thu Sep 25, 2003 10:26 am

Lack of delays actually. Click is not instantaneous, and there are several places where left clicks (the usual culprit in clicky macros) are not followed by /delay. I recommend starting with /delay 2 after ever /click left. Slower computers or connections (lag IS a factor) require a higher /delay. I've had to run mine as high as /delay 8 on a slower computer with a dialup connection.

There's another post here (don't have the link sorry) where Valerian makes a suggestion for a WaitingForCursor loop that won't rely on /delay after /click left. Take a look at that, it should simplify things.
MQ2: Think of it as Evolution in action.