SRL Archive - SRL Archives

WorldSwitching include


Fourscape

2007-04-01 13:12:39

This is not completely finished yet, it only works for worlds 1-20. It checks if the world you want is full. Gives you the option to open the world if it is not full. I made a sample script to test out how it works. For the sample I just put the include in the srl/srl/core

I just want to know how you would have done something different, and how I could fix it up. I have seen a few world switchers already and thaught I would give it a shot.

Procedures and Functions are…

Procedure LoadWorldBitmaps;
Loads the bitmaps.

Function MenuIsOpen : Boolean;
Will return true if world menu is open.

Function OpenMenu : Boolean;
If world menu is not open, it will open it.

Function SwitchToWorld(WorldNumber : Integer) : Boolean;
Checks if menu is open, opens if it is not, looks for specified world, will click if it is not full, will exit if it is full.

Ejjman

2007-04-01 13:27:36

It works!…But its ever so slow.

Sumilion

2007-04-01 14:24:58

Yeh er, i dont like all the bitmaps :) maybe use CreateBitmapMaskFromText if you want to do it like this .. ?

Fourscape

2007-04-01 15:10:00

I do, I tried that and when I did World 2, sometimes it went to World 20… Know how to fix it?

Pentti

2007-04-01 15:28:43

From: Sumilion
Yeh er, i dont like all the bitmaps :) maybe use CreateBitmapMaskFromText if you want to do it like this .. ?

Ye rather use function what Sumilion told.

:D Hmm.

moparisthebest

2007-04-01 16:06:04

I made something like this about 2 years ago, and found it is much easier to hit the tab button a certain amount of times instead of looking for bitmaps and clicking.

Tab and enter are your friends ;)

TOB

2007-04-02 14:23:40

From: moparisthebest
I made something like this about 2 years ago, and found it is much easier to hit the tab button a certain amount of times instead of looking for bitmaps and clicking.

Tab and enter are your friends ;)


You are mistaken. This is for the world switcher on the RuneScape client.

—

I didn't check your code but you would be better off having it sort by world then using text read functions to find the number of players in desired world.

Make a function that you can put an array of integer to try the worlds if under x number of players in that order. If all are over that number then randomly pick a world(random selection could be by the top one on free sorting or by least players.)

TheGodfather

2007-04-06 00:00:29

From: fourscape
I do, I tried that and when I did World 2, sometimes it went to World 20… Know how to fix it?


Do something like…. note its not accurate for scripting but it'll work if you know what im talking about

Make something like a Boolean function for the world picking

Begin
Result:= false;
if FindBitmap(2, x, y) then
begin
x1:= x - 6
y1:= y - 6
x2:= x + 20
y2:= y + 20
if( not(FindBitmapIn(20, x, y, x1, y1, x2, y2) then
result:= true;
end;

Of course this isnt accurate to scar, but it looks simalair. Too bad I dont have SCAR on this computer.

Basically what it does it finds that 2, and that makes a box around the two and searches for 20 in the box that the 2 you found is in. If it finds the 20, then the result doesn't become true. If it does NOT find it, the result becomes TRUE.

moparisthebest

2007-04-06 16:50:33

Oops, sorry I thought you were talking about old-style world switching through the webpages. :)