SRL Archive - Help and Support

Script cuts out?


Pancakes

2007-10-06 02:19:20

Yeah, well I have designed this script, and it works pretty much flawlessly. But it has one problem. It seems to get into an endless loop somewhere, when switching players I assume. I assume this because in the debug window it says:
[BANANA]
NextPlayer
**** *****
[/BANANA]

And, down the bottom, it still says that the script is running, although nothing is happening. I am always AFK (away from keyboard) when this happens, although it seems to happen about an hour or so into the script. Without giving too much away from my script (it is private), here is the main loop:


begin
LoadScript;

SRLPlayerForm(True, [], [], [], []);

Disguise('Starting script.');
Wait(1000);
Disguise('');

case RandomStarter of
True: CurrentPlayer := Random(HowManyPlayers - 1);
False: CurrentPlayer := 0;
end;


repeat
if(Not(LoggedIn)) then LoginPlayer;
UserSetup;

repeat
case Location of
'castle': Walk(ToMine);
'lost': begin
if (Not(HomeTeleport)) then Break;
Walk(ToMine);
end;
end;

if (Not(Location = 'mine')) then WalkIntoMine;

if (Not(GotPick)) then GetPick;

MineRock;

if (RBoolEx(4)) then
begin
if (GetSkillLevel('mining') > MaxLevel) then Logout;
end;

if (InvCount = 28) then ClearInventory;

until(TimeFromMark(PlayerTime) > MinutesPerPlayer * 60000) or (Not(LoggedIn));

NextPlayer(LoggedIn);

until(AllPlayersInactive);
Disguise('Script finished.');
end.

Can anyone help me out here? I'll post my whole script if need be, but I'd prefer not to :p

JuKKa

2007-10-06 02:43:07

You cant have "NextPlayer(Loggedin)"

U should have: "If(Loggedin)Then NextPlayer(True) Else NextPlayer(False);"

Pancakes

2007-10-06 02:46:54

From: JuKKa
You cant have "NextPlayer(Loggedin)"

U should have: "If(Loggedin)Then NextPlayer(True) Else NextPlayer(False);"


Well I'll put that in there and try it then. Anyone else, please?

nielsie95

2007-10-06 02:51:30

NextPlayer starts an endless loop when there aren't anymore players active.


NextPlayer(LoggedIn);

until(AllPlayersInactive);

So that wont work also, you should have AllPlayersInactive before NextPlayer.


if (not AllPlayersInactive) then
NextPlayer(LoggedIn);

until(AllPlayersInactive);

Markus

2007-10-06 02:57:35

From: JuKKa
You cant have "NextPlayer(Loggedin)"

U should have: "If(Loggedin)Then NextPlayer(True) Else NextPlayer(False);"


That's bulllshit, I use it in my own scripts and it works.

Pancakes

2007-10-06 03:04:40

I thought so. Also, thanks nielsie.

Anyone else care to improve / point out bugs / make suggestions?

Also I dont know if this problem is fixed yet, but Nielsie probably fixed it. But yeah.

JuKKa

2007-10-06 03:33:09

From: Markus
That's bulllshit, I use it in my own scripts and it works.

Please shut up… While looking at your threads i noticed how you have only released 1 script that BANKS! and one script that accepts trades. The runecrafter.. Not a single report over 1 hour …

Even be4 i was srl member.. I could make scripts that lasted over 2 hours.

From: Markus
I use it in my own scripts and it works.


Scripts?! I saw only ONE! so it should be Script. K.. If u do have more script showme and ill post!

K, Thx, Bai!

Markus

2007-10-06 03:59:05

From: JuKKa


Scripts?! I saw only ONE! so it should be Script. K.. If u do have more script showme and ill post!

K, Thx, Bai!


Powerfisher pl0x, second at the competition.

http://www.villavu.com/forum/showthread.php?t=16376?p=199735#post199735
From: Starblaster100

Glad to see you are using the technique Nextplayer(loggedin);

I don't think star would say that if it didn't work.

Pancakes

2007-10-06 04:07:13

From: Pancakes
I thought so. Also, thanks nielsie.

Anyone else care to improve / point out bugs / make suggestions?

Also I dont know if this problem is fixed yet, but Nielsie probably fixed it. But yeah.


…

Pancakes

2007-10-06 09:16:10

Gah, its still happening!

What the debug window says..
ker klink
NextPlayer
function x
NextPlayer
lord greedle
NextPlayer
far trap
NextPlayer
hut jobi
NextPlayer
lord greedle
NextPlayer << It's just sitting there…


