View Full Version : Trading Functions
Alright, I plan to make a merchanting bot, one that interacts with other people. I plan to make several functions for trading such as:
+SwitchWorld(WorldNumber := Integer) - Switches the user into another world.
+FindTraderAmount - Returns an integer with the amount of noted ores/armor/etc. the other person has placed on the trading window.
+IsTraderAmountRight(ItemCost := Integer) - Returns a boolean, true if the amount of merchandise is equal to how much gold an opposing player is paying. Works both ways, whether the script user is buying or selling.
Now, my main problem is: if someone placed 287 coal ores in the trade window...can GetTextAt find the amount? If not, how could I go about finding it?
If any more questions arise about the functions I'm working on, I will post here.
Edit: Should I have posted this in the Scripting Help area of the forums? If so, could a mod relocate it for me? Thanks!
Boreas
04-16-2007, 01:04 PM
look in misc/trade.scar
Alright, I'll check that out once I get home, cause these school computers can't extract RAR files (got scar on here, not SRL). :(
Hate to double post, butI still need to make some of my own functions, and I need help with GetTextAtEx. I have the color of the text (65535), but I don't know what the font is, or its number for the Chars integer. Any idea what I put for Chars?
Mr. Doctor
04-16-2007, 10:06 PM
Gettextat only works for the option/command on the top left corner.
There was some SRL Procedure in the manual.
Cant look at it now because on the internet channel on my wii.
(You cant upload stuff from another comp)
Gettextat only works for the option/command on the top left corner.
There was some SRL Procedure in the manual.
Cant look at it now because on the internet channel on my wii.
(You cant upload stuff from another comp)
GetTextAtEx should work with anything, thats why it offers x and y coordinates to find what text you want. However, I'm not familiar with this function, and need help with it to find noted item text. If someone IS familiar with it, please tell me :p
Bump, been a day, awaiting an answer. :( sorry if I sound impatient, but I can't really continue my script till I get this part done or not, and I've waited a day.
3Garrett3
04-18-2007, 02:45 PM
maybe just say buying a certain amount, make a bitmap of the numbers, and if it doesnt get the right amount, decline, and say "*however many you want* plz" and then goes back to typing buying or selling until it finds someone with the right amount?
maybe just say buying a certain amount, make a bitmap of the numbers, and if it doesnt get the right amount, decline, and say "*however many you want* plz" and then goes back to typing buying or selling until it finds someone with the right amount?
Because people in unpopulated worlds never happen to have 1k, 2k coal on them! They sell in small ammounts, like 28 to 100. I need to be able to read the small gold numbers >.>
crapkiller
04-22-2007, 01:42 AM
Would FindText work?
Something like
FindText(x, y, '100', UpChars, x1, y1, x2, y2)
X1 = x start coord of seaching for text
Y1 = Y start coord of searching for text
x2 = x end coord of seaching for text
Y2 = Y end coord of searching for text
'100' = The little gold numbers that say how many...
The font might not be upchars, i dont really know te diff between any of the fonts...
I may be completely wrong, so dont laugh at ,me TOO much :(
EDIT: its all in core/text.scar
Good stuff crapkiller, I'll try it when I get home.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.