SRL Archive - First Scripts

Skeleton Safespotter (First script)


ownedlikenoob

2010-06-13 01:13:14

This is my first script, I know that my standards are not good at all. It is mostly just all thrown together. I will be editing it more later but for now I am finished. The script ranges skeletons at the safespot in the varrock sewers.



Uploaded with ImageShack.us

I have not ran this script for a long period of time, So go ahead and give it a try if you want.

USE AT YOUR OWN RISK.

Also, You need to be level 28 so that the squirpions don't attack you.

Script:

{First Script I have made. Hope you enjoy it. I know it is not great
but it's my first script.}

{Directions:
1. Change Brightness to all the way up
2. Drag the crosshair on RS Screen.
3. Log in and stand in safe spot.
4. Join a Clan Chat. I usually join Green098
5 Run the script.

It may mess up, So use at your own risk.}




program SafeDemSkellies;
{$IFDEF SIMBA}
{$I SRL/SRL.scar}
{$ELSE}
{.Include SRL/SRL.scar}
{$ENDIF}


Var
x,y,i : integer;


Const
Skellie = 6844785;
Sqorpion = 5009303;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
end;

Procedure NotFound;
Begin
If(Not(FindColorSpiral(x,y,Skellie,0,0,518,339))) then
I := I+1;
WriteLn('Did not find Skeleton '+IntToStr(I)+' Times');
Keydown(40);
Wait(1000+random(1000));
MakeCompass('N');
end;

Procedure Check;
begin
If (I>5) then
begin
Mouse(754, 10,5,5,true);
Mouse(608, 419,5,5,true);
WriteLn('Did not find skeltons 4 times, logging out.')
TerminateScript;
end;
end;

Procedure AntiBann;
begin
case (Random(60)) of
1: Typesend('/lol');
2: RandomRClick;
8: Begin
Mouse(538, 64,5,5,true);
end;
9: Begin
Mouse(566, 186,5,5,true);
wait(100+random(200));
Mouse(585, 309,5,5,true);
wait(5000+random(5000));
Mouse(501, 22,5,5,true);
end;
10: MMouse(338, 78, 20, 20);
11: MMouse(57, 111, 24, 23);
12: MMouse(203,232, 30, 14);
14: ExamineInv;
7: Begin
FindNormalRandoms;
Writeln('Looking for randoms')
end;
3: PickUpMouse;
4: RandomMovement;
5: Begin
BoredHuman;
Keydown(40);
Wait(1000+random(1000));
MakeCompass('N');
end;
6: Begin
Mouse(572,485,5,5,true);
Wait(1000+random(1000));
end;
end;
end;

function F_InFight: Boolean;
var GTPA, RTPA: TPointArray;
begin
FindColorsTolerance(GTPA, 49499, MSCX - 15, MSCY - 40, MSCX + 15, MSCY, 20);
FindColorsTolerance(RTPA, 590010, MSCX - 15, MSCY - 40, MSCX + 15, MSCY, 20);
Result := ((GetArrayLength(GTPA) + GetArrayLength(RTPA)) >= 20);
end;

function WhileInFight: Boolean;
begin
while F_InFight do
begin
AntiBann;
Wait(200 + Random (500));
end;
Result := True;
end;

Procedure Attack;
begin
If(FindColorSpiral(x,y,Skellie,0,0,518,339)) then
case (Random(3)) of
1: Begin
I:=0
MMouse(X,y, 5, 5);
if WaitUpText('Skeleton', 100) then
Mouse(x,y,5,2,False);
wait(100+random(200));
ChooseOption('ack');
Wait(9000+random(2000));
WhileInFight;
end;
2: Begin
I:=0
MMouse(x,y, 5, 5);
if WaitUpText('Skeleton', 100) then
Mouse(x,y,1,1,True);
Wait(9000+random(2000));
WhileInFight;
end;
end;
end;

begin
SetupSRL;
I := 0
Mouse(572, 10,2,4,true);
Repeat
Check;
NotFound;
Attack;
AntiBann;
Until(false);
end.

Feel free to edit and use any method in this script. If you are going to edit the whole script and repost it, Crediting me would be nice.

Thanks

Danizho

2010-06-13 01:31:08

its risky…
sometimes, the character is going to cross the bridge… (when the skl is moving and the click fails)

i luffs yeww

2010-06-13 01:46:48


{First Script I have made. Hope you enjoy it. I know it is not great
but it's my first script.}

{Directions:
1. Change Brightness to all the way up
2. Drag the crosshair on RS Screen.
3. Log in and stand in safe spot.
4. Join a Clan Chat. I usually join Green098
5 Run the script.

It may mess up, So use at your own risk.}

program SafeDemSkellies;
{.include SRL/SRL.scar}

var
x, y, i: Integer;

const
Skellie = 6844785;
Scorpion = 5009303;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
end;
procedure NotFound;
begin
if(not(FindColorSpiral(x, y, Skellie, MSX1, MSY1, MSX2, MSY2)))then
begin
Inc(i);
Writeln('Did not find skeleton ' + IntToStr(I) + ' times');
KeyDown(40);
Wait(1000 + Random(1000));
KeyUp(40);
MakeCompass('N');
end;
end;

procedure Check;
begin
if(i > 5)then
begin
Mouse(754, 10, 5, 5, True); // Blind clicking isn't good.
Mouse(608, 419, 5, 5, True); // Still isn't good.
Writeln('Did not find skeltons 6 times, logging out.')
TerminateScript;
end;
end;

procedure AntiBann;
begin
case Random(60) of
1: Typesend('/lol');
2: RandomRClick;
3: PickUpMouse;
4: RandomMovement;
5: begin
BoredHuman;
Keydown(40);
Wait(1000 + Random(1000));
KeyUp(40);
MakeCompass('N');
end;
6: begin
Mouse(572,485,5,5,true);
Wait(1000+random(1000));
end;
7: begin
Writeln('Looking for randoms');
FindNormalRandoms;
end;
8: Mouse(538, 64, 5, 5, True);
9: begin
Mouse(566, 186, 5, 5, True);
Wait(100 + Random(200));
Mouse(585, 309, 5, 5, True);
Wait(5000 + Random(5000));
Mouse(501, 22, 5, 5, True);
end;
10: MMouse(338, 78, 20, 20);
11: MMouse(57, 111, 24, 23);
12: MMouse(203, 232, 30, 14);
14: ExamineInv;
end;
end;

function F_InFight: Boolean;
var
GTPA, RTPA: TPointArray;
begin
FindColorsTolerance(GTPA, 49499, MSCX - 15, MSCY - 40, MSCX + 15, MSCY, 20);
FindColorsTolerance(RTPA, 590010, MSCX - 15, MSCY - 40, MSCX + 15, MSCY, 20);
Result := ((GetArrayLength(GTPA) + GetArrayLength(RTPA)) >= 20);
end;

function WhileInFight: Boolean;
begin
while F_InFight do
begin
AntiBann;
Wait(200 + Random(500));
end;
Result := True;
end;

procedure Attack;
begin
if(FindColorSpiral(x, y, Skellie, MSX1, MSY1, MSX2, MSY2))then
case Random(3) of
1: begin
i := 0;
MMouse(x, y, 5, 5);
if(WaitUpText('Skeleton', 100))then
Mouse(x, y, 5, 2, False);
Wait(100 + Random(200));
ChooseOption('ack');
Wait(9000 + Random(2000));
WhileInFight;
end;
2: begin
i := 0;
MMouse(x, y, 5, 5);
if(WaitUpText('Skeleton', 100))then
Mouse(x,y,1,1,True);
Wait(9000+random(2000));
WhileInFight;
end;
end;
end;

begin
SetupSRL;
i := 0;
Mouse(572, 10, 2, 4, True);
repeat
Check;
NotFound;
Attack;
AntiBann;
until(False);
end.

I just standardized it real quick as I'm going out to a party in a few minutes. You forgot a couple KeyUp's and had open KeyDown's. D:

And you shouldn't blind click </3. But I'm always happy to see new people learn and successfully complete a script! :D

Keep it up, mang, seriously. You'll have tons of fun.

Sorry, I'm kinda on some Klonopin and really excited for tonight. ;D

And you never used the Scorpion color.

The Claw

2010-06-13 02:22:01

Random(3) returns 0, 1, or 2 so fix that up in Attack.
You also want to check for randoms more often than 1/60 times, imagine you get a random when you click attack and end up cycling through antiban until it happens to get to FindNormalRandoms. So I'd put FindNormalRandoms in the loop in your main loop.
I also wouldnt use a typsend as antiban, could get suspicious if someones training there with you and you randomly say "lol" every so often.

Theres more stuff but thats just a couple of pointers :)

ownedlikenoob

2010-06-13 11:45:21

From: The Claw
Random(3) returns 0, 1, or 2 so fix that up in Attack.
You also want to check for randoms more often than 1/60 times, imagine you get a random when you click attack and end up cycling through antiban until it happens to get to FindNormalRandoms. So I'd put FindNormalRandoms in the loop in your main loop.
I also wouldnt use a typsend as antiban, could get suspicious if someones training there with you and you randomly say "lol" every so often.

Theres more stuff but thats just a couple of pointers :)


