PDA

View Full Version : InGame World Switch button!!!!



WT-Fakawi
03-20-2007, 11:17 AM
Yoho, Good update. Now there is a World Switcher ingame!!!! We can now switch worlsd from within the regular rs-client windowhandle!

Start working on that guys :)

Yakman
03-20-2007, 12:53 PM
i cant get onto runescape here,
but it seems to me like they want to slowly outlaw SwiftSwitch and other clients

you know how the first time you load a world, it has the colours darker than normal, when you walk past a loading screen, they are normal
do these darker colours come back when you switch within the client?

m0u53m4t
03-20-2007, 01:20 PM
Im sure we'll have a working bit of code for that in 2 days...

Mjordan
03-20-2007, 01:32 PM
i cant get onto runescape here,
but it seems to me like they want to slowly outlaw SwiftSwitch and other clients

you know how the first time you load a world, it has the colours darker than normal, when you walk past a loading screen, they are normal
do these darker colours come back when you switch within the client?

You also have to be on a signed applet to use it. Im thinking they are trying to get everyone(mainly us) to play on signed so they can link characters and ban more???

Boreas
03-20-2007, 01:32 PM
"unfortunately it is not available if you're using the unsigned version of the applet" keep that in mind

Sumilion
03-20-2007, 02:20 PM
program New;
{.include SRL.scar}

procedure WorldButtonCoordinates(WorldPlace: Integer; var WorldCoord1, WorldCoord2: TPoint);
var
World_Column, World_Row, Count, tmpWorldPlace: Integer;
begin
if(WorldPlace <= 20)then
begin
World_Column := 0;
World_Row := WorldPlace - 1;
end else
begin
repeat;
Count := Count + 1;
tmpWorldPlace := WorldPlace - (Count * 20);
until(tmpWorldPlace <= 20);
World_Column := Count;
World_Row := tmpWorldPlace - 1;
end;
//Writeln('Column = ' + IntToStr(World_Column) + ' Row = ' + IntToStr(World_Row));
WorldCoord1.x := 59 + (World_Column * 93);
WorldCoord1.y := 35 + (World_Row * 23);
WorldCoord2.x := WorldCoord1.x + 87;
WorldCoord2.y := WorldCoord1.y + 18;
end;

procedure ChangeWorld(WorldPlace: Integer; F2P, QuietServer: Boolean);
var
tmpMask: Integer;
WorldCoord1, WorldCoord2: TPoint;
begin
tmpMask := CreateBitmapMaskFromText('orld', upchars);
if (FindBitmapMaskTolerance(tmpMask, x, y, 0, 461, 106, 501, 10, 50))then
begin
MouseBox(19, 471, 93, 491, 1);
Wait(200 + Random(200));
if(QuietServer)then
begin
Mouse(411, 12, 3, 3, True);
Wait(100 + Random(100));
end else
begin
Mouse(396, 11, 3, 3, True);
Wait(100 + Random(100));
end;
if(F2P)then
begin
Mouse(632, 13, 3, 3, True);
Wait(100 + Random(100));
end else
begin
Mouse(616, 13, 3, 3, True);
Wait(100 + Random(100));
end;
end else
Writeln('Your most likely in Unsigned java, no world switch.');
FreeBitmap(tmpMask);
WorldButtonCoordinates(WorldPlace, WorldCoord1, WorldCoord2);
MouseBox(WorldCoord1.x, WorldCoord1.y, WorldCoord2.x, WorldCoord2.y, 1);
Wait(300 + Random(500));
end;

begin
SetupSRL;
ActivateClient;
Wait(500);
ChangeWorld(Random(10), True, True);
end.

Cmon! I need a real challenge !! *cough* Lets get back to studying ...

EDIT : Commit it ?

Wizzup?
03-20-2007, 03:37 PM
Sumilion, that indeed isn't much of a challenge. :p

m0u53m4t
03-20-2007, 03:59 PM
Nice going Sum. I figured 24 hours until a new piece of code :p

Secet
03-20-2007, 04:02 PM
So... What do you think, is it a big risk to use normal java, instead of Unsigned? Because I think they are trying to get us to use normal java so they can ban us easily.

