SRL Archive - OSR Help

Log in to specific world ?


illuminatiswag

2012-01-17 23:58:25

is it possible to add a function to a script so it longs into a certain world ? and if so and you know how could you please whip it up if you got time or show me where i can find it please and thank you

kevin33

2012-01-18 00:01:05

Is it to switch worlds? Is this not what it uses to sign into a world:

SMART_Server := 4; //this guy
SMART_Signed := True;
SMART_Members := False;

YoHoJo

2012-01-18 00:02:43

^ Common misconception.

SMART Automatically logs into the server which Runescape says you have the least (best) ping for. Setting SMART_Server does nothing!

kevin33

2012-01-18 00:04:31

From: YoHoJo
^ Common misconception.

SMART Automatically logs into the server which Runescape says you have the least (best) ping for. Setting SMART_Server does nothing!


Thanks for clearing that up. I had no idea, I just figured server…world probably world number.
So now unfortunately I cannot help cuz I have no idea.

YoHoJo

2012-01-18 00:06:21

The reason people leave that line in though, is because without it, a new SMART pops up each time you stop/start a script.
By leaving SmartSrver set to any # world, you are able to start/stop script as much as you want, without the SMART window closing on you each restart.

:D Good info from a vet!

NickMystre

2012-01-18 00:08:15

From: kevin33
SMART_Server := 4; //this guy


Isn't this setting used to prevent your SMART Runescape client from closing / restarting each time you start the same script with it in (if you keep the server number the same ?

EDIT: O bother … Beaten to the punch by YoHoJo. Or is that what u call being ninja'd ?

kevin33

2012-01-18 00:08:34

From: YoHoJo
The reason people leave that line in though, is because without it, a new SMART pops up each time you stop/start a script.
By leaving SmartSrver set to any # world, you are able to start/stop script as much as you want, without the SMART window closing on you each restart.

:D Good info from a vet!


Will implement that into script im making, I was wondering why that kept happening to me lol.

As for the problem, I might actually have found the answer. Its a function:

{*******************************************************************************
Function SelectWorld(W: Integer): Boolean;
by: Narcle & ZephyrsFury
Description: Switches to the specified world. Returns true if successful.
*******************************************************************************}
function SelectWorld(W: integer): boolean;
var
x, y, xx, yy, T, CurW: integer;
WRec: TWorld;
begin
if OpenWorldScreen then
begin
T := GetSystemTime + 60000;
Repeat
Wait(100+random(100));
until InRange(CountColorTolerance(SRL_WS_ARROWCOLOR, 0, 0, 716, 240, 1), 550, 650) or (GetSystemTime > T);
if (GetSystemTime > T) then
begin
Writeln('World screen did not load after a minute, please refreash.');
Exit;
end;
WS_CurrentWorld(CurW);
if (W = CurW) then
begin
Result := True;
WriteLn('Already on world ' + IntToStr(W));
Exit;
end;

if FindWorld(W) then
begin
wait(100+random(100));
if GetWorldInfo(W, WRec) then
begin
Writeln('World: '+inttostr(WRec.Number)+', Players: '+inttostr(WRec.PlayerNo)+', Members: '+Booltostr(WRec.Members)+', PvP: '+Booltostr(WRec.PVP));
if FindText(x, y, ' '+inttostr(W)+' ', StatChars, 84, 134, 140, 440) then
begin
MMouse(x, y, 500, 4);
GetMousePos(x, y);
wait(400+random(100));
if FindColor(xx, yy, 6316128, x-20, y-2, x+20, y+2) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
if FindColor(xx, yy, 19890, x-20, y-2, x+20, y+2) then
begin
Writeln('World '+inttostr(W)+' selected.');
Result := true;
end;
end;
end;
end else
if WRec.PlayerNo = -2 then
WriteLn('World ' + IntToStr(W) + ' is FULL.')
else
WriteLn('World ' + IntToStr(W) + ' is OFFLINE.')
end else
WriteLn('Failed to find World ' + IntToStr(W) + '!');
if (not(Result)) then TypeByte(vk_Escape);
end;
end;

And this to find it:

function FindWorld(W: integer): Boolean;
by: Narcle
Description: Scrolls to area and returns true if world was found
*******************************************************************************}
function FindWorld(W: integer): Boolean;
Var
WPos, SPos, CurPos, i, H, CurW, TextColor: integer;
BarHeight, WorldsOnScreen: integer;
p: TPoint;
TPA, TPA2, TPA3: TPointArray;
SP, SB: TBox;
begin
if not WorldScreen then
Exit;
WS_CurrentWorld(CurW);
if (W = CurW) then
begin
Result := True;
WriteLn('Already on world ' + IntToStr(W));
Exit;
end;
if (W = 0) then
begin
srl_Warn('FindWorld', 'World Number cannot be 0', warn_AllVersions);
Exit;
end;

