buyitem.mac

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

Moderator: MacroQuest Developers

kndzakndza
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 21, 2002 2:59 am

buyitem.mac

Post by kndzakndza » Wed Aug 21, 2002 5:09 pm

I have been working on a buyitem.mac, I am trying to target the merchant then buy **unstackable items**By there names,
like 16 "Blocks" 2 packs full and then 16 "Cams" 2 packs full..

so far my mac will target the murchant and then freeze **ick** :oops:
dos someone maby have a mac like this already that can help me out
or some advice :) much thanks

newbee :(

Magnus
a ghoul
a ghoul
Posts: 85
Joined: Sun Aug 11, 2002 3:50 pm

Post by Magnus » Wed Aug 21, 2002 8:38 pm

You need to know your merchant layout and tell your code what coordinates it should buy.

Code: Select all

| Buy ItemX
   /click left merchant down
   /click left merchant down
   /click left merchant down
   /click left merchant 9
   /call BuyItem

It might work by name but don't make it difficult. I guess it all depends on what functionality you are looking for...


Mag

kndzakndza
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 21, 2002 2:59 am

Post by kndzakndza » Thu Aug 22, 2002 4:45 am

Hmm it keeps saying "Main not found" :(

/sigh and i dont know why...i think ill cry :cry:

Xaanin
a lesser mummy
a lesser mummy
Posts: 66
Joined: Fri Jun 28, 2002 6:41 am

Post by Xaanin » Thu Aug 22, 2002 4:56 am

sounds like you just need to correct a spelling error somewhere, you should post the macro so we can help you, or atleast check if Main is misspelled somewhere...

kndzakndza
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 21, 2002 2:59 am

Post by kndzakndza » Thu Aug 22, 2002 5:22 am

Ok :oops: dont laugh, this is my first one :P
and so far it looks like this..
I took part of what Magnus posted

Code: Select all

| Buyitem.mac
   
Sub Buy 
:StartBuy 

  /target Narmase
  /face

   | Buy "Hemp Twine" 
   /click left merchant 4 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem
 
   | Buy "Oak Bow Staff" 
   /click left merchant 10 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
 

/return 
then i want to close my packs and my inventory


I know it is something realy easy and i cant figure it out :evil: /ack
Ps. Thanks for the help guys

Xaanin
a lesser mummy
a lesser mummy
Posts: 66
Joined: Fri Jun 28, 2002 6:41 am

Post by Xaanin » Thu Aug 22, 2002 8:37 am

Code: Select all

| Buyitem.mac
#include routines.mac
Sub Main 
:StartBuy 

  /target Narmase
  /face

   | Buy "Hemp Twine" 
   /click left merchant 4 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem
 
   | Buy "Oak Bow Staff" 
   /click left merchant 10 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 
   /call buyitem 

:closemerchant 
/press esc
/press esc
/if $invpanel==TRUE /goto :closemerchant
/return 
That should work better...

kndzakndza
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 21, 2002 2:59 am

Post by kndzakndza » Thu Aug 22, 2002 3:32 pm

Thanks Xaanin, I tried it out and it still says
"subroutine buyitem not found"
however it will now target him and poing me at him :lol:

but still no luck opening his inventory and buying items :cry:
I dont know what i am leaving out of the code to get it wrong.
I have looked in the read me (Macro commands) and still cant quight get it.
I am still messing around w/ it and if i get it figured out ill post it,
maby if someone can try it out to and maby u will see what i am doing wrong. You will need to change the merchants name and the name of the items :P but if i get it befor someone posts ill put it up so maby others can use it .
thanks agen

kndza

MeatHead
orc pawn
orc pawn
Posts: 17
Joined: Mon Aug 19, 2002 2:23 pm
Location: Earth

Post by MeatHead » Thu Aug 22, 2002 4:07 pm

Change the /call buyitem to /call buyitems

Look in routines.mac and you'll notice that the subroutine is buyitems. Plural not singular. You're getting the "can't find subroutine buyitem" because it doesn't exist

kndzakndza
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 21, 2002 2:59 am

Post by kndzakndza » Thu Aug 22, 2002 5:00 pm

Woot Thanks MeatHead It works :)

but one last thing it dos spam me with this:

/for <v#|p#> <start> <to|downto> <end> [stepx]


:?: :?: what is that??

thanks
kndza

User avatar
Ravena666
a ghoul
a ghoul
Posts: 101
Joined: Fri Aug 23, 2002 2:57 am

Post by Ravena666 » Fri Aug 23, 2002 3:01 am

I tried your code and I too got spamed with that, not sure what that is
maby someone could help ?

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

Post by rizwank » Sun Aug 25, 2002 8:49 pm

the /for in it isnt being used correctly, so its returning syntax.

Havent looked at code yet, but thats why the spammage.

powerspike
a ghoul
a ghoul
Posts: 80
Joined: Sun Aug 11, 2002 11:40 pm
Location: Australia
Contact:

Post by powerspike » Sun Aug 25, 2002 10:25 pm

ummm would guess that the a /for loop in the routines.mac isn't working right, try getting a new copy of it out of the marco depot