I know for a fact that all players are not inactive, either. And even if they were, the script would stop, not just say 'Running script.' down the bottom. This is really starting to piss me off. :mad:

Santa_Clause

2007-10-06 09:20:27

From: JuKKa
Please shut up… While looking at your threads i noticed how you have only released 1 script that BANKS! and one script that accepts trades. The runecrafter.. Not a single report over 1 hour …

Even be4 i was srl member.. I could make scripts that lasted over 2 hours.



Scripts?! I saw only ONE! so it should be Script. K.. If u do have more script showme and ill post!

K, Thx, Bai!


Take it easy, dude! No need to put other people down…

R0b0t1

2007-10-06 09:23:59

Did you howchister your flabbergasting? That might be the problem :).

Pancakes

2007-10-06 09:25:20

Guys, I actually need some help… please? :o

ZephyrsFury

2007-10-06 09:47:45

Whats your AllPlayersInactive function look like?

Pancakes

2007-10-06 09:56:07

Hell, I'll post the whole script :p

Check it and see if you can find the error, I sure can't.

Pancakes

2007-10-06 09:57:17


program MiningAdvantage;
{.include SRL\SRL.scar}
{.include SRL\SRL\MISC\KYAB.scar}

{******************************************************************************}

const
RunDir = 'N'; //Direction to run in if a fight is found.
MaxLevel = 31; //The max mining level of the player.
MaxSecsPerRock = 8; //Max seconds per rock.
MinutesPerPlayer = 15; //How many minutes per player.
RandomStarter = True; //Choose a random player to start with.

var PickDTM, PlayerTime, RandomsTime : Integer;
var CopperColors, TinColors, TutorColors : Array of Integer;
var ToMine : Array of Tpoint;
{******************************************************************************}
procedure LoadScript;
var T : Integer;
begin
MarkTime(T);
SetupSRL;
if (Not(SetupKYAB)) then TerminateScript;
MouseSpeed := 20;
ClickTileTimeout := 10000;
MarkTime(RandomsTime);

PickDTM := DTMFromString('78DA637462626060646440067AF20C0CFF813' +
'448F43F10300603D5FC6340038C482490F600AAF94C408D3950CD' +
'0F026AAC806AF818F1ABB125AC0600450009FA');

CopperColors:= [4681883,4945571,3296877];
TinColors:= [7895168,6250343,5855584];
TutorColors := [3942946, 7690063, 6178368, 8676185, 3151633, 7050175];

SetArrayLength(ToMine, 20);
ToMine[0].X:=3227; ToMine[0].Y:=3217;
ToMine[1].X:=3232; ToMine[1].Y:=3217;
ToMine[2].X:=3236; ToMine[2].Y:=3215;
ToMine[3].X:=3236; ToMine[3].Y:=3209;
ToMine[4].X:=3237; ToMine[4].Y:=3205;
ToMine[5].X:=3237; ToMine[5].Y:=3201;
ToMine[6].X:=3241; ToMine[6].Y:=3199;
ToMine[7].X:=3245; ToMine[7].Y:=3196;
ToMine[8].X:=3245; ToMine[8].Y:=3192;
ToMine[9].X:=3245; ToMine[9].Y:=3187;
ToMine[10].X:=3245; ToMine[10].Y:=3182;
ToMine[11].X:=3242; ToMine[11].Y:=3179;
ToMine[12].X:=3241; ToMine[12].Y:=3174;
ToMine[13].X:=3239; ToMine[13].Y:=3170;
ToMine[14].X:=3239; ToMine[14].Y:=3164;
ToMine[15].X:=3242; ToMine[15].Y:=3159;
ToMine[16].X:=3238; ToMine[16].Y:=3156;
ToMine[17].X:=3235; ToMine[17].Y:=3151;
ToMine[18].X:=3232; ToMine[18].Y:=3148;
ToMine[19].X:=3228; ToMine[19].Y:=3145;
KYAB_Log('Script loaded in ' + IntToStr(T) + 'ms.');
end;

{=*****************************************************=}
{= ANTIBAN =}
{=*****************************************************=}

procedure ExamineInventory;
var j : Integer;
var T : Tpoint;
begin
if (Not(LoggedIn)) then Exit;
repeat
if (InvCount = 0) then Exit;
j := Random(28) + 1;
until(ExistsItem(j));

T := ItemCoords(j);

Mouse(T.x, T.y, 3, 3, False);

