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
And the debug box after running:
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.