SRL Archive - SRL Archives

BreakUpdate


bullzeye95

2007-07-16 19:49:54

This breaks the RS update.

{*******************************************************************************
Function IsWorldFree(World: Integer): Boolean;
By: Bullzeye95
Description: Returns true if the specified world is a free world.
*******************************************************************************}

Function IsWorldFree(World: Integer): Boolean;
begin
case World of
1: Result:= True;
2: Result:= False;
3: Result:= True;
4: Result:= True;
5: Result:= True;
6: Result:= False;
7: Result:= True;
8: Result:= True;
9: Result:= False;
10: Result:= True;
11: Result:= True;
12: Result:= False;
13: Result:= True;
14: Result:= True;
15: Result:= True;
16: Result:= True;
17: Result:= True;
18: Result:= False;
19: Result:= True;
20: Result:= True;
21: Result:= True;
22: Result:= False;
23: Result:= False;
24: Result:= False;
25: Result:= True;
26: Result:= False;
27: Result:= False;
28: Result:= False;
29: Result:= True;
30: Result:= True;
31: Result:= False;
32: Result:= True;
33: Result:= True;
34: Result:= True;
35: Result:= True;
36: Result:= False;
37: Result:= True;
38: Result:= True;
39: Result:= False;
40: Result:= True;
41: Result:= True;
42: Result:= False;
43: Result:= True;
44: Result:= False;
45: Result:= False;
46: Result:= False;
47: Result:= True;
48: Result:= False;
49: Result:= True;
50: Result:= True;
51: Result:= True;
52: Result:= True;
53: Result:= False;
54: Result:= False;
55: Result:= True;
56: Result:= False;
57: Result:= True;
58: Result:= False;
59: Result:= False;
60: Result:= False;
61: Result:= True;
62: Result:= True;
63: Result:= True;
64: Result:= False;
65: Result:= False;
66: Result:= False;
67: Result:= True;
68: Result:= True;
69: Result:= False;
70: Result:= False;
71: Result:= False;
72: Result:= True;
73: writeln('World does not exist');
74: Result:= True;
75: Result:= True;
76: Result:= False;
77: Result:= False;
78: Result:= False;
79: Result:= False;
80: Result:= True;
81: Result:= True;
82: Result:= False;
83: Result:= False;
84: Result:= False;
85: Result:= True;
86: Result:= True;
87: Result:= True;
88: Result:= False;
89: writeln('World does not exist');
90: Result:= True;
91: Result:= False;
92: Result:= False;
93: Result:= True;
94: Result:= True;
95: Result:= True;
96: Result:= True;
97: Result:= False;
98: Result:= False;
99: Result:= False;
100: Result:= False;
101: Result:= True;
102: Result:= True;
103: Result:= False;
104: Result:= False;
105: Result:= True;
106: Result:= True;
107: Result:= True;
108: Result:= True;
109: Result:= True;
110: Result:= False;
111: Result:= False;
112: Result:= False;
113: Result:= True;
114: Result:= False;
115: Result:= False;
116: Result:= False;
117: Result:= True;
118: Result:= True;
119: Result:= True;
120: Result:= False;
121: Result:= False;
122: writeln('World does not exist');
123: writeln('World does not exist');
124: Result:= False;
125: Result:= True;
126: Result:= True;
127: Result:= True;
128: Result:= True;
129: Result:= False;
130: Result:= False;
131: Result:= False;
132: Result:= False;
133: Result:= True;
134: Result:= True;
135: Result:= True;
136: Result:= True;
137: Result:= False;
138: Result:= False;
139: writeln('World does not exist');
140: writeln('World does not exist');
141: Result:= True;
142: Result:= True;
143: Result:= False;
144: Result:= False;
end;
end;

{*******************************************************************************
Function IsWorldMembers(World: Integer): Boolean;
By: Bullzeye95
Description: Returns true if the specified world is a members world.
*******************************************************************************}
Function IsWorldMembers(World: Integer): Boolean;
begin
Result:= not(IsWorldFree(World));
end;