Wait(150 + Random(150));

ChooseOption('xamine');

Wait(100 + Random(500));

end;

procedure RCompassLittle;
var i : Byte;
var r : Integer;
begin
if (Not(LoggedIn)) then Exit;
//Set R to equal either 0 or 1.
r := Random(2);
case r of
//If R was equal to 0, then set i to VK_Left.
0: i := VK_LEFT;
//If R was equal to 1, then set i to VK_Right.
1: i := VK_RIGHT;
end;
//Hold the selected key down.
KeyDown(i);
//Wait for a minimum of 100ms plus a random 200ms.
Wait(50 + Random(300));
//Release the selected key.
KeyUp(i);
end;

procedure RTypeSend(TypeList : TStringArray);
var i : Integer;
begin
i := Random(GetArrayLength(TypeList) - 1);
TypeSend(TypeList[i]);
end;

procedure REmote;
begin
DoEmote(1 + Random(20));
end;

procedure RGameTab;
var i : Integer;
begin
i := GetCurrentTab;

GameTab(1 + Random(12));

Wait(100 + Random(4000));

GameTab(i);
end;

procedure RRotate;
var i : Integer;
begin
i := Random(4);
case i of
0: MakeCompass('N');
1: MakeCompass('E');
2: MakeCompass('S');
3: MakeCompass('W');
end;
end;

function Antiban : Boolean;
var i : Integer;
begin
if (Not(LoggedIn)) then Exit;
i := Random(400);

case i of
0: RandomRClick;
1: HoverSkill('random', False);
2: PickUpMouse;
3: AlmostLogout;
4: RandomMovement;
5: Wait2(3000 + Random(3000), True);
6: RRotate;
7: ExamineInventory;
8: RGameTab;
9: BoredHuman;
10: REmote;
11: RTypeSend(['hehe', 'heh', 'ha', 'hah', 'hihi', 'rofl', 'lol', 'loll', 'haha', 'lolz', 'lol/']);
12: RTypeSend(['boring', 'bored', '*sigh*', 'bored...', 'boring...', 'so bored']);
13: RCompassLittle;
end;

if (InRange(i, 0, 12)) then Result := True;
end;

{=*****************************************************=}
{= END ANTIBAN =}
{= =}
{= START RANDOMS =}
{=*****************************************************=}

Function FindFastRandoms: Boolean; // By WT-Fakawi.
var
i: Integer;
begin
if (Not(TimeFromMark(RandomsTime) > 2000)) then Exit;
if (Not(LoggedIn)) then Exit;
MarkTime(RandomsTime);

for i:=1 to 14 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
8 : If RC Then Result := True;

9: If FindTalk Then Result := True;

11: If SolveChatRandom Then Result := True;
12: ClickToContinue;
13: while (FindBox) do
begin
SolveBox;
end;
14: if FindFight then
begin
RunAwayDirection(RunDir);
Wait(8500 + Random(5000));
RunBack;
end;
End;
Wait(1);
end;
end;

{=*****************************************************=}
{= END RANDOMS =}
{=*****************************************************=}
function NextEmptyPosition : Integer; //Starting from 1, returns the next free inventory position.
var i : Integer;
begin
if (Not(LoggedIn)) then Exit;
GameTab(4);
for i := 1 To 28 do
begin
if (Not(ExistsItem(i))) then
begin
Result := i;
Exit;
end;
end;
end;

procedure ArrangeInventory;
var i : Integer;
begin
if (Not(LoggedIn)) then Exit;
GameTab(4);
if (InvCount > 20) then Exit;

Disguise('Arranging inventory.');

for i := 1 to 28 do
begin
if (ExistsItem(i)) then DragItem(i, NextEmptyPosition);
end;
Disguise('');
end;

function PlayerInBox(X1, Y1, X2, Y2 : Integer) : Boolean;
var PX, PY : Integer;
begin
if (Not(LoggedIn)) then Exit;
PX := GetPlayerX;
PY := GetPlayerY;

if (PX > X1) and (PY > Y1) and (PX < X2) and (PY < Y2) then Result := True;
end;

function AllPlayersInactive : Boolean;
var
Player, Inactive: Integer;
begin
for Player:= 0 to HowManyPlayers - 1 do
begin
if(Players[Player].Active = False) then
Inactive := Inactive + 1;
end;
if (Inactive = HowManyPlayers) then Result := True;
end;

function GotAnimation : Boolean;
begin
if (Not(LoggedIn)) then Exit;

