SRL Archive - Discussions and Debates

03-Mar-2010 Update and SRL...


WT-Fakawi

2010-03-03 15:47:46

The official thread for all the changes in runescape and the implications/solutions for SRL.

Quick observations:

  • Login (duh)
  • Hitpoints (duh)

Main

2010-03-03 15:51:05

Should be easy to fix.
I REALLY DON'T see a point of this update unless its trying to delay macroing by changing 2 fonts.

Dynamite

2010-03-03 15:54:18

[Edit:YoHoJo:You Had Your IP In the Picture St00peed!]

There ya go.
I will try and change some stuff, I will try to aim for fixing the 1st pic

NCDS

2010-03-03 15:55:27

Question about the Lobby…

Would it be useful to have a InLobby function? Then mutliple functions to go along with it for ClickToPlay, and then the other tabs?

Also, SetGraphics is going to need an update.

noidea

2010-03-03 15:59:15

omg.. I seem to hate each and every update more and more.

Dynamite

2010-03-03 16:08:23

Function InLobby : boolean;
Var
LobbyWait : integer;
Begin
TimeMark(LobbyWait);
Repeat
Wait(100);
if (LobbyWait > 60000) then
Writeln('Waited 60 seconds');
Until(GetColor(565, 638) = 9291999);
Begin
Writeln('We are in lobby');
Result := True;
end;
end;

RAM

2010-03-03 16:10:10

From: WT-Fakawi
The official thread for all the changes in runescape and the implications/solutions for SRL.

Quick observations:

  • Login (duh)
  • Hitpoints (duh)


I realize this is in SRL members section..just wanted to point out, there is 2 other discussions already,

RuneScape Lobby/Login Changes

march 3rd big hitpoint changes


but probably best to keep solutions in here ….

NCDS

2010-03-03 16:10:39

From: The Man
Function InLobby : boolean;
Var
LobbyWait : integer;
Begin
TimeMark(LobbyWait);
Repeat
Wait(100);
if (LobbyWait > 60000) then
Writeln('Waited 60 seconds'); // you would need to Break here as well.
Until(GetColor(565, 638) = 9291999);
Begin
Writeln('We are in lobby');
Result := True;
end;
end;


That has an endless loop.

Bionicle

2010-03-03 16:12:30

From: The Man
Function InLobby : boolean;
Var
LobbyWait : integer;
Begin
TimeMark(LobbyWait);
Repeat
Wait(100);
if (LobbyWait > 60000) then
Writeln('Waited 60 seconds');
Until(GetColor(565, 638) = 9291999);
Begin
Writeln('We are in lobby');
Result := True;
end;
end;


function InLobby: boolean;
begin
if (GetColor(565, 638) = 9291999) then
Result := true;
end;
Why not that? LoggedIn doesn't have a wait, neither do other functions with the same kind of function (e.g. InvFull, BankOpen etc.) just takes up too much room imo

Markus

2010-03-03 16:15:37

setgraphics/setaudio are done and comitted. Doesn't work with Simba yet due to some wtf bug, but works with 3.23prerelease?

Blumblebee

2010-03-03 16:18:26

From: bionicle1800
function InLobby: boolean;
begin
if (GetColor(565, 638) = 9291999) then
Result := true;
end;
Why not that? LoggedIn doesn't have a wait, neither do other functions with the same kind of function (e.g. InvFull, BankOpen etc.) just takes up too much room imo


function InLobby: boolean;
begin
result := (GetColor(565, 638) = 9291999);
end;

fixed ;)

I would assume loginplayer() would require a complete rewrite. I'll try some stuff and maybe post it up if it works :p

Bionicle

2010-03-03 16:19:15

From: Blumblebee
function InLobby: boolean;
begin
result := (GetColor(565, 638) = 9291999);
end;

fixed ;)


:duh:

WT-Fakawi

2010-03-03 16:32:23

From: RAM
I realize this is in SRL members section..just wanted to point out, there is 2 other discussions already,

RuneScape Lobby/Login Changes

march 3rd big hitpoint changes


but probably best to keep solutions in here ….


Yes. And this thread is code related too.

Bionicle

2010-03-03 16:50:42

