SRL Archive - Outdated Tutorials

[#44] Recent changes to the Include


Wanted

2010-03-10 02:41:01

In response to the March 3rd, 2010 game updates to RS, a few changes to the include have been made noticeable since then.

GameTab.scar


Lobby tabs have been added

function LobbyScreen: Boolean;
function GetLobbyTab: Integer;
function LobbyTab(Tab: Integer): Boolean;
LeaveLobby; //is actually in login

const
L_PlayerInfo = 1;
L_WorldSelect = 2;
L_FriendsList = 3;
L_ClanChat = 4;
L_Options = 5;

GetMMLevels will not return your constitution level, but rather the number on the minimap.

However, function HPPercent: Integer; will return your actual percentage.

Login.scar


This is a big one.

Logout will function like the last one, it will take you all the way completely logged out to before the lobby, if you would like to just exit to the lobby you can use ExitToLobby instead.

I have just recently added LoginPlayerToLob, which will function normally as LoginPlayer but only take you up to the lobby screen. LoginPlayer will still function the same as normal and use LoginPlayerToLob within it. I have also reorganized the login procedure and double checked and tweaked all the fail safes/error checks ect as well as added some new failsafes and features you can read about below…. you will be very satisfied with the current quality of login player.

WorldSwitcher.scar


Now officially works with the new update, a new and easy way to switch worlds is by using the new Players[…].WorldInfo in the player record.

How this works is very simple.

If you wish to use LoginPlayer like you have in the past without any other details than simply omit all of this below as it will not affect you in anyway :)

However, if you wish to switch worlds for players and such I will briefly explain how to use this new system.

WorldInfo is a TVariantArray and depending on what you put in it, it will select a server to play on.

There's two ways to use it,

There first way is to login to a specific world, to do this you will need to set the array length to two, have the first one the members boolean and the 2nd one the world integer.

Players[0].WorldInfo := [False {True for Members}, 38];

The other way to do this is to have it login to a random world, to do this you will need to set the array length to three, have the first one members boolean, the 2nd doesn't matter at all so just 0 or -1, and the 3rd one needs to be the PvP boolean (false for no PvP worlds)

Players[0].WorldInfo := [False, -1, False];

Then when you call LoginPlayer, it will automatically do all this with the integrated world switcher :)

If you wish to make a more custom way, then simply don't ever declare any player's WorldInfo's and use

LoginPlayerToLob;
//Custom Stuff
LoginPlayer;

If there are any detailed questions to how the system works, there is always the source to look at, as Players[].Member and AllowPVP have not been removed they may still affect how your script runs based on the hierarchy of overrides in the include, if you intend to use PvP worlds I recommend you set AllowPVP := True after SetUpSRL.

World switcher.scar works slightly different now.

Just keep in mind the ChangeWorld only takes you to the lobby instead of logging you all the way out, and that SelectWorld will only click the world and not click "Click here to play afterwards"

Sorry if anything you just read was hard to understand, it's 2 AM and I've been raging/tired because of a few really stupid problems I had doing all this.

Any feedback would be appreciated, and anyone who can is welcome to edit this thread.

Cheers

-IceFire908

YoHoJo

2010-03-10 02:50:04

Amazing, great work, love it! Great dedication, sleep well sexy.

Naum

2010-03-10 02:51:18

Good work!!
Good to see SRL was on its feet before 72 hours!
Thanks to anyone who helped :)

EDIT: Sleep very well.

i luffs yeww

2010-03-10 03:11:37

So you got the TVariantArray figured out? Or are you doing something else? Array of Boolean or something? If..then? :p I can't check because I'm not on a computer, but good work nonetheless. ^^

And Naum, I'm not trying to sound rude or sarcastic or anything, but do you personally think that we could get to the point of being fully functional from RuneScape updates in 24 hours? (As long as they aren't huge things like RuneTek5 and whatnot.) I'm just wondering because I think that'd be a good way to keep people involved. :)

YoHoJo

2010-03-10 03:31:10

Maybe, if everyone worked together and hard. We were functional withing 24 hours kind of (Login function was working) which is all we really needed to auto.

Just really depends on the size of the update and the number/speed of people working on it.

Anything's Possible!

tarajunky

2010-03-10 10:06:41

When I updated to the latest version, smart now logs in, hangs for about one minute, then says "One minute has passed…". Then it will continue on as normal.

It wasn't pausing like that for the latest version before this one.

Sir R. M8gic1an

2010-03-10 10:16:46

Why would you allow strings in gametab…?

Moving this.

~RM

Wanted

2010-03-10 10:36:42

From: tarajunky
When I updated to the latest version, smart now logs in, hangs for about one minute, then says "One minute has passed…". Then it will continue on as normal.

It wasn't pausing like that for the latest version before this one.


Simple fix probably, if someone will do it. It worked as far as I tested last night, although it was 2 am.

From: Rasta Magician
Why would you allow strings in gametab…?

Moving this.

