XxKanexX
2006-05-25 13:02:01
Looked like something easy to script, which it was; So i did it. Just opens the Runescape home page, Clicks the detail (You Specify) and then either Clicks Best Free world or Best Members World (You, also Specifiy).
Then waits for the Rs client to start loading and stops there. ;)
Then waits for the Rs client to start loading and stops there. ;)
Const
Detail = 'low';
BestWorld = 'free';
procedure Error(r: boolean);
begin
if (not(r)) then
begin
Writeln('An error occured');
terminatescript;
end;
end;
function FindDTMClientFree(DTM: integer): boolean;
var w, h, x, y, i: Integer;
begin
GetClientDimensions(w, h);
for i:= 1 to 20 do
begin
if (FindDTM(DTM, x, y, 0, 0, w, h)) then
begin
FreeDTM(Dtm);
result:= True;
Exit;
end;
Wait(500);
end;
FreeDTM(Dtm);
end;
function ClickDTMClientFree(DTM: integer): boolean;
var w, h, x, y, i: Integer;
begin
GetClientDimensions(w, h);
for i:= 1 to 20 do
begin
if (FindDTM(DTM, x, y, 0, 0, w, h)) then
begin
MoveMouseSmooth(x, y);
Wait(100);
ClickMouse(x, y, True);
FreeDTM(Dtm);
result:= True;
Exit;
end;
Wait(500);
end;
Error(result);
FreeDTM(Dtm);
end;
procedure Play;
var P: Integer;
begin
P := DTMFromString('78DA63BCCAC4C0B09C010598196A826946289' +
'F918B99816125AA1A6B231554357F81E6DC445573717B0DAA9A47' +
'40358B50D518EB28A0AAB90154B395805DE240F71C2560172F50C' +
'D1D026AE600EDBA4140CD7522D42803ED9A8BAAC6C7410F55CD6C' +
'A0393350D5B83918A1A80100B6DC1BD9');
ClickDtmClientFree(P);
end;
function FDet(s: string): string;
begin
result := Copy(Lowercase(s), 1, 1);
end;
function FWorld(s: string): string;
begin
result := Copy(Lowercase(s), 1, 1);
end;
procedure DetailMe(s: string);
var H, L: Integer;
begin
if (FDet(s) <> 'h') and (FDet(s) <> 'l') then
begin
Writeln('Set the Detail..');
terminatescript;
end;
if (FDet(s) = 'l') then
begin
L := DTMFromString('78DA63AC676260E065644006FFFEFD03D3305' +
'1C633986ABE5D398FAA2619A8460155CD8DC75751D5F401D518A0' +
'AAF9787A27AA9A02A01A1D5435E16AAC286A00E1B10E76');
ClickDtmClientFree(L);
end;
if (FDet(s) = 'h') then
begin
H := DTMFromString('78DA63546464606001622410AE6508A661A28' +
'C55409600AA9A6F57CEA3AAA901B29850D5B4A5A7A1AA5106B204' +
'51D57CDA7304554D3A906588AA66556901AA1A2D204B0555CDAF6' +
'73750D5E803597A04D4F40359D2A86A2CA07E80890200CB9B11B9' +
'');
ClickDtmClientFree(H);
end;
end;
procedure BestWorldMe(s: string);
var M, F: Integer;
begin
if (FWorld(s) <> 'm') and (FWorld(s) <> 'f') then
begin
Writeln('Choose the world..');
terminatescript;
end;
if (FWorld(s) = 'm') then
begin
M := DTMFromString('78DA63EC61626058CF80024EACAF04D38C503' +
'EE372A09A67A86A2E6C6941557309A8E614AA9A0827594C353B50' +
'D504D849A1AA2903AA3987AA26CA411A450D00927C0D53');
ClickDtmClientFree(M);
end;
if (FWorld(s) = 'f') then
begin
F := DTMFromString('78DA636C616460D8CC80020C74D5C0342394C' +
'F381DC83A8DAA66DBEA99A86A7E0259E751D56C5F330B55CD1D20' +
'EB3EAA1A533D0D54350F30DD13E2E780A2060021CC0DA6');
ClickDtmClientFree(F);
end;
end;
procedure Open;
begin
OpenWebPage('http://www.runescape.com');
end;
procedure Activate;
var i: integer;
begin
for i:= 1 to 10 do
begin
if (FindWindowTitlePart('RuneScape - the', false)) then
begin
ActivateClient;
exit;
end;
Wait(200);
end;
Writeln('Couldn''t find Runescape..');
terminatescript;
end;
procedure Arrow;
var Ar: integer;
begin
Ar := DTMFromString('78DA63FCCBC0C070820105ACADE502D38C503' +
'EE3174C359B3BE451D57C00128750D59C9DAB8669CE6E5435111E' +
'06A86ADE61AAF97FBD12450D00CD6F0FD3');
FindDtmClientFree(Ar);
end;
procedure OpenLoadRunescape(Detail, BestWorld: string);
begin
ClearDebug;
Open;
Activate;
Play;
DetailMe(Detail);
BestWorldMe(BestWorld);
Arrow;
Writeln('Opened Runescape.. Loading.');
end;
begin
OpenLoadRunescape(Detail, BestWorld);
end.