{*******************************************************************************
function LobbyTab(Tab: Integer): Boolean;
By: Bionicle1800
Description: Goes to the lobby tab specified by the integer 'Tab'.
Valid arguments are 1 through 5.
*******************************************************************************}
function LobbyTab(Tab: Integer): Boolean;
begin
if (Tab > 5) or (Tab < 1) then
begin
Srl_Warn('LobbyTab', 'Tab ' + IntToStr(Tab) + ' is not valid.', warn_AllVersions);
exit;
end;
if GetColor(97 + (Tab-1)*123, 31) = 7375258 then
begin
result := true;
exit;
end else
begin
Mouse(97 + (Tab-1)*123, 31, 6, 6, true);
result := true;
end;
end;
Just for funzies
Tested and it works for all of them.

E:
{*******************************************************************************
function GetLobbyTab: Integer;
By: Bionicle1800
Description: Gets current lobby tab.
*******************************************************************************}
function GetLobbyTab: Integer;
var
T: Integer;

begin
for T := 0 to 4 do
begin
if GetColor(97 + T*123, 31) = 7375258 then
begin
result := T + 1;
exit;
end;
end;
end;
tested and works.

Gu3st...

2010-03-03 16:54:22

From: bionicle1800
{*******************************************************************************
function LobbyTab(Tab: Integer): Boolean;
By: Bionicle1800
Description: Goes to the lobby tab specified by the integer 'Tab'.
Valid arguments are 1 through 5.
*******************************************************************************}
function LobbyTab(Tab: Integer): Boolean;
begin
if (Tab-1) > 4 then
Srl_Warn('LobbyTab', 'Tab ' + IntToStr(Tab) + ' is not valid.', warn_AllVersions);
if GetColor(97 + (Tab-1)*123, 31) = 7375258 then
begin
result := true;
exit;
end else
begin
Mouse(97 + (Tab-1)*123, 31, 6, 6, true);
result := true;
end;
end;
Just for funzies
Tested and it works for all of them.


LobbyTab(-23);

Bionicle

2010-03-03 16:59:05

From: Zyt3x
LobbyTab(-23);


oops forgot the exit after the SRL_warn :p thx

Gu3st...

2010-03-03 17:03:34

From: bionicle1800
oops forgot the exit after the SRL_warn :p thx
If I do LobbyTab(-23); it will still not exit the function

Bionicle

2010-03-03 17:09:35

From: Zyt3x
If I do LobbyTab(-23); it will still not exit the function


right.
works now.

Dynamite

2010-03-03 17:15:15

From: bionicle1800
function InLobby: boolean;
begin
if (GetColor(565, 638) = 9291999) then
Result := true;
end;
Why not that? LoggedIn doesn't have a wait, neither do other functions with the same kind of function (e.g. InvFull, BankOpen etc.) just takes up too much room imo


i meant lobby as in when you load RS.
So it needs a repeat until.

NCDS

2010-03-03 17:16:32


{*******************************************************************************
function LobbyTab(Tab: Integer): Boolean;
By: Bionicle1800
Description: Goes to the lobby tab specified by the integer 'Tab'.
Valid arguments are 1 through 5.
*******************************************************************************}
function LobbyTab(Tab: Integer): Boolean;
begin
if not InRange(Tab, 1, 5) then
begin
Srl_Warn('LobbyTab', 'Tab ' + IntToStr(Tab) + ' is not valid.', warn_AllVersions);
exit;
end;
Result := GetLobbyTab = Tab;
if Result then
Exit;
Mouse(97 + (Tab-1)*123, 31, 6, 6, true);
Wait(30);
result := GetLobbyTab = Tab;
end;

Could be done differently with a loop as well to cut down on lines if you wanted.

Bionicle

2010-03-03 17:29:08

From: NCDS

{*******************************************************************************
function LobbyTab(Tab: Integer): Boolean;
By: Bionicle1800
Description: Goes to the lobby tab specified by the integer 'Tab'.
Valid arguments are 1 through 5.
*******************************************************************************}
function LobbyTab(Tab: Integer): Boolean;
begin
if not InRange(Tab, 1, 5) then
begin
Srl_Warn('LobbyTab', 'Tab ' + IntToStr(Tab) + ' is not valid.', warn_AllVersions);
exit;
end;
Result := GetLobbyTab = Tab;
if Result then
Exit;
Mouse(97 + (Tab-1)*123, 31, 6, 6, true);
Wait(30);
result := GetLobbyTab = Tab;
end;

