FiXed(Compiling) Version!!!!say if i need to delete…
//#########################################################
//#########################################################
//#### Azzon's Gnome Agility Runner ####
//#### Version: 1.0 ####
//#########################################################
//#########################################################
//#### ####
//#### Hello, and Welcome. I would like to start ####
//#### off by saying, thank you for using this ####
//#### script. If you have any questions, ####
//#### suggestions, or problems related to this ####
//#### script, then feel free to post on the ####
//#### thread, or send me a pm. ####
//#### ####
//#### You can find the player adjustable ####
//#### variables for the script between lines ####
//#### 30 and 37. ####
//#### ####
//#### You can setup the players using this ####
//#### script between lines, 63 and 75. Due note ####
//#### that the script is only designed for a ####
//#### single player, and the purpose of the ####
//#### player setup is for Anti-Randoms. ####
//#### ####
//#### Thank you for using this script. ####
//#### - Azzon ####
//#########################################################
//#########################################################
program GnomeAgilityRunner; //561 Lines, With Spacers And Procedure Headers
{.include SRL/SRL.scar}
var
LapsMade, tries, WaitOnPipe, LapsTillCheckRun, WaitOnFlagLoops : Integer;
FirstLap, s1_Complete, s2_Complete, s3_Complete, s4_Complete : Boolean;
s5_Complete, s6_Complete, NewLap, LapComplete, FoundPipe, WalkingToStart : Boolean;
X,y:integer;
//################################################################
//## Manual Player Setup ##
//################################################################
const
g_ColorTol = 16; //Game Screen Color Tolerance
mMSpeed = 15; //The Mouse Speed
UseBenMouse = true; //UseBenMouse, I Personally Recommend Leaving It 'True'
Laps = 50; //Number Of Laps You Want The Script To Run For
CheckRunLapDelay = 10; //Number Of Laps To Complete Before Calling CheckRun Again
NumberOfAccounts = 1; //Only Designed For One
FirstAccount = 0; //Basically Right Now, Don't Touch
//################################
//## Note: Unless You Experience##
//## Color Problems, It Is ##
//## Recommended To Leave The ##
//## Color's As-Is. ##
//################################
s_LogBalance_C = 606057; //Obstacle 1, Log Color
s_ObstacleNet_C = 5726328; //Obstacle 2 and Obstacle 6, Net Color
s_TreeBranch_C = 1660014; //Obstace 3, and Obstacle 5, Tree Color
s_BalancingRope_C = 5931680; //Obstacle 4, Rope Color
s_ObstaclePipe_C = 3685440; //Obstacle 7, Pipe Color
s_Mushroom_C = 2576031; //End Of Obstacle 7, Mushroom Color
//################################################################
//################################################################
//####################################
//## Player Setup Location ##
//####################################
procedure SetupPlayers;
begin
HowManyplayers := NumberOfAccounts;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := FirstAccount;
Players[0].Name := '';
Players[0].Pass := '' ;
Players[0].Nick := '';
Players[0].Active := True;
WriteLn(IntTostr(HowManyPlayers) + ' Players');
end;
//####################################
//## Greeting Procedure ##
//####################################
procedure A_Greeting;
begin
WriteLn('#################################')
WriteLn('## Welcome ##')
WriteLn('## You Are Using ##')
WriteLn('## A Script Created By Azzon ##')
WriteLn('## Enjoy ##')
WriteLn('#################################')
end;
//####################################
//## Player Report Procedure ##
//####################################
procedure PlayerReport;
begin
ClearDebug;
WriteLn('() (============================');
WriteLn('() (= Azzons Gnome Agility Course Runner');
WriteLn('() (============================');
WriteLn('() (== Laps Completed - ' + IntToStr(LapsMade));
WriteLn('() (== Laps Left - ' + IntToStr(Laps - LapsMade));
WriteLn('() (== Script Run Length - ' + TimeRunning+'');
WriteLn('() (============================');
WriteLn('() (== Happy Running! ');
WriteLn('() (============================');
SRLRandomsReport;
end;
//####################################
//## AntiRandom Procedure ##
//####################################
procedure AntiRandoms;
begin
FTWait(2);
FindNormalRandoms;
end;
//####################################
//## WaitOnFlag Procedure ##
//####################################
procedure WaitOnFlag;
begin
WaitOnFlagLoops := 0;
repeat
Wait(1000+random(500));
WaitOnFlagLoops := WaitOnFlagLoops + 1;
if WaitOnFlagLoops = 12 then
begin
Mouse(250, 210, 32, 32, true);
end;
if (not(LoggedIn)) then Exit;
until(FlagPresent = false);
end;
//####################################
//## CheckRun Procedure ##
//####################################
procedure CheckRun;
begin
GameTab(11);
Wait(500+random(250));
if FindText(x, y, '100', smallchars, 628, 411, 667, 450) then
begin
SetRun(true);
end;
Wait(500+random(250));
GameTab(4);
Wait(250+random(125));
end;
//####################################
//## CheckForLevel Procedure ##
//####################################
procedure CheckForLevel;
begin
repeat
if FindText(x, y, 'continue', npcchars, mcx1, mcy1, mcx2, mcy2) then
begin
FindText(x, y, 'lick', npcchars, mcx1, mcy1, mcx2, mcy2);
Mouse(x, y, 100, 12, true);
end;
Wait(500+random(500));
if (not(LoggedIn)) then Exit;
until(not FindText(x, y, 'continue', npcchars, mcx1, mcy1, mcx2, mcy2));
end;
//####################################
//## 1st Obstacle Procedure ##
//####################################
procedure s1_LogBalance;
begin
tries := 0;
repeat
if (tries = 4) then
begin
if FindSymbol(x, y, 'agility') then
begin
Mouse(x, y, 12, 12, true);
WaitOnFlag;
tries := 0;
end;
end;
AntiRandoms;
if FindObj(x, y, 'Log balance', s_LogBalance_C, g_ColorTol) then
begin
Mouse(x, y, 6, 6, true);
WaitOnFlag;
end;
tries := tries + 1;
Wait(500+random(250));
if (not(LoggedIn)) then Exit;
until(IsChatBlackTextAnyLine('carefully') or IsChatBlackTextAnyLine('safely') or IsChatBlackTextAnyLine('advanced'));
Wait(500+random(250));
CheckForLevel;
AntiRandoms;
repeat
Wait(500+random(250));
CheckForLevel;
AntiRandoms;
if IsChatBlackTextAnyLine('safely') or IsChatBlackTextAnyLine('advanced') then
begin
case random(3)+1 of
1: Mouse(200, 260, 32, 32, true);
2: Mouse(240, 250, 32, 32, true);
3: Mouse(300, 250, 32, 32, true);
end;
s1_Complete := true;
end;
if (not(LoggedIn)) then Exit;
until(s1_Complete = true);
end;
//####################################
//## 2nd Obstacle Procedure ##
//####################################
procedure s2_ObstacleNet;
begin
repeat
WaitOnFlag;
Wait(1000+random(500));
if FindObj(x, y, 'Obstacle net', s_ObstacleNet_C, g_ColorTol) then
begin
Mouse(x, y, 6, 6, true);
end;
Wait(750+random(250));
CheckForLevel;
AntiRandoms;
if (not(LoggedIn)) then Exit;
until(IsChatBlackTextAnyLine('netting') or IsChatBlackTextAnyLine('advanced'));
repeat
Wait(500+random(250));
CheckForLevel;
AntiRandoms;
if IsChatBlackTextAnyLine('netting') or IsChatBlackTextAnyLine('advanced') then
begin
s2_Complete := true;
end;
if (not(LoggedIn)) then Exit;
until(s2_Complete = true);
end;
//####################################
//## 3rd Obstacle Procedure ##
//####################################
procedure s3_TreeBranch;
begin
repeat
WaitOnFlag;
if FindObj(x, y, 'Tree branch', s_TreeBranch_C, g_ColorTol) then
begin
Mouse(x, y, 6, 6, true);
end;
Wait(750+random(250));
CheckForLevel;
AntiRandoms;
if (not(LoggedIn)) then Exit;
until (IsChatBlackTextAnyLine('tree.') or IsChatBlackTextAnyLine('platform') or IsChatBlackTextAnyLine('advanced'));
Wait(250+random(125));
repeat
CheckForLevel;
AntiRandoms;
Wait(500+random(250));
if IsChatBlackTextAnyLine('platform') or IsChatBlackTextAnyLine('advanced') then
begin
Mouse(340, 165, 32, 32, true);
Wait(500+random(500));
s3_Complete := true;
end;
if (not(LoggedIn)) then Exit;
until(s3_Complete = true);
end;
//####################################
//## 4th Obstacle Procedure ##
//####################################
procedure s4_BalancingRope;
begin
repeat
WaitOnFlag;
if FindObj(x, y, 'Balancing rope', s_BalancingRope_C, g_ColorTol) then
begin
Mouse(x, y, 2, 2, true);
end;
WaitOnFlag;
Wait(500+random(250));
CheckForLevel;
AntiRandoms;
if (not(LoggedIn)) then Exit;
until(IsChatBlackTextAnyLine('carefully') or IsChatBlackTextAnyLine('advanced'));
Wait(250+random(125));
repeat
CheckForLevel;
AntiRandoms;
Wait(500+random(250));
if IsChatBlackTextAnyLine('tightrope') or IsChatBlackTextAnyLine('advanced') then
begin
s4_Complete := true;
end;
if (not(LoggedIn)) then Exit;
until(s4_Complete = true);
end;
//####################################
//## 5th Obstacle Procedure ##
//####################################
procedure s5_TreeBranch;
begin
repeat
WaitOnFlag;
if FindObj(x, y, 'Tree branch', s_TreeBranch_C, g_ColorTol) then
begin
Mouse(x, y, 6, 6, true);
end;
Wait(750+random(250));
CheckForLevel;
AntiRandoms;
if (not(LoggedIn)) then Exit;
until(IsChatBlackTextAnyLine('tree.') or IsChatBlackTextAnyLine('ground') or IsChatBlackTextAnyLine('advanced'));
Wait(250+random(125));
repeat
CheckForLevel;
AntiRandoms;
Wait(500+random(250));
if IsChatBlackTextAnyLine('ground') or IsChatBlackTextAnyLine('advanced') then
begin
case random(3)+1 of
1: Mouse(240, 50, 32, 32, true);
2: Mouse(170, 75, 32, 32, true);
3: Mouse(110, 90, 32, 32, true);
end;
s5_Complete := true;
end;
if (not(LoggedIn)) then Exit;
until(s5_Complete = true);
end;
//####################################
//## 6th Obstacle Procedure ##
//####################################
procedure s6_ObstacleNet;
begin
repeat
WaitOnFlag;
if FindObj(x, y, 'Obstacle net', s_ObstacleNet_C, g_ColorTol) then
begin
Mouse(x, y, 6, 6, true);
end;
Wait(750+random(250));
CheckForLevel;
AntiRandoms;
if (not(LoggedIn)) then Exit;
until(IsChatBlackTextAnyLine('netting') or IsChatBlackTextAnyLine('advanced'));
Wait(250+random(125));
repeat
CheckForLevel;
AntiRandoms;
Wait(500+random(250));
if IsChatBlackTextAnyLine('netting') or IsChatBlackTextAnyLine('advanced') then
begin
s6_Complete := true;
end;
if (not(LoggedIn)) then Exit;
until(s6_Complete = true);
end;
//####################################
//## Pipe Finder Procedure ##
//####################################
procedure PipeFinding;
begin
repeat
WaitOnFlag;
Wait(500+random(500));
if FindObj(x, y, 'Obstacle pipe', s_ObstaclePipe_C, g_ColorTol) then
begin
Mouse(x, y, 6, 6, true);
WaitOnFlag;
Wait(500+random(500));
if IsChatBlackTextAnyLine('being') then
begin
FoundPipe := false;
end else
begin
FoundPipe := true;
WaitOnPipe := 0;
end;
end;
Wait(500+random(500));
AntiRandoms;
if (not(LoggedIn)) then Exit;
until(FoundPipe = true);
end;
//####################################
//## 7th Obstacle Procedure ##
//####################################
procedure s7_ObstaclePipe;
begin
PipeFinding;
Wait(250+random(125));
repeat
CheckForLevel;
AntiRandoms;
Wait(500+random(250));
if FindColorTolerance(x, y, s_Mushroom_C, msx1, msy1, msx2, msy2, g_ColorTol) then
begin
tries := 0;
repeat
if FindSymbol(x, y, 'agility') then
begin
Mouse(x, y, 12, 12, true);
WalkingToStart := true;
WaitOnFlag;
LapComplete := true;
end;
tries := tries + 1;
if (not(LoggedIn)) then Exit;
until((WalkingToStart = true) or (tries = 12));
if (tries = 12) then
begin
LogOut;
WriteLn('Couldnt find the agility symbol.');
end;
end else
begin
WaitOnPipe := WaitOnPipe + 1;
end;
if (WaitOnPipe = 5) then
begin
PipeFinding;
end;
until(LapComplete = true);
end;
//####################################
//## Global Script Setup ##
//####################################
procedure SetupAgilityRunner;
begin
SetupSRL;
ClearDebug;
MouseSpeed := mMSpeed;
A_Greeting;
Wait(250+random(125));
ActivateClient;
Wait(250+random(125));
FirstLap := true;
SetupPlayers;
CurrentPlayer := FirstAccount;
LoginPlayer;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, Upchars);
MakeCompass('N');
HighestAngle;
end;
//########################################################################
//########################################################################
//####################################
//## Main Loop ##
//####################################
begin
SetupAgilityRunner;
Wait(100+random(50));
SetChat('off', 1);
SetChat('off', 1);
repeat
if (not(LoggedIn)) then Exit;
if (FirstLap = true) then
begin
LapsTillCheckRun := CheckRunLapDelay;
CheckRun;
Wait(250+random(100));
FirstLap := false;
s1_LogBalance;
end;
if LapsTillCheckRun <= 0 then
begin
LapsTillCheckRun := CheckRunLapDelay;
CheckRun;
end;
if NewLap = true then
begin
NewLap := false;
LapsTillCheckRun := LapsTillCheckRun - 1;
s1_LogBalance;
end;
if s1_Complete = true then
begin
s1_Complete := false;
s2_ObstacleNet;
end;
if s2_Complete = true then
begin
s2_Complete := false;
s3_TreeBranch;
end;
if s3_Complete = true then
begin
s3_Complete := false;
s4_BalancingRope;
end;
if s4_Complete = true then
begin
s4_Complete := false;
s5_TreeBranch;
end;
if s5_Complete = true then
begin
s5_Complete := false;
s6_ObstacleNet;
end;
if s6_Complete = true then
begin
s6_Complete := false;
s7_ObstaclePipe;
end;
if LapComplete = true then
begin
LapComplete := false;
LapsMade := LapsMade + 1;
PlayerReport;
NewLap := true;
end;
until(LapsMade >= Laps);
if (LapsMade >= Laps) then
begin
LogOut;
WriteLn('Training Was A Success.');
end else
begin
WriteLn('A Problem Was Encountered During Training.');
end;
end.
//########################################################################
//########################################################################