/call Buyitem

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

Moderator: MacroQuest Developers

Repard
orc pawn
orc pawn
Posts: 23
Joined: Sun Oct 20, 2002 8:12 pm

/call Buyitem

Post by Repard » Sun Oct 20, 2002 8:18 pm

I have been workin on makin a macro to buy specific items. I've been tryin to pick other macros apart but I keep running into a problem with the /call Buyitem. When it does that I get

Usage: /for <v#|p#|l#> <start> <to|downto> <end> [step x]

The line that is reffering to is in the routines.mac

/for l1 1 to $p0

I have tried various macros that make calls to this and nothing seems to work. I've gotten all the combine and selling macros to work just fine but this is where I've run into a wall. There have been questions regarding this in the past but no answers. Has anyone come up with a solution so far? A simple one? I have gone through all the readme files and searched till my eyes burned. I more than likely didn't search for the one key word that would have helped me. Any help would be appreciated.

Gengis
a ghoul
a ghoul
Posts: 116
Joined: Wed Aug 14, 2002 7:46 pm

Post by Gengis » Mon Oct 21, 2002 1:39 am

:)
Last edited by Gengis on Mon Oct 21, 2002 11:00 am, edited 1 time in total.

DaRoot
orc pawn
orc pawn
Posts: 15
Joined: Sat Oct 05, 2002 10:39 pm

Post by DaRoot » Mon Oct 21, 2002 6:15 am

the $p0 refers to the number you put after /call buyitem #

the /for statement is used to a range of variables

if you know what slot the item is in you can simplify it by telling the macro
to /click left merchant # (where # refers to the merchant slot)
then /click left merchant buy.

not sure, but there may be a reason you need the /for statement... is the | in the

/for |1 1 to $p0 in the code or just a typo?(its not supposed to be there)

it would go like this...

Code: Select all

/for v99 1 to $p0  (your range is 1 to whatever # you specify)
/click left merchant buy
/delay 1
/next v99
(of corse you have to have the merchant slot clicked previous in your code)
or you could try this one( a lil more thourough)

Code: Select all

Sub BuyItem 
/varset v99 $char(plat) 
/varset v98 $char(gold) 
/varset v55 $char(silver) 
/varset v56 $char(copper) 
/click left merchant buy 
/varset t9 15s 
:WaitBuy 
/doevents 
/if n $v99!=$char(plat) /goto :Waitend 
/if n $v98!=$char(gold) /goto :Waitend 
/if n $v55!=$char(silver) /goto :Waitend 
/if n $v56!=$char(copper) /goto :Waitend 
/if $t9>0 /goto :WaitBuy 
:Waitend 
/varset t9 0 
/return
this is in the tutorial 
this last one checks to see if you actually bought the item by checkin if your money changed at all and if not, then wait till it does. however you would have to put a /call in for however many times you want it to buy

if this is a lil basic for you then please pardon my ignorance, not sure of the lvl you are at :D Hope this helps.