{*******************************************************************************
function WelcomeToRS: Boolean;
By: Two lines off Fawki's WelcomeToRuneScape
Description: WelcomeToRuneScape, but it doesn't click the music button.
*******************************************************************************}
function WelcomeToRS: Boolean;
var
Welcome, tx, ty: Integer;
begin
Welcome := CreateBitmapMaskFromText('Welcome', UpChars);
Result := FindBitmapMaskTolerance(Welcome, tx, ty, 250, 200, 530, 260, 10, 10);
FreeBitmap(Welcome);
end;

{*******************************************************************************
procedure BreakUpdate;
By: Bullzeye95
Description: Loads a world of the opposite type of the one you're in, and then
loads a world of the original type.
*******************************************************************************}
procedure BreakUpdate;
begin
if(IsWorldFree(StrToInt(Trim(GetTextAtEx(55, 466, 4, UpChars, False, False, 0, 5, 16777215, 5, False, tr_Digits)))))then
begin
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'up');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'down');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
end else
begin
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'down');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
FindRS;
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'up');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
end;
end;

And here's a login.scar with this implemented:
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Login Routines --//
//-----------------------------------------------------------------//
// * function LoggedIn: Boolean; // * by WT-Fakawi
// * function WelcomeToRuneScape: Boolean; // * by WT-Fakawi
// * procedure Logout; // * by Stupid3ooo, Flyboy
// * procedure LoginPlayer; // * by WT-Fakawi and modified by Ron
// * procedure NextPlayerOrder(Active : Boolean); // * by WT-Fakawi and modified by Ron
// * procedure RandomNextPlayer(Active: Boolean); // * by Dankness based on WT-Fawki's NextPlayer and modified by Ron
// * procedure NextPlayer(Active: Boolean); // * by Dankness and modified by Ron
// * procedure LogOutEvery(hours, forxmins: Integer); // * by Stupid3ooo
// * procedure HighestAngle; // * by Starblaster100

function WelcomeToRunescape: Boolean; forward;
function FindRS: Boolean; forward;
{.include SRL\SRL\Misc\WorldSwitcher.scar}

{ var logs, Attempts: Integer;
Description: Variables needed for some login functions. }
var
SRL_Logs, SRL_Attempts: Integer;

{*******************************************************************************
function LoggedIn: Boolean;
By: WT-Fakawi
Description: Returns True if Logged In.
*******************************************************************************}

function LoggedIn: Boolean;
begin
Result := (GetColor(421, 480) = 16777215);
end;

{*******************************************************************************
function WelcomeToRuneScape: Boolean;
By: WT-Fakawi
Description: Returns True on Welcome Screen.
*******************************************************************************}

function WelcomeToRuneScape: Boolean;
var
Welcome, tx, ty: Integer;
begin
Welcome := CreateBitmapMaskFromText('Welcome', UpChars);
Result := FindBitmapMaskTolerance(Welcome, tx, ty, 250, 200, 530, 260, 10, 10);
FreeBitmap(Welcome);
Wait(100);
Mouse(730, 467, 20, 20, True);
end;

{*******************************************************************************
Function IsWorldFree(World: Integer): Boolean;
By: Bullzeye95
Description: Returns true if the specified world is a free world.
*******************************************************************************}