Btw, could someone explain why is it more dangerous to use normal java instead of unsigned?

Sumilion
03-20-2007, 04:52 PM
Sumilion, that indeed isn't much of a challenge. :p

Haha ^^ but you like it ? :p

Yakman
03-20-2007, 04:57 PM
So... What do you think, is it a big risk to use normal java, instead of Unsigned? Because I think they are trying to get us to use normal java so they can ban us easily.

Btw, could someone explain why is it more dangerous to use normal java instead of unsigned?

to be honist, i mostly use the signed applet
its because my computer runs faster with it, and i normally do 'safe' things in terms of autoing, like autofighing or pottery

the reason its more dangerous is because of the uid.dat file which can link your accounts, so if one gets banned, jagex might look at other accounts on that uid,
but i havent heard any evidence that they do, but i might be wrong

Wizzup?
03-20-2007, 08:02 PM
the reason its more dangerous is because of the uid.dat file which can link your accounts, so if one gets banned, jagex might look at other accounts on that uid,
but i havent heard any evidence that they do, but i might be wrong

They do, I am 100% that they do!
I that is how "Sumilion" got banned too (and some other of his accs)

Sumilion
03-20-2007, 08:04 PM
Or it was a freaky coincidence or it was UID, but 2 accs got banned, Yakman knows this though ...

bullzeye95
03-20-2007, 10:35 PM
They actually did something right for once! This is pretty cool :)

Ron
03-20-2007, 11:11 PM
They changed the chickens. So all chicken killers stopped working.

danrox2004
03-21-2007, 10:26 AM
Heh i just made one... I think its more complete then Summilions but im sure he could make it better if he had time :)

Well here it is:
function GetXY(World: integer; var x, y: Integer): Boolean;
var
column, row: integer;
begin
World := World - 1;
Row := World mod 20;
Column := trunc((World/20));
x := 137 + (Column * 93);
y := 42 + (Row * 23);
Result := True;
end;

function ArrangeWorlds(Arrow: Integer): Boolean;
var
Buttons: Array[1..8] of Integer;
begin
Buttons[1]:=283;
Buttons[2]:=298;
Buttons[3]:=393;
Buttons[4]:=408;
Buttons[5]:=503;
Buttons[6]:=518;
Buttons[7]:=613;
Buttons[8]:=628;
If(GetColor(Buttons[Arrow], 7) = 265388)then
begin
Mouse(Buttons[Arrow], 7, 3, 3, True);
ArrangeWorlds(Arrow);
end else
Result := True;
end;

function CheckFree(World: Integer): Boolean;
var
x, y: Integer;
begin
GetXY(World, x, y);
Result:= ((SimilarColors(GetColor(x, y), 14079702, 5))
or (SimilarColors(GetColor(x, y), 15395562, 5)));
end;

function ChooseWorld(World: integer): Boolean;
begin
GetXY(World, x, y);
Mouse((x - 74), (y - 5), 83, 14, True);
Result := True;
end;

function CheckOpenChooseWorld: Boolean;
begin
Result := ((GetColor(19, 58)=0) and (GetColor(641, 430)=0));
end;

function OpenChooseWorld: Boolean;
begin
if(CheckOpenChooseWorld) then
begin
Result := True;
Exit;
end
if(GetColor(718, 413) = 6055005) then
begin
Mouse(10, 465, 90, 30, True);
wait(1000+random(1000));
OpenChooseWorld;
end
end;

function ChooseFirst(Free: Boolean): Boolean;
var
i :integer;
begin
for i:= 1 to 100 do
begin
if(CheckFree(i)=Free) then
begin
ChooseWorld(i);
Result := True;
Exit;
end
end
end;

Contains lots of mini functions lol

How to use:
ArrangeWorlds - Clicks on one of the arrows specified, 1 being the first arrow, 8 being the last.
CheckFree - Checks if specified world is free.
ChooseWorld - Clicks on world
CheckOpenChooseWorld - Returns true if world select window is up
OpenChooseWorld - Opens world select window
ChooseFirst - Chooses the first member / free world on the list

