stocky8
2014-07-10 23:32:04

Actually, it's only sometimes horrible.
I find that the script works best at a less populated stall, like Silk. You may also have to start, move the camera a tad then start it again to see if it detects the stall. (I WILL MAKE IMPROVEMENTS) Sometimes the random events mess up the location of the player and it starts clicking on another stall. All it does to stop the randoms is loop to see if it see's the text to close in the top right.
I still have lots of improvements to make and code to clean up but I want to know what people think of it!
program RSPS_ShittyStealer;
{$I SRL-OSR/SRL.simba}
const
////////////////////////////
/////////SETTINGS///////////
stealamount = 1500;
//////END OF SETTINGS///////
////////////////////////////
var
closeBmp,stealFrom,numberOfWaits,numberOfRandoms,numberOfMisclicks:integer;
procedure steal();
var
x,y: integer;
begin
if findBitmapToleranceIn(stealFrom, x,y,3,57,514,390,145) then
begin
mmouse(x,y,1,1);
wait(150);
clickMouse(x,y,MOUSE_LEFT);
wait(250);
inc(numberOfWaits);
end;
//findStall();
end;
procedure findStall();
var
x,y: integer;
begin
//findColorTolerance(x,y,552966,192,132,347,270,0);
findColorTolerance(x,y,2373181,192,132,347,270,0);
mmouse(x,y,2,2);
wait(150);
clickMouse(x,y, MOUSE_RIGHT);
wait(100);
steal();
end;
function checkInvalidStall():boolean;
var
marketBMP,x,y: integer;
begin
marketBMP := BitmapFromString(60, 6, 'meJyVU0EOwCAI43f7wK77/zN0CQk' +
'h2BY0HAi2gAXN7Hm/ua1lv9mMdQWes+LKkW6FnoORsEWy4NkeLCFS' +
'ec/hl2YyLCNhkNHjMD3zgaySH+oM38JeUabJ/FZnvRsTnVnRdnBQf' +
'7G9YjpwIq04gi52AOo//3eiqPsb56+n9A==');
result := findBitmapToleranceIn(marketBMP, x,y,3,57,514,390,145);
freeBitmap(marketBMP);
end;
procedure cancelOption();
var
cancelBMP,x,y: integer;
begin
if checkInvalidStall then
begin
mmouse(10,10,5,5);
inc(numberOfMisclicks);
//numberOfWaits = numberOfWaits-1
end;
end;
function checkRandom():boolean;
var
randomDTM,x,y: integer;
begin
randomDTM := DTMFromString('mbQAAAHicY2VgYDjHyMCwGYi/A/FhIH4JxN4MCOwH' +
'xK5A/P8/JmZlwMSMWDAYAAA7+w+3');
result := findDTM(randomDTM, x,y, 413,59,514,85);
freeDTM(randomDTM);
end;
procedure closeRandom();
var x,y: integer;
begin
mmouse(467, 73, 5, 2);
wait(100);
clickMouse(x,y,MOUSE_LEFT);
wait(250);
end;
function misclick():boolean;
var noOption,x,y: integer;
begin
noOption := BitmapFromString(12, 40, 'meJy9klEKwDAIQ3u7XWC/u/8x3E' +
'Amklixm5v40cojDTVjYG37cTWNHzLWOZNo+nmdYc2QAcHKW98VuAq' +
'7S6erRQSuMNGhd6UM+OxlzAYwcpcx/uD5hFnVgbIdMQ8Af2my5Z/3' +
'Xo9HGAleYoL5P5klnJNQZ3hBM5OchJc64lIKjJ5Pl7zviA==');
result := findBitmapToleranceIn(noOption, x,y,3,57,514,390,145);
freeBitmap(noOption);
end;
begin
stealFrom := BitmapFromString(72, 7, 'meJy9VEEOwCAI83d+YNf9/xldopE' +
'sIBVxWeOBEEJbRAGUhnrdEqChx7kT74CBNBdpm1Z16EvK/rGGF3iS' +
'F8d91bEtaWpyQZbObqaa7TLP2a19qYlTq4BY8+imr09pntYUg+VFq' +
'/62redLLQlRNRXvDXPr5+EuTnz1WXlqvc2MDzP+vr719QBvV/cz');
closeBmp := BitmapFromString(67, 6, 'meJydlN0KwjAMhXM1fMQxxvyZcyI' +
'i4pvqjY9Ts532NGsrDsuhhIwm52vKqmpTLSXOicjz9e66M7XdXcbx' +
'QQ2n+0/1xxu1P1wTaRfdtSxl21nBT9sOqqbpi6rrvXc+KwfhJwvCp' +
'Iq2mbH+ISStfx+LIKPFcbaAAAUQZojAGP4lLIKgzrRjOUeKybZZoI' +
'jJjAUFk5hEvCic5YBi9wCiwbSHLhFNBCDwnzwtzpRlNU4mshhHZjU' +
'BASBi798EaMSORKON5I1ZOg+7AsSbn0G883Atybvybr+AcM9B4nRM' +
'0t5hEYSD+BvEDoIBV/FprQexo8lBkj8Ay34ApIa7xQ==');
clearDebug();
//setupSRL();
mouseSpeed := 20;
repeat
if checkRandom then
begin
closeRandom();
inc(numberOfRandoms);
//numberOfWaits = numberOfWaits-1
end;
if misclick then
begin
mmouse(10,10,5,5);
inc(numberOfMisclicks);
end;
cancelOption();
wait(540);
findStall();
wait(500);
//inc(numberOfWaits);
clearDebug();
writeLn('---------------------------------------');
writeLn(' Stocky''s Shitty Stealer ');
writeLn('+++++++++++++++++++++++++++++++++++++++');
writeLn('Steal Attempts: ' + intToStr(numberOfWaits) + '/' + intToStr(stealamount));
writeLn('Guaranteed Misclicks: ' + intToStr(numberOfMisclicks));
writeLn('Random Events: ' + intToStr(numberOfRandoms));
writeLn('---------------------------------------');
until numberOfWaits = stealamount;
freeBitmap(stealFrom);
end.