Could be done differently with a loop as well to cut down on lines if you wanted.


Hmm..yea i wrote the GetLobbyTab function after, so i never thought of using it in this one :p

Blumblebee

2010-03-03 17:31:32

fixed loginplayer and RSready, some better failsafes might be in order, but it does work :). new Login.scar

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Login Routines --//
//-----------------------------------------------------------------//
// * function RSReady: Boolean; // * by ZephyrsFury
// * Procedure LoginScreenMusic(State: Variant); // * by Wizzup?
// * procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: (Stereo, Mono, NoChange) ); // * by ZephyrsFury
// * procedure Login_SetGraphics(Brightness: Integer; vl, rr, gd, td, ia, fl, gt, cs: string); // * by ZephyrsFury
// * procedure SetAutoingDefaults; // * by ZephyrsFury
// * procedure Logout; // * by Starblaster100 and Raymond
// * procedure LoginPlayer; // * by SRL Developers
// * function NextPlayerIndex: Integer; // * by Dankness, Ron, Raymond & ZephyrsFury
// * function RandomPlayerIndex: Integer; // * by Dankness, Ron, Raymond & ZephyrsFury
// * function SwitchToPlayer(PlayerNo: Integer; Active: Boolean): Boolean; // * by Dankness, Ron, Raymond & ZephyrsFury
// * procedure NextPlayer(Active: Boolean); // * by ZephyrsFury
// * procedure RandomNextPlayer(Active: Boolean); // * by ZephyrsFury
// * procedure CheckUserNicks; // * by Sumilion, Raymond and Nava2

{ var SRL_Logs: Integer;
Description: Variables needed for some login functions. }
{ var RandomPlayer, GraphicsSet: Boolean;
Description: Variables needed for some login functions. }
var
SRL_Logs: Integer;
RandomPlayer, GraphicsSet, AllowPVP: Boolean;

procedure NextPlayer(Active: Boolean); forward;
procedure RandomNextPlayer(Active: Boolean); forward;

const
UBx1 = 250; // Username tBox
UBy1 = 210;
UBx2 = 515;
UBy2 = 240;

PBx1 = 250; // Password tBox
PBy1 = 265;
PBx2 = 515;
PBy2 = 290;

GBx1 = 230; // greeting box in final screen
GBy1 = 330;
GBx2 = 660;
GBy2 = 400;

WDx1 = 88; // window box (to enter game) "click here to play"
WDy1 = 450;
WDx2 = 545;
WDy2 = 473;

WHITE_TEXT = 16777215; // white text color
MESSAGE_BOX = 11452366; // The "helpful message" box color
INFO_BOX = 7428416; // Blue information box color
LOGIN_COLOR = 6865381; // Login button color

{*******************************************************************************
function RSReady: Boolean;
By: ZephyrsFury
Description: Returns true if we are ready to auto (on loginscreen or logged in).
Useful for waiting until RS has fully loaded.
*******************************************************************************}

function RSReady: Boolean;
begin
Result := (countcolor(INFO_BOX, 208, 448, 555, 468) > 0) or (LoggedIn);
end;

{*******************************************************************************
Procedure LoginScreenMusic(State: Variant);
By: Wizzup?
Description: Takes Boolean(True, False) or Integer(1..5) as arguments.
1 or True = Off, 5 or False = Max.
1 2 3 4 5
<-o---o---o---o---o->
*******************************************************************************}

Procedure LoginScreenMusic(State: Variant);

Var
RealState: Variant;
x: Extended;

Begin
if (LoggedIn) then Exit;
TypeByte(vk_Escape);
Wait(500);
if (CountColor(51, 342, 396, 419, 410) <> 158) then Exit;
Case VarType(State) Of
11: RealState := (State + 1) * 4;
3, 5: if (State >= 1) and (State <= 5) then//If InRange(State, 1, 5) Then
RealState := State - 1;
Else
RealState := 0;
End;
x := (421.0 - 333.0) * RealState / 4.0 + 333.0;
If CountColorTolerance(1647966, Round(x) - 5, 375, Round(x) + 5, 385, 20) < 5 Then
If CountColorTolerance(991349, Round(x) - 5, 375, Round(x) + 5, 385, 20) < 5 Then
Mouse(Round(x), RandomRange(375, 385), 0, 0, True);