With ChooseFirst you can arrange it by lowest players with ArrangeWorlds(4) then choose the first free world on the list. May work on this further but this is all im doing tonight.

By the way - This uses coordinates and colours - no text or bmps or anything... should be quicker.

BTW you will need to get the handle of the client every time you change worlds, it refreshes the page.

Example use:
OpenChooseWorld;
ArrangeWorlds(4);
ChooseFirst(True);

This opens change world screen, changes it to sort by lowest players if needed and selects the first free world from the list.

Anyone that got it before i edited, i made a typo... Get new version

Edit:
Added two more functions:
CheckFull - Returns true if world is full
ChooseFirstNotFull - Chooses first non full world


function CheckFull(World: Integer): Boolean;
var
x, y: integer;
begin
GetXY(World, x, y);
if((GetColor((x - 28), (y - 2))=16777215) and
(GetColor((x - 21), (y + 5))=16777215) and
(GetColor((x - 14), (y + 5))=16777215)) then
Result := True
end;

function ChooseFirstNotFull(Free: Boolean): Boolean;
var
i :integer;
begin
for i:= 1 to 100 do
begin
if((CheckFree(i)=Free) and (not CheckFull(i))) then
begin
ChooseWorld(i);
Result := True;
Exit;
end
end
end;

EDIT #3:
Added two new functions -
GetCountry - Gets country of world
ClickFirstCountry - Clicks the first on the list of the specified country

here they are:

function GetCountry(World: Integer): Integer;
var
FlagPos: Array[1..7] of Integer;
k: integer;
x, y: integer;
begin
GetXY(World, x, y);
k := GetColor((x - 43),(y - 5));
case k of
9777152: Result := 1;//Flag 1 blue cross
16711422: if(GetColor((x - 42),(y - 5)) = 253) then
Result := 5//Flag 5 Australia
else
Result := 2;//Flag 2 canada
52222: Result := 3;//Flag 3 yellow cross
5177858: Result := 4;//Flag 4 America
6424072: Result := 6;//Flag 6 england
1180111: Result := 7;//Flag 7 red white blue
end
end;

function ClickFirstCountry(Free, Full: boolean; Country: integer): Boolean;
var
i :integer;
begin
for i:= 1 to 100 do
begin
if((CheckFree(i)=Free) and (GetCountry(i)=Country)) then
begin
if(Full) then
begin
if(not CheckFull(i))then
begin
ChooseWorld(i);
Result := True; // =0 lots of nested ifs
Exit;
end
end else
begin
ChooseWorld(i);
Result := True; // =0 lots of nested ifs
Exit;
end
end
end
end;


BTW these havent been tested very much, but i assume they will work.

Oh yeah - I added the country ones because i thought there could be a global variable or something of the country they would most like to go into to reduce lag or whatever.. I know one of my friends comps always used to lag when he went into a non australian world. That way in the script you can make it go to the world in the country with the least players.

Click first country goes down the list, first checking if the world is free or members, then checking if the country matches the one specified, then if the boolean full is true it checks if the country is full.

Edit 4.. oops little bug

c0de
03-21-2007, 12:49 PM
Nice!

danrox2004
03-21-2007, 01:01 PM
Nice!
Thanks alot c0de! By the way - If anyone has any suggestions i will add them... Just post here.

Sumilion
03-21-2007, 01:36 PM
Row := World mod 20;

Rofl, so easy, oops xD

danrox2004
03-22-2007, 09:06 AM
Rofl, so easy, oops xD

Lol, oh and btw what do your gears and cat thing avatars mean?

EDIT: Added two new functions, check above post for them

Boreas
03-22-2007, 11:21 AM
http://www.villavu.com/forum/showthread.php?t=2410

danrox2004
03-22-2007, 01:05 PM
http://www.villavu.com/forum/showthread.php?t=2410

Oh right cool.. Wow Boreas you have LOTS of cups =) hehe
edit: It doesnt say what the gears are =S

Sumilion
03-22-2007, 04:01 PM
Tutorial writers cup.

YoHoJo
03-23-2007, 07:33 AM
Gears=SRL Developer
Cat=SRL Scripter