Cheese.mac - Please Help with Turbo problem

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

Moderator: MacroQuest Developers

EQFanatic
decaying skeleton
decaying skeleton
Posts: 4
Joined: Thu Jul 18, 2002 1:33 pm

Cheese.mac - Please Help with Turbo problem

Post by EQFanatic » Thu Jul 18, 2002 1:37 pm

I used a cheese macro I found here and it worked great. I tried to add in turbo and now when its run it WILL NOT access the merchant.. If I right click the merchant, the macro resumes, but each time it goes to access the merchant it wont.. Heres my code, hopefully someone can help me figure out why it wont work.

Code: Select all

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

#chat say 
#turbo
Sub Main 
   /afk Im working on baking, do not disturb.
   /filter skills none 
   /filter target off
   /stand 
   /mqlog 
   /varcalc v50 $char(plat)*10+$char(gold) 
   /varset t0 3000 
   /varset t1 $p0 s

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

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

   /varset v39 0 
   /if "$cursor()"=="TRUE" /click left auto 
   :cleanpack 
      /doevents
   /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 
      /doevents
   /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
      /doevents 
       /if "$cursor()"!="TRUE" /goto :cleanwait0 
      /click left auto 
      :cleanwait1
      /doevents 
       /if "$cursor()"=="TRUE" /goto :cleanwait1 
  :skipclean 
      /doevents
   /next v1 
   /sendkey up shift 
/return 

Sub MakeCheese 

   :MakeCheese 

      /doevents
      /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 

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

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

   /goto :MakeCheese 

/return 

Sub MakeCheese2 

   :MakeCheese 

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

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

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

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

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

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

   /goto :MakeCheese 

   :AutoDropCheese 

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

      :AutoDropSpoon 
      /doevents
      /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
   /doevents 
      /finditem "Mature Cheese" 
      /if $find()==FALSE /goto :DoneSelling 
      /call buyitem 
   /goto :SellCheese 

   :DoneSelling 
   /doevents
   /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
   /doevents 

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

   /sendkey up shift 
   /cleanup 
   :cleanuploop1
   /doevents 
    /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 

   
   /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 
   /doevents
      /varcalc v97 $char(gold)*100+$char(silver)*10+$char(copper) 
   /if n $v98==$v97 /goto :WaitBuy 
/return 
/if $gm==TRUE /call Crap 

Sub Crap 
  /cleanup 
  /sit 
  /reply I was just leaving... Sorry 
  /delay 20 
  /q 
  /unload 
/return 


Sub Event_Chat 
/if "$p0"=="say" /if "$p1"~~"Granger" /varset v55 1 
/return
Thanks.

Genoius
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Jul 13, 2002 8:20 am

Post by Genoius » Thu Jul 18, 2002 9:25 pm

This part here:

Code: Select all

 /target Granger 
   /face 
   /press u 
   /varset v55 0 
   /doevents flush 
   :sellwait 
    /doevents 
    /if n $v55!=1 /goto :sellwait
Could be cleaned up a tidbit.

CHANGE it to:

Code: Select all

 /target Granger 
   /face 
   /press u 
   /press u 
   /press u 
   /varset v55 0 
   /doevents flush 
   :sellwait 
    /doevents 
    /if n $v55!=1 /goto :sellwait
Since its waiting for Granger to speak to YOU to go to the next thing.

U U U will make sure he is in front of you and it opens.

---Genoius---

EQFanatic
decaying skeleton
decaying skeleton
Posts: 4
Joined: Thu Jul 18, 2002 1:33 pm

Thank you!

Post by EQFanatic » Thu Jul 18, 2002 9:44 pm

Did what ya said and it runs like a charm!. Thanks

Genoius
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Jul 13, 2002 8:20 am

Post by Genoius » Fri Jul 19, 2002 12:51 am

Np. The thing that wasn't happening was Granger(and every vendor) says something when you open the item list they offer. The above script(and most sell/buy scripts) use this mode to ensure you have the list up before ot attempts to buy or sell the items.

Keep this in mind when doing any buying and selling in a macro.

---Genoius---

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Tue Oct 01, 2002 10:30 am

Hey, Actually I added #turbo to Plazmics version of cheese.mac (the edited one by LIzard) and when it gets to the vendor it actually freezes the game, before i added it it worked fine tho...but ever since turbo it accesses Grangers Inventory (the store) and freezes.

Im using EQW,s o that might be a factor but i dont think so..

In any case! Any answers would be helpful :) thanks

User avatar
rizwank
Huggle Police
Huggle Police
Posts: 524
Joined: Tue Jul 23, 2002 12:07 am
Contact:

Post by rizwank » Tue Oct 01, 2002 1:01 pm

moving to to Macro Help...
#macroquest op
Macroquest Official Documentarion
Macroquest Board Moderator
All around cool guy

[img]http://medicomuerte.users.btopenworld.com/images/fairy_bounce08.gif[/img]

User avatar
Nuad
a ghoul
a ghoul
Posts: 93
Joined: Thu Jun 27, 2002 11:43 am
Location: Berlin, Germany

Post by Nuad » Tue Oct 01, 2002 2:18 pm

Draekz wrote:Hey, Actually I added #turbo to Plazmics version of cheese.mac (the edited one by LIzard) and when it gets to the vendor it actually freezes the game, before i added it it worked fine tho...but ever since turbo it accesses Grangers Inventory (the store) and freezes.

Im using EQW,s o that might be a factor but i dont think so..

In any case! Any answers would be helpful :) thanks

RTFM

#turbo
Runs macro commands as fast as possible.
WARNING: Any loop needs either a /doevents or /delay in it or the client will lock up.

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Tue Oct 01, 2002 3:20 pm

Hey...well although the manual migh tmake sense to you..it doesnt exactly make entire sense to me.

Soo anyway... i do have /doevents in it but I took out all the /delay's.

Like i said, its Lizards version of the macro..it has /doevents..so do I need both /doevents and delay? Or either/or?

OR if you dont wanna answer that..could u at least answer this?

Is the cheese.mac compatible with #turbo? Or would putting that on and adding delays actually just lower my pp/h?

Just curious thanks.

I'll add this question here as well since im here..

I was looking through the code in the cheese.mac and decided it'd be better (or more efficient for me) if i had it buy 6 stacks of milk and 3 stacks of rennet.

Now..does all the ingredients have to be in a single bag to function properly? Or does the code actually search all your packs for ingredients?

I noticed if i add more /call buyitem commands that it'll buy them, but not use them...then when im out of the previous ingredients (im presuming its just reading from the first pack it finds ingredients in) it buys more..even tho theres a

Code: Select all

/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 
command...doesnt that tell it to search all my packs? Or just the one pack?

Anyway...i've decided to take it out (the extra /call commands) because as far as i can tell it doesnt do anything.

Also, the rennet, if there happens to be any left, is still bought (even tho the above command is there). and i just end up with 1 or 2 extra stacks every 2 or 3 times i visit the merchant guy..

Not sure why thats happening but i would have presumed the macro just skips rennet until it doesnt find ANY in your inventory

In any case, any answers to that question would be great thanks :)

And dont flame me for this..cuz its in the help section heh...i have read pretty much all the cheese.mac posts (yes, i use the search function commonly) and it doesnt seem to cover my questions i just asked, therefore its here..

But actually flame away hehe cuz i know it'll happen...all the "uber coders" here seem to think there arent any newbs (with exception of lizard and S_B_R and the actual macroquest team..they are good peeps and seem to understand that not all of us were born with this ultimate coding ability) hehe

Anyway..

later ;)