//If GetAnimation does not return -1 (no animation) then we have go animation, return true.
Result := Not(GetAnimation = -1);

FindFastRandoms;
end;

procedure WaitStop;
begin
if (Not(LoggedIn)) then Exit;
//If we are moving then do the loop, if we are not then do not execute.
while(KYAB_isMoving) do
begin
//If we are not logged in then exit the procedure.
if (Not(LoggedIn)) then Exit;
//And wait 100ms.
Wait(100);
end;
FindFastRandoms;
end;

function WalkIntoMine : Boolean;
begin
if (Not(LoggedIn)) then Exit;
Result := NewWalkToTileTol(3227, 3144, 3);
FindFastRandoms;
end;

function HomeTeleport : Boolean;
var T : Integer;
begin
if (Not(LoggedIn)) then Exit;

Disguise('Casting H. Teleport.');

FindFastRandoms;

GameTab(7);
Wait(100 + Random(100));
Mouse(570, 237, 3, 3, True);

MarkTime(T);
repeat
if (GotAnimation) then
begin
Result := True;
Break;
end;
if (TimeFromMark(T) > 5000) then Exit;
Wait(200 + Random(100));
until(false);

while (GotAnimation) do
begin
Wait(200 + Random(100));
end;

Wait(500 + Random(500));

FindFastRandoms;

Disguise('');
end;

procedure Walk(Path : Array of TPoint);
var i : Integer;
begin
for i := 0 To GetArrayLength(Path) - 1 do
begin
if (Not(LoggedIn)) then Exit;
NewWalkToTileTol(Path[i].X, Path[i].Y, 3);
if (RboolEx(5)) then RCompassLittle;
end;
end;

procedure DropExceptName(ItemList : TStringArray);
var J : TPoint;
var i, X, Y : Integer;
begin
if (Not(LoggedIn)) then Exit;
GameTab(4);

for i := 1 To 28 do
begin
if (Not(ExistsItem(i))) then Continue;

J := ItemCoords(i);
MMouse(J.X, J.Y, 3, 3);
Wait(150 + Random(150));

if (Not(IsUpTextMultiCustom(ItemList))) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Wait(150 + Random(150));
ChooseOption('rop');
end;
end;
end;

function GotPick : Boolean;
var X, Y : Integer;
begin
if (Not(LoggedIn)) then Exit;

Disguise('Checking for pickaxe.');

if (GetCurrentTab = 4) then
begin
Result := FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
if (Result) then Exit;

GameTab(5);
Wait(150 + Random(150));
Result := FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
if (Result) then Exit;
end;


if (GetCurrentTab = 5) then
begin
Result := FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
if (Result) then Exit;

GameTab(4);
Wait(150 + Random(150));
Result := FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
if (Result) then Mouse(X, Y, 4, 4, True);
end;

GameTab(4);
Wait(150 + Random(150));
Result := FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
if (Result) then Exit;

GameTab(5);
Wait(150 + Random(150));
Result := FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
if (Result) then Mouse(X, Y, 4, 4, True);
end;

procedure GetPick;
var T, X, Y : Integer;
begin
if (Not(LoggedIn)) then Exit;

Disguise('Getting another pickaxe.');

FindFastRandoms;

GameTab(4);

MarkTime(T);
repeat
if (FindObjCustom(X, Y, ['tuto', 'utor', 'alk-', 'k-to'], TutorColors, 3)) then Break;
if (TimeFromMark(T) > 15000) then Exit;
until(false);

case RBool of
True: Mouse(X, Y, 0, 0, True);
False: begin
Mouse(X, Y, 0, 0, False);
Wait(150 + Random(150));
if (Not(ChooseOption('alk-'))) or (Not(ChooseOption('lk-to'))) then Exit;
end;
end;

Wait(250 + Random(250));
WaitStop;

Disguise('Talking to Mining tutor.');

MarkTime(T)
repeat
if (ClickNpcChatText('basics', True)) or (ClickNpcChatText('teach', True)) or
(ClickNpcChatText('me the', True)) or (ClickNpcChatText('please', True)) then Break;
if (TimeFromMark(T) > 5000) then Exit;
Wait(50 + Random(50));
until(false);

MarkTime(T);
repeat
if (ClickToContinue) then MarkTime(T);
if (FindDTM(PickDTM, X, Y, MIX1, MIY1, MIX2, MIY2)) then
begin
Disguise('We receieved a pickaxe.');
Wait(500 + Random(200));
Disguise('');
Exit;
end;
if (TimeFromMark(T) > 7500) then Exit;
Wait(100);
until(false);
end;

