Moar updates:
Simba Code:
function RandomCheck : Boolean; //thanks mormonman for giveing me this idea and help
var I : Integer;
begin
for I := 0 to 2 do
begin
case I of
0: begin
if Players[CurrentPlayer].Booleans[0] then Result := R_FindRandoms;
end;
1: Result := FindRandoms;
2: ClickToContinue; // for sling message.
end;
if Result then Exit;
end;
end;
The current version of LevelCheck tries to set the fight everytime.. we might as well remember what we set it to last time and eliminate the effort of setting it to the same thing. 
Simba Code:
procedure SetFight(i:integer); //will add check to not click if allready clicked.
var
cTab: Integer;
begin
if (not LoggedIn) then Exit;
// check if the players current attack mode is the same, if so do not touch it.
if (Players[CurrentPlayer].Integers[30] = i) then Exit;
cTab := getCurrentTab;
GameTab(tab_Combat);
case i of
1:begin
if (CountColor(2106252, 576, 260, 628, 287) <= 30) then
begin
MouseBox(577, 258, 628, 287, 1);
Wait(500+Random(800));
end;
end;
2:begin
if (CountColor(2106252, 661, 257, 713, 288) <= 30)then
begin
MouseBox(661, 257, 713, 288, 1);
Wait(500+Random(800));
end;
end;
3:begin
if (CountColor(2070783, 666, 332, 706, 347) >= 10)then //looks for ornage text
begin
if (CountColor(2106252, 661, 314, 712, 339) <= 30)then
begin
MouseBox(661, 314, 712, 339, 1);
Wait(500+Random(800));
end;
end else
begin
if (CountColor(2106252, 578, 313, 628, 337) <= 30)then
begin
MouseBox(578, 313, 628, 337, 1);
Wait(500+Random(800));
end;
end;
end;
end;
GameTab(cTab);
Players[CurrentPlayer].Integers[30] := i;
end;
Procedure LevelCheck;
var
i:Integer;
Skills, AttackStyle:TIntegerArray;
ChangeMode:Boolean;
begin
ChangeMode:= False;
if (not (LoggedIn)) then Exit;
Skills:= [R_GetSkillLevel(Skill_Attack), R_GetSkillLevel(Skill_Strength), R_GetSkillLevel(Skill_Defence)]; //store players current levels
AttackStyle:= [1, 2, 3];
for i:=0 to 2 do
begin
if (Skills[i] >= Players[CurrentPlayer].Integers[int]) then
begin
ChangeMode:= True;
Players[CurrentPlayer].Integers[4] := (AttackStyle[i]);
end else
begin
Players[CurrentPlayer].Integers[4] := (AttackStyle[i]);
Break;
end;
end;
//means it will run once at startup to set it to correct stage of loop
if ChangeMode or (not Players[CurrentPlayer].Booleans[20]) then
begin
SetFight(Players[CurrentPlayer].Integers[4]);
Players[CurrentPlayer].Booleans[20] := True;
end;
end;
Fixed some faulty logic:
Simba Code:
procedure Relocation; //relocate the player if no rats are found on ms
var
rats:TPoint;
Char : TNPCArray;
P: TPoint;
i, x, y, clx, cly:integer;
begin
if (not (LoggedIn)) then Exit;
Char := (SortNPCS(GetNPCS));
if (Length(Char) = 0) then
Exit;
GetClientDimensions(clx, cly);
//Write('Checking if a relocation is needed');
for i := 0 to High(Char) do
begin
if (DistanceFrom(Tile(3195, 3204)) > 8)then //3195, 3210 //check we are away from rat pit
if((Char[i].Name = 'Giant rat') and (TileOnMS(Char[i].Tile, 0)) and (not(Char[i].Fighting)))then
begin
P := TileToMS(Char[i].Tile, 5);
rats:= TileToMM(Tile(3195, 3204)); //checks rat color is found on MS and if it is wont relocate
if FindColorSpiralTolerance(x, y, MyFindColor('rat', false), max(P.x - 20,0), max(P.y - 20,0), min(P.x + 20,clx), min(P.y +20, cly), 8)then
begin
if WaitUpTextMulti(['Giant rat', 'iant ra'], 400)then //if the rat is on the mainscreen you are still fine
begin
Write('Rats found on MS, not relocating');
Exit;
end;
if (CountColor(1179390, rats.x - 20, rats.y - 20, rats.x + 20, rats.y + 20) > 5 )then
begin //if npc minimap color is found then clicks on mm
Write('No rats Found On MS');
Write('Might be Out of range of Rat Pit');
Write('Attempting to Relocate');
Mouse(rats.x, rats.y, 3, 3, true);
R_Flag;
Wait(1000+Random(800));
Exit;
end;
end;
end;
end;
end;
Cleaned up a bit:
Simba Code:
Procedure Attack;
begin
if (not (LoggedIn)) then Exit;
if Players[CurrentPlayer].Booleans[0] then //checks if we are using reflection
begin
RFAttack;
end else
ColorAttack;
if (not Players[CurrentPlayer].Booleans[1]) then
repeat
Wait(1000+Random(1000));
if Dead then Exit;
AntiBan;
until((not Fighting) and (not(MyInFight)))
else begin
Write('Attempting to Fast Fight');
repeat
if Dead then Exit;
Wait(500 +Random(800));
until((not Fighting) or (not(MyInFight)))
end;
if SmartDebugReport then PrintSmartReport;
LevelCheck; //checks if we need to change fighting mode
Relocation;
if (TimeFromMark(Report)>=(300000))then //does progress report every 5 minutes
begin
MarkTime(Report);
ProgressReport;
end;
if RandomCheck then
if not loggedin then exit;
end;
Also, you may want to add ``Players.WorldInfo'' to Declare Players, most do not know its there, nor how it works. 