I put Random(3) because Random(2) wouldn't work. It refused to click at all. So I had to make it 3. and for some reason, When I do FindNormalRandoms; it starts clicking my inventory tab like 100 times and just gets stuck there. it only does that sometimes though. I don't know why. Oh and the Typesend command sends "lol" to a clan chat. not outloud. That's why I say to join a cc at the beggining of the script.

Thanks for the advice though. :)

ownedlikenoob

2010-06-13 11:46:45

From: Danizho
its risky…
sometimes, the character is going to cross the bridge… (when the skl is moving and the click fails)


Yeah this is a really big bug I have… I can't find a way to fix it. what would be a good way to fix it?

Danizho

2010-06-13 14:18:23

From: ownedlikenoob
Yeah this is a really big bug I have… I can't find a way to fix it. what would be a good way to fix it?


i was thinkin the same script with
DMTs detect or something
(If it detects DMTs, move the mouse in the minimap to a
bright spot), but was an idea…

Frement

2010-06-13 15:01:56

I made this once when I trained ranged. Can't find it anymore, but it didn't walk away ever.

i luffs yeww

2010-06-13 15:08:38

From: Danizho
i was thinkin the same script with
DMTs detect or something
(If it detects DMTs, move the mouse in the minimap to a
bright spot), but was an idea…