Function IsWorldFree(World: Integer): Boolean;
begin
case World of
1: Result:= True;
2: Result:= False;
3: Result:= True;
4: Result:= True;
5: Result:= True;
6: Result:= False;
7: Result:= True;
8: Result:= True;
9: Result:= False;
10: Result:= True;
11: Result:= True;
12: Result:= False;
13: Result:= True;
14: Result:= True;
15: Result:= True;
16: Result:= True;
17: Result:= True;
18: Result:= False;
19: Result:= True;
20: Result:= True;
21: Result:= True;
22: Result:= False;
23: Result:= False;
24: Result:= False;
25: Result:= True;
26: Result:= False;
27: Result:= False;
28: Result:= False;
29: Result:= True;
30: Result:= True;
31: Result:= False;
32: Result:= True;
33: Result:= True;
34: Result:= True;
35: Result:= True;
36: Result:= False;
37: Result:= True;
38: Result:= True;
39: Result:= False;
40: Result:= True;
41: Result:= True;
42: Result:= False;
43: Result:= True;
44: Result:= False;
45: Result:= False;
46: Result:= False;
47: Result:= True;
48: Result:= False;
49: Result:= True;
50: Result:= True;
51: Result:= True;
52: Result:= True;
53: Result:= False;
54: Result:= False;
55: Result:= True;
56: Result:= False;
57: Result:= True;
58: Result:= False;
59: Result:= False;
60: Result:= False;
61: Result:= True;
62: Result:= True;
63: Result:= True;
64: Result:= False;
65: Result:= False;
66: Result:= False;
67: Result:= True;
68: Result:= True;
69: Result:= False;
70: Result:= False;
71: Result:= False;
72: Result:= True;
73: writeln('World does not exist');
74: Result:= True;
75: Result:= True;
76: Result:= False;
77: Result:= False;
78: Result:= False;
79: Result:= False;
80: Result:= True;
81: Result:= True;
82: Result:= False;
83: Result:= False;
84: Result:= False;
85: Result:= True;
86: Result:= True;
87: Result:= True;
88: Result:= False;
89: writeln('World does not exist');
90: Result:= True;
91: Result:= False;
92: Result:= False;
93: Result:= True;
94: Result:= True;
95: Result:= True;
96: Result:= True;
97: Result:= False;
98: Result:= False;
99: Result:= False;
100: Result:= False;
101: Result:= True;
102: Result:= True;
103: Result:= False;
104: Result:= False;
105: Result:= True;
106: Result:= True;
107: Result:= True;
108: Result:= True;
109: Result:= True;
110: Result:= False;
111: Result:= False;
112: Result:= False;
113: Result:= True;
114: Result:= False;
115: Result:= False;
116: Result:= False;
117: Result:= True;
118: Result:= True;
119: Result:= True;
120: Result:= False;
121: Result:= False;
122: writeln('World does not exist');
123: writeln('World does not exist');
124: Result:= False;
125: Result:= True;
126: Result:= True;
127: Result:= True;
128: Result:= True;
129: Result:= False;
130: Result:= False;
131: Result:= False;
132: Result:= False;
133: Result:= True;
134: Result:= True;
135: Result:= True;
136: Result:= True;
137: Result:= False;
138: Result:= False;
139: writeln('World does not exist');
140: writeln('World does not exist');
141: Result:= True;
142: Result:= True;
143: Result:= False;
144: Result:= False;
end;
end;

{*******************************************************************************
Function IsWorldMembers(World: Integer): Boolean;
By: Bullzeye95
Description: Returns true if the specified world is a members world.
*******************************************************************************}
Function IsWorldMembers(World: Integer): Boolean;
begin
Result:= not(IsWorldFree(World));
end;

{*******************************************************************************
function WelcomeToRS: Boolean;
By: Two lines off Fawki's WelcomeToRuneScape
Description: WelcomeToRuneScape, but it doesn't click the music button.
*******************************************************************************}
function WelcomeToRS: Boolean;
var
Welcome, tx, ty: Integer;
begin
Welcome := CreateBitmapMaskFromText('Welcome', UpChars);
Result := FindBitmapMaskTolerance(Welcome, tx, ty, 250, 200, 530, 260, 10, 10);
FreeBitmap(Welcome);
end;

{*******************************************************************************
procedure BreakUpdate;
By: Bullzeye95
Description: Loads a world of the opposite type of the one you're in, and then
loads a world of the original type.
*******************************************************************************}
procedure BreakUpdate;
begin
if(IsWorldFree(StrToInt(Trim(GetTextAtEx(55, 466, 4, UpChars, False, False, 0, 5, 16777215, 5, False, tr_Digits)))))then
begin
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'up');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'down');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
end else
begin
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'down');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
FindRS;
ClickWorldSwitchButton;
OrderBy('players', 'down');
OrderBy('type', 'up');
Mouse(115, 44, 15, 5, True);
wait(5000);
FindRS;
repeat
wait(1000);
FindRS;
until(WelcomeToRS)
end;
end;

