Ransom
11-16-2006, 07:28 PM
Ok i'm making a handy dandy merchant script to buy and sell stuff for you to other players so you can avoind the boring nights of typing the same old message over and over and sitting there with a calculator figuring out how much you owe or need to receive.
ANYWAY that aside
I have this handy dandy procedure to find out how many of an item they put up in a trade. That way i can put up the correct amount of gold.
Procedure FindItemsInTrade;
var FX, FY : Integer;
begin
repeat
Wait(1000);
Until(FindBitMapTol(FX,FY,Coal,320,70,365,105) = True);
writeln('I MADE IT HERE');
Wait(700);
Items := StrToInt(GetTextAtEx(FX-18, FY-18, 50, TradeChars, False, True, 0, 3, 65535, 5, False, tr_Digits));
Wait(700);
end;
The problem I run into is this
SRL Compiled in 156msec.
I MADE IT HERE
[Runtime Error] : Exception: ' ' is not a valid integer value in line 48 in script C:\Program Files\SCAR 2.03\Scripts\Merchant.scar
So i'm assuming the gettxt procedure has gone kaput on me and can't find what i want it to. Basically i'm asking anyone who knows about this stuff to tell me what i'm doing wrong or a better way to do it. I was using the built in GetAmount() and AmountDTM/Bmp etc... Those didn't work for me at all.....i'm not really sure why either... but i decided to just go ahead and try this myself. So far i'm failing... any ideas?
Once i get a few more procedure to finish off the trade done i'll post what i have so people can critique it. It's rough and dirty, I tend to brute force a problem. And my standard are a bit lower than what they should be. But if i do make a formal release i'll try to clean it up and comment a bunch.
Anyway i hope you can help me. Thanks!
Ransom
ANYWAY that aside
I have this handy dandy procedure to find out how many of an item they put up in a trade. That way i can put up the correct amount of gold.
Procedure FindItemsInTrade;
var FX, FY : Integer;
begin
repeat
Wait(1000);
Until(FindBitMapTol(FX,FY,Coal,320,70,365,105) = True);
writeln('I MADE IT HERE');
Wait(700);
Items := StrToInt(GetTextAtEx(FX-18, FY-18, 50, TradeChars, False, True, 0, 3, 65535, 5, False, tr_Digits));
Wait(700);
end;
The problem I run into is this
SRL Compiled in 156msec.
I MADE IT HERE
[Runtime Error] : Exception: ' ' is not a valid integer value in line 48 in script C:\Program Files\SCAR 2.03\Scripts\Merchant.scar
So i'm assuming the gettxt procedure has gone kaput on me and can't find what i want it to. Basically i'm asking anyone who knows about this stuff to tell me what i'm doing wrong or a better way to do it. I was using the built in GetAmount() and AmountDTM/Bmp etc... Those didn't work for me at all.....i'm not really sure why either... but i decided to just go ahead and try this myself. So far i'm failing... any ideas?
Once i get a few more procedure to finish off the trade done i'll post what i have so people can critique it. It's rough and dirty, I tend to brute force a problem. And my standard are a bit lower than what they should be. But if i do make a formal release i'll try to clean it up and comment a bunch.
Anyway i hope you can help me. Thanks!
Ransom