Riley
2013-04-05 12:38:44
I've been slowly grasping the pascal language so bare with me if this is terrible code lol, Thanks to @Sjoekeloe for showing me the basics.
Now from a script Sjoe showed me how to make and explaining it, I've decided to make it 100% Accurate and be able to run it for hours before i try to code a script solely by my self. I've been trying to make a failsafe, yet its not responding to when it doesnt find the stall, here is the code, can you tell me what I have done wrong here?
Now from a script Sjoe showed me how to make and explaining it, I've decided to make it 100% Accurate and be able to run it for hours before i try to code a script solely by my self. I've been trying to make a failsafe, yet its not responding to when it doesnt find the stall, here is the code, can you tell me what I have done wrong here?
program PickSilk;
{$i SRL-OSR/SRL.simba}
Function GreenRandom: Boolean;
begin
Result := (CountcolorTolerance(1207359, 552, 4, 697, 152, 13) > 10000);
end;
function LeftGreenRandom:Boolean;
begin
if (not CountcolorTolerance(1207359, 552, 4, 697, 152, 13) > 10000) then
Result := True;
end;
function RandomSolver: Boolean;
begin
Gametab(tab_magic);
Wait(500);
MouseBox(658, 325, 674, 342, mouse_left);
Wait(2000 + Random(500));
MouseBox(230, 423, 288, 435, mouse_left);
if WaitFunc(@LeftGreenRandom, 100, 8000) then
Writeln('Left the random');
end;
function StealFromStall: Boolean;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['Gem', 'stall'], [1908001, 2229602, 11579274], 7) then
begin
Writeln('Found Gems') // debug
Mouse(x, y, 3, 3, true); // leftclicking :)
Result := True;
Wait(2500);
Exit;
end;
end;
[COLOR="#0000FF"][B]Function FindGems: Boolean;
var
x, y : Integer;
begin
if (FindObjCustom(x, y, ['Gem', 'stall'], [1908001, 2229602, 11579274], 7)) then
begin
Writeln('We Found Gems!');
if (not (FindObjCustom(x, y, ['Gem', 'stall'], [1908001, 2229602, 11579274], 7))) then
begin
Gametab(tab_magic);
Wait(500);
MouseBox(658, 325, 674, 342, mouse_left);
Wait(2000 + Random(500));
MouseBox(230, 423, 288, 435, mouse_left);
if WaitFunc(@FindGems, 100, 8000) then
Writeln('Saved your self!');
end;
end;
end;[/B]
[/COLOR]
begin
SetupSRL;
ActivateClient;
repeat
if (GreenRandom = True) then RandomSolver;
FindGems;
StealFromStall
until(false);
end.