help refining my bear.mac

Need help running MacroQuest 1? Too bad! Use MQ2.

Moderator: MacroQuest Developers

freeplat
decaying skeleton
decaying skeleton
Posts: 5
Joined: Tue Jul 09, 2002 7:05 pm

help refining my bear.mac

Post by freeplat » Tue Jul 09, 2002 11:09 pm

ok, here's my bear.mac, tweaked from a friends version. I need to add something so that when I go to sell the made bear fillets it checks to see if I already have bear meat, and does not buy more, if I have some in my inventory. I want it to just go back to MakeCheese if it finds any bear meat during the SellBuy.

I occasionally get lag spikes, and sometimes end up filling my inventory with bear meat, breaking the macro. The few changes I tried to get my idea to work have not done what I wanted :(

Yeah, I know the labels are all for cheese, but it works.

| - bear.mac -
|
#include routines.mac

Sub Main

/mqlog
/varcalc v50 $char(plat)*10+$char(gold)
/varset t0 3000

/filter skills none
/filter money off
/filter food off
:StartLoop
/call FindCombiner Baking
/if $return==99 /return
/varset v80 $return

| :StartLoop

/cleanup
/delay 5
/click left auto
/delay 5
/click right inv $v80

/if $pack($v80,empty)==FALSE /call CleanPack
| /if $pack($v80,empty)==FALSE /goto :TooFull
/if $pack($v80,empty)==FALSE /call SellBuy

/sendkey down ctrl
/call MakeCheese
/sendkey up ctrl

/call SellBuy

/if $t0==0 /call LogStats

/goto :StartLoop

:TooFull
/echo You are too full on stuff...
/return


Sub CleanPack
/varcalc v2 $pack($v80,slots)-1
/sendkey down shift
/for v1 0 to $v2
/click left pack $v80 $v1
/click left auto
/delay 5
/next v1
/sendkey up shift
/return


Sub MakeCheese

:MakeCheese

/finditem "Bear Meat"
/if $find()==FALSE /goto :DoMerchant
/click left pack $v80 0

/finditem "Filleting Knife"
/if $find()==FALSE /goto :Finished
/click left pack $v80 1


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

/click left pack $v80 combine

| :AutoDropFillets
| /echo dropping fillets...
| /for v1 1 to 150
/for v1 1 to 75
/if "$cursor()"=="TRUE" /goto :AutoDropFillets
| /delay 1
/next v1

:AutoDropFillets
| /echo Cursor is $cursor() and name is $cursor(name)
/if "$cursor()"=="TRUE" /click left auto

| /echo Cursor2 is $cursor() and name is $cursor(name)
|
| /if "$cursor()"=="Filleted Bear" /click left auto
| /echo Cursor3 is $cursor() and name is $cursor(name)
|
| /if "$cursor()"=="Filleting Knife" /click left auto

| make sure cursor is empty
| /delay 1
/if "$cursor()"=="TRUE" /goto :AutoDropFillets


/goto :MakeCheese

:Finished

:DoMerchant

/return


Sub SellBuy

| Open merchant
| /target Nicoela
/click left auto
/delay 5
/click left auto
/delay 5
/target Samotal
| /target Daliea
| /face
/press u
/delay 20

/sendkey down shift

| Sell our cheese
:SellCheese
/finditem "Filleted Bear"
/delay 2
/if $find()==FALSE /goto :DoneSelling
/click left merchant buy
/delay 2
/goto :SellCheese

:DoneSelling
/varset v51 0
/finditem "Bear Meat"
/delay 5
/if $find()==TRUE /varset v51 1
/delay 2

| Buy Bottles of Milk
/click left merchant 11
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
| /click left merchant buy
| /delay 2
| /click left merchant buy
| /delay 2
| /click left merchant buy
| /delay 2
| /click left merchant buy
| /delay 2
| /click left merchant buy
| /delay 2

/sendkey up shift
/press esc
/cleanup

/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

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

Re: help refining my bear.mac

Post by Nuad » Wed Jul 10, 2002 4:41 am

freeplat wrote:I occasionally get lag spikes, and sometimes end up filling my inventory with bear meat, breaking the macro. The few changes I tried to get my idea to work have not done what I wanted :(
Lag Spikes (packet losses) will cause every macro to break... no loop and no delay can bring back a lost data packet.

And btw... wrong Forum.... :)

freeplat
decaying skeleton
decaying skeleton
Posts: 5
Joined: Tue Jul 09, 2002 7:05 pm

Post by freeplat » Wed Jul 10, 2002 5:40 am

Packet loss is not the root cause. The way it loops to recover is to go into the BuySell, and I just need it to check for bear meat before buying. And, it's not in the wrong forum, as this macro makes more plat per hour than any I've seen posted, for me. I thought others might want to try it, go figure.

Rookie
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Jul 03, 2002 4:58 am

Post by Rookie » Wed Jul 10, 2002 5:43 am

This is simple enough just look below. I had the same problem. This will just loop it till no you have no bear meat and will then buy.

| Buy Bear Meat
/finditem "Bear Meat"
/if $find()==TRUE /goto :BearFound
/click left merchant 11
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2
/click left merchant buy
/delay 2

|Bear Meat Found in inventory, Not Buying
:BearFound
/sendkey up shift
/press esc
/cleanup

/return

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Wed Jul 10, 2002 1:14 pm

Salutations,
Moved to the Help forum...