SRL Archive - MSI Suggestions

World switching if user is using signed client


Harry

2010-10-30 08:21:31

If the user is using more than one player, and they are using the signed client, it should change worlds every time it switches a player. This will dramatically reduce player-reports-to-Jagex, especially if your entire army is training the same place.

It shouldn't be that hard as the buttons are constant… should just have the global const "SWITCH_WORLD", default as "True".. and then it will switch world every time it switches a player. Only thing you would need to watch out for is PVP worlds.

NCDS

2010-10-30 10:33:47

Not sure how well SRL's WorldSwitcher.scar stuff is working, but I know it handles PVP worlds, so this should be a rather simple addition.

I'll add to my list. Thanks for the suggestions lately :)

Harry

2010-10-30 13:13:50

Yeah no problem. I am hopefully going to learn more about how MSI works (it's so confusing compared to the scripting I remember from 2 years ago), then I can actually produce some actual code to solve the request, heh.

Just seems weird to a legit player in a less-popular area if you don't hop worlds… "hm that quiet guy logged out, and now a new quiet guy logged in. Both reported now!" D:

Overtime

2010-10-30 13:28:13

i would deffitnely like this as my bot army goes like this

SRL FTW1
SRL FTW2
SRL FTW3

etc all the way to 50 0_0

if only there was a better turtorial runner that changed some letters around :/

NCDS

2010-10-30 13:29:03

From: Harry
Yeah no problem. I am hopefully going to learn more about how MSI works (it's so confusing compared to the scripting I remember from 2 years ago), then I can actually produce some actual code to solve the request, heh.

It's basically all just arrays, pointers, and custom data types. It can be quite overwhelming at first, though I'm confident you will understand it pretty well after familiarizing yourself with the code a bit.
From: Harry

Just seems weird to a legit player in a less-popular area if you don't hop worlds… "hm that quiet guy logged out, and now a new quiet guy logged in. Both reported now!" D:

Yeah, I agree.

From: Squancy
i would deffitnely like this as my bot army goes like this

SRL FTW1
SRL FTW2
SRL FTW3

etc all the way to 50 0_0

if only there was a better turtorial runner that changed some letters around :/


{******************************************************************************}
{ function MSI_RandomizeArray(Objs: TIntegerArray): TIntegerArray; }
{ By: NCDS & Coh3n }
{ Date: 20 Sept 2010 }
{ Description: Returns the Objects array in a random order }
{******************************************************************************}
function MSI_RandomizeArray(Objs: TIntegerArray): TIntegerArray;
var
i, o: Integer;
begin
SetLength(Result, Length(Objs));

while (Length(Objs) <> 0) do
for i := 0 to High(Result) do
begin
o := Random(Length(Objs));
//Writeln(IntToStr(Objs[o]));
Result[i] := Objs[o];
DeleteValueInIntArray(Objs, o);
end;
end;
Edit the one your currently using ;)

This could easily be converted to use strings instead of integers.

Coh3n

2010-10-30 17:52:59

I think something like this was suggested a while ago, but a little different. I like it and as far as I know, SRL's world switching is working.

Harry

2010-11-01 22:06:57

From: Coh3n
I think something like this was suggested a while ago, but a little different. I like it and as far as I know, SRL's world switching is working.

Mmmm… I think it would require editing actual SRL to add it though… as the world switching option is after you enter password, but BEFORE you hit the play button.

I think the options are:
1) Edit SRL's loginplayer so it will have a global switch_world boolean or something, default to false.
2) Rip off SRL's loginplayer and copy-paste it into MSI.
3) Any other option?

I think #1 would work best, though. I think I will work on it right now .. my only SRL work in forever. Don't know if SRL devs will even commit it, but it's worth a try.

Edit: uuuuh worldswitching is already built into SRL's login.scar.. I don't know if it works though. Would be:
Players[0].WorldInfo := [False {True if Members}, -1 {Leave as such for random world}, False {True for PVP worlds}];

Edit2: lol WorldInfo works flawlessly, no edits needed. Will only need minor edits to MSI (I think), as it works flawlessly with traditional declareplayers…. :D

Too lazy to make a .diff, but this should work:

Globals.simba:
Line 626, add:
WorldInfo: TVariantArray;

RunMe.simba:
In with MSI_Players[NUMBER] do:
Add at end of "TotalTime":
WorldInfo := [False {True if Members; YOU COULD PROBABLY MAKE IT GRAB THE VALUE FROM MSI_Member, HINT HINT}, -1 {Leave as such for random world}, False {True for PVP worlds}];
Add in for i := 0 to High(Players) do:
after:
Players[i].Member := MSI_Players[i].Member;:
Players[i].WorldInfo := MSI_Players[i].WorldInfo;

Not trying to make you look dumb, I am sure it would take you 20 seconds to add it without me doing that step-by-step instruction… just trying to make it easier for you :)

Yay, I can finally auto tonight without being reported a ton ^_^

ZephyrsFury

2010-11-01 22:29:26

SRL_Procs[srl_OnNextPlayer] := @SwitchWorlds; ?

Oh and yes I believe IceFire added some world switching magic to LoginPlayer.

Harry

2010-11-01 22:54:06

From: ZephyrsFury
Oh and yes I believe IceFire added some world switching magic to LoginPlayer.

Yes, and it works perfectly!

Coh3n

2010-11-01 23:36:11

Okay so Harry, did you add the SRL_Proc, and that's what's working perfect (along with what you added in your previous post)? Also I was thinking, we may not even have to add WorldInfo to DeclarePlayers. We can just set it automatically assuming nobody wants to auto on a PVP world.

Harry

2010-11-01 23:39:33

From: Coh3n
Okay so Harry, did you add the SRL_Proc, and that's what's working perfect (along with what you added in your previous post)? Also I was thinking, we may not even have to add WorldInfo to DeclarePlayers. We can just set it automatically assuming nobody wants to auto on a PVP world.

No, I only changed what I put in simba tags above. That worked for me. Did not even try srl_proc… but I think it'd be better in declareplayers maybe even with a boolean, because most people would use it, but there would be many others who do not want to.

Coh3n

2010-11-01 23:42:02

From: Harry
No, I only changed what I put in simba tags above. That worked for me. Did not even try srl_proc… but I think it'd be better in declareplayers maybe even with a boolean, because most people would use it, but there would be many others who do not want to.

How did it know to switch worlds then? It automatically does in LoginPlayer? Does it switch worlds every time it logs in?

And I would add a constant at the top SWITCH_WORLDS or something. That would be what the user fills out, rather than confusing them with a WorldInfo array.

Harry

2010-11-01 23:43:31

From: Coh3n
How did it know to switch worlds then? It automatically does in LoginPlayer? Does it switch worlds every time it logs in?

Yes it does. It checks if WoldInfo is set in LoginPlayer; if it's set, it follows its options. I was surprised, it is so well made and flexable.


And I would add a constant at the top SWITCH_WORLDS or something. That would be what the user fills out, rather than confusing them with a WorldInfo array.

Yes, good.

Coh3n

2010-11-01 23:46:36

From: Harry
Yes it does. It checks if WoldInfo is set in LoginPlayer; if it's set, it follows its options. I was surprised, it is so well made and flexable.

Wonderful, I'll do this right now. :)

E: Committed. :)