Jump to content
Amberleaf

[PRSC]GuardRanger

Recommended Posts

My first script of 2013! Start the script facing north in the position shown in the picture below with either a bow or crossbow equip and plenty of arrows/bolts in your bag.

 

If you wish to use the alarm you'll need to place a .wav file in your c: directory or equivalent directory.

 

Enjoy. B|

 

guardranger.jpg

 

[sCAR]//AmberGuardRanger v0.2

//Amberleaf

//http://www.scar-divi.com

 

{.include OSI\OSI.scar}

 

const

 

USERNAME = 'jimbob';

PASSWORD = 'jones';

WAITBEFORELOGIN = 0; // minutes to wait before logging back in

 

 

procedure ScriptTerminate;

begin

FreeOSI;

end;

 

procedure LogIn;

var x, y: Integer;

begin

If FindColor(x, y, 0, 274, 267, 274, 267) then

begin

Writeln('Logging In')

Mouse(355, 281, 0, 0, True);

Wait(150);

TypeText(USERNAME);

Wait(1000);

Mouse(193, 309, 0, 0, True);

Wait(60000 * WAITBEFORELOGIN);

TypeText(PASSWORD);

Mouse(411, 250, 0, 0, True);

Wait(6000);

Mouse(264, 196, 0, 0, True);

Wait(150);

end;

end;

 

procedure FindTarget;

var x, y: Integer;

begin

If FindColors(x, y, [10727147, 10858731, 11121644, 10661355, 10990060], 252, 191, 502, 323) then

begin

MMouse(x, y, 0, 0);

Wait(5);

Mouse(x, y, 0, 0, False);

end;

end;

 

procedure Atttack;

var x, y: Integer;

begin

If FindColor(x, y, 65280, 23, 28, 490, 301) then

begin

MMouse(x, y, 0, 0);

GetMousePos(x, y);

Mouse(x, y, 0, 0, false);

Wait(2500);

end else

begin

MMouse(377, 281, 15, 15);

end;

end;

 

procedure InCombat;

var x, y: Integer;

begin

repeat

If FindColors(x, y, [10727147, 10858731, 11121644, 10661355, 10990060], 244, 147, 353, 223) then

begin

MMouse(x, y, 15, 15);

Wait(1000);

WriteLn('in combat...');

end;

If GetKeyState(VK_F12) then

begin

TerminateScript;

end;

until (FindColors(x, y, [10727147, 10858731, 11121644, 10661355, 10990060], 244, 147, 353, 223) = False);

Wait(500);

end;

 

procedure Alarm;

var x, y: Integer;

begin

If FindColor(x, y, 65280, 242, 250, 300, 321) then

begin

PlaySound('c:\siren.wav'); //change to your own wave in your own directory

Wait(1000);

TerminateScript;

end;

end;

 

begin

SetupOSI;

MouseSpeed := 25;

repeat

LogIn;

Alarm;

FindTarget;

Atttack;

InCombat;

until GetKeyState(VK_F12);

end.

[/sCAR]

Edited by Amberleaf
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...