Closed tkphoto closed 11 years ago
What is on line 82 and 94 of tk.cs?
line 82: ProcessTradeMessage(message); line 94: Trade.SetReady(true);
Basically im trying to get it to insert a weapon which it does using 'addwep'.. but it doesnt readyup as it crashes with the error
But in whatever situation i put a Trade.SetReady(true); after a line with adding an item (AddItemsByCraftType ) it crashes.. I tested with reacting to a word saying rdyup with Trade.SetReady(true); it works.. so its obviously a problem with steambot accepting a readyup statement after items being added , in any quantity aswell
@tkphoto You might be better off making the Bot ready up after the other user readies up (there's an override or event for that in UserHandler
).
The trade is probably still processing the the Add command and the items have not been fully added before you hit the validation code by calling SetReady
.
Yeah i think thats the problem with it, i wanted to work this out mainly as a way of getting 2 bots to interact with each other to offload some items. The other way you mentioned works, but of course is about a human readying up the trade.
Ive got automatically adding type of items etc.. and the amount i want done.. its just getting a bot to readyup first.. which the 2nd will readyup already automatically afterwards.... and then either one to go ahead with the trade.. if you have any suggestions for this .. i would be grateful
Does UserHandler.cs inherit SimpleUserHandler?
What I mean is, if I add code in UserHandler.cs, and use it, will code that is also in SimpleUserHandler.cs work, or affect the bot?
@coffman34 It's the other way around. SimpleUserHandler
inherits from UserHandler
. If you add stuff to UserHandler you can use it in SimpleUserHandler or any other child classes.
@tkphoto You should sleep for some arbitrary amount of time before reading up after adding items to the trade. See if that works.
Thank you for that.
I'm having exactly the same problem! I've tried doing: System.Threading.Thread.Sleep(2000);
to make it wait for 2 seconds before clicking ready, after it adds the items, but I am still receiving this error.
Any ideas?
Just move your Trade.SetReady(true) somewhere away from right behind Trade.addItem. IMHO You should be using a separate function to add items, and Trade.SetReady(true) be set in it's normal location, also, make sure you have checks in validate() so that the user can't rip you off.
@tkphoto Did you ever complete a working system to transfer items between bot accounts? I almost have one working but I'm still running into a few errors.
I get this error whenever i use a
Trade.SetReady(true);
after the next line of adding any itemsie
Is there a solution to making a bot automatically ready up after it adds something to trade ?