SRL Archive - First Scripts

Needlefinder [RS2]


tofuli

2007-11-06 10:42:42

So, I messed with some tutorials and made this with the newly learned stuff!

Thanks Bebe! Your tut was great!

It will just look for a needle in the inventory and then say if it found it, in the SCAR debug window.
I will continue to learn more, and then, just maybe, I will make a leatherworker script!

Please, feedback! :D

// Needlefinder by Tofuli
// Big thanks to Bebe!
//
// This script looks for a needle in inventory and will keep doing it until
// it finds it, or you stop the script.


program Needlefinder;

const
found='Needle Found!';
notfound='Needle not found!';

var
needle: integer;

procedure LoadBitmap;
begin
needle := BitmapFromString(22, 33, 'beNrFlc1Kw0AUhXt3xafoI/' +
'hSXak7N4FSCm1sjWVCjdM4Y5yaJv2ltiIIPp4nBAouc2bR4S6yOWc' +
'+Tu6902pd7oinPEmch4nUdd3poAj5Vbtdvqa1Aweg50sfgDQtXZL4' +
'AMDBB8CY1eTxhQUQazfLuWYBJMu2cBiNFA0Ah3OABIBz+5U1g0FEA' +
'chicYCDUYoGgMOH1r3eAweQ50c46KeIApCiOMEhm82CYMgBlOUXAm' +
'QTkPX6OwxjG8f9/oROACPM9oDsdj8AwC+gmlAOn78YH8jPa6Spg1I' +
'GVyNDagyr/CGEfPueNQeobkdt3uzeOXw0BJAo0nWd0ElF0RCgWr/j' +
'8TP4p9P0mOdgaAoAh/vbm2EQxGF41+2iGYgMYVKXx2vy7yXilrmP9' +
'sLnD2B0nGk=');
end;

procedure FBitmap;
var
x, y :integer;
begin
if (FindBitmapToleranceIn(needle, x, y, 545, 203, 745, 470, 25)) then
begin
writeln(found);
wait(500);
end else
begin
writeln(notfound);
wait(3000+random(500));
repeat
FBitmap;
until(FindBitmapToleranceIn(needle, x, y, 545, 203, 745, 470, 25))
end;
end;

begin
LoadBitmap;
FBitmap;
end.