SRL Archive - OSR Help

IsUpText not working for me?


Falreigimer

2013-04-02 03:10:09

Hey I'm new to scripting, and I can't seem to make the IsUpText procedure to work…

Maybe you guys can see where is my mistake. Thanks for your time

The following code simply looks for a raw salmon in my bag (which he does just fine) and tries to click it if he finds the uptext (which he doesnt) - I've tried all kinds of text "aw salmon" "almon" nothing seems to work. HELP! :D

program New;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SPS/sps-osr.simba}

var
Salmon : Integer;

function CheckSalmon: boolean;
var
x, y : Integer;

begin
Salmon := BitmapFromString(19, 13, 'meJxtkW1LwmAYhd2/CiIwUgwLNU' +
'zEUipzS8T3FMuSbGGatkSzNxGVpmQlJUmJIKYkEX2IXv9PBx6SpXs' +
'4X69d59yTSEQeJZFotLRKYx6R0mNy18RUQKEJK2cjKn18xpjWLWUX' +
'7FeiFDIqs0sVXiBydWhSy07rYkD05twcXTQ7b+3rnWGKIONKn0wVh' +
'AiI1pQxWPLzDG+yVSyeuiv0HNj9GKD6CEQoRhCjtYxuEK34m57wa3' +
'Dvk/pfD8X6FhQDAsWio7rsrtHee9tae5V9CyW+hBRBsIXMxxZYoEA' +
'xxtewBlqOja5/5z3M/aMIojZwKAYEW4BAgWKwACGj2OQ3JdiFIxOE' +
'bEExIFDgbs7NnnvrhYyKpH+EFF4iVePSdweZeuqkcXjaPM61YOkHO' +
'IyxzCCFB4phnAW+ky20z/ItBEZUJV9LHj3gg8MUAYvlLqh+cA0knr' +
'yJJCrR/esYVxUFQeXOH4VBPQQisGy0tB3hRUGURIDzF0+lyx5OgVB' +
'/f5ZE9P0CL1Tx1g==');

if FindBitmapToleranceIn(Salmon, x, y, MIX1, MIY1, MIX2, MIY2, 15) then
begin
Writeln('Found Salmon!');
MMouse(x, y, 3, 3);
if IsUpText('lmon') then
begin
Wait(200 + Random(100));
Mouse(x, y, 0, 0, True);
Result := True;
end else
Writeln('Couldn''t find upText');
end else
Writeln('Couldn''t find Salmon!');
FreeBitmap(Salmon);
end;

begin
ClearDebug;
SetupSRL;
if CheckSalmon then
begin
Writeln('cool');
end else
Writeln('damn');
end.

And the debug box after running:

SRL Compiled in 0 msec
Paired with SMART[4956]
Found Salmon!
Couldn't find upText
damn
Successfully executed.

Justin

2013-04-02 03:11:25

After
MMouse(x, y, 3, 3);
put:
writeln(GetUpText);
See what it is reading

Falreigimer

2013-04-02 03:14:27

LOL that was wierd, with that writeln it clicked the salmon o.O Waht is this sorcery…

SRL Compiled in 0 msec
Paired with SMART[4956]
Found Salmon!
Use Raw salmon
cool
Successfully executed.

Justin

2013-04-02 03:16:35

From: Falreigimer
LOL that was wierd, with that writeln it clicked the salmon o.O Waht is this sorcery…

SRL Compiled in 0 msec
Paired with SMART[4956]
Found Salmon!
Use Raw salmon
cool
Successfully executed.


Hah, keep an eye on it, you might need to change it to a multi uptext if you keep getting different results :P

Falreigimer

2013-04-02 03:23:07

I just found out something interesting, when the salmon is on the bank here is what happens (tweaked the code to work withdraw a salmon)

Found Salmon!
Withdraw 1 Raw salmc
Couldn't find upText
FAIL!
Successfully executed.