function Location : String;
begin
if (Not(LoggedIn)) then Exit;
if (PlayerInBox(3218, 3209, 3226, 3224)) then
begin
Result := 'castle';
Exit;
end;
if (PlayerInBox(3221, 3139, 3235, 3150)) then
begin
Result := 'mine';
Exit;
end;

Result := 'lost';

Disguise('We are at ' + Capitalize(Result) + '.');
Wait(500 + Random(200));
Disguise('');
end;

procedure ClearInventory;
begin
if (Not(LoggedIn)) then Exit;
Disguise('Clearing inventory.');
DropExceptName(['pickaxe', 'oins', 'iamond', 'uby', 'aphire', 'merald']);
if (RBoolEx(3)) then ArrangeInventory;
FindFastRandoms;
Disguise('');
end;

procedure UserSetup;
begin
Disguise('Setting up the user.');
if (Not(LoggedIn)) then LoginPlayer;
MakeCompass('N');
HighestAngle;
SetRun(True);
MarkTime(PlayerTime);
//Set brightness to VHigh...
SetBar('Brightness', 4);
Disguise('');
end;

function MineRock : Boolean;
var Col : Array of Integer;
var X, Y, T, I : Integer;
begin
if (Not(LoggedIn)) then Exit;

FindFastRandoms;

case RBool of
True: Col := TinColors;
False: Col := CopperColors;
end;

if (FindObjCustom(X, Y, ['Mine', 'Rock', 'ine', 'Roc', 'roc', 'ock'], Col, 3)) then
begin
Result := True;
case RBoolEx(4) of
True: begin
Mouse(X, Y, 0, 0, False);
Wait(150 + Random(150));
case RBool of
True: ChooseOption('ine');
False: ChooseOption('ock');
end;
end;
False: Mouse(X, Y, 0, 0, True);
end;
end;

if (Not(Result)) then
begin
WalkIntoMine;
Exit;
end;

Wait(500 + Random(500));
WaitStop;
Wait(500 + Random(500));

MarkTime(T);
while (GotAnimation) do
begin
while (GotAnimation) do
begin
{===========================}
for i := 0 to 2 do
begin
case i of
0: if (FindFastRandoms) then Exit;
1: Antiban;
2: if (TimeFromMark(T) > MaxSecsPerRock * 1000) then Exit;
end;
Wait(1);
end;
Wait(250 + Random(250));
{===========================}
end;
Wait(1000 + Random(1000));
end;

FindFastRandoms;

end;


begin
LoadScript;

ClearDebug;

SRLPlayerForm(True, [], [], [], []);

Disguise('Starting script.');
Wait(1000);
Disguise('');

case RandomStarter of
True: CurrentPlayer := Random(HowManyPlayers - 1);
False: CurrentPlayer := 0;
end;


repeat
if(Not(LoggedIn)) then
begin
Disguise('Logging in player.');
LoginPlayer;
end;

UserSetup;

repeat
case Location of
'castle': Walk(ToMine);
'lost': begin
if (Not(HomeTeleport)) then Break;
Walk(ToMine);
end;
end;

if (Not(Location = 'mine')) then WalkIntoMine;

if (Not(GotPick)) then GetPick;

MineRock;

if (RBoolEx(4)) then
begin
if (GetSkillLevel('mining') > MaxLevel) then Logout;
end;

if (InvCount = 28) then ClearInventory;

until(TimeFromMark(PlayerTime) > MinutesPerPlayer * 60000) or (Not(LoggedIn));

if (AllPlayersInactive) then Break;

if (LoggedIn) then NextPlayer(True) else NextPlayer(False);

until(false);
Disguise('Script finished.');
end.

Santa_Clause

2007-10-06 10:03:27

function AllPlayersInactive : boolean;
var
I : Integer;
begin
for I := 0 to HowManyPlayers - 1 do
if Players[i].Active then
Exit;
end;

Pancakes

2007-10-06 10:10:02

It never returns true? Besides its not a problem with that function anyway, its something to do with NextPlayer… this is getting on my nerves, so confusing :confused:

ZephyrsFury

2007-10-06 10:12:33

From: Santa_Clause
function AllPlayersInactive : boolean;
var
I : Integer;
begin
for I := 0 to HowManyPlayers - 1 do
if Players[i].Active then
Exit;
end;