End;

{*******************************************************************************
procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: (Stereo, Mono, NoChange) );
By: ZephyrsFury
Description: Sets audio options through the login screen.
Use: Enter the desired Setting for the desired Option. Make option 0 for no change.
EG. Login_SetAudio(1, 5, 2, NoChange);

1 2 3 4 5
Volume, SFX, Area: <-o---o---o---o---o->
*******************************************************************************}

procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: TSMSetting);
var
II, Tx, Ty, T, AudioMask: Integer;
Pts: TIntegerArray;
begin
if (LoggedIn) then Exit;
AudioMask := BitmapFromString(25, 8, 'beNpjYICA/zCAzEWTgovgEf+PA' +
'2AqQBPBz8aqEb96PC7Ho5huRlHRg7iij6BRRPoXWTHWaMUiCAAICy' +
'rk');
TypeByte(vk_Escape);
T := GetSystemTime;
while (not(FindBitmapMaskTolerance(AudioMask, TX, TY, 300, 352, 463, 389, 0, 0))) and (GetSystemTime - T < 5000) do
Wait(100);
if (FindBitmapMaskTolerance(AudioMask, TX, TY, 300, 352, 463, 389, 0, 0)) then
Mouse(TX - 20, TY + 3, 50, 5, True)
else
begin
FreeBitmap(AudioMask);
Exit;
end;
Wait(100);
Pts := [Volume, SFX, Area];
for II := 0 to 2 do
begin
if (Pts[II] = 0) then Continue;
if (not(InRange(Pts[II], 0, 5))) then
begin
srl_Warn('Login_SetAudio', 'Points must be between 0 and 5', warn_AllVersions);
Continue;
end;
if Pts[II] = 1 then Tx:=305 else
Tx := 337 + Round((425 - 337) * (Pts[II] - 1) / 4);
Ty := Round(3.5 * II * II + 46.5 * II + 245);
if (GetColor(Tx, Ty) <> 1121100) then
Mouse(Tx + 2, Ty - 14, 0, 0, True);
Wait(50);
end;
if (GetColor(337, 389) = 181) and (SMSetting = Stereo) then
Mouse(421, 385, 10, 10, True)
else
if (GetColor(426, 389) = 181) and (SMSetting = Mono) then
Mouse(332, 385, 10, 10, True);
Wait(100);
TypeByte(vk_Escape);
FreeBitmap(AudioMask);
end;

{*******************************************************************************
procedure Login_SetGraphics(Brightness: Integer);
By: ZephyrsFury Fixed by J_Pizzle
Description: Sets graphic options in the login screen.
*******************************************************************************}
procedure Login_SetGraphics(Brightness: Integer);
var
T, x, y, tx, ty, GraphicsMask: Integer;
P: TPoint;
begin
if (LoggedIn) then Exit;
GraphicsMask := BitmapFromString(20, 8, 'beNpjYPiPBBiQwH9UgFUcmYumA' +
'JOLJoipGNMNuMwkQy8eR+LRi1U7JhuPdvx2YXUYZvgQExdYtTAAAF' +
'Km3SM=');
TypeByte(vk_Escape); //347, 273, 393, 292
T := GetSystemTime;
while (not(FindBitmapMaskTolerance(GraphicsMask, X, Y, 279, 272, 483, 352, 0, 0))) and (GetSystemTime - T < 5000) do
Wait(100);
if (FindBitmapMaskTolerance(GraphicsMask, X, Y, 279, 272, 483, 352, 0, 0)) then
Mouse(X - 20, Y + 3, 50, 5, True)
else
begin
FreeBitmap(GraphicsMask);
Exit;
end;
Wait(100);
if (Brightness > 4) then
srl_Warn('Login_SetGraphics', 'Brightness must be between 0 and 4', warn_AllVersions)
else
if (Brightness <> 0) then
begin
x := 0;
repeat
P := Point(260 + (Brightness - 1) * 32, 315);
if (GetColor(P.x, P.y) <> 16748688) then
begin
Mouse(P.x - 3, P.y, 3, 3, True);
if WaitColor(P.x, P.Y, 16748688, 1, 1000) then
break;
Inc(x);
end else
break;
until(x >= 5)
end;
repeat
if FindColor(x, y, 16777215, 143, 287, 621, 429) then
begin
Mouse(x + 10, y + 3, 10, 7, True);
getmousepos(tx, ty);
mouse(tx, ty + 10, 4, 4, true);
wait(300);
end;
until(not(FindColor(x, y, 16777215, 143, 287, 621, 429)));
Wait(100);
TypeByte(vk_Escape);
FreeBitmap(GraphicsMask);
end;