{*******************************************************************************
procedure Logout;
By: Stupid3ooo, Flyboy
Description: Logs you out.
*******************************************************************************}

procedure Logout;
var
x, y, bmpLogOut, FailSafe: Integer;
begin
bmpLogOut := BitmapFromString(26, 2, 'z78DA8D4F5B0A80300CBB52D321' +
'759F7335F73F92D0FA519982F90825E4416914278325B03710CE4' +
'54FD88689D19B3615FECEA67EF350E0CC1E9B701CABBFEA8FF50F' +
'7F6D4EAE9E956B674DD5EFF27ED90AE705B1A445B8');
try
MarkTime(FailSafe);
if (LogTimeOut) then
begin
Wait(90000);
end
else
if (LoggedIn) then
begin
if GetCurrentTab <> 10 then GameTab(10);

wait(2000);
while ((TimeFromMark(FailSafe) < 90000) and LoggedIn) do
begin
if FindBitmapIn(bmpLogOut, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 20, 10, True);
wait(10000);
end;
end;
finally
FreeBitmap(bmpLogOut);
end; //end try/finally
end;

procedure NextPlayer(Active: Boolean); forward;
function FindNormalRandoms: Boolean; forward;

{*******************************************************************************
procedure LoginPlayer;
By: WT-Fakawi and modified by Ron
Description: Logs Player[CurrentPlayer] in. Is usually preceeded by NextPlayer.
*******************************************************************************}
// * Still to implement, but have never encountered any of these:

// * Login limit exceeded.
// * Too many connections from your address."
// * Bad session id.
// * Could not complete login.
// * Please try using a different world.
// * Invalid login server requested
// * Malformed login packet.
// * Unexpected server response