You missed the Result:
function AllPlayersInactive : boolean;
var
I : Integer;
begin
for I := 0 to HowManyPlayers - 1 do
if Players[i].Active then
Exit;
Result := True;
end;

But his original function should work. Sorry Pancakes I have no idea why it gets stuck.

EDIT: Wait a second… have you declared the players???

Pancakes

2007-10-06 10:23:30

Yes, I use SRLPlayerForm, lolz :)

ZephyrsFury

2007-10-06 10:26:30

Lol sorry. I have no idea then.. still looking though. ;)

Pancakes

2007-10-06 10:30:39

Thanks man, I really appreciate it. :)

[Offtopic]Bit late for you to be up :p[/Offtopic]

ZephyrsFury

2007-10-06 10:33:24

10:32pm? Thats not late especially on Saturday night in the middle of the school hols… :)

Pancakes

2007-10-06 10:39:10

Ah okay, here in NSW its 12:38AM…

ZephyrsFury

2007-10-06 10:40:56

Pancakes is banned because I know… ;)

shaunthasheep

2007-10-06 10:41:35

A possible scenario:

You have 8 players.
7 are inactive, and 1 is still active.
The player is not logged in.
AllPlayersInactive returns false because 1 is still active.
NextPlayer(Loggedin), makes the last person inactive, and then engages in a infinite loop due to no more players.

procedure MyNextPlayer(Active : boolean);
var
PlayersLeft : integer;
begin
PlayersLeft := GetHowManyPlayersLeft; //just an example.
if (PlayersLeft <= 1) then
begin
if PlayersLeft = 0 then TerminateScript;
if (PlayerLeft = 1) and (not(Active)) then TerminateScript;
end;
NextPlayer(Active);
end;

Pancakes

2007-10-06 10:44:13

Thanks for the reply The_Rs_Monkey, that isn't the problem though, unfortunately.

Only one out of my 6 players are inactive, and it still is performing an endless loop.

I wouldn't be too pissed off it only one player was left active, but.. yeah.

Pancakes

2007-10-06 19:11:35

Happened again last night, script lasted 46 minutes with all players still active.

Pancakes

2007-10-06 22:39:28

*cough*

Harry

2007-10-06 22:50:41

From: Pancakes
Thanks for the reply The_Rs_Monkey, that isn't the problem though, unfortunately.

Only one out of my 6 players are inactive, and it still is performing an endless loop.

I wouldn't be too pissed off it only one player was left active, but.. yeah.


From: Pancakes
Happened again last night, script lasted 46 minutes with all players still active.


From: Pancakes
*cough*


Heh, spam and tripple post; I like it!

How about using simple DeclarePlayers?!

Pancakes

2007-10-06 23:13:08

Just wanted someone to help out, not flame. Jeez. And the SRLPlayerForm is simple declare players -.-

Special Ed

2007-10-07 01:31:51

First of all, try to be considerate of the rules, I <3 the edit button, and I don't know why some people don't.

As far as your problem goes, are you sure that your player is considered "Active" make sure in any places where you make a player inactive that specific player is the only one being set as inactive. NextPlayer(LoggedIn), I've never used it before but it sounds like a good idea. Maybe it is mistaking your player as logged out for some reason, or maybe somewhere in your script you have it setting a player as "Inactive" when its not supposed to.

Some things you should check
  • Is it the same player that it gets stuck on?
  • Script properly makes the player inactive.
  • No infinite loops anywhere (you never know).

Can't think so well at the moment I'll try again in the morning.

Pancakes

2007-10-07 01:39:14

Thanks, I'll check my script again :) I just didn't use the edit button because I wanted to 'bump' the thread, thanks for you help.

the scar noob

2007-10-07 11:33:38

From: Pancakes
Thanks, I'll check my script again :) I just didn't use the edit button because I wanted to 'bump' the thread, thanks for you help.


Did you already managed to solve the problem?
Otherwise, if non of above helps, just declare your players at the "classic" way, maybe Sumilion made a mistake?:p

Pancakes

2007-10-07 19:27:51

Maybe.. but I'm using another popular script now (The Claw's West Swamp Miner) and it works for longer, but still 'hangs' after a while, although it is an improvement on my script. This one lasted for 4 hours :)

mat_de_b

2007-10-09 16:04:17

Needs to be

function AllPlayersInactive : boolean;
var
I : Integer;
begin
for I := 0 to HowManyPlayers - 1 do
if Players[i].Active then
begin
Exit;
Result := True;
end;