{*******************************************************************************
procedure SetAudioOff;
By: ZephyrsFury
Description: Sets the Audio to off (1 for each bar). Works logged in and out.
*******************************************************************************}

procedure SetAudioOff;
begin
if (LoggedIn) then
SetAudio(1, 1, 1, NoChange)
else
Login_SetAudio(1, 1, 1, NoChange);
end;

{*******************************************************************************
procedure SetAutoingDefaults;
By: ZephyrsFury
Description: Sets the graphic options for best SRL compatibility. Works both logged in and out.
*******************************************************************************}

procedure SetAutoingDefaults;
begin
if (LoggedIn) then
FixGraphics
else
Login_SetGraphics(4);
end;

{*******************************************************************************
procedure Logout;
By: Starblaster100 / Raymond
Description: Logs you out.
*******************************************************************************}

function Logout: Boolean;
var
c, i: Integer;
begin
Result := (not (LoggedIn));
if Result = True then
Exit;
if (SRL_Procs[srl_OnLogOut] <> nil) then
SRL_Procs[srl_OnLogOut]();
if GameTab(tab_LogOut) = False then
Exit;
Wait(200 + Random(100));
while (LoggedIn) and (c < 10) do
begin
Inc(c);
if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(LoggedIn)then
begin
Result := True;
Exit;
end;
end;
end;
end;

{*******************************************************************************
procedure LoginPlayer;
By: SRL Developers & Blumblebee
Description: Logs in the Player[CurrentPlayer]. Detects most Client Login Errors
*******************************************************************************}

procedure clearEditBox(x1, y1, x2, y2: integer);
begin
while countColor(WHITE_TEXT, x1, y1, x2, y2) > 12 do
begin
TypeByte(VK_BACK);
Wait(50 + Random(50));
end;
end;

procedure LogInPlayer();
var
t, mark: LongInt;
Actions: TVariantArray;
begin
ActivateClient;
wait(randomRange(50, 250));

if countcolor(MESSAGE_BOX, GBx1, GBy1, GBx2, GBy2) > 0 then // if at final screen ("lobby")
begin
wait(randomRange(750, 1500));
mouseBox(672, 18, 700, 46, 1); // straight values. I can add constants if you want, I don't want to bloat constants.
t := getSystemTime();
while (getSystemTime()-t < 30000) and (countcolor(INFO_BOX, 208, 460, 555, 464) < 0) do
wait(randomRange(1000, 2000));
end;

if (not(RSReady)) then // kept the same as original. I can adjust if deemed neccessary.
begin
MarkTime(Mark);
while (not(RSReady)) do
begin
Wait(100);
if (TimeFromMark(Mark) > 180000) then
begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
end;
end;
WriteLn('Welcome to Runescape.');
end;

{LoginScreenMusic(True);
if (not(GraphicsSet)) then
begin
SetAutoingDefaults;
GraphicsSet := True;
end;}

if (not(LoggedIn)) then
begin
if (not(Players[CurrentPlayer].Active)) then
begin
WriteLn('Player is not Active...');
NextPlayer(False);
Exit;
end;
wait(randomRange(500, 900));

if (countcolor(INFO_BOX, 208, 460, 555, 464) > 0) then
begin
wait(randomRange(50, 200));
mouseBox(215, 404, 368, 421, 1);
t := getSystemTime();
while (getSystemTime()-t < 30000) and (getcolor(287, 312) <> LOGIN_COLOR) do
wait(randomRange(1000, 2000));
end;

if countcolor(WHITE_TEXT, UBx1, UBy1, UBx2, UBy2) <= 0 then
mousebox(UBx1, UBy1, UBx2, UBy2, 1);
wait(randomRange(500, 1000));

// Enter Username
clearEditBox(UBx1, UBy1, UBx2, UBy2);
Wait(100 + Random(200));
WriteLn(Capitalize(Players[CurrentPlayer].Name));
TypeSend(Players[CurrentPlayer].Name);
Wait(100+random(50));

