Your last Until(False) in the main loop, switch it to
Until(AllPlayersInactive)
Other people have been getting the 101 error, also.
In your global variables, it's easier to define x,y in them, but it's better if you define them in each procedure itself, to prevent any type of bugs.
Begin
Repeat
If InvCount=+1 Then
MarkTime(FishCounter);
Antiban;
Wait(1000);
Until(TimeFromMark(FishCounter) > 7000) or (InvFull)
End.
End.
You can't end the End's in periods, only the mainloop can. End them in ;
Begin
Repeat
If InvCount=+1 Then
MarkTime(FishCounter);
Antiban;
Wait(1000);
Until(TimeFromMark(FishCounter) > 7000) or (InvFull)
End;
End;
It's also better if you use the tab key, makes the script a lot easier to read.
Try to keep all the Begins,Ends,Ifs,Thens,ect all the same. If you capitalize them, capitalize all of them. If not, make them all lowercase. They all look better lowercase, anyway. ;D
Here's the script with all the spacing, to the best of my ability. (My standards aren't perfect)
program Myfirstfisher;
{$DEFINE SRL5}
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i SRL/SRL/misc/paintsmart.simba}
Const
//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';
//General settings
SwitchWorlds = True; //Switch worlds after break?
//Break settings
BreakIn = 235; //How long before we take a break? (minutes)
BreakFor = 15; //How long will we break for? (minutes)
Bir = 13; //Random minutes to add/subtract from how long until we break
Bfr = 7; //Random minutes to add/subjtract from break duraction
Var
x, y, Tries, Tried, FishCounter: integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Fishing;
Active := True;
end;
end;
Function Antiban: Boolean;
var
i: Integer;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
i := Random(300);
case i of
1:
begin
RandomRClick;
Result := True;
end;
2..5:
begin
KeyDown(40);
Wait(RandomRange(500, 1100));
KeyUp(40);
Wait(RandomRange(310, 865));
SetAngle(SRL_Angle_High);
Result := True;
end;
6:
begin
HoverSkill('Fishing', False);
Result := True;
end;
7..300:
begin
Wait(RandomRange(250, 350));
Exit;
end;
end;
Wait(RandomRange(250, 350));
end;
function SpotColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.27, 0.83);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 11708319, MSX1, MSY1, MSX2, MSY2, 7);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 27.52) and (X <= 46.16) and (Y >= 28.88) and (Y <= 48.80) and (Z >= 39.69) and (Z <= 55.71) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Procedure Spotfinding;
Begin
If Not loggedin Then
Exit;
If (not (FindObjCustom(x, y, ['Use', 'rod'], [SpotColor], 5))) Then
begin
Wait(100+random(70));
Tried:= Tries + 1;
end;
if(Tries = 15)Then
Begin
Logout;
Exit;
End else
if FindObjCustom(x, y, ['Use', 'rod'], [SpotColor], 5)Then
Mouse(x, y, 0, 0, True);
End;
////////////What is this?
//Begin
//Repeat
// If InvCount=+1 Then
// begin
// MarkTime(FishCounter);
// Antiban;
// Wait(1000);
// end;
//Until(TimeFromMark(FishCounter) > 7000) or (InvFull)
//End;
Procedure DropFish;
Begin
If InvFull Then
DropAllExcept(1);
End;
Begin
SetupSRL;
Repeat
Spotfinding;
DropFish;
AntiBan
Until (AllPlayersInactive)
End.