procedure LoginPlayer;
var
ClickHereToPlay, tx, ty, CHx, CHy, c, tmpMask, LastPlayer: Integer;
begin
ClickHereToPlay := BitmapFromString(33, 1, 'z78DA758E510E80300843' +
'AF54C0E2F6E94CB8FF9134123392693FFA41FA4A23A6F0888443D' +
'26DC000A7DCE7F458F23EE444E721444B6A0F53D58FE44F4365B7' +
'067D37AC3D95AADF2F50962C79');
if (not (LoggedIn)) then
begin
// Beginning player not active...
if (not (Players[CurrentPlayer].Active)) then
begin
WriteLn('Current player is not Active...');
LastPlayer := CurrentPlayer;
repeat
CurrentPlayer := Random(HowManyPlayers);
Wait(100);
until (Players[CurrentPlayer].Active);
LoginPlayer;
FreeBitmap(ClickHereToPlay);
Exit;
end;
x := 150;
y := 173;
if (FindClient) then
FindWindowBySize(766, 504);
Wait(1000);
ClickOption('Cancel', 1);
ClickOption('Exist', 1);
tmpMask := CreateBitmapMaskFromText('Username', upchars);
if (FindBitmapMaskTolerance(tmpMask, x, y, 0, 0, 520, 340, 10, 50)) then
begin
Wait(25 + Random(50));
Mouse(x + 24, y + 3, 3, 0, True);
Wait(25 + Random(50));
//SendKeysSilent(Players[CurrentPlayer].Name + chr(13) + Players[CurrentPlayer].Pass)
WriteLn(Players[CurrentPlayer].Name);
TypeSend(Players[CurrentPlayer].Name);
Wait(100 + Random(100));
Mouse(327, 272, 0, 0, True);
TypeSend(Players[CurrentPlayer].Pass);
Wait(100 + Random(100));
end;
ClickOption('Login', 1);
// Waiting for Connecting to Server...
MarkTime(Mark);
while FindText(tx, ty, '...', upchars, 240, 180, 530, 240) do
begin
Wait(100);
if TimeFromMark(Mark) > 20000 then Break;
end;
MarkTime(Mark);
repeat
Wait(1000);
// Enter your username and password. If all failed...
if FindText(tx, ty, 'nter you', upchars, 240, 180, 530, 240) then
begin
WriteLn('Enter your username and Password');
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Your account is already logged in.
if FindText(tx, ty, 'lready', upchars, 240, 180, 530, 240) then
begin
WriteLn('Your account is already logged in');
LastPlayer := CurrentPlayer;
repeat
CurrentPlayer := Random(HowManyPlayers);
Wait(100);
until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Invalid Username. 3 attempts. If fails, you haven't set your username/pass correct
if FindText(tx, ty, 'nvalid', upchars, 240, 180, 530, 240) then
begin
WriteLn('Invalid Username.');
SRL_Attempts := SRL_Attempts + 1;
if SRL_Attempts > 3 then
begin
Players[CurrentPlayer].loc := 'L/P ERROR';
NextPlayer(False);
end;
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Login attempts exceeded. Please wait 1 minute and try again.
if FindText(tx, ty, 'excee', upchars, 240, 180, 530, 240) then
begin
WriteLn('Login attempts exceeded. Please wait 1 minute and try again.');
Wait(60000);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// World is full.
if FindText(tx, ty, 'full', upchars, 240, 180, 530, 240) then
begin
WriteLn('World is full.');
Wait(3000);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Unable to connect. Login Server offline.
if FindText(tx, ty, 'offl', upchars, 240, 180, 530, 240) then
begin
WriteLn('Unable to connect Login Server offline.');
Wait((6000) + Random(6000));
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Error Connecting.
if FindText(tx, ty, 'rror', upchars, 240, 180, 530, 240) then
begin
WriteLn('Error Connecting.');
Wait(10000);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Error loading your profile. Will attempt to re-login 5 more times.)
if FindText(tx, ty, 'ontact', upchars, 240, 180, 530, 240) then
begin
WriteLn('Error loading your profile.');
Wait(2000);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Login server rejected session.
if FindText(tx, ty, 'reject', upchars, 240, 180, 530, 240) then
begin
WriteLn('Login server rejected session.');
Wait(1000);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Runescape has been updated.
if FindText(tx, ty, 'reload', upchars, 240, 180, 530, 240) then
begin
WriteLn('ERROR. RuneScape has been updated. Script Terminated.');
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
BreakUpdate;
LoginPlayer;
end;
// The Server is being updated. Please wait 1 minute.
if FindText(tx, ty, 'updat', upchars, 240, 180, 530, 240) then
begin
WriteLn('The Server is being updated.');
Wait(60000);
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Your account has been disabled.
if FindText(tx, ty, 'disabled', upchars, 420, 180, 500, 220) then
begin
WriteLn('Your account has been disabled');
Players[CurrentPlayer].loc := 'DISABLED';
NextPlayer(False);
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end else
// Waiting for Profile to be Transferred
if FindText(tx, ty, 'trans', upchars, 240, 180, 530, 240) then
begin
WriteLn('Waiting for your Profile to be Transferred');
Wait(2500);
end else
// You need a Members account...
if FindText(tx, ty, 'member', upchars, 240, 180, 530, 240) then
begin
WriteLn('You need a Members account...');
Players[CurrentPlayer].loc := 'Non-Member';
NextPlayer(False);
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
end else
// Welcome to RuneScape. If all failed...
if FindText(tx, ty, 'elcom', upchars, 240, 180, 530, 240) then
begin
WriteLn('Welcome.');
LoginPlayer;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
Exit;
end;

