Feroc1ty
2009-12-09 20:45:10
yeah im making a script and im basically gonna keep updating this, you can take any functions i make and put em in repository if you want, so far nothing worthy of it tho, except my keyboard and mouse includes which ill post if you want.
oh btw dont take that find fish function its not complete yet :P
program all_my_rsc_crap;
{.include Feroc1ty Keyboard.scar}
{.include Feroc1ty Mouse.scar}
const
rscclient_x = 511;
rscclient_y = 344;
rscchar_x = 255;
rscchar_y = 160;
hoveropt_y = 18;
hoveropt_1 = 328;
hoveropt_2 = 361;
hoveropt_3 = 394;
hoveropt_4 = 426;
hoveropt_5 = 459;
hoveropt_6 = 493;
var
rsclient: integer;
clientpos_x,clientpos_y:integer;
buttons_login: TPoint;
function cx():integer;
begin
result := clientpos_x;
end;
function cy():integer;
begin
result := clientpos_y;
end;
procedure LoadBitmap;
begin
rsclient := BitmapFromString(5, 10, 'beNrTMmHACjhhCAJEpaAIA' +
'rRMoAgC7PygCAKCM6AIAtIaoAirLJpeiLEA0/MNOQ==');
end;
procedure SetupClientPosition;
begin
if FindBitmap(rsclient, clientpos_x,clientpos_y) then
begin
clientpos_x := clientpos_x + 2;
clientpos_y := clientpos_y - 333;
writeln('Successfully found client!');
writeln(inttostr(clientpos_x) + ',' + inttostr(clientpos_y));
end else
begin
writeln('Failed to find client.');
FindWindow('SCAR Divi CDE');
ActivateClient;
TerminateScript;
end;
end;
function LocateFish(name:string):TPoint;
var x,y:integer;
begin
FindColorSpiral(x,y,10047536,cx,cy,cx+rscclient_x,cy+rscclient_y);
end;
procedure Initializer();
begin
FindWindowTitlePart('Runescape Classic', false);
ActivateClient;
LoadBitmap;
MouseInit;
Wait(1000);
SetupClientPosition;
KeyboardVars;
end;
procedure RMouse(x,y,rx,ry:integer;left:boolean);
begin
Mouse(x+cx,y+cy,rx,ry,left);
end;
procedure RMMouse(x,y,rx,ry:integer);
begin
MMouse(x+cx,y+cy,rx,ry);
end;
procedure WaitForColor(x,y,color,timeout:integer);
var i:integer;
begin
i := 0;
while i < timeout do
begin
if GetColor(x,y) = color then
exit;
timeout := timeout + 100;
wait(100);
end;
end;
function RWaitForColor(x,y,color,timeout:integer):boolean;
var i:integer;
begin
result := true;
i := 0;
while i < timeout do
begin
if GetColor(x+cx,y+cy) = color then
begin
result := false;
exit;
end;
i := i + 100;
wait(100);
end;
end;
function LogIn(name,pass:string):boolean;
begin
result := false;
RMouse(260,295,40,5,true);
TypeText(name,true,true);
PressEnter;
TypeText(pass,true,true);
PressEnter;
if RWaitForColor(60,100,0,10000) then
begin
Writeln('Timed out at login.');
exit;
end;
if (GetColor(cx+440,cy+100) <> 0) and (GetColor(cx+440,cy+230) <> 0) then
begin
Writeln('Login failed.');
exit;
end;
RMouse(260,218,40,3,true);
result := true;
writeln('Login succesful!');
end;
procedure HoverOpt(num:integer);
var x:integer;
begin
case num of
1:x := hoveropt_1;
2:x := hoveropt_2;
3:x := hoveropt_3;
4:x := hoveropt_4;
5:x := hoveropt_5;
6:x := hoveropt_6;
end;
RMMouse(x,hoveropt_y,8,8);
end;
begin
Initializer;
LogIn('*','*');
HoverOpt(1);
LocateFish('heh');
end.oh btw dont take that find fish function its not complete yet :P