Log in

View Full Version : IsTextAt2



Yakman
08-26-2006, 12:39 PM
there are a few occations when people use IsTextAt2 in SRL when they should not, :mad: this function only works if you put loadchars('') in your main loop

i know that loadchars('') is not used in SRL because if it was, you would get the message "font loaded from c://program files/..../scar/charsrs2/"

one example is in skills/woodcutting.scar, DropAllLogs


rocedure DropAllLogs;
var
rx, ry, m, n : Integer;
begin
Status('Dropping Logs');
Gametab(4)
begin
for M:=1 to 7 do
begin
for n:=1 to 4 do
begin
rx := 544 + (n * 42)
ry := 192 + (m * 36)
mmouse(rx, ry, 0, 0)
wait(100 + random(100));
if (IsTextAt2(9, 9, 'Wield', 100)) or
(IsTextAt2(9, 9, 'Search Bird', 100)) or
(IsTextAt2(9, 9, 'Use Knife', 100)) or
(IsTextAt2(9, 9, 'Use Tinder', 100)) then
Chopped := Chopped - 1;


Another example is in core/text.scar, FindTextSpiral, i understand this because it was made by people who didn't use loadchars2 or IsTextAtEx (khain and ohdearurdead)


GetMousePos(x, y);
x := x - step;
MoveMouseSmooth(x, y);
Wait(SpiralWait);
if (IsTextAt2(9, 9, txt, 100)) then
FoundText := True;
until (qx >= x) or (FoundText);
if (FoundText) then
Break;


My point is, in the next SRL, change these IsTextAt2 to IsUpText or something, otherwise it will not work unless we all put loadchars('') in our main loops :(

Sumilion
08-26-2006, 12:54 PM
I'm not sure, but isn't loadchars already in srl. Meaning that when you do SetupSRL; that it also does LoadChars('');...

Dankness
08-26-2006, 01:09 PM
I'm not sure, but isn't loadchars already in srl. Meaning that when you do SetupSRL; that it also does LoadChars('');...

Actualy no its not, and that is a very good observation we were already discussing adding LoadChars to SRL, it just wasnt a high priority yet...

Yakman
08-26-2006, 07:40 PM
when you do loadchars, it says "font loaded from ....scar/charsrs2"
thats how i know that SRL doesn't use loadchars

I dont think SRL should have it, its a depreceated function so it probably has some fatal flaw in it which made kaitneiks decide to scap it and change to loadchars2

Sumilion
08-26-2006, 08:27 PM
Well i must say, very nice observation, how in the world did you found out about this :rolleyes: . I'm sure something will be done about it pretty soon ;)