SamSatanas
04-24-2012, 02:08 PM
Every time I run a script, simba opens the GameTab and my script stops. I even get the error when I run a simple script.
program CowKiller;
{$DEFINE SMART}
{$DEFINE SRL5}
{$i SRL/srl.simba}
procedure start;
begin
ClearDebug;
Smart_Server := 14;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
activateclient;
SetupSRL;
end;
Function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 1500+Random(500)) Then
begin
Result:=True
GetMousePos(x, y);
If RClick Then
begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 2000);
If Result Then FFlag(0);
end else
begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
end;
end;
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
function InFight: Boolean;
begin
Result := srl_InFight;
end;
Procedure Antiban;
begin
Case Random(250) of
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('WoodCutting', False) GameTab(28)end;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28)end;
3: Begin StatsGuise('AntiBan') RandomAngle(1); end;
4: Begin StatsGuise('AntiBan') GameTab(tab_Stats); Wait(3000 + Random(500)); GameTab(28)end;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28)end;
end;
end;
Procedure FailSafe(Reason:String);
begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
Writeln(Reason);
TerminateScript;
end;
function CColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.57);
if not (FindColorsTolerance(arP, 10859196, MSX1, MSY1, MSX2, MSY2, 24)) 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
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function AttackingCow:Boolean;
Var
x,y:Integer;
begin
x:=MSCX;
y:=MSCY;
SetAngle(SRL_ANGLE_HIGH);
if InFight then
begin
repeat
FindNormalRandoms;
until ((not LoggedIn) or (not InFight))
end;
If FindObjEx(x,y, ['Attack'], [CColor], 10, 50, 1, 5, 690, 400) then
Begin
StatsGuise('Attacking Cow');
GetMousePos(x,y);
Case random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('ttack', 500);
end;
End;
End;
end;
Procedure Eat;
begin
Writeln(HPPercent);
end;
begin
start;
CColor;
Eat;
repeat
Antiban;
AttackingCow;
until(false);
end.
SRL Compiled in 15 msec
SMART Initialized.
Loaded: Server 14, Members: True, Signed: True, Super Detail: False.
AutoColor = 9672602
Error: Out Of Range at line 957
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]
program CowKiller;
{$DEFINE SMART}
{$DEFINE SRL5}
{$i SRL/srl.simba}
procedure start;
begin
ClearDebug;
Smart_Server := 14;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
activateclient;
SetupSRL;
end;
Function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 1500+Random(500)) Then
begin
Result:=True
GetMousePos(x, y);
If RClick Then
begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 2000);
If Result Then FFlag(0);
end else
begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
end;
end;
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
function InFight: Boolean;
begin
Result := srl_InFight;
end;
Procedure Antiban;
begin
Case Random(250) of
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('WoodCutting', False) GameTab(28)end;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28)end;
3: Begin StatsGuise('AntiBan') RandomAngle(1); end;
4: Begin StatsGuise('AntiBan') GameTab(tab_Stats); Wait(3000 + Random(500)); GameTab(28)end;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28)end;
end;
end;
Procedure FailSafe(Reason:String);
begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
Writeln(Reason);
TerminateScript;
end;
function CColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.57);
if not (FindColorsTolerance(arP, 10859196, MSX1, MSY1, MSX2, MSY2, 24)) 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
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function AttackingCow:Boolean;
Var
x,y:Integer;
begin
x:=MSCX;
y:=MSCY;
SetAngle(SRL_ANGLE_HIGH);
if InFight then
begin
repeat
FindNormalRandoms;
until ((not LoggedIn) or (not InFight))
end;
If FindObjEx(x,y, ['Attack'], [CColor], 10, 50, 1, 5, 690, 400) then
Begin
StatsGuise('Attacking Cow');
GetMousePos(x,y);
Case random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('ttack', 500);
end;
End;
End;
end;
Procedure Eat;
begin
Writeln(HPPercent);
end;
begin
start;
CColor;
Eat;
repeat
Antiban;
AttackingCow;
until(false);
end.
SRL Compiled in 15 msec
SMART Initialized.
Loaded: Server 14, Members: True, Signed: True, Super Detail: False.
AutoColor = 9672602
Error: Out Of Range at line 957
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]