SRL Archive - Jr. Member General Help and Discussion

Worldswitching - Ignore certain worlds


CRASH_OVERRIDE

2014-07-18 05:00:39

Is their a way when using the
lobbyWorlds.selectRandomWorld
to ignore certain worlds? I need to ignore the EoC and oldskool worlds etc, can't really think of a neat way to do it, any ideas?

Turpinator

2014-07-18 09:09:46

write your own random world function that picks from a smaller list. ie
function TRSLobbyWorlds.selectMyRandomWorld(): boolean;
var
myWorlds: TIntegerArray = [1, 2, 6, 83, 64];
begin
self.selectWorld(myWorlds[random(length(myWorlds)]);
end;
;

obvs code prolly wont work out of the box, but… thats where you come in.

KeepBotting

2014-07-18 09:58:06

Check out worldSwitcher in my signature, then look into ITntegerArrays as Turpinator suggested.

CRASH_OVERRIDE

2014-07-26 21:35:38

Here is my current procedure:
procedure worldSwitch();
var
WorldSwitchTime: integer;
p: TPoint;
begin
if (not isLoggedIn()) then exit;
WorldSwitchTime:= Round(players[currentPlayer].integers[2] * (60 * (1000)));

if players[currentPlayer].booleans[5] then
begin
if (WorldTimer.getTime >= WorldSwitchTime) or (worldPlayerCount()) then
begin
progressReport('Swapping Worlds.');

if not (players[currentPlayer].booleans[3]) then
writeLn('STATUS: Swapping Worlds.');

players[currentPlayer].exitToLobby();
if lobbyWorlds.selectRandomWorld(players[currentPlayer].booleans[6]) then
if (not isLoggedIn) then
begin
players[currentPlayer].login();
end;
end;
end else
exit;
end;

booleans6 is:
if not players[currentPlayer].booleans[6] then
isMember := false else
isMember := true;

Basically want to implement the following into what i already have:
if members is true
select a random member world from this:
3 7 8 11 17 19 20 29 34 38 41 43 61 80 81 108


if members is false
select a random world from this:
1 2 4 5 6 9 10 12 14 15 16 21 22 23 25 26 27 28 31 32 35 36 37 39 40 42 44 45 46 49 50 51 53 56 58 59 60 62 63 64 65 67 68 69 70 71 72 73 74 76 78 79 82 83 84 85 87 88 89 91 92 96 98 99 100 103 104 105 106 116 119 123 124 134 138 139