if not WorldsOrdered then
begin
if not OrderWorlds('w', True) then
begin
Writeln('FindWorld: Could not order worlds properly.');
Exit;
end;
WorldsOrdered := true;
wait(400+random(200));
end;

FindColorsTolerance(TPA, SRL_WS_SCROLLCOLOR1, 680, 1, 705, 500, 0);//These coords determine the scroll bars general area, it deviates everything.
SB := GetTPABounds(TPA);
With SB do
begin
FindColorsTolerance(TPA2, SRL_WS_SCROLLCOLOR1, x1+3, y1, x1+3, y2, 0);//SRL_WS_SCROLLCOLOR1
FindColorsTolerance(TPA3, SRL_WS_SCROLLCOLOR2, x1+3, y1, x1+3, y2, 0);//SRL_WS_SCROLLCOLOR2
end;
TPA2 := CombineTPA(TPA2, TPA3);
SP := GetTPABounds(TPA2);

BarHeight := (SP.Y2-SP.Y1);
WorldsOnScreen := (SB.y2-SB.y1+32) div 42;//This is HALF of the worlds on screen. I don't use the full amount.

if Length(WorldArray) < 1 then
LoadWorldArrays;
WPos := -1;
H := High(WorldArray);
for i := 0 to H do
if (WorldArray[i].Number = W) then
begin
WPos := i;
if i < (WorldsOnScreen) then
WPos := 0;
if i > (H+1-(WorldsOnScreen)) then
WPos := (H+1);
if WorldArray[i].Members then
TextColor := SRL_WS_YELLOWCOLOR
else
TextColor := SRL_WS_WHITECOLOR;
Break;
end;

if WPos = -1 then
begin
srl_Warn('FindWorld', 'World '+IntToStr(W)+' does not exist in worlds.ini ', warn_AllVersions);
Exit;
end;

SPos := (SB.y1+BarHeight div 2) + (WPos)*(SB.y2-SB.y1-BarHeight) div (H+1-WorldsOnScreen);//need the 0.0 to make it extended inside ()
CurPos := (SP.y1 + BarHeight div 2);
{$IFDEF SIMBA}
Debugln('SCROLLINFO: CurPos: '+ToStr(CurPos)+' WPos: '+ToStr(WPos)+' H+1: '+ToSTr(H+1)+' SPos: '+ToStr(SPos));
{$ENDIF}
if InRange(SPos, CurPos - BarHeight, CurPos + BarHeight) then
begin//if its too close the scroll bar won't move to correct position
if (CurPos < ((SB.y1+BarHeight div 2)+ (SB.y2-SB.y1-BarHeight) div 2)) then//half point
Mouse((SB.x1 + (SB.x2-SB.x1) div 2), SB.y2, 0, 0, true)
else
Mouse((SB.x1 + (SB.x2-SB.x1) div 2), SB.y1, 0, 0, true);
end;

//Writeln('SPos := '+ToStr(SPos));
Mouse((SB.x1 + (SB.x2-SB.x1) div 2), SPos, 0, 0, true);
wait(300+Random(100));
Result := IsTextInAreaEx(84, 134, 134, 440, p.X, p.Y, IntToStr(W) + ' ', 0, StatChars, False, False, -1, 2, TextColor);
end;

YoHoJo

2012-01-18 00:09:14

^ That's SRL 4 :p but where was that located?
WHAT.simba/scar?

E:
worldswitcher!

kevin33

2012-01-18 00:10:44

From: YoHoJo
^ That's SRL 4 :p but where was that located?
WHAT.simba/scar?

E:
worldswitcher!


Correct, but could he not update it or ask someone to help him update it so he can use it??

YoHoJo

2012-01-18 00:11:50

What? I'm saying the copy/paste YOU put is SRL4! :p

kevin33

2012-01-18 00:13:12

LOL I know. It was from the function list under worldswitcher. Im all updated I just figured I would take a look for him and I found it there so I copied and pasted it. No SRL5 version for it he could use or could he rewrite that to work with SRL5??

bolshak25

2012-01-18 18:44:46

WorldInfo   := [False, 1, False] //[Members, World, PVP] meaning do you want a members world?, if you want one specific world(sometimes it cant find it so it picks a random world based on the other two settings), do you want a pvp world?  
put that in your declare players. it would put you in world 1

illuminatiswag

2012-03-13 20:40:57

From: bolshak25
WorldInfo   := [False, 1, False] //[Members, World, PVP] meaning do you want a members world?, if you want one specific world(sometimes it cant find it so it picks a random world based on the other two settings), do you want a pvp world?  
put that in your declare players. it would put you in world 1


Im getting this [Error] (36:3): Unknown identifier 'worldinfo' at line 35
Compiling failed.

bolshak25

2012-03-13 20:55:45

From: illuminatiswag
Im getting this [Error] (36:3): Unknown identifier 'worldinfo' at line 35
Compiling failed.


can you show me which declare players setup you have?