Page 1 of 1
Trying to trade money between two bots
Posted: Wed Jul 14, 2004 4:58 am
by Kore
I'm trying to write a macro that trades money between two bots - basically what i am doing is turning on an auto hunter macro on my warrior that basically runs around and kills stuff, and when low on health returns to my cleric bot who sits in a stationary location for heals; while at the cleric i want him to give the cleric all platinum and gold - i also need the cleric to accept the trade. Any and all help would be most appreciated - i've been racking my brain over this one, been totally humbled by it.
Posted: Wed Jul 14, 2004 11:11 am
by Terramantian
k... eq is down atm so can't test this (actually that's why I'm writing it, bored)... but this should be close:
Code: Select all
|For warrior
|Call Give_Cleric_Money when you've run back to cleric
#event Busy "#*#tells you#*#busy right now#*#"
|Wait and try again if cleric rejects trade b/c of casting, etc
Sub Event_Busy
/autoinv
/delay 10s
/call Give_Cleric_Money
/return
Sub Give_Cleric_Money
/target CLERIC_NAME
/shiftkey /notify Inventory IW_Money0 leftmouseup
/delay 5
/click left target
/delay 5
/doevents
/shiftkey /notify Inventory IW_Money1 leftmouseup
/delay 5
/notify TradeWnd TRDW_MyMoney1 leftmouseup
/delay 5
/notify TradeWnd TRDW_Trade_Button leftmouseup
/return
Code: Select all
|Cleric code
#event Trade "#*#has offered you#*#"
Sub Event_Trade
/delay 5s
/notify TradeWnd TRDW_Trade_Button leftmouseup
/return
Tweak the delays to fit your comp. Also, this probably won't work as it is. I've never done anything with the trade window so I'm not sure of the notify names. I'm using
http://macroquest2.com/phpBB2/viewtopic.php?t=6806 as a guide, but I think MQ names are not always exactly the same. One more thing, I can't remember the exact #event messages you need to use (and can't test now..) Does the "has offered you" message even show up with money? I can't remember at all but I'm thinking not... if not you might want to take the cheap/ugly way out and have the warrior send a tell to the cleric, "I'm giving you money". But whatever, this is as good as I can do without testing, it should give you a place to start.
Posted: Wed Jul 14, 2004 1:12 pm
by aChallenged1
Code: Select all
#event Busy '#*#tells you#*#busy right now#*#"
The first " came out as a ' in your code. Not really nitpicky, just noticed it as I was reading it; I know it will cause it to not work even if it would have otherwise.
Posted: Wed Jul 14, 2004 1:26 pm
by Terramantian
Thanks, lol. Changed it. I really don't think it'll work as it is anyway... if there wasn't a patch I might've had a chance to test it. But the basic idea should be workable anyway.
Posted: Wed Jul 14, 2004 1:55 pm
by Rusty~
no you dont get the "has offered you" message with money. you should be able to do something like this though:
Code: Select all
/if ${Window[TradeWnd].Open} {
/delay 5s
/notify TradeWnd TRDW_Trade_Button leftmouseup
}
Posted: Wed Jul 14, 2004 9:48 pm
by Kore
Wicked guys, i cant wait to try this! Thanks again!