if TimeFromMark(Mark) > 180000 then
begin
WriteLn('three minutes have passed');
WriteFileString(TheFile, Chr(13) + 'THREE MINUTES HAVE PASSED!!!' +
Chr(13));
if (FindClient) then
FindWindowBySize(766, 504);
ClickOption('Cancel', 1);
ClickOption('Exist', 1);
end;
until (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390,
5)) or FindColor(CHx, CHy, 723587, 555, 10, 575, 30);
Wait(1000 + Random(500));
if (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390, 5)) then
Mouse(CHx, CHy, 50, 20, True) else Writeln('Found Compass'); // Clicks randomly on the button
repeat
Wait(1000);
c := c + 1;
until (LoggedIn) or (c >= 600);
end;
FreeBitmap(tmpMask);
FreeBitmap(ClickHereToPlay);
if LoggedIn then
begin
PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
if NickNameBMP <> 0 then
FreeBitmap(NickNameBMP);
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick,
upchars); // Screenname
WriteFileString(TheFile, Chr(13) + UpperCase(Players[CurrentPlayer].Name) +
Chr(13)); //* Save NAME to file
end;
end;

{*******************************************************************************
procedure NextPlayerOrder(Active : Boolean);
By: WT-Fakawi and modified by Ron
Description: Logs in CurrentPlayer. If Player[CurrentPlayer].Active = False,
then next Player attempts to login.
*******************************************************************************}

procedure NextPlayerOrder(Active: Boolean);
begin
WriteLn('NextPlayer');
if not Active then
Players[CurrentPlayer].Active := False;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
CurrentPlayer := CurrentPlayer + 1;
if CurrentPlayer > HowManyPlayers - 1 then
CurrentPlayer := 0;
while Players[CurrentPlayer].Active = False do
begin
CurrentPlayer := CurrentPlayer + 1;
if CurrentPlayer > HowManyPlayers - 1 then
begin
CurrentPlayer := 0;
Wait(10000); // Everybody False. Endless Loop.
end;
end;
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;

{*******************************************************************************
procedure RandomNextPlayer(Active: Boolean);
By: Dankness based on WT-Fawki's NextPlayer and modified by Ron
Description: Picks Random Player that is Active and Logs in
*******************************************************************************}

procedure RandomNextPlayer(Active: Boolean);
var
LastPlayer: Integer;
begin
WriteLn('NextPlayer');
LastPlayer := CurrentPlayer;
if not Active then
Players[CurrentPlayer].Active := False;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
repeat
CurrentPlayer := Random(HowManyPlayers);
Wait(100);
until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;

{*******************************************************************************
procedure NextPlayer(Active: Boolean);
By: Dankness and modified by Ron
Description: Logs in the next player.
Boolean: True - Current player is ok. False - Current player is false.
*******************************************************************************}

procedure NextPlayer(Active: Boolean);
begin
if RandomPlayer then
RandomNextPlayer(Active)
else
begin
WriteLn('NextPlayer');
if not Active then
Players[CurrentPlayer].Active := False;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
CurrentPlayer := CurrentPlayer + 1;
if CurrentPlayer > HowManyPlayers - 1 then
CurrentPlayer := 0;
while Players[CurrentPlayer].Active = False do
begin
CurrentPlayer := CurrentPlayer + 1;
if CurrentPlayer > HowManyPlayers - 1 then
begin
CurrentPlayer := 0;
Wait(10000); // Everybody False. Endless Loop.
end;
end;
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;
end;

{*******************************************************************************
procedure LogOutEvery(hours, forxmins: Integer);
By: Stupid3ooo
Description: Logs you out every hours for forxmins
*******************************************************************************}

procedure LogOutEvery(hours, forxmins: Integer);
var
Mark: Integer;
begin
if ((TimeFromMark(LogOutMark) / 1000) / 3600 >= hours) then
begin
MarkTime(LogOutMark);
MMouse(Random(500), -10, 0, 0)
Logout;
WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +
' min(s)');
MarkTime(Mark);
repeat
MMouse(0, 0, 100, 100)
Wait(90000 + Random(1000));
Wait(15 + Random(15) + Random(15))
until (TimeFromMark(Mark) >= forxmins);
Wait(Random(30000) + Random(30000));
LoginPlayer;
Wait(Random(15000) + Random(15000));
end;
end;

