SRL Archive - SRL Suggestions

Few things


NCDS

2011-01-15 22:49:12

Instead of just 'LogoutOnMod', why not have a 'SwitchOnMod' as well? This way instead of logging out and just waiting to log back in, it gives the user the option to just switch worlds.

To add this…

Players.scar:
Patch:

--- players.scar (revision 689)
+++ players.scar (working copy)
@@ -93,6 +93,11 @@
Description: If you wish to logout, wait then login again when a mod is found. }
var
LogoutOnMod: Boolean;
+
+{ var SwitchOnMod: Boolean;
+ Description: If you wish to logout, switch worlds then login again when a mod is found. }
+var
+ SwitchOnMod: Boolean;

AntiRandoms.scar:

===================================================================
--- antirandoms.scar (revision 689)
+++ antirandoms.scar (working copy)
@@ -328,15 +328,16 @@
SaveToChatLog;
if (SRL_Procs[srl_OnFindMod] <> nil) then
SRL_Procs[srl_OnFindMod]();
- if (LogoutOnMod) then
+ if (LogoutOnMod) or (SwitchOnMod) then
begin
Players[CurrentPlayer].Rand := 'Found Mod';
- repeat
- Logout;
- Wait(1500 + Random(500));
- until not (LoggedIn);
- Wait(60000 + Random(60000));
- LoginPlayer;
+ WaitFunc(@ExitToLobby, 500, 1500);
+ if SwitchOnMod then
+ ChangeWorld(RandomWorld(Players[CurrentPlayer].Member, Players[CurrentPlayer].WorldInfo[2]))
+ else begin
+ Wait(60000 + Random(60000));
+ LoginPlayer;
+ end;
Players[CurrentPlayer].Rand := '';
end;
end;
Note: LoginPlayer is called in ChangeWorld.

Also, fixed a possible infinite loop in ChangeWorld..
WorldSwitcher.scar:

Index: worldswitcher.scar
===================================================================
--- worldswitcher.scar (revision 689)
+++ worldswitcher.scar (working copy)
@@ -456,7 +456,8 @@
*******************************************************************************}
function ChangeWorld(W: Integer): Boolean;
begin
- while LoggedIn do ExitToLobby;
+ if LoggedIn then
+ WaitFunc(@ExitToLobby, 500, 5000);
Result := SelectWorld(W);
LoginPlayer;
end;

Just seemed like some pretty positive changes to me.

Wanted

2011-01-16 00:23:59

Wait function is useful but you realize the world switching is integrated with login player?

NCDS

2011-01-16 15:50:14

From: IceFire908
Wait function is useful but you realize the world switching is integrated with login player?


I see that, though the code could be optimized quite a bit, but why bother waiting a minute+ if your just going to switch worlds anyways?

I'm extremely tired right now so it's probably best not to get too into it tonight. I'll look at it more tomorrow but I feel if I do too much else tonight I'll end up messing something up.

Regardless, I'll have another look in the morning.

Edit: Ok, so after looking at this while I'm a bit more awake, I guess the only question that remains is why is it set to wait for a minute after LogoutOnMod before calling LoginPlayer?

Regardless, the ChangeWorld edit should be applied, as well as the WaitFunc in AntiRandoms.scar, I would think anyways.

Wanted

2011-01-16 15:59:32

I'll do the infinite loop removal, but I don't see the point in adding a changeworld or removing the minuewait since changeworld is already in loginplayer and the minutewait was put there for the reason of humanlikeness. What normal player sees a mod, then rapidly changes worlds? It just doesn't seem important to remove that minute wait.

NCDS

2011-01-16 16:12:49

From: IceFire908
I'll do the infinite loop removal, but I don't see the point in adding a changeworld or removing the minuewait since changeworld is already in loginplayer and the minutewait was put there for the reason of humanlikeness. What normal player sees a mod, then rapidly changes worlds? It just doesn't seem important to remove that minute wait.


Yeah that makes sense.

in the AntiBan edit though,

- repeat
- Logout;
- Wait(1500 + Random(500));
- until not (LoggedIn);
Should still be changed to:

+ WaitFunc(@ExitToLobby, 500, 1500);
IMO anyways, not trying to tell anyone what to do. :redface:

Wanted

2011-01-16 16:23:52

Ok, I said I would do that.

NCDS

2011-01-16 21:50:19

From: IceFire908
Ok, I said I would do that.


My bad I thought you were just talking about the 'ChangeWorld' edit.

Thanks for the commit.