SRL Archive - SRL Archives

Procedure SwitchWorld.....


TheGodfather

2007-04-09 02:00:08

Hey, since there's been such contreversy on the new world switching bs Jagex has made, and so many people wanna take a whack at making an include for it, I've decided to do so too :S …

Heres what I've got.

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Signed WorldSwitch routines --//
//-----------------------------------------------------------------//

// * Function WorldMenu: Boolean; // * TheGodfather
// * Procedure OpenWorldMenu; // * TheGodfather
// * Procedure WorldCoords(WWorld: integer); // * TheGodfather
// * Procedure SwitchWorld(World: integer; Backup: Boolean; World2: integer) // * TheGodfather

//*****************************************************************//

{*******************************************************************************
Function WorldMenu : Boolean;
by: TheGodfather
Description: Checks if the world menu is open. True if so.
*******************************************************************************}
Function WorldMenu : Boolean;
Begin
if (GetColor(712, 12)= 0) and
(GetColor(660, 380)= 0) then result:= true;
End;

{*******************************************************************************
Procedure OpenWorldMenu;
by: TheGodfather
Description: Opens the world menu if not already open.
*******************************************************************************}
Procedure OpenWorldMenu;
Begin
if (not (WorldMenu) ) and (not (LoggedIn) ) and
(GetColor(328, 246)= 65535) and
(GetColor(312, 249)= 65535) then
begin
Mouse(50, 480, 7, 7, true);
end;
End;

{*******************************************************************************
Procedure WorldCoords(WWorld : integer);
by: TheGodfather
Description: The world coords, and also moves the mouse to the selected world.
*******************************************************************************}
Procedure WorldCoords(WWorld : integer);
Begin
case WWorld of
1 : MMouse(80, 44, 5, 5);
2 : MMouse(80, 67, 5, 5);
3 : MMouse(80, 90, 5, 5);
4 : MMouse(80, 113, 5, 5);
5 : MMouse(80, 136, 5, 5);
6 : MMouse(80, 159, 5, 5);
7 : MMouse(80, 182, 5, 5);
8 : MMouse(80, 205, 5, 5);
9 : MMouse(80, 228, 5, 5);
10 : MMouse(81, 251, 5, 5);
11 : MMouse(81, 274, 5, 5);
12 : MMouse(81, 297, 5, 5);
13 : MMouse(81, 320, 5, 5);
14 : MMouse(81, 343, 5, 5);
15 : MMouse(81, 365, 5, 5);
16 : MMouse(81, 388, 5, 5);
17 : MMouse(81, 411, 5, 5);
18 : MMouse(81, 434, 5, 5);
19 : MMouse(81, 458, 5, 5);
20 : MMouse(82, 481, 5, 5);
end;
End;

{*******************************************************************************
Procedure SwitchWorld(World: integer; Backup: Boolean; World2: integer);
by: TheGodfather
Description: Switches to world using signed world switcher menu
*******************************************************************************}
Procedure SwitchWorld(World: integer; Backup: Boolean; World2: integer);

var
SWorld, BWorld : integer; BSwitch : Boolean;

Begin

if (LoggedIn) then LogOut;

Wait(1250 + random(1250));

if (not (WorldMenu) ) then OpenWorldMenu;

Wait(2500 + random(2000));
MouseSpeed:= MouseSpeed + 5 + random(5);

SWorld:= world;
if WorldMenu then
begin
WorldCoords(SWorld);
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

Wait(2500 + random(500));

if WorldMenu then
begin
BSwitch:= true;
Writeln('cannot connect to world '+IntToStr(SWorld));
if (not (Backup) ) then Mouse(735, 12, 3, 3, true);
end;

if (BSwitch) and (Backup) then
begin
BWorld:= world2;
WorldCoords(BWorld);
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

Wait(2500 + random(500));

if WorldMenu then
begin
Writeln('cannot connect to world '+IntToStr(BWorld));
Writeln('Both desired worlds failed.');
Wait(1500 + random(1000));
Mouse(735, 12, 3, 3, true);
end;

End;
sorry if the paste looks wierd.

Post comments and suggestions please :)

The main proc is SwitchWorld




Here's what I used for testing it…

Mr. Freeweed

2007-04-10 13:12:48

1 : MMouse(80, 44, 5, 5);
2 : MMouse(80, 67, 5, 5);
3 : MMouse(80, 90, 5, 5);
4 : MMouse(80, 113, 5, 5);
5 : MMouse(80, 136, 5, 5);
6 : MMouse(80, 159, 5, 5);
7 : MMouse(80, 182, 5, 5);
8 : MMouse(80, 205, 5, 5);
9 : MMouse(80, 228, 5, 5);
10 : MMouse(81, 251, 5, 5);
11 : MMouse(81, 274, 5, 5);
12 : MMouse(81, 297, 5, 5);
13 : MMouse(81, 320, 5, 5);
14 : MMouse(81, 343, 5, 5);
15 : MMouse(81, 365, 5, 5);
16 : MMouse(81, 388, 5, 5);
17 : MMouse(81, 411, 5, 5);
18 : MMouse(81, 434, 5, 5);
19 : MMouse(81, 458, 5, 5);
20 : MMouse(82, 481, 5, 5);


instead try this =)

Procedure WorldCoords(WWorld : integer);
begin
x:=80
y:=(23*wworld+44);
MMouse(x, y, 5, 5);
end;

gets rid of that unnessary code =P

TheGodfather

2007-04-10 14:46:39

From: Mr. Freeweed



instead try this =)

Procedure WorldCoords(WWorld : integer);
begin
x:=80
y:=(23*wworld+44);
MMouse(x, y, 5, 5);
end;

gets rid of that unnessary code =P


I know about that. I find the uneccessary code an easier way to edit and add worlds to the list. And if Jagex updates the world list for an example, I wouldnt have such trouble fixing the world list.