SRL Archive - First Scripts

My autofighter


Vandalf

2008-10-19 01:06:26

It's (not so) easy to use, and can be easily reverse engineered. Also buries bones. //I didn't test it yet, so…//

program TheKiller;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Fighting.scar}
const
Victim =2700135; {Color of the victim}
Victim2 =3682603; {Second color, duhhh...}
Loot =950950; {Color of whatever drop you want}
BonesFloor =9671841; {Color of the bones on the floor}
Bones =13356242; {Color of the bones in the inventory}
{Dir ='S' ; {Direction to run if Attack fails}
{Dist =False; {Distance to run if Attack fails, False = short, True = long}
T =25 ; {Time to wait between fighting and collecting loot}

var
x, y : integer;

procedure AntiBan;
begin
case Random(12) of
0: wait(500+random(3000));
1: RandomMovement;
2: begin
HoverSkill('random' ,false);
wait(500+random(1000));
Mouse (646, 181, 8, 8,true);
end;
3: PickUpMouse;
5: RandomRClick;
6: begin
SetAngle(False);
Wait (500 +random(800));
SetAngle(true);
end;
end;
end;

procedure Attack;
begin
if FindColor(x, y, Victim , 0, 0, 630, 420) or
FindColor(x, y, Victim2, 0, 0, 630, 420) then
begin
Mouse(x,y,7,7,False);
if not ChooseOption('Attack') then exit;
end;
AntiBan;
Wait(T*1000)
end;

procedure TakeLoot;
begin
if(FindColor(x, y, Loot, 0, 0, 516, 333))then
begin
Mouse(x,y,3,3,False);
ChooseOption('Take');
end;
Wait(1000);
if(FindColor(x, y, BonesFloor, 0, 0, 516, 333))then
begin
Mouse(x,y,3,3,False);
ChooseOption('Take');
end;
end;

procedure BuryBones;
begin
{repeat
N := 0;}
if FindColor(x, y, Bones, 525, 160, 760, 500) then
Mouse (x, y, 0, 0, True);
wait (500 + random(1500));
{else end;
until N = 10;}
end;

{This is the program itself}
begin
repeat
{repeat
N := 0;
N := N + 1;}
AntiBan;
Attack;
if InFight then repeat
Wait(2000);
until not InFight;
TakeLoot;
{until N = 10;}
BuryBones;
until(False);
end.

Is it regular, good, or very good?

P.S.: You are supposed to log in "before" starting this script.

19/10/2008: First test. Fixed some stuff, added nothing.

joelster134

2008-10-19 01:09:52

ok first put your script in a [.SCAR] tags (top left hand next to the black H in a yellow box (its a tractor thingo) second dont use Findcolor ill look through it more now…thats just what i spotted atm. and keep reading through tutorials, nice try for first script though keep reading tutorials amd learning :) add me on msn if you want [email]joelster134@hotmail.com[/email]

heres what i added in
program TheKiller;

{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Fighting.scar}

const
Victim =00000; {Color of the victim}
Victim2 =00000; //second color of monster//
Loot =00000; {Color of whatever drop you want}
BonesFloor =00000; {Color of the bones on the floor}
Bones =00000; {Color of the bones in the inventory}
Dir ='N' ; {Direction to run if Attack fails}
Dist =False; {Distance to run if Attack fails, False = short, True = long}
T =30 ; {Time to wait between fighting and collecting loot}

var
x, y, N : integer;

procedure AntiBan;
begin
case Random(12) of
0: wait(500+random(3000));
1: RandomMovement;
2: HoverSkill('random' ,false);
3: PickUpMouse;
4: BoredHuman;
5: RandomRClick;
6: begin
SetAngle(False);
Wait (500 +random(800));
SetAngle(true);
end;
end;
end;

procedure Antirandoms;
begin
findnormalrandoms;
if HpPercent<25 then
begin
runaway('E',true,1,5000+random(1000));
end;
end;

function KillChicken: boolean;
var
X, Y, Mark : Integer;
begin

if FindObjCustom(x, y, ['tta', 'ack', 'hick', 'ken'], [2572628, 6916764, 9155272, 3627895, 5928325], 3) then
begin
Mouse(x, y, 2, 2, False);
Wait(25 + Random(100));
AntiRandoms;
if not ChooseOption('ttack') then Exit;
Flag;
MarkTime(Mark);
Wait(2 * 5000 + Random(1000));
AntiBan;
AntiRandoms;
if HPPercent < 25 then RunTo('N', true);
Wait(300);
AntiRandoms;
end;
procedure TakeLoot;
begin
if(FindColor(x, y, Loot, 0, 0, 630, 420))then
begin
Mouse(x,y,3,3,False);
ChooseOption('Take');
end;
if(FindColor(x, y, BonesFloor, 0, 0, 630, 420))then
begin
Mouse(x,y,3,3,False);
ChooseOption('Take');
end;
end;

procedure BuryAllBones;
begin
repeat
N := 0;
if FindColor(x, y, Bones, 525, 160, 760, 500) then
Mouse (x, y, 0, 0, True);
wait (500 + random(1500));
until N = 10;
end;


begin
repeat
repeat
N := 0;
N := N + 1;
AntiBan;
Attack;
if not InFight then repeat
RunTo(Dir,Dist);
Attack;
until InFight;
TakeLoot;
until N = 10;
BuryAllBones;
until(False);
end.

Try to use sumthing like this for picking up items…other wise it will try and pickup things of any color (thats the same as wat u set it to be)

  if FindObjCustom(x, y, ['tta', 'ack', 'hick', 'ken'], [2572628, 6916764, 9155272, 3627895, 5928325], 3) then
begin
Mouse(x, y, 2, 2, False);
Wait(25 + Random(100));
AntiRandoms;
if not ChooseOption('ttack') then Exit;

Vandalf

2008-10-19 01:32:21

Thanks, joelster. I'll try that.

joelster134

2008-10-19 01:46:48

Np :) Goodluck

and yes your supposed to start logged in,,or out dosnt really matter. most scripts log out then in anyway