// Enter Password
clearEditBox(PBx1, PBy1, PBx2, PBy2);
Wait(100 + Random(200));
TypeSend(Players[CurrentPlayer].Pass);
Wait(100+random(50));

t := getSystemTime();
while ( (getSystemTime-t < 30000) and (countcolor(MESSAGE_BOX, GBx1, GBy1, GBx2, GBy2) <= 0) ) do
wait(randomRange(500, 1000));

if (countcolor(MESSAGE_BOX, GBx1, GBy1, GBx2, GBy2) <= 0) then
begin
SRL_Warn('LoginPlayer', 'LogInPlayer() could not enter Lobby screen.', Warn_AllVersions);
NextPlayer(False);
Exit;
end;
wait(randomRange(500, 1000));
mouseBox(WDx1, WDy1, WDx2, WDy2, 1);
wait(randomRange(750, 1500));
t := getsystemTime();
while not LoggedIn() do
begin
if getSystemtime()-t > randomRange(25000, 30000) then
break;
wait(randomRange(750, 1500));
end;
end;

if (LoggedIn) then
begin
PlayerStartTime := GetSystemTime; // PlayerStartTime
if Length(Players[CurrentPlayer].NickTPA) < 2 then
begin;
Writeln('Creating the NickTPA.');
if Players[CurrentPlayer].Nick <> '' then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
else
if (Players[CurrentPlayer].Name <> '') then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
ClickText('here to con', NPCChars, MCX1, MCY1, MCX2, MCY2, True);
end;
end;

{*******************************************************************************
function NextPlayerIndex: Integer;
By: Dankness, Ron, Raymond & ZephyrsFury
Description: Returns the player number of the next active player.
*******************************************************************************}

function NextPlayerIndex: Integer;
begin
if (AllPlayersInactive) then
begin
Result := -1;
Exit;
end;
Result := (CurrentPlayer + 1) mod Length(Players);
while (Players[Result].Active = False) do
Result := (Result + 1) mod Length(Players);
end;

{*******************************************************************************
function RandomPlayerIndex: Integer;
By: Dankness, Ron, Raymond & ZephyrsFury
Description: Returns the Player number of a random active player.
*******************************************************************************}

function RandomPlayerIndex: Integer;
var
N: Integer;
begin
if (AllPlayersInactive) then
begin
Result := -1;
Exit;
end;
N := Random(Length(Players));
while (Players[N].Active = False) or (N = CurrentPlayer) do
begin
if (PlayersActive = 1) and (N = CurrentPlayer) then Break;
N := Random(Length(Players));
end;
Result := N;
end;
{*******************************************************************************
function SwitchToPlayer(PlayerNo: Integer; Active: Boolean): Boolean;
By: Dankness, Ron, Raymond & ZephyrsFury
Description: Switches to a specific player, setting the current player's
activity to True or False.
*******************************************************************************}

function SwitchToPlayer(PlayerNo: Integer; Active: Boolean): Boolean;
begin
WriteLn('SwitchToPlayer(PlayerNo: ' + IntToStr(PlayerNo) + ', Active: ' + BoolToStr(Active)+ ');');
Players[CurrentPlayer].Active := Active;
Logout;
if (SRL_Procs[srl_OnNextPlayer] <> nil) then
SRL_Procs[srl_OnNextPlayer]();
PlayerCurTime := GetSystemTime;
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked + (PlayerCurTime - PlayerStartTime);
CurrentPlayer := PlayerNo;
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
Result := LoggedIn;
end;

{*******************************************************************************
procedure NextPlayer(Active: Boolean);
By: ZephyrsFury
Description: Logs in the next player that isn't inactive.
Boolean: True - Current player is ok. False - Current player is false.
*******************************************************************************}

procedure NextPlayer(Active: Boolean);
var
srl_PlayerIndexFunc: function: Integer;
cP: Integer;
begin
if (RandomPlayer) then
srl_PlayerIndexFunc := @RandomPlayerIndex
else
srl_PlayerIndexFunc := @NextPlayerIndex;