~RM


Well you called Gametab in Timing.scar, which caused SRL not to compile, and the only way for that work work was to forward about 5 functions, and the consts couldn't be moved so I did an array then called 'inv' which does an InStrArrEx and adds the lowest tab number const so it's consistent with the latest tab numbers. Luke, use the source ;)

Sir R. M8gic1an

2010-03-10 11:34:39

From: IceFire908
Simple fix probably, if someone will do it. It worked as far as I tested last night, although it was 2 am.



Well you called Gametab in Timing.scar, which caused SRL not to compile, and the only way for that work work was to forward about 5 functions, and the consts couldn't be moved so I did an array then called 'inv' which does an InStrArrEx and adds the lowest tab number const so it's consistent with the latest tab numbers. Luke, use the source ;)


wtf…?

Just include Timing.scar after Gametab, since none of the others use Timing.scar? And wth didn't compile? I've been running it for ages….

question remains, why strings? The whole of SRL is moving away from strings! Worst case scenario just stick the consts in globals.scar!

~RM

Wanted

2010-03-10 11:45:17

From: Rasta Magician
wtf…?

Just include Timing.scar after Gametab, since none of the others use Timing.scar? And wth didn't compile? I've been running it for ages….

question remains, why strings? The whole of SRL is moving away from strings! Worst case scenario just stick the consts in globals.scar!

~RM



I just answered why I used strings

                 if (InStrArrEx(LowerCase(TheTab), AllTabs, Tab)) then
IncEx(Tab, tab_Combat)
else
Tab := -1;

I can't put Gametab before timing, I would have to forward like 15 functions into gametab if I did that, you made a committ calling Gametab in timing and this was the only sensible way of fixing it.

http://bugs.villavu.com/view.php?id=123

Edit: Well if someone wants to move the tab consts to globals, then do it. The only instance of a string in gametab is the one in Timing.scar

Narcle

2010-03-10 18:30:43

From: Rasta Magician
wtf…?

Just include Timing.scar after Gametab, since none of the others use Timing.scar? And wth didn't compile? I've been running it for ages….

question remains, why strings? The whole of SRL is moving away from strings! Worst case scenario just stick the consts in globals.scar!

~RM


Then you have a messed up version of SRL. Everyone including myself couldn't compile SRL after that added GameTab to timing.scar. So the forward was needed as IceFire stated you would need to forward 15 functions if you placed Timing.scar before GameTab.

Wanted

2010-03-10 20:43:14

From: tarajunky
When I updated to the latest version, smart now logs in, hangs for about one minute, then says "One minute has passed…". Then it will continue on as normal.

It wasn't pausing like that for the latest version before this one.


I tried as hard as I could to replicate your error. Just a few questions

1) Tested in SCAR or simba?
2) Tested from the most logged out as possible, before you click members/free?
3) Test w/ SMART? without SMART?

I've tested in SCAR w/ and without SMART and it worked O_o

I change the TimeFromMark to if ((GetSystemTime - T) > 60000) then .. doubt that changes anything though

Can anyone else confirm?

Yea so, I reverted Gametab to only take consts and moved the gameconsts to globals.scar x] already edited it out of the first post :)

tarajunky

2010-03-10 23:06:22

This is my ChickenKiller with SCAR, the most logged out possible, after setting it to fixed and low detail manually.

It's with SMART, on an unsigned client and a non-members world.

It only seems to happen the first time it logs in. It logs in, sits there for 1 minute, spits out the "one minute has passed…" text, and the continues on as if nothing was out of the ordinary.

I don't get the "one minute has passed…" text after it logs out and does NextPlayer to log back in.

It's a minor issue, but hopefully that will help track it down.

Wanted

2010-03-10 23:47:14

From: tarajunky
This is my ChickenKiller with SCAR, the most logged out possible, after setting it to fixed and low detail manually.

It's with SMART, on an unsigned client and a non-members world.

It only seems to happen the first time it logs in. It logs in, sits there for 1 minute, spits out the "one minute has passed…" text, and the continues on as if nothing was out of the ordinary.

I don't get the "one minute has passed…" text after it logs out and does NextPlayer to log back in.

It's a minor issue, but hopefully that will help track it down.


Hmm, low detail? You mean safe mode?

Tried rev 417 yet?


The few other people I asked to test reported no problems yet…. hmmm odd.

silor

2010-03-11 04:32:37

Nevermind, tried redownloading everything and it compiles fine.

just tried the new world selecting with LoginPlayer and worldinfo declared, it clicks on the favorite world then goes to the scroll bar and says it couldn't find the world and clicks the Click here to play button.

Wanted

2010-03-11 16:39:17

From: silor
Nevermind, tried redownloading everything and it compiles fine.

just tried the new world selecting with LoginPlayer and worldinfo declared, it clicks on the favorite world then goes to the scroll bar and says it couldn't find the world and clicks the Click here to play button.


Delete all your favorite worlds :duh: