SRL Archive - OSR Help

World changer problems


Cstrike

2010-08-10 00:12:16

Hi there,

I've been trying to get WorldChanger.scar to work for me. So far it works flawlessly in finding a world ONLY if it doesn't have to scroll.
When it has to scroll down to lets say world 60 (or w/e)… it won't find it. Instead it just logs back into the same world. Is there any actual way to fix this?

Also, I tried making my own 'scroller' but I can't use changeworld because it just logs back in.

My current trouble is I can't logout to the lobby without basically scripting everything from scratch. Do I have to script everything from scratch? If it needs to be done, so be it.
Thanks :)

Heavenguard

2010-08-10 00:40:03

From: cstrike
Hi there,

I've been trying to get WorldChanger.scar to work for me. So far it works flawlessly in finding a world ONLY if it doesn't have to scroll.
When it has to scroll down to lets say world 60 (or w/e)… it won't find it. Instead it just logs back into the same world. Is there any actual way to fix this?

Also, I tried making my own 'scroller' but I can't use changeworld because it just logs back in.

My current trouble is I can't logout to the lobby without basically scripting everything from scratch. Do I have to script everything from scratch? If it needs to be done, so be it.
Thanks :)


Thanks for posting =], I forgot to mention this as well. The scroll seems to not work anymore [and i think it stopped working for a good time now]. You can logout to the lobby still though. Just use ExitToLobby;

Cstrike

2010-08-10 01:10:30

Ah thats the code I'm looking for :)

Do you (or anyone else!) think holdmouse would work? Or is that a dangerous function to use?

ZephyrsFury

2010-08-10 04:10:31

From: cstrike
Ah thats the code I'm looking for :)

Do you (or anyone else!) think holdmouse would work? Or is that a dangerous function to use?


HoldMouse to scroll? We tried that before and it was really slow so then I believe Narcle made it click the scroll bar in approximately the right distance down and hoped to find it. Obviously that doesn't work anymore. But using HoldMouse would work.

Shuttleu

2010-08-10 04:21:26

now gonna attempt to fix it

~shut

Shuttleu

2010-08-10 05:57:22

edit your WorldSwitcher.scar with this please
{*******************************************************************************
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, i, x, y, H, CurW: integer;
BarPos: TPoint;
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 Length(WorldArray) < 1 then
LoadWorldArrays;
H := High(WorldArray);
for i := 0 to H do
if (WorldArray[i].Number = W) then
begin
WPos := i+1;
Break;
end;
SPos := Round(WPos/(H+1)*100);
if not WorldsOrdered then
begin
Mouse(116, 125, 4, 4, true);//makes them drop down
WorldsOrdered := true;
wait(500+random(500));
end;
case W of
1..15: BarPos:= Point(700, 162);
16..30: BarPos:= Point(700, 192);
31..44: BarPos:= Point(700, 217);
45..57: BarPos:= Point(700, 241);
58..73: BarPos:= Point(700, 267);
74..87: BarPos:= Point(700, 292);
88..102: BarPos:= Point(700, 315);
103..115: BarPos:= Point(700, 338);
116..135: BarPos:= Point(700, 362);
136..153: BarPos:= Point(700, 385);
154..169: BarPos:= Point(700, 409);
end;
Mouse(BarPos.x, BarPos.y, 0, 0, true);
wait(300+Random(100));
Result := IsTextInAreaEx(84, 134, 134, 440, X, Y, IntToStr(W) + ' ', 0, StatChars, False, False, -1, 2, 16579836) or
IsTextInAreaEx(84, 134, 134, 440, X, Y, IntToStr(W) + ' ', 0, StatChars, False, False, -1, 2, 6618364);
end;
and let me know how it goes

~shut

ZephyrsFury

2010-08-10 06:55:54

Should probably make it this:


case W of
1..15: BarPos:= Point(700, 162);
16..30: BarPos:= Point(700, 192);
31..44: BarPos:= Point(700, 217);
45..57: BarPos:= Point(700, 241);
58..73: BarPos:= Point(700, 267);
74..87: BarPos:= Point(700, 292);
88..102: BarPos:= Point(700, 315);
103..115: BarPos:= Point(700, 338);
116..135: BarPos:= Point(700, 362);
136..153: BarPos:= Point(700, 385);
else BarPos:= Point(700, 409); //edit here
end;

so that if they Jagex adds new worlds, theres a chance the function might work still.

For the person who adds this also add a check for W (world number) equaling zero and exit accordingly.

Cstrike

2010-08-10 11:07:52

The code works really well. Thank you to both above… I've been testing it rigorously with various worlds [only p2p] and it works awesome. Thanks once again!

Heavenguard

2010-08-10 12:53:27

Wow thanks for fixing it, great job. Please do commit =].

Nava2

2010-08-10 13:24:43

I think that could be done with some maths, removing the ugly case and would allow the function to adapt to changes.

E: Not to mention you are clicking an exact co-ord each time.

NCDS

2010-08-10 15:15:57

From: Nava2
I think that could be done with some maths, removing the ugly case and would allow the function to adapt to changes.

E: Not to mention you are clicking an exact co-ord each time.


He at least uses randomness, but a MouseBox would be more "human-like".

Shuttleu

2010-08-10 18:21:29

From: Nava2
I think that could be done with some maths, removing the ugly case and would allow the function to adapt to changes.

E: Not to mention you are clicking an exact co-ord each time.


well you could easily add a bit of randomness cant you…?

~shut

ZephyrsFury

2010-09-04 06:56:41

Added Shuttleu's fix for FindWorld. Cheers Shuttleu :)