SCAR Code:
{.Script Info:
# ScriptName = Soul Wars!
# Author = Sandstorm and NiCbaZ.
# Description = Walks into Soul Wars game walks to an afk spot,
# Desc. Cont. = sits and antibans until it's outside. Repeats
# Version = 1.3
# Date = February 15th, 2009.
# Comments = Err... None.
/Script Info
Credits:
05hartor for letting me borrow his account to develop the script on.
}
Program New;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
const
ChanceToAntiban = 3000; //How often to do antiban? The higher, the less often.
WhichWorld = 0; //Which favorite world do you wish to use? Set to zero to disable.
SwitchTeams = True; //Switch teams based on who won the last game?
Switch = True; //Switch players?
Rest = True; //Use breaks?
TimeL = 10; //How long to break for? In minutes. Adds a random amount.
//Random amount = Time to break / 10 rounded down.
var
TeamString, Team: string;
Chances, TeamInteger, GameCount, GamesPlayed, GamesWon, GamesLost : Integer;
GamesDrawn, Antibanz, Zeal, Iz : Integer;
Guthix, EndInitForm : Boolean;
frmDesign, Authorization : TForm;
PageControl : TPageControl;
TabPages : array of TTabSheet;
PlayersZ, GroupBox2 : array of TGroupBox;
Label2, Label3, Label4, Label5, Label10, Label6, Label7, Label8, Label9, Label15 : array of TLabel;
Username, Edit2, Edit3, Edit4, Edit5 : array of TEdit;
Button2, Button1 : array of TButton;
ComboBox1, ComboBox2, ComboBox3 : array of TComboBox;
AuthUser, AuthPass : TEdit;
ButtonStart : TButton;
procedure ProgressReport;
begin
ClearDebug;
GamesDrawn := GamesPlayed - GamesLost - GamesWon;
Zeal := (GamesWon * 3) + (GamesDrawn * 2) + (GamesLost * 1);
WriteLn('[' + Padr('You won: ' + IntToStr(GamesWon) + ' games.', 80) + ']');
WriteLn('[' + Padr('You lost: ' + IntToStr(GamesLost) + ' games.', 80) + ']');
WriteLn('[' + Padr('You drawn: ' + IntToStr(GamesDrawn) + ' games.', 80) + ']');
WriteLn('[' + Padr('You have played: ' + IntToStr(GamesPlayed) + ' games.', 80) + ']');
WriteLn('[' + Padr('You have gained: ' + IntToStr(Zeal) + ' zeal.', 80) + ']');
WriteLn('[' + Padr('You have performed: ' + IntToStr(Antibanz) + ' antibans', 80) + ']');
WriteLn('[' + Padr('The script has been running for: ' + TimeRunning, 80) + ']');
WriteLn('[' + Padr('Thanks for using the Soul Wars Lite by Sandstorm!', 80) + ']');
end;
procedure SetupSmart;
begin
SmartSetupEx(144, True, true, false);
while (not RSReady) and (not (IsFkeyDown(9))) do
wait(100);
SetTargetDC(SmartGetDC);
end;
function Contain(Stringz, Strings: string): Boolean;
begin
Result := Pos(Stringz, Strings) <> 0;
end;
function AntiBan(Chance: Integer): Boolean;
var
x, y: Integer;
begin
if not (LoggedIn) then
Exit;
case random(Chance) of
0:
begin
PickUpMouse;
Result := True;
Inc(Antibanz);
end;
1:
begin
Result := True;
GameTab(1 + Random(12));
Inc(Antibanz);
end;
2:
begin
Result := True;
RandomRclick;
Inc(Antibanz);
end;
3:
begin
Result := True;
randomMovement;
Inc(Antibanz);
end;
4:
begin
Result := True;
MMouse(Random(MSX2), Random(MSY2), Random(MSX2), Random(MSY2));
Inc(Antibanz);
end;
5:
begin
HoverSkill('random', false);
sleepandmovemouse(200 + Random(100));
gametab(4);
MMouse(Random(MSY1), Random(MSX1), Random(MSX2), Random(MSY2));
Inc(Antibanz);
end;
6:
begin
GameTab(1 + Random(13));
wait(1000 + Random(600));
Result := True;
Inc(Antibanz);
end;
7:
begin
HoverSkill('random', false);
sleepandmovemouse(200 + Random(100));
Result := True;
Inc(Antibanz);
end;
8:
begin
Result := True;
MMouse(x, y, (10 + random(350)), (10 + random(200)));
Inc(Antibanz);
end;
9:
begin
Result := True;
MMouse(Random(MSX2), Random(MSY2), Random(MSX2), Random(MSY2));
Inc(Antibanz);
end;
end;
end;
procedure DoAntiBans;
begin
if Chances <= 0 then
Chances := 50;
if Chances < 50 then
Chances := 50;
if Antiban(Chances) then
begin
Chances := ChanceToAntiban;
end
else
Chances := Chances - randomrange(1, 5);
end;
function DidIDie: Integer;
begin
Result := 0;
if PointInBox(GetMyPos, IntToBox(1816, 3220, 1823, 3230)) then
Result := 1;
if PointInBox(GetMyPos, IntToBox(1841, 3217, 1843, 3219)) then
Result := 2;
if PointInBox(GetMyPos, IntToBox(1932, 3244, 1934, 3246)) then
Result := 3;
if PointInBox(GetMyPos, IntToBox(1951, 3234, 1958, 3244)) then
Result := 4;
end;
function InWaitingRoom(Team: string): Boolean;
begin
case Lowercase(Team) of
'zamorak': Result := PointInBox(GetMyPos, IntToBox(1900, 3157, 1909, 3166));
'saradomin': Result := PointInBox(GetMyPos, IntToBox(1871, 3159, 1879, 3166));
end;
end;
function InAWaitingRoom: Boolean;
begin
Result := InWaitingRoom('saradomin') or InWaitingRoom('zamorak');
end;
function OutOfGame: Boolean;
begin
Result := TileOnMM(Point(60 - 1899, 77 - 3162)) or TileOnMM(Point(60 - 1880, 77 - 3162));
end;
procedure ToPortal(Portal: Integer);
begin
if not OutOfGame then
Exit;
case Portal of
1:
begin
if not TileOnMM(Point(60 - 1899, 77 - 3162)) then
WalkToTile(Point(60 - 1890, 77 - 3164), 2, 1);
WalkToTile(Point(60 - 1899, 77 - 3162), 2, 1);
end;
2:
begin
if not TileOnMM(Point(60 - 1880, 77 - 3162)) then
WalkToTile(Point(60 - 1890, 77 - 3164), 2, 1);
WalkToTile(Point(60 - 1880, 77 - 3162), 2, 1);
end;
3: WalkToTile(Point(60 - 1891, 77 - 3163), 2, 1);
end;
end;
Function TimeRemaining(Procedures : String) : Variant;
Begin
Case Lowercase(Procedures) of
'enterportal' : Result := Contain('ou left a', GetInterfaceText(211, 1));
'waiting' : Result := GetNumbers(GetInterfaceText(211, 1));
End;
End;
Procedure Waiting;
Var
C : Integer;
Begin
C := StrToInt(TimeRemaining('waiting'))
Logout;
Wait(C * 60 * 1000 + random(10000));
LoginPlayer;
End;
procedure HandleChat;
var
x, y: Integer;
begin
If TimeRemaining('enterportal') Then
Waiting;
while FindText(x, y, 'lease wait', npcChars, MCX1, MCY1, MCX2, MCY2) do
Wait(750);
if Guthix then
ClickText('nter portal.', npcChars, MCX1, MCY1, MCX2, MCY2, true)
else
ClickText('nter waiting area', npcChars, MCX1, MCY1, MCX2, MCY2, true);
end;
procedure EnterPortal(Portal: Integer);
var
P: Tpoint;
X, Y: Integer;
C: TMe;
begin
if InWaitingRoom('saradomin') or InWaitingRoom('zamorak') then
Exit;
case Portal of
1:
begin
MakeCompass('e');
If TimeRemaining('enterportal') Then
Waiting;
if ClickToContinue then
HandleChat;
if not TileOnMS(Point(60 - 1900, 77 - 3162), 0) then
ToPortal(1);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1900, 77 - 3162.5), 5);
MMouse(P.x, P.y, 3, 3);
Wait(500);
if IsUpText('ed barr') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;
If TimeRemaining('enterportal') Then
Waiting;
if ClickToContinue then
HandleChat;
if ClickToContinue then
HandleChat;
end;
end;
2:
begin
MakeCompass('w');
If TimeRemaining('enterportal') Then
Waiting;
if ClickToContinue then
HandleChat;
if not TileOnMS(Point(60 - 1879, 3162), 0) then
ToPortal(2);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1879, 3162.5), 5);
MMouse(P.x, P.y, 3, 3);
Wait(500);
if IsUpText('lue barr') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;
If TimeRemaining('enterportal') Then
Waiting;
if ClickToContinue then
HandleChat;
if ClickToContinue then
HandleChat;
end;
end;
3:
begin
MakeCompass('s');
If TimeRemaining('enterportal') Then
Waiting;
if ClickToContinue then
HandleChat;
if not TileOnMS(Point(60 - 1891, 77 - 3163), 0) then
ToPortal(3);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1891, 77 - 3163), 5);
MMouse(P.x, P.y, 3, 3);
Wait(500);
if IsUpText('eam Ba') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;
If TimeRemaining('enterportal') Then
Waiting;
if ClickToContinue then
HandleChat;
if ClickToContinue then
HandleChat;
end;
end;
end;
end;
function ABFlag: Boolean;
var
timeout, x, y: Integer;
begin
if (FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) then
begin
Result := True;
repeat
Wait(100);
DoAntiBans;
if (SRL_Procs[srl_AntiBan] <> nil) then
SRL_Procs[srl_AntiBan]();
timeout := timeout + 1;
until (not FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) or (timeout > 300);
end;
end;
function WalkToPath(Path: TPointArray): Boolean;
var
I: integer;
Last, II, Dist: Integer;
P: TPoint;
DoTile: Integer;
begin
case random(3) of
1: SetRun(true);
end;
P := GetMyPos;
Last := 1 shl 20;
for II := 0 to High(Path) - 1 do
begin
Dist := Distance(P.x, P.y, Path[II + 1].x, Path[II + 1].y);
if (Dist > Last) then Continue;
Last := Dist;
DoTile := II;
end;
if (not(WalkToTile(Path[DoTile + 1], 1, 10))) then
begin
Result:= False;
Exit;
end else
for I := DoTile + 1 to High(Path) - 1 do
begin
if not (WalkToTile(Path[i + 1], 1, 3)) then
begin
Exit;
Result:= False;
end else
begin
ABFlag;
end;
end;
Result := True;
End;
function SoulWalk(WhereTo : Integer): boolean;
Var
Paths : Array[0..4] of TPointArray;
Begin
Paths[1] := [Point(60 - 1815, 77 - 3225), Point(60 - 1807, 77 - 3232), Point(60 - 1811, 77 - 3244), Point(60 - 1820, 77 - 3246), Point(60 - 1829, 77 - 3244), Point(60 - 1836, 77 - 3247), Point(60 - 1844, 77 - 3247)];
Paths[2] := [Point(60 - 1842, 77 - 3230), Point(60 - 1842, 77 - 3238), Point(60 - 1844, 77 - 3247)];
Paths[3] := [Point(60 - 1934, 77 - 3231), Point(60 - 1929, 77 - 3222), Point(60 - 1928, 77 - 3212)];
Paths[4] :=[Point(60 - 1968, 77 - 3233), Point(60 - 1966, 77 - 3223), Point(60 - 1961, 77 - 3213), Point(60 - 1950, 77 - 3217), Point(60 - 1939, 77 - 3220), Point(60 - 1929, 77 - 3216), Point(60 - 1927, 77 - 3213)];
Result := WalkToPath(Paths[WhereTo]);
end;
Function InGraveYard(WhichOne : Integer) : Boolean;
Begin
Case WhichOne Of
1 : Result := PointInBox(GetMyPos, IntToBox(60 - 1841, 77 - 3217, 60 - 1843, 77 - 3219));
4 : Result := PointInBox(GetMyPos, IntToBox(60 - 1932, 77 - 3244, 60 - 1934, 77 - 3246));
End;
End;
Function InPyreSpot(WhichOne : Integer) : Boolean;
Begin
Case WhichOne Of
1 : Result := PointInBox(GetMyPos, IntToBox(1837, 3238, 1855, 3255));
4 : Result := PointInBox(GetMyPos, IntToBox(1922, 3205, 1936, 3220));
End;
End;
Procedure ToPyre(WhichOne : Integer);
Begin
While Not InPyreSpot(WhichOne) Do
SoulWalk(WhichOne);
End;
Function InBoolArray(Bool : Boolean; Bools : Array of Boolean) : Boolean;
Var
I : Integer;
Begin
For I := 0 To High(Bools) Do
Begin
Result := Bool = Bools[i];
If Result Then
Exit;
End;
End;
Function r_InFight: Boolean;
Var
T: Integer;
Me: TMe;
Begin
T := GetSystemTime;
Repeat
If Not LoggedIn Then
Exit;
Wait(67);
Me := GetMe;
Result := Me.Animation > 0;
Until (Result) or (GetSystemTime - T > 2667);
End;
Procedure FightPyres;
Var
Pyres : Array of TNpc;
Idz : TIntegerArray;
X, Y, I : Integer;
C : TMe;
Begin
C := GetMe;
If (C.Speed <> 0) Then
Exit;
If Random(5) = 2 Then
MakeCompass(IntToStr(Random(360)));
Pyres := GetNPCsBy('Pyrefiend');
SetArrayLength(Idz, High(Pyres) + 1);
For I := 0 To High(Pyres) Do
Idz[I] := Pyres[i].index;
If Not C.InFight Then
Begin
For I := 0 To High(Pyres) do
Begin
If Not PointInBox(Point(Pyres[i].MS.X, Pyres[i].MS.Y), IntToBox(0, 0, 5, 5)) Then
Begin
MMouse(Pyres[i].MS.X, Pyres[i].MS.Y + 20, 3, 3);
Wait(500 + random(250));
If IsUpText('yrefiend') Then
Begin
GetMousePos(X, Y);
Mouse(X, Y, 0 ,0, True);
Break;
End else
Begin
GetMousePos(X, Y);
Mouse(X, Y, 0 ,0, False);
Wait(500 + random(250));
ChooseOption('ck Pyrefiend');
Break;
End;
End;
End;
End;
While R_InFight Do
DoAntiBans;
End;
Function SolveWest : Boolean;
Var
P : TPoint;
X, Y : Integer;
begin
WriteLn('Ran SolveWest');
If Not InGraveYard(1) Then
Exit;
Result := True;
MakeCompass('n');
While InGraveYard(1) Do
Begin
P := TileToMSEx(Tile(60 - 1842.5, 77 - 3220.5), 5);
MMouse(P.x, P.y, 3, 3);
Wait(500);
if IsUpText('ue barr') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;
Wait(1000);
End;
ToPyre(2);
end;
Function SolveEast : Boolean;
Var
P : TPoint;
X, Y : Integer;
begin
WriteLn('Ran SolveEast');
If Not InGraveYard(4) Then
Exit;
Result := True;
MakeCompass('s');
While InGraveYard(1) Do
Begin
P := TileToMSEx(Tile(60 - 1933.5, 77 - 3243.5), 5);
MMouse(P.x, P.y, 3, 3);
Wait(500);
if IsUpText('ed barr') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;
Wait(1000);
End;
ToPyre(3);
end;
procedure HandleRoom(Team2: string);
var
P: Tpoint;
x, y, T: Integer;
C: Tme;
begin
C := GetMe;
if not C.Speed = 0 then
Exit;
T := DidIDie;
if not InRange(T, 0, 5) then
Exit;
if InRange(T, 2, 3) then
begin
if not T <> 2 then
SolveWest
else if not T <> 3 then
SolveEast;
end;
case lowercase(Team2) of
'zamorak':
begin
if not T <> 4 then
begin
MakeCompass('E');
if not TileOnMS(Point(60 - 1959, 77 - 3239), 1) then
begin
if WalkToTile(Point(60 - 1958, 77 - 3239), 0, 0) then
begin
Wait(1500);
P := TileToMS(Point(60 - 1959, 77 - 3239), 1);
MMouse(P.x, P.y, 3, 3);
Wait(250);
GetMousePos(x, y);
if IsUpText('ass Red') then
Mouse(x, y, 0, 0, true);
FFlag(0);
end;
end
else
begin
Wait(1500);
P := TileToMS(Point(60 - 1959, 77 - 3239), 1);
MMouse(P.x, P.y, 3, 3);
Wait(250);
GetMousePos(x, y);
if IsUpText('ass Red') then
Mouse(x, y, 0, 0, true);
FFlag(0);
end;
end;
end;
'saradomin':
begin
if T = 1 then
begin
Wait(500);
MakeCompass('W');
if not TileOnMS(Point(60 - 1816, 77 - 3224), 1) then
begin
if WalkToTile(Point(60 - 1816, 77 - 3224), 0, 0) then
begin
Wait(1500);
P := TileToMSEx(Tile(60 - 1815.5, 77 - 3225.5), 1);
MMouse(P.x, P.y, 3, 3);
Wait(250);
GetMousePos(x, y);
if IsUpText('ass Blue') then
Mouse(x, y, 0, 0, true);
FFlag(0);
end;
end
else
begin
Wait(1500);
P := TileToMSEx(Tile(1815.5, 3225.5), 1);
MMouse(P.x, P.y, 3, 3);
Wait(250);
GetMousePos(x, y);
if IsUpText('ass Blue') then
Mouse(x, y, 0, 0, true);
FFlag(0);
end;
end;
end;
end;
end;
procedure FavWorld(Which: Integer);
var
XCo, YCo: Integer;
begin
if LoggedIn then
Exit;
case Which of
1:
begin
if GetColor(429, 264) = 1648224 then
XCo := 388
else
XCo := 410;
YCo := 266;
if GetColor(XCo, YCo) = 1648224 then
Mouse(XCo + Random(5), YCo, 3, 3, True)
else
WriteLn('You don''''t have a world favorited there!');
end;
2:
if GetColor(429, 264) = 1648224 then
Mouse(435, 264, 3, 3, True)
else
WriteLn('You don''''t have a world favorited there!');
end;
end;
function InAfkSpot(Team: Integer): Boolean;
begin
case Team of
4: Result := PointInBox(GetMyPos, IntToBox(1959, 3234, 1959, 3236));
1: Result := PointInBox(GetMyPos, IntToBox(1815, 3228, 1815, 3230));
end;
end;
procedure SwitchPlayers(Active: Boolean);
begin
if Guthix then
Guthix := False;
Case Players[currentplayer].Strings[1] Of
'5-10 - Games' : Players[currentplayer].integers[0] := 5 + random(10);
'10-20 - Games' : Players[currentplayer].integers[0] := 10 + random(10);
'20-30 - Games' : Players[currentplayer].integers[0] := 20 + random(10);
End;
If Rest Then
Begin
Logout;
Wait(1000 * 60 * TimeL + Random(Floor(1000 * 60 * (TimeL/10))));
End;
NextPlayer(active);
Team := Players[currentplayer].Strings[0];
GameCount := 0;
end;
procedure Mainloop;
var
T, P: Boolean;
X: string;
begin
ClearDebug;
if not LoggedIn then
LoginPlayer;
Team := Players[currentplayer].Strings[0];
T := False;
X := Lowercase(Team);
if Lowercase(Players[currentplayer].strings[0]) = 'guthix' then
Guthix := True;
repeat
if Guthix and (DidIDie <> 0) then
begin
if DidIDie = 1 then
TeamString := 'saradomin'
else
TeamString := 'zamorak';
case TeamString of
'saradomin': TeamInteger := 1;
'zamorak': TeamInteger := 4;
end;
end
else if Guthix and InAWaitingRoom then
begin
if DidIDie = 1 then
TeamString := 'saradomin'
else
TeamString := 'zamorak';
case TeamString of
'saradomin': TeamInteger := 1;
'zamorak': TeamInteger := 4;
end;
end
else if (GameCount = Players[currentplayer].integers[0]) and (Switch) then
SwitchPlayers(True);
if not LoggedIn then
begin
LoginPlayer;
if OutOfGame then
Mainloop
else
NextPlayer(False);
end;
ProgressReport;
X := Lowercase(Team);
TeamString := Lowercase(X);
if OutOfGame then
begin
Disguise('Out of game!');
FindNormalRandoms;
TeamString := X;
if TeamInteger = 0 then
case TeamString of
'saradomin': TeamInteger := 1;
'zamorak': TeamInteger := 4;
end;
if OutOfGame and not InAWaitingRoom then
begin
Disguise('Entering a Portal!');
if Guthix then
begin
EnterPortal(3);
Exit;
end
else
case X of
'zamorak': EnterPortal(1);
'saradomin': EnterPortal(2);
end;
end;
end;
if not TeamInteger <> 0 then
case TeamString of
'saradomin': TeamInteger := 1;
'zamorak': TeamInteger := 4;
end;
while InAWaitingRoom do
begin
if Guthix then
begin
if InWaitingRoom('saradomin') then
TeamString := 'saradomin'
else
TeamString := 'zamorak';
case TeamString of
'saradomin': TeamInteger := 1;
'zamorak': TeamInteger := 4;
end;
end;
Disguise('In a Waiting Room!');
Wait(500);
DoAntiBans;
end;
if not (DidIDie = TeamInteger) = T then
T := DidIDie = TeamInteger;
if not OutOfGame and not InAWaitingRoom and T then
begin
if Guthix then
begin
if DidIDie = 1 then
TeamString := 'saradomin'
else
TeamString := 'zamorak';
case TeamString of
'saradomin': TeamInteger := 1;
'zamorak': TeamInteger := 4;
end;
end;
HandleRoom(TeamString);
HandleChat;
end;
if not (DidIDie = TeamInteger) = T then
T := DidIDie = TeamInteger;
if (not Players[currentplayer].booleans[0]) and not OutOfGame and not InAWaitingRoom and not T and not InAfkSpot(TeamInteger) then
begin
Disguise('Walking to AFK Spot!');
case TeamString of
'saradomin': WalkToTile(Point(60 - 1815, 77 - 3230), 1, 0);
'zamorak': WalkToTile(Point(60 - 1959, 77 - 3234), 1, 0);
end;
end;
if (Players[currentplayer].booleans[0]) and not OutOfGame and not InAWaitingRoom and not T and not InPyreSpot(TeamInteger) then
begin
If InGraveYard(1) Then
SolveWest;
If InGraveYard(4) Then
SolveEast;
Disguise('Walking to Pyre Spot!');
case TeamString of
'saradomin': ToPyre(1);
'zamorak': ToPyre(4);
end;
end;
while (not Players[currentplayer].booleans[0]) and (not OutOfGame) and (not InAWaitingRoom) and (T = false) and (InAfkSpot(TeamInteger)) do
begin
DoAntiBans;
Disguise('Game ends In: ' + GetInterfaceText(836, 27));
Wait(500);
if ValidInterface(836) then
begin
if GetInterfaceText(836, 27) = '1 min' then
begin
if StrToInt(GetInterfaceText(836, 13)) = StrToInt(GetInterfaceText(836, 9)) then
Wait(1)
else
begin
P := StrToInt(GetInterfaceText(836, 13)) > StrToInt(GetInterfaceText(836, 9));
case P of
False:
begin
if TeamString = 'zamorak' then
Begin
If SwitchTeams Then
TeamString := 'saradomin';
Inc(GamesWon)
End
else
Inc(GamesLost);
end;
True:
begin
if TeamString = 'saradomin' then
Begin
If SwitchTeams Then
TeamString := 'zamorak';
Inc(GamesWon)
End
else
Inc(GamesLost);
end;
end;
end;
Inc(GamesPlayed);
Inc(GameCount);
Wait(Ceil(1000 * 60 * 1.1));
end;
end;
if not (DidIDie = TeamInteger) = T then
T := (DidIDie = TeamInteger);
end;
if not (DidIDie = TeamInteger) = T then
T := (DidIDie = TeamInteger);
while (Players[currentplayer].booleans[0]) and (not OutOfGame) and (not InAWaitingRoom) and (T = false) and (InPyreSpot(TeamInteger)) do
begin
FightPyres;
Disguise('Game ends In: ' + GetInterfaceText(836, 27));
Wait(500);
if ValidInterface(836) then
begin
if GetInterfaceText(836, 27) = '1 min' then
begin
if StrToInt(GetInterfaceText(836, 13)) = StrToInt(GetInterfaceText(836, 9)) then
Wait(1)
else
begin
P := StrToInt(GetInterfaceText(836, 13)) > StrToInt(GetInterfaceText(836, 9));
case P of
False:
begin
if TeamString = 'zamorak' then
Begin
If SwitchTeams Then
TeamString := 'saradomin';
Inc(GamesWon)
End
else
Inc(GamesLost);
end;
True:
begin
if TeamString = 'saradomin' then
Begin
If SwitchTeams Then
TeamString := 'zamorak';
Inc(GamesWon)
End
Else
Inc(GamesLost);
End;
End;
end;
Inc(GamesPlayed);
Inc(GameCount);
Wait(Ceil(1000 * 60 * 1.1));
end;
end;
if not (DidIDie = TeamInteger) = T then
T := (DidIDie = TeamInteger);
If not T and not InPyreSpot(TeamInteger) Then
T := True;
end;
TeamInteger := 0;
ProgressReport;
if not (DidIDie = TeamInteger) = T then
T := (DidIDie = TeamInteger);
until (AllPlayersInactive)
end;
Function AuthRight(Passw, Usern : String) : Boolean;
var
User, Pass : Array of String;
I : Integer;
begin
SetArrayLength(User, 4);
SetArrayLength(Pass, 4);
if (Passw <> '') and (Passw <> ' ') and (Usern <> ' ') and (Usern <> '') then
Begin
User := ['hi','hello','sup','lol'];
Pass := ['hi1','hello1','sup101','lol101'];
begin
for I:= 0 to High(Pass) do
Begin
if (User[I] = Usern) and (Pass[I] = Passw) then
Result := True;
End;
end;
end;
If not Result Then
WriteLn('Invalid Username or Password!');
end;
procedure SaveFormSetting; forward;
procedure LoadSettings(I: integer); forward;
procedure StartButton(sender: Tobject);
begin
SaveFormSetting;
FrmDesign.modalresult := mrOk;
end;
procedure InitFormOnClose1(Sender : TObject; var Action : TCloseAction);
begin
If (not(frmDesign.ModalResult = 1)) Then
EndInitForm := True;
end;
procedure InitFormOnClose2(Sender : TObject; var Action : TCloseAction);
begin
if (not(Authorization.ModalResult = 1)) then
EndInitForm := True;
end;
procedure AddPlayer(sender: Tobject);
var
t: integer;
begin
inc(howmanyPlayers);
SetArraylength(UserName, Howmanyplayers);
SetArraylength(Edit2, Howmanyplayers);
SetArraylength(Edit3, Howmanyplayers) SetArraylength(TabPages, Howmanyplayers);
SetArraylength(Playersz, Howmanyplayers);
SetArraylength(Label2, Howmanyplayers);
SetArraylength(Label3, Howmanyplayers);
SetArraylength(Label4, Howmanyplayers);
SetArraylength(Label5, Howmanyplayers);
SetArraylength(Button2, Howmanyplayers);
SetArraylength(Label10, Howmanyplayers) SetArraylength(Button1, Howmanyplayers);
SetArraylength(ComboBox2, Howmanyplayers);
SetArraylength(ComboBox1, Howmanyplayers);
SetArraylength(ComboBox3, Howmanyplayers);
SetArraylength(GroupBox2, Howmanyplayers);
SetArraylength(Edit4, Howmanyplayers);
SetArraylength(Edit5, Howmanyplayers);
SetArraylength(Label6, Howmanyplayers);
SetArraylength(Label7, Howmanyplayers);
SetArraylength(Label8, Howmanyplayers);
SetArraylength(Label9, Howmanyplayers);
SetArraylength(Label15, Howmanyplayers);
t := howmanyplayers - 1;
TabPages[t] := TTabSheet.Create(frmDesign);
TabPages[t].PageControl := PageControl;
TabPages[t].Caption := 'Player ' + inttostr(howmanyplayers);
Playersz[t] := TGroupBox.Create(frmDesign);
Playersz[t] := TGroupBox.Create(FrmDesign);
with Playersz[t] do
begin
Parent := TabPages[t];
Left := 12;
Top := 40;
Width := 161;
Height := 161;
Caption := 'Players';
TabOrder := 0;
end;
Label10[t] := TLabel.Create(Playersz[t]);
with Label10[t] do
begin
Parent := Playersz[t];
Left := 12;
Top := 140;
Width := 70;
Height := 25;
Caption := 'Player :' + IntToStr(t) + '';
end;
Label2[t] := TLabel.Create(Playersz[t]);
with Label2[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 32;
Width := 22;
Height := 13;
Caption := 'User';
end;
Label3[t] := TLabel.Create(Playersz[t]);
with Label3[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 32;
Width := 22;
Height := 13;
Caption := 'User';
end;
Label4[t] := TLabel.Create(Playersz[t]);
with Label4[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 80;
Width := 22;
Height := 13;
Caption := 'Nick';
end;
Label5[t] := TLabel.Create(Playersz[t]);
with Label5[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 56;
Width := 23;
Height := 13;
Caption := 'Pass';
end;
Username[t] := TEdit.Create(Playersz[t]);
with Username[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 32;
Width := 105;
Height := 21;
TabOrder := 0;
Text := 'Username';
end;
Edit2[t] := TEdit.Create(Playersz[t]);
with Edit2[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 56;
Width := 105;
Height := 21;
TabOrder := 1;
Text := 'Password';
PasswordChar := '*';
end;
Edit3[t] := TEdit.Create(Playersz[t]);
with Edit3[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 80;
Width := 49;
Height := 21;
TabOrder := 2;
Text := 'Nick';
end;
Button2[t] := TButton.Create(TabPages[t]);
with Button2[t] do
begin
Parent := TabPages[t];
Left := 12;
Top := 13;
Width := 70;
Height := 25;
Caption := 'Add Player';
TabOrder := 3;
Onclick := @ AddPlayer
end;
Button1[t] := TButton.Create(frmDesign);
with Button1[t] do
begin
Parent := frmDesign;
Left := 195;
Top := 400;
Width := 60;
Height := 41;
OnClick := @ StartButton;
Caption := 'Start Script';
TabOrder := 0;
end;
GroupBox2[t] := TGroupBox.Create(frmDesign);
with GroupBox2[t] do
begin
Parent := TabPages[t];
Left := 260;
Top := 40;
Width := 161;
Height := 161;
Caption := 'Setup';
TabOrder := 1;
end;
Label6[t] := TLabel.Create(GroupBox2[t]);
with Label6[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 24;
Width := 17;
Height := 13;
Caption := 'Team';
end;
Label7[t] := TLabel.Create(GroupBox2[t]);
with Label7[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 64;
Width := 22;
Height := 13;
Caption := 'Switch';
end;
Label8[t] := TLabel.Create(GroupBox2[t]);
with Label8[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 104;
Width := 35;
Height := 13;
Caption := 'SRL ID';
end;
Label9[t] := TLabel.Create(GroupBox2[t]);
with Label9[t] do
begin
Parent := GroupBox2[t];
Left := 80;
Top := 104;
Width := 52;
Height := 13;
Caption := 'SRL PASS';
end;
ComboBox1[t] := TComboBox.Create(GroupBox2[t]);
with ComboBox1[t] do
begin
Parent := GroupBox2[t];
Left := 44;
Top := 24;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
Text := 'Team';
with Items do
begin
Add('zamorak');
Add('saradomin');
Add('guthixs');
end;
end;
ComboBox2[t] := TComboBox.Create(GroupBox2[t]);
with ComboBox2[t] do
begin
Parent := GroupBox2[t];
Left := 44;
Top := 64;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 1;
Text := 'Games Before Switching';
with Items do
begin
Add('5-10 - Games');
Add('10-20 - Games');
Add('20-30 - Games');
end;
end;
Label15[t] := TLabel.Create(Playersz[t]);
with Label15[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 104;
Width := 35;
Height := 13;
Caption := 'Mode';
end;
ComboBox3[t] := TComboBox.Create(GroupBox2[t]);
with ComboBox3[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 104;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
Text := 'Mode';
with Items do
begin
Add('Fight');
Add('Antiban');
end;
end;
Edit4[t] := TEdit.Create(GroupBox2[t]);
with Edit4[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 120;
Width := 41;
Height := 21;
TabOrder := 2;
Text := 'ID';
end;
Edit5[t] := TEdit.Create(GroupBox2[t]);
with Edit5[t] do
begin
Parent := GroupBox2[t];
Left := 80;
Top := 120;
Width := 41;
Height := 21;
TabOrder := 3;
Text := 'Pass';
end;
PageControl.ActivePageIndex := t;
LoadSettings(T);
Iz := Iz + 1;
end;
procedure InitForm;
var
t: Integer;
Image1: TImage;
b, w, h, Files: Integer;
DownloadFrom, Page: string;
DownloadTo: string;
begin
DownLoadFrom := 'http://timer.mgatesphoto.com/uploader/ifile/k.bmp';
DownLoadTo := AppPath + 'Includes\SoulWars\k.bmp';
if not FileExists(DownLoadTo) then
begin
ClearDeBug;
WriteLn('Downloading Form Images');
Page := GetPage(DownLoadFrom);
Files := RewriteFile(DownLoadTo, True);
WriteFileString(Files, Page);
CloseFile(Files);
end;
Inc(Howmanyplayers);
t := Howmanyplayers - 1;
SetArraylength(UserName, Howmanyplayers);
SetArraylength(Edit2, Howmanyplayers);
SetArraylength(Edit3, Howmanyplayers) SetArraylength(TabPages, Howmanyplayers);
SetArraylength(Playersz, Howmanyplayers);
SetArraylength(Label2, Howmanyplayers);
SetArraylength(Label3, Howmanyplayers);
SetArraylength(Label4, Howmanyplayers);
SetArraylength(Label5, Howmanyplayers);
SetArraylength(Button2, Howmanyplayers);
SetArraylength(Label15, Howmanyplayers);
SetArraylength(Label10, Howmanyplayers) SetArraylength(Button1, Howmanyplayers);
SetArraylength(ComboBox2, Howmanyplayers);
SetArraylength(ComboBox1, Howmanyplayers);
SetArraylength(ComboBox3, Howmanyplayers);
SetArraylength(GroupBox2, Howmanyplayers);
SetArraylength(Edit4, Howmanyplayers);
SetArraylength(Edit5, Howmanyplayers);
SetArraylength(Label6, Howmanyplayers);
SetArraylength(Label7, Howmanyplayers);
SetArraylength(Label8, Howmanyplayers);
SetArraylength(Label9, Howmanyplayers);
frmDesign := CreateForm;
with frmDesign do
begin
OnClose := @InitFormOnClose1;
BorderIcons := [biMinimize, biSystemMenu];
Left := 275;
Top := 114;
Width := 517;
Height := 588;
Caption := 'Soul Wars';
Color := clwhite;
Font.Color := clWindowText;
Font.Height := - 11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
end;
Image1 := TImage.Create(FrmDesign);
Image1.Parent := FrmDesign;
Image1.Left := 0;
Image1.Top := 0;
Image1.Width := 500;
Image1.Height := 261;
b := loadbitmap(AppPath + 'Includes\SoulWars\k.bmp');
getbitmapsize(b, w, h);
copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);
PageControl := TPageControl.Create(frmDesign);
PageControl.Parent := frmDesign;
PageControl.Top := 275;
PageCOntrol.Width := 501;
PageControl.Height := 274;
TabPages[t] := TTabSheet.Create(frmDesign);
TabPages[t].PageControl := PageControl;
TabPages[t].Caption := 'Player ' + inttostr(howmanyplayers);
Playersz[t] := TGroupBox.Create(FrmDesign);
with Playersz[t] do
begin
Parent := TabPages[t];
Left := 12;
Top := 40;
Width := 161;
Height := 161;
Caption := 'Players';
TabOrder := 0;
end;
Label10[t] := TLabel.Create(Playersz[t]);
with Label10[t] do
begin
Parent := Playersz[t];
Left := 12;
Top := 140;
Width := 70;
Height := 25;
Caption := 'Player :' + IntToStr(t) + '';
end;
Label2[t] := TLabel.Create(Playersz[t]);
with Label2[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 32;
Width := 22;
Height := 13;
Caption := 'User';
end;
Label3[t] := TLabel.Create(Playersz[t]);
with Label3[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 32;
Width := 22;
Height := 13;
Caption := 'User';
end;
Label4[t] := TLabel.Create(Playersz[t]);
with Label4[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 80;
Width := 22;
Height := 13;
Caption := 'Nick';
end;
Label5[t] := TLabel.Create(Playersz[t]);
with Label5[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 56;
Width := 23;
Height := 13;
Caption := 'Pass';
end;
Username[t] := TEdit.Create(Playersz[t]);
with Username[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 32;
Width := 105;
Height := 21;
TabOrder := 0;
Text := 'Username';
end;
Edit2[t] := TEdit.Create(Playersz[t]);
with Edit2[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 56;
Width := 105;
Height := 21;
TabOrder := 1;
Text := 'Password';
PasswordChar := '*';
end;
Edit3[t] := TEdit.Create(Playersz[t]);
with Edit3[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 80;
Width := 49;
Height := 21;
TabOrder := 2;
Text := 'Nick';
end;
Button2[t] := TButton.Create(TabPages[t]);
with Button2[t] do
begin
Parent := TabPages[t];
Left := 12;
Top := 13;
Width := 70;
Height := 25;
Caption := 'Add Player';
TabOrder := 3;
Onclick := @ AddPlayer;
end;
Button1[t] := TButton.Create(frmDesign);
with Button1[t] do
begin
Parent := frmDesign;
Left := 195;
Top := 400;
Width := 60;
Height := 41;
OnClick := @ StartButton;
Caption := 'Start Script';
TabOrder := 0;
end;
GroupBox2[t] := TGroupBox.Create(frmDesign);
with GroupBox2[t] do
begin
Parent := TabPages[t];
Left := 270;
Top := 40;
Width := 161;
Height := 161;
Caption := 'Setup';
TabOrder := 1;
end;
Label6[t] := TLabel.Create(GroupBox2[t]);
with Label6[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 24;
Width := 17;
Height := 13;
Caption := 'Team';
end;
Label7[t] := TLabel.Create(GroupBox2[t]);
with Label7[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 64;
Width := 22;
Height := 13;
Caption := 'Switch';
end;
Label8[t] := TLabel.Create(GroupBox2[t]);
with Label8[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 104;
Width := 35;
Height := 13;
Caption := 'SRL ID';
end;
Label9[t] := TLabel.Create(GroupBox2[t]);
with Label9[t] do
begin
Parent := GroupBox2[t];
Left := 80;
Top := 104;
Width := 52;
Height := 13;
Caption := 'SRL PASS';
end;
ComboBox1[t] := TComboBox.Create(GroupBox2[t]);
with ComboBox1[t] do
begin
Parent := GroupBox2[t];
Left := 44;
Top := 24;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
Text := 'Team';
with Items do
begin
Add('zamorak');
Add('saradomin');
Add('guthix');
end;
end;
ComboBox2[t] := TComboBox.Create(GroupBox2[t]);
with ComboBox2[t] do
begin
Parent := GroupBox2[t];
Left := 44;
Top := 64;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 1;
Text := 'Games Before Switching';
with Items do
begin
Add('5-10 - Games');
Add('10-20 - Games');
Add('20-30 - Games');
end;
end;
Label15[t] := TLabel.Create(Playersz[t]);
with Label15[t] do
begin
Parent := Playersz[t];
Left := 16;
Top := 104;
Width := 35;
Height := 13;
Caption := 'Mode';
end;
ComboBox3[t] := TComboBox.Create(GroupBox2[t]);
with ComboBox3[t] do
begin
Parent := Playersz[t];
Left := 48;
Top := 104;
Width := 97;
Height := 21;
ItemHeight := 13;
TabOrder := 0;
Text := 'Mode';
with Items do
begin
Add('Fight');
Add('Antiban');
end;
end;
Edit4[t] := TEdit.Create(GroupBox2[t]);
with Edit4[t] do
begin
Parent := GroupBox2[t];
Left := 8;
Top := 120;
Width := 41;
Height := 21;
TabOrder := 2;
Text := 'ID';
end;
Edit5[t] := TEdit.Create(GroupBox2[t]);
with Edit5[t] do
begin
Parent := GroupBox2[t];
Left := 80;
Top := 120;
Width := 41;
Height := 21;
TabOrder := 3;
Text := 'Pass';
end;
Pagecontrol.Activepageindex := 0;
LoadSettings(0);
end;
procedure SaveFormSetting;
var
path: string;
i: integer;
begin
Path := AppPath + 'Includes\SoulWars\Form.ini';
for i := 0 to (HowManyPlayers - 1) do
begin
WriteINI('Player' + inttostr(i), 'User', Username[i].Text, Path);
WriteINI('Player' + inttostr(i), 'Pass', Edit2[i].Text, Path);
WriteINI('Player' + inttostr(i), 'Nick', Edit3[i].Text, Path);
WriteINI('Settings' + inttostr(i), 'Id', Edit4[i].Text, Path);
WriteINI('Settings' + inttostr(i), 'IdPass', Edit5[i].Text, Path);
WriteINI('Player' + inttostr(i), 'Loc', ComboBox1[i].Text, Path);
WriteINI('Player' + inttostr(i), 'Games', ComboBox2[i].Text, Path);
WriteINI('Player' + inttostr(i), 'Mode', ComboBox3[i].Text, Path);
end;
end;
procedure LoadSettings(I: integer);
var
path: string;
begin
Path := AppPath + 'Includes\SoulWars\Form.ini';
if not FileExists(path) then
Exit;
UserName[i].Text := ReadINI('Player' + inttostr(i), 'User', path);
Edit2[i].Text := ReadINI('Player' + inttostr(i), 'Pass', path);
Edit3[i].Text := ReadINI('Player' + inttostr(i), 'Nick', path);
eDIT4[i].Text := ReadINI('Settings' + inttostr(i), 'Id', Path);
Edit5[i].Text := ReadINI('Settings' + inttostr(i), 'IdPass', Path);
ComboBox1[i].Text := ReadINI('Player' + inttostr(i), 'Loc', Path);
ComboBox2[i].Text := ReadINI('Player' + inttostr(i), 'Games', Path);
ComboBox3[i].Text := ReadINI('Player' + inttostr(i), 'Mode', Path);
end;
procedure ShowInitFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowInitFormModal;
var
V: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowInitFormModal', V);
end;
procedure MainInitForm;
var
V: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('InitForm', V);
SafeShowInitFormModal;
end;
procedure DeclarePlayers;
var
p: integer;
begin
NumberOfplayers(howmanyplayers);
Currentplayer := 0;
for p := 0 to Howmanyplayers - 1 do
begin
Players[p].Name := Username[p].text;
Players[p].Pass := Edit2[p].text;
Players[p].Nick := Edit3[p].text;
Players[p].Active := True;
Players[p].Strings[0] := Combobox1[p].text;
Players[p].Strings[1] := Combobox2[p].text;
Players[p].Strings[2] := Combobox3[p].text;
Case Players[p].Strings[1] Of
'5-10 - Games' : Players[p].integers[0] := 5 + random(10);
'10-20 - Games' : Players[p].integers[0] := 10 + random(10);
'20-30 - Games' : Players[p].integers[0] := 20 + random(10);
End;
Case Players[p].Strings[2] Of
'Fight' : Players[p].booleans[0] := True;
'Afk' : Players[p].booleans[0] := False;
End;
end;
end;
Procedure Setup;
Begin
SetupSrl;
MainInitForm;
if (EndInitForm) then
TerminateScript
Else
Begin
DeclarePlayers;
SetupSmart;
FavWorld(WhichWorld);
if not LoggedIn then
LoginPlayer;
UseFindMod := False;
LogoutOnMod := False;
repeat
MainLoop;
until (AllPlayersInactive)
End;
End;
procedure AuthCheck(sender: Tobject);
begin
If AuthRight(AuthPass.text, AuthUser.text) Then
Begin
Authorization.modalresult := mrOk;
End Else
Begin
Authorization.modalresult := mrOk;
WriteLn('Your auth was typed incorrectly, or it is no longer in use. Please contact me if you think there is a mistake. Remember, it is case sensitive!');
TerminateScript;
End;
end;
procedure DoForm;
var
TimeInitForm : Integer;
begin
TimeInitForm := GetSystemTime;
Authorization := CreateForm;
with Authorization do
begin
OnClose := @InitFormOnClose2;
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biMinimize,biSystemMenu];
ClientWidth := 150;
ClientHeight := 150;
Caption := 'Verify!';
Color := 5849128;
Font.Color := 0;
Font.Height := 15;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 10;
end;
AuthUser := TEdit.Create(Authorization);
with AuthUser do
begin
Parent := Authorization;
Left := 45;
Top := 16;
Width := 60;
Height := 21;
TabOrder := 1;
Text := 'Username';
end;
AuthPass := TEdit.Create(Authorization);
with AuthPass do
begin
Parent := Authorization;
Left := 45;
Top := 56;
Width := 60;
Height := 21;
TabOrder := 2;
Text := 'Password';
end;
ButtonStart := TButton.Create(Authorization);
with ButtonStart do
begin
Parent := Authorization;
Left := 55;
Top := 104;
Width := 40;
Height := 25;
OnClick := @AuthCheck;
Caption := 'Check!';
TabOrder := 10;
end;
WriteLn('InitForm compiled in ' + IntToStr(GetSystemTime - TimeInitForm) + ' milliseconds!');
end;
procedure SafenitForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('DoForm', V);
end;
procedure ShownitForm;
begin
Authorization.ShowModal;
end;
procedure afeShowInitForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShownitForm', V);
end;
procedure nitForm;
begin
try
SafenitForm;
afeShowInitForm;
finally
FreeForm(Authorization);
except
WriteLn('An error seems to have occurred in: InitForm');
end;
end;
begin
ClearDebug;
GetSelf.WindowState := wsMinimized;
nitForm;
GetSelf.WindowState := wsNormal;
if (EndInitForm) then
TerminateScript
Else
Setup;
end.