SRL Archive - Help

WorldHop Issues!!!


CRASH_OVERRIDE

2012-12-30 21:29:20

Hey guys,

The script i am currently working on is going really well.

I have an issue though, With my WorldSwitch procedure, it works great and all on the first WorldSwitch. But after the first WorldSwitch it keeps doing it. I know this is because i use "GetTimeRunning" to determine the worldswap. Is their something that i can replace this with so that after every 1hour-25mins that goes past it re-world hops.?

I call this procedure in the main loop as part of a walking Begin and End. So after it walks to a certain location if the timerunning is more than a 1hour+random25mins it worldshops every 1.25 hours that go by?

heres the current procedure i made:

Procedure WorldSwitch;
Var
W, WorldHopCount: Integer;
Begin
If(Players[CurrentPlayer].Booleans[5]) Then
Begin
If(GetTimeRunning > 3600000 + Random(90000)) Then
Begin
StatusReport('Status: Worldhop');
ExitToLobby;
If Not(Players[CurrentPlayer].Booleans[6]) Then
Begin
StatusReport('Status: Forced Antiban');
Wait(60000 + Random(15000));
W := RandomWorld(False, False);
If LoginPlayerToLob Then
ChangeWorld(W);
StatusReport('Status: Swapping to Free World' + IntToStr(W));
End;
If(Players[CurrentPlayer].Booleans[6]) Then
Begin
StatusReport('Status: Forced Antiban');
Wait(60000 + Random(90000));
W := RandomWorld(True, False);
If LoginPlayerToLob Then
ChangeWorld(W);
StatusReport('Status: Swapping to Members World' + IntToStr(W));
End;
End;
End Else
LoginPlayer;
End;


Im thinking maybe if i add a result at the top that = the math of the time gone by? Or Maybe add a Inc(WorldHopCount), if timerunning - (worldhopcount). Any ideas?

Wardancer

2012-12-30 22:34:36

A simple fix would be to use MarkTime and TimeFromMark instead of GetTimeRunning. Just MarkTime once more after the world switch and it won't continuously switch.

CRASH_OVERRIDE

2012-12-30 23:11:59

From: Wardancer
A simple fix would be to use MarkTime and TimeFromMark instead of GetTimeRunning. Just MarkTime once more after the world switch and it won't continuously switch.


Would this mean the first time worldswitch is used it wont actually worldswitch just marktime first time round(If i add marktime to this procedure)?

If so maybe ill just add worldswitch under LoginPlayer at bottom.


EDIT: Sweet got it working. Cheers mate. I feel ashamed for not thinking of simply using martime :0.