WriteLn('NextPlayer');
LogOut;
cP := srl_PlayerIndexFunc();
while (cP = -1) do
begin
cP := srl_PlayerIndexFunc();
if (SRL_Procs[srl_InNextPlayerLoop] <> nil) then
SRL_Procs[srl_InNextPlayerLoop]();
Wait(5000); //Endless loop
end;

SwitchToPlayer(cP, Active);
end;

{*******************************************************************************
procedure RandomNextPlayer(Active: Boolean);
By: ZephyrsFury
Description: Logs in a random player that isn't inactive.
Boolean: True - Current player is ok. False - Current player is false.
*******************************************************************************}

procedure RandomNextPlayer(Active: Boolean);
var
tmpBool: Boolean;
begin
tmpBool := RandomPlayer;
RandomPlayer := True;
NextPlayer(Active);
RandomPlayer := tmpBool;
end;

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

procedure CheckUserNicks;
var
I, II: Integer;
Wrong, FWrong: Boolean;
WarnStrings: TStringArray;
begin
WarnStrings := ['Please fill in your nickname.', 'Please Uncapitalise your nickname.',
'Dont use the first letter in your nick.', 'Dont use spaces in your Nick.',
'Nick does NOT match the name.'];
for i := 0 to HowManyPlayers - 1 do
for II := 0 to 4 do
begin
case II of
0: Wrong := (Players[i].Nick = '');
1: Wrong := (Players[i].Nick <> LowerCase(Players[i].Nick));
2: Wrong := (Pos(Players[i].Nick, LowerCase(Players[i].Name)) = 1);
3: Wrong := (Pos(' ', Players[i].Nick) > 0);
4: Wrong := (Pos(LowerCase(Players[i].Nick), Capitalize(LowerCase(Players[i].Name))) = 0);
end;
if Wrong then
begin;
Writeln('--');
Writeln('WARNING: ' + WarnStrings[II] + ' with player: ' + Players[i].Name);
FWrong := True;
end;
end;
if FWrong then
begin
Writeln('');
Writeln('For more information, visit [url]http://www.villavu.com/forum/showthread.php?t=5410');[/url]
end;
end;

RAM

2010-03-03 20:27:23

From: Blumblebee
fixed loginplayer and RSready, some better failsafes might be in order, but it does work :). new Login.scar

….

Line 555: [Error] (5919:94): comma (',') expected in script C:SCAR80\includes\SRL\SRL\Core\Login.scar
Successfully compiled (10153 ms)
Line 298: [Hint] (5662:1): Variable 'ACTIONS' never used in script C:SCAR80\includes\SRL\SRL\Core\Login.scar
SRL Compiled in 0 msec
Successfully executed
simple fix…
 Writeln('For more information, visit [URL]http://www.villavu.com/forum/showthread.php?t=5410[/URL]') ;

Blumblebee

2010-03-04 00:40:26

From: RAM
….

Line 555: [Error] (5919:94): comma (',') expected in script C:SCAR80\includes\SRL\SRL\Core\Login.scar
Successfully compiled (10153 ms)
Line 298: [Hint] (5662:1): Variable 'ACTIONS' never used in script C:SCAR80\includes\SRL\SRL\Core\Login.scar
SRL Compiled in 0 msec
Successfully executed
simple fix…
 Writeln('For more information, visit [URL]http://www.villavu.com/forum/showthread.php?t=5410[/URL]') ;


I am confused. Are you saying it does not work? I tested it a few times, used NextPlayer() with it and such and it worked, but there is absolutely no failsafes to it (which is maybe the fact you are alluding to?)

if the comment was directed at the variable "ACTIONS" never used, I left the actions variable in because it should still be implemented, I just didn't have the time atm to do so.

and yes, it is a simple fix. I can do some more work on it tomorrow morning if anyone cares for me to do so.

RAM

2010-03-04 09:07:26

Um, there was a compiling error about a coma, and I was just posting how it was fixed…

Yes, it logged in fine…

EDIT: WTF…the URL tags won't let me post it correctly….

Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');

Scroll down in the code box, this is how it appears….

Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');

Blumblebee

2010-03-04 11:07:30

From: RAM
Um, there was a compiling error about a coma, and I was just posting how it was fixed…

Yes, it logged in fine…

EDIT: WTF…the URL tags won't let me post it correctly….

Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');


Oh sorry, It doesn't do that for me? I was running it on SCAR though, not Simba that could be why.