SRL Archive - Archive

Sandstorm - SRL Member Application


Sandstorm

2010-12-03 20:16:36

How Long have You Played Runescape?
4 Year(s)


Are you affilated in anyway with Jagex LTD?
No.

Were you Referred to SRL?



What is your general programming knowledge?
Just SCAR, basically. I know a bit of VB.Net.


Are you a member of any other communities?
No other Runescape/botting communities (I wouldn't call powerbots a community).


Tell us about yourself…
From: Sandstorm
I'm not sure what to put here xP. I enjoy learning about things, particularly about scripting, and while I don't really enjoy Runescape as much as I used to, I do still bot/auto/whatever you want to call it, and do enjoy reading the scripts that I use. When they're made in Simba. I can't understand the Java ones, after a point :(.

But anyway, I enjoy reading, playing computer games, and helping people, if they're willing to learn. I haven't been as active around here lately, but I do want to change that, and I hope that I can prove I know what I'm doing and I'm not the same person I was.

Final note: In the script section, I included the 'same' script twice. The first instance of it is a complete copy, with all lines of the script there. The second one is the same script with the parts NiCbaZ wrote (the main form) removed. I separated them with a bunch of spaces.



Please show us one (or multiple) of your scripts.
{.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.2
# 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;
WhichWorld = 2;
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(1899, 3162)) or TileOnMM(Point(1880, 3162));
end;

procedure ToPortal(Portal: Integer);
begin
if not OutOfGame then
Exit;
case Portal of
1:
begin
if not TileOnMM(Point(1899, 3162)) then
WalkToTile(Point(1890, 3164), 2, 1);
WalkToTile(Point(1899, 3162), 2, 1);
end;
2:
begin
if not TileOnMM(Point(1880, 3162)) then
WalkToTile(Point(1890, 3164), 2, 1);
WalkToTile(Point(1880, 3162), 2, 1);
end;
3: WalkToTile(Point(1891, 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(1900, 3162), 0) then
ToPortal(1);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1900, 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(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(1891, 3163), 0) then
ToPortal(3);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1891, 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(1815, 3225), Point(1807, 3232), Point(1811, 3244), Point(1820, 3246), Point(1829, 3244), Point(1836, 3247), Point(1844, 3247)];
Paths[2] := [Point(1842, 3230), Point(1842, 3238), Point(1844, 3247)];
Paths[3] := [Point(1934, 3231), Point(1929, 3222), Point(1928, 3212)];
Paths[4] :=[Point(1968, 3233), Point(1966, 3223), Point(1961, 3213), Point(1950, 3217), Point(1939, 3220), Point(1929, 3216), Point(1927, 3213)];
Result := WalkToPath(Paths[WhereTo]);
end;

Function InGraveYard(WhichOne : Integer) : Boolean;
Begin
Case WhichOne Of
1 : Result := PointInBox(GetMyPos, IntToBox(1841, 3217, 1843, 3219));
4 : Result := PointInBox(GetMyPos, IntToBox(1932, 3244, 1934, 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(1842.5, 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(1933.5, 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(1959, 3239), 1) then
begin
if WalkToTile(Point(1958, 3239), 0, 0) then
begin
Wait(1500);
P := TileToMS(Point(1959, 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(1959, 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(1816, 3224), 1) then
begin
if WalkToTile(Point(1816, 3224), 0, 0) then
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
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(1815, 3230), 1, 0);
'zamorak': WalkToTile(Point(1959, 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';
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 := 'Team';
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('Afk');
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';
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 := 'Team';
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('Afk');
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.






































{.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.2
# 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;
WhichWorld = 2;
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(1899, 3162)) or TileOnMM(Point(1880, 3162));
end;

procedure ToPortal(Portal: Integer);
begin
if not OutOfGame then
Exit;
case Portal of
1:
begin
if not TileOnMM(Point(1899, 3162)) then
WalkToTile(Point(1890, 3164), 2, 1);
WalkToTile(Point(1899, 3162), 2, 1);
end;
2:
begin
if not TileOnMM(Point(1880, 3162)) then
WalkToTile(Point(1890, 3164), 2, 1);
WalkToTile(Point(1880, 3162), 2, 1);
end;
3: WalkToTile(Point(1891, 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(1900, 3162), 0) then
ToPortal(1);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1900, 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(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(1891, 3163), 0) then
ToPortal(3);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1891, 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(1815, 3225), Point(1807, 3232), Point(1811, 3244), Point(1820, 3246), Point(1829, 3244), Point(1836, 3247), Point(1844, 3247)];
Paths[2] := [Point(1842, 3230), Point(1842, 3238), Point(1844, 3247)];
Paths[3] := [Point(1934, 3231), Point(1929, 3222), Point(1928, 3212)];
Paths[4] :=[Point(1968, 3233), Point(1966, 3223), Point(1961, 3213), Point(1950, 3217), Point(1939, 3220), Point(1929, 3216), Point(1927, 3213)];
Result := WalkToPath(Paths[WhereTo]);
end;

Function InGraveYard(WhichOne : Integer) : Boolean;
Begin
Case WhichOne Of
1 : Result := PointInBox(GetMyPos, IntToBox(1841, 3217, 1843, 3219));
4 : Result := PointInBox(GetMyPos, IntToBox(1932, 3244, 1934, 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(1842.5, 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(1933.5, 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(1959, 3239), 1) then
begin
if WalkToTile(Point(1958, 3239), 0, 0) then
begin
Wait(1500);
P := TileToMS(Point(1959, 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(1959, 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(1816, 3224), 1) then
begin
if WalkToTile(Point(1816, 3224), 0, 0) then
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
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(1815, 3230), 1, 0);
'zamorak': WalkToTile(Point(1959, 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 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.

Bad Boy JH

2010-12-03 20:22:32

I personally don't like collaberation scripts for Membership applications, if you can can you mark what procedures you made, what the other Person / people made, that would be a help. some looks really good, some needs alot of improving.

BraK

2010-12-03 20:27:33

From: Bad Boy JH
I personally don't like collaberation scripts for Membership applications, if you can can you mark what procedures you made, what the other Person / people made, that would be a help. some looks really good, some needs alot of improving.



He did it's a little more than halfway down, but not sepperated very well. I'll look through it more when I wake up. I'm Beat.

~BraK

Sandstorm

2010-12-03 20:28:23

Yeah, sorry. I didn't know how to separate it properly, and you can't add two different script quotes anymore.

Thinking about it, I should probably have fixed a lot of the errors before posting. Stupid me. I realize there are many coding efficiency errors in there, I just didn't fix them for some reason >.>.

Gu3st...

2010-12-03 20:31:32

Did Nicbaz make 70% of your script?

Sandstorm

2010-12-03 20:33:54

From: Zyt3x
Did Nicbaz make 70% of your script?


Uh, no? NiCbaZ created the player form for my script, which is about 700 lines. The total script is about 1.1k lines after I removed the form (woops, forgot that part o.o;).

Here's the part I myself wrote, errors and all.

{.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.2
# 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;
WhichWorld = 2;
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(1899, 3162)) or TileOnMM(Point(1880, 3162));
end;

procedure ToPortal(Portal: Integer);
begin
if not OutOfGame then
Exit;
case Portal of
1:
begin
if not TileOnMM(Point(1899, 3162)) then
WalkToTile(Point(1890, 3164), 2, 1);
WalkToTile(Point(1899, 3162), 2, 1);
end;
2:
begin
if not TileOnMM(Point(1880, 3162)) then
WalkToTile(Point(1890, 3164), 2, 1);
WalkToTile(Point(1880, 3162), 2, 1);
end;
3: WalkToTile(Point(1891, 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(1900, 3162), 0) then
ToPortal(1);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1900, 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(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(1891, 3163), 0) then
ToPortal(3);
C := GetMe;
if C.Speed = 0 then
begin
P := TileToMSEx(Tile(1891, 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(1815, 3225), Point(1807, 3232), Point(1811, 3244), Point(1820, 3246), Point(1829, 3244), Point(1836, 3247), Point(1844, 3247)];
Paths[2] := [Point(1842, 3230), Point(1842, 3238), Point(1844, 3247)];
Paths[3] := [Point(1934, 3231), Point(1929, 3222), Point(1928, 3212)];
Paths[4] :=[Point(1968, 3233), Point(1966, 3223), Point(1961, 3213), Point(1950, 3217), Point(1939, 3220), Point(1929, 3216), Point(1927, 3213)];
Result := WalkToPath(Paths[WhereTo]);
end;

Function InGraveYard(WhichOne : Integer) : Boolean;
Begin
Case WhichOne Of
1 : Result := PointInBox(GetMyPos, IntToBox(1841, 3217, 1843, 3219));
4 : Result := PointInBox(GetMyPos, IntToBox(1932, 3244, 1934, 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(1842.5, 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(1933.5, 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(1959, 3239), 1) then
begin
if WalkToTile(Point(1958, 3239), 0, 0) then
begin
Wait(1500);
P := TileToMS(Point(1959, 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(1959, 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(1816, 3224), 1) then
begin
if WalkToTile(Point(1816, 3224), 0, 0) then
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
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(1815, 3230), 1, 0);
'zamorak': WalkToTile(Point(1959, 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 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.

Gu3st...

2010-12-03 20:36:10

Ah, I see

I voted yes by the way.
I was 70% on the yes side the moment I opened this thread (because of your good attitude and personality), and looking at your script made me certain that I want you in :)

Cstrike

2010-12-03 20:39:54

Yes, nice to see color and reflection used together.

pyroryan

2010-12-03 20:54:13

Yes based on attitude and personality.
Btw, what was the auth system for?

Sandstorm

2010-12-03 20:56:08

From: pyroryan
Yes based on attitude and personality.
Btw, what was the auth system for?


I was originally selling the script on Sythe, but then released it for free later, when it bombed xD.

I feel like a stalker, replying in 2 minutes o.o.

pyroryan

2010-12-03 20:57:33

From: Sandstorm
I was originally selling the script on Sythe, but then released it for free later, when it bombed xD.

I feel like a stalker, replying in 2 minutes o.o.


Ah, I see. Just seemed odd having that there thats why I asked :).

Bad Boy JH

2010-12-03 23:16:59

well, I don't know about voting yes then. Its a good script, and your attitude is good, however SRL prides itself on having free scripts only, probably will vote yes. by the sounds it won't matter much

Harry

2010-12-03 23:39:14

You had some problems in the past (2+ years ago), but that hatchet is already buried. Your script looks good and I see no problems with your attitude anymore. Yes from me. Hope you get it.

mormonman

2010-12-04 00:00:31

From: Harry
You had some problems in the past (2+ years ago), but that hatchet is already buried. Your script looks good and I see no problems with your attitude anymore. Yes from me. Hope you get it.


Agreed. I look forward to hopefully seeing you in members. Yes.

lordsaturn

2010-12-04 00:27:14

From: WT-Fakawi
I am sorry Sandstorm, but you will have to accept the fact you will be capped at Junior Members. Rules are rules, you where permanently banned so technically speaking you shouldnt be here in the first place.

Now, I am not saying you are not a nice guy nor that you haven't learned from your mistakes, but Junior is all you will ever be.


You might have to consult WT-Fakawi on this one.

Sandstorm

2010-12-04 00:39:46

From: lordsaturn
You might have to consult WT-Fakawi on this one.


I was sent a private message by one of the administrators saying that I could apply for SRL Members again. I believe he was an administrator when he sent me the PM, anyway.

lordsaturn

2010-12-04 00:40:39

From: Sandstorm
I was sent a private message by one of the administrators saying that I could apply for SRL Members again.


Okay then, diregard that :).

Gu3st...

2010-12-04 05:49:39

From: Sandstorm
I was sent a private message by one of the administrators saying that I could apply for SRL Members again. I believe he was an administrator when he sent me the PM, anyway.
I'm glad to hear that :)

EDIT: Who voted no? no-one posted about that….

Sir R. M8gic1an

2010-12-04 09:27:52

Yes.

~RM

NCDS

2010-12-04 09:34:34

I do like what I have seen the past months.

I vote yes.

Awkwardsaw

2010-12-04 09:42:33

i dont care about the script. yes :)

Shuttleu

2010-12-04 10:19:22

is there really any need to carry this on? :p

just to make this non-spam
i voted yes based on your attitude ;)

~shut

Bad Boy JH

2010-12-05 02:52:29

why is he now banned?

pyroryan

2010-12-05 02:54:17

From: Bad Boy JH
why is he now banned?


http://villavu.com/forum/showthread.php?p=755258
Suppose he got hacked or something.

YoHoJo

2010-12-05 03:13:05

From: Bad Boy JH
why is he now banned?


He got hacked by someone.
Account was banned to stop the hacker form abusing it and posting malicious links.

Dervish

2010-12-05 04:51:24

Definitely voting yes Sandstorm. Good luck.

Macrosoft

2010-12-14 22:46:53

i voted yes

i dont get this new reflection stuff at all but the color part looked good and i feel like being nice

3Garrett3

2010-12-15 14:13:54

Whenever he is unhacked, I've voted yes because I like him :P

Harry

2010-12-15 21:06:55

I personally would change my vote if I could. He was pretty arrogant on IRC a day after the incident. Many of us tried to help him get a clean system (he insists that just a virus scan would be safe and the rootkit would be gone), and I beg to differ. We offered him ways to get a clean new copy of Windows, (but that he should - until he can get a new Windows install working - to go and use Ubuntu for a bit so he could be unbanned and stop spreading viruses). He seemed to have no intentions of getting a new clean copy of Windows, and that will cause the same hack to happen again, and have these forums spammed AGAIN.

Do not get me wrong, he does seem like he has good intentions, but unless he:
1) does a complete reinstall of his OS,
2) THEN changes all his passwords,
he should NOT have members until those are done in that order. We all tried to explain this to him and he seemed to not care. I personally would want a clean system to stop with all the nonsense (hasn't he been hacked what, 2 times now?). Whatever.

If he has a guaranteed clean reinstall, then I would vote yes.