{*******************************************************************************
procedure HighestAngle;
By: Starblaster100
Description: Makes the Screen at the higest angle it can be - For use after logging in.
*******************************************************************************}

procedure HighestAngle;
begin
if (LoggedIn) then
begin
KeyDown(38);
Sleep(1000 + Random(100) + Random(200));
KeyUp(38);
Wait(1000 + Random(100));
end;
end;

{*******************************************************************************
procedure CheckUserNicks;
By: Sumilion
Description: Checks if all nicks are set correct.
*******************************************************************************}

procedure CheckUserNicks;
var
CorrectString: string;
i: Integer;
begin
for i := 0 to HowManyPlayers - 1 do
begin
if (Players[i].Nick = '') then
begin
Writeln('--');
Writeln('WARNING : Please fill in your nickname.');
if (Length(Players[i].Name) > 0) then
Writeln('Warning occured with player : ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
Exit;
end;
if (Players[i].Nick <> LowerCase(Players[i].Nick)) then
begin
Writeln('--');
Writeln('WARNING : Please Uncapitalise your nickname.');
if (Length(Players[i].Name) > 0) then
Writeln('Warning occured with player : ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
Exit;
end;
if (pos(Players[i].Nick, LowerCase(Players[i].Name)) = 1) then
begin
Writeln('--');
Writeln('WARNING : Dont use the first letter in your nick.');
if (Length(Players[i].Name) > 0) then
Writeln('Warning occured with player : ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
Exit;
end;
if (pos(' ', Players[i].Nick) > 0) then
begin
Writeln('--');
Writeln('WARNING : Dont use spaces in your Nick.');
if (Length(Players[i].Name) > 0) then
Writeln('Warning occured with player : ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
Exit;
end;
CorrectString := Capitalize(Players[i].Name);
if not (Pos(LowerCase(Players[i].Nick), CorrectString) > 0) then
begin
Writeln('--');
Writeln('WARNING : Nick does NOT match the name.');
if (Length(Players[i].Name) > 0) then
Writeln('Nick : ' + Players[i].Nick + ', does NOT match ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
Exit;
end;
end;
end;

shaunthasheep

2007-07-17 00:39:19

Nice :) I like it, but since I'm a noob, I'm going to say:
Arrays pl0x! e.g. freeworlds = [num, num, num]; (then checks to see if world is in array)

bullzeye95

2007-07-17 01:40:49

Yeh I was gonna do that, but I had already made them a couple months ago without arrays. I'm lazy :p

nielsie95

2007-07-17 03:04:43

Here, I made this for my smelter, could be usefull :)


procedure SetupWorlds;
var
i, c: Integer;
begin
if F2P then WorldsArray :=
[1, 3, 4, 5, 7, 8, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 25, 29, 30, 32, 33,
34, 35, 37, 38, 40, 41, 43, 47, 50, 51, 52, 55, 57, 61, 62, 63, 67, 68, 72,
74, 75, 80, 81, 85, 86, 87, 90, 93, 94, 95, 96, 101, 102, 105, 106, 107, 108,
109, 113, 117, 118, 119, 125, 126, 127, 128, 133, 134, 135, 136, 141, 142]
else
begin
SetLength(WorldsArray, 138);
for i := 0 to 143 do
if (i <> 49) and (i <> 60) and (i <> 73) and
(i <> 122) and (i <> 123) and (i <> 139) and (i <> 140) then
begin
WorldsArray[c] := i + 1;
Inc(c);
end;
end;
end;

n3ss3s

2007-07-17 05:40:37

And here's a login.scar with this implemented:

Feeling confident , eh? :D
But, to ruin all your work and effort, you can use
like 1,2,3,4,5 : Result := True;
:)

bullzeye95

2007-07-18 13:49:09

I changed mine and thought "hey why not post it?".
I know that, but I just made a simple script to make that. When I pressed f9 it would make that world false, and f10 would make it true.

And you can also use or instead of commas :)

(and you can use "and"… I don't see how though)