From: DemiseScythe
(*
Abyss
=====
Written by: DemiseScythe
Stores all the routines to solve the Abyss random.
*)
{$DEFINE TEST} // Uncomment to test separately from the SRL include
{$i srl/srl.simba}
procedure Abyss_Solve;
var
Stick, dx, dy, i: Integer; //Stick is the DTM of the area above the stick.
aFound: Extended;
begin
Stick := DTMFromString('mrAAAAHic42BgYNBhZGCQAWJbIFYEYnMgFgNiJyDWBuIqoJp8IM4D4jogrgHiLiBuh+JQVSmGMntThlgjLYZIdRkw34WPi8GdH4glxRj4gWrwYUYCGAYAeSYKcw==');
Writeln('We started Abyssal Plane Random!');
MakeCompass('n'); //Sets the right direction and angle.
SetAngle(SRL_Angle_High);
Writeln('We should walk to an appendage!');
Mouse(646, 48, 3, 3, True); //Will make sure we approach anywhere near the stop Stick
FFlag(6);
Wait(1500 + Random(100));
Writeln('We should activate appendage!');
repeat
if FindDTMRotated(Stick, dx, dy, MSX1, MSY1, MSX2, 200, -Pi/4, Pi/4, Pi/30, aFound) then
Mouse(dx, dy, 3, 3, True);
Wait(2500 + Random(100));
Inc(i); //Clicks the stick and goes through ClickToContinue 25 times or until it has left the random.
ClickToContinue; //Clicks stick until it has clicked the right one. "Guesses" 25% of guessing right.
until (TabExists(tab_Inv)) or (i >= 25); //17% chance it will fail 5 times in a row. 25 should be plenty.
FreeDTM(Stick); //May be needs some wait here to allow time for it to be teleported back.
end;
{$IFDEF TEST}
begin
clearDebug();
activateClient();
setupSRL();
//Abyss_Solve();
end.
{$ENDIF}
Wow. That is an amazing piece of code. You apply my favourite principle: Keep It Simple Stupid. Only one thing you need to do: Make it a function, returning True or False…. and maybe wait a little more. On some systems the GUI needs time to build up.
I definately like this! Keep it up.