DMT!? WHEREEEE!? :D

But srsly.

I don't see why it would get lost. If it did, you could have a check of the water color, towards the right of the water (the water in between you and the NPCs), and then check that same coordinate that you got the water color from and if there isn't a water color there, it's been moved.

Danizho

2010-06-13 15:13:19

From: i luffs yeww
DMT!? WHEREEEE!? :D

But srsly.

I don't see why it would get lost. If it did, you could have a check of the water color, towards the right of the water (the water in between you and the NPCs), and then check that same coordinate that you got the water color from and if there isn't a water color there, it's been moved.


was an idea … ¬¬ "

i luffs yeww

2010-06-13 15:18:33

^ DMT is a drug, Dimethyltryptamine, which is a crazy awesome drug. You meant DTM, Deformable Template Model or something..

Danizho

2010-06-13 15:28:42

From: i luffs yeww
^ DMT is a drug, Dimethyltryptamine, which is a crazy awesome drug. You meant DTM, Deformable Template Model or something..


some drugs to make a good script… thats what i spoke ;)

ownedlikenoob

2010-06-13 22:48:26

From: i luffs yeww
DMT!? WHEREEEE!? :D

But srsly.

I don't see why it would get lost. If it did, you could have a check of the water color, towards the right of the water (the water in between you and the NPCs), and then check that same coordinate that you got the water color from and if there isn't a water color there, it's been moved.


Well if it doesn't find a skeleton 4 times it logs out and terminates the script.\

Procedure Check;
begin
If (I>5) then
begin
Mouse(754, 10,5,5,true); // This is where it logs out.
Mouse(608, 419,5,5,true);
WriteLn('Did not find skeltons 4 times, logging out.')
TerminateScript;
end;
end;

ownedlikenoob

2010-06-13 22:51:45

This is where I have the problem though,

2: Begin
I:=0
MMouse(x,y, 5, 5);
if WaitUpText('Skeleton', 100) then
Mouse(x,y,1,1,True);
Wait(9000+random(2000));
WhileInFight;
end;
end;
end;

That is where it finds the skeleton and if the uptext is skeleton then it right clicks. Only thing is that the skeleton will be moving and SCAR will move the mouse there and click but because the skeleton is moving it clicks behind it and walks on the other side.

any ideas on how to fix this?

i luffs yeww

2010-06-13 23:32:04

Do Moues(x, y, 1, 1, False); Wait(Random(300)); ChooseOption('tack');

ownedlikenoob

2010-06-14 12:38:49

From: i luffs yeww
Do Moues(x, y, 1, 1, False); Wait(Random(300)); ChooseOption('tack');


Yeah but you cant always have it right click. That would be too noticable. I have it to do a left or right click.

Danizho

2010-06-14 12:50:14

From: ownedlikenoob
Yeah but you cant always have it right click. That would be too noticable. I have it to do a left or right click.


case (random) :whistling:

ownedlikenoob

2010-06-14 14:17:27

From: Danizho
case (random) :whistling:



That is what I have here,


procedure Attack;
begin
if(FindColorSpiral(x, y, Skellie, MSX1, MSY1, MSX2, MSY2))then
case Random(2) of
1: begin
i := 0;
MMouse(x, y, 5, 5);
if(WaitUpText('Skeleton', 100))then
Mouse(x, y, 5, 2, False);
Wait(100 + Random(200));
ChooseOption('ack');
Wait(9000 + Random(2000));
WhileInFight;
end;
2: begin
i := 0;
MMouse(x, y, 5, 5);
if(WaitUpText('Skeleton', 100))then
Mouse(x,y,1,1,True);
Wait(9000+random(2000));
WhileInFight;
end;
end;
end;

Only thing is that when it left clicks it sometimes misses the skeleton and walks to the other side of the river.