SRL Archive - First Scripts

Very First Auto!


Ziphlon

2008-02-14 17:30:44

Well this isnt much but this is my very first script ever. All it does it just kills Goblins. Some things I have noticed with this is it will attack one goblin then before your done killing it, it will try to go to another. Any way to make that stop?
Any adjustments just post them here. =D
Please no flaming me this is my very first script.
{.Script Info:
# ScriptName = AutoFight and Walker
# Author = Ziphlon
# Description = Fights Goblins for now.
# Version = V1.2
# Date = 2/14/08
# DateVersion = 2/14/08 = V1.0 2/15/08 = V1.2
# Comments = The fighter now has SRL codeing!
/Script Info}
// ******************INSTRUCTIONS*******************
// All you need to do is drag the selection tool to
// the runescape applet and it will do the rest for
// you! You must sign on to a **LOW DETAIL** world
// in order for this to work properly.
// **NOTE**
// You may have to change the goblin color in order
// for this to work and if you dont you will just be
// standing there doing nothing.

program AutoFighter;
{.include SRl/SRL.scar}

var
x,y: Integer;

const
Monster = 1658212; //input the goblin color here
LumbridgeColor = 10116152; //input the color of the blue shield on the wall in lumbridge

// ************ANYTHING BELOW THIS LINE DO NOT TOUCH!****************

procedure FindMonster; //This block to the left
begin //searches for the monster
if(findcolor(x,y,Monster,0,0,700,700)) then //and then it will target
begin //it.
Writeln('Monster found!'); // **NOTE**
MMouse(x,y,3,3); // This has only been
Wait(50+random(100)); // tested on goblins north
Mouse(x,y,0,0,true); // of lumbridge any other
end else // monster MAY work but I
Writeln('Monster not found...Searching again'); // do not gurrentee results.
end;
//*******************Setup Block********************
procedure Setup;
begin
cleardebug;
Writeln('You will now have 5 seconds to get to the runscape applet');
Wait(5000);
if(findcolor(x,y,LumbridgeColor,0,0,700,700)) then
begin
Writeln('Setting to run.');
MMouse(674,484,2,2);
Wait(100+random(500));
Mouse(674,484,0,0,true); // Clicks the screw icon
Wait(500+random(1000));
MMouse(642,427,3,3);
Wait(100+random(500));
Mouse(642,427,0,0,true); // Clicks the run icon
Wait(500+random(1000));
MMouse(648,186,2,2);
Wait(100+random(500));
Mouse(648,186,0,0,true); // Clicks the Backpack icon
Wait(500+random(1000));
end else
Writeln('Not in lumbridge or colors are wrong.'); //This will just skip the whole test above
end;
//*******************Walking Block********************
procedure Walking;
begin
MMouse(676,45,0,0); //Everything to the left
Mouse(676,45,0,0,true); //is the way to the goblin
Wait(7000+random(2500)); //field.
MMouse(582,42,0,0); //
Mouse(582,42,0,0,true); //
Wait(4700+random(1900)); //
MMouse(572,84,0,0); //
Mouse(572,84,0,0,true); //
Wait(4500+random(1430)); //
MMouse(560,59,0,0); //
Mouse(560,59,0,0,true);
Wait(5000+random(1532));
end;
//*******************StopRun Block*********************
procedure StopRun;
begin
Writeln('Stoping run.');
MMouse(671,477,2,2);
Wait(100+random(500));
Mouse(671,477,0,0,true); //Clicks tool icon
Wait(500+random(1000));
MMouse(654,436,3,3);
Wait(100+random(500));
Mouse(654,436,0,0,true); // Clicks run icon
Wait(500+random(1000));
MMouse(653,194,3,3);
Wait(100+random(500));
Mouse(653,194,0,0,true); // Clicks the backpack icon
Wait(4500+random(4000));
end;

begin
SetupSRL;
Setup
Walking
StopRun
repeat
FindMonster
Wait(7000+random(6000));
until(false);
end.

**EDIT** Huge update to the script and it now has SRL codeing into it! Any more adjustments I should make to this?

Harry

2008-02-14 17:34:58

I reccomend you replace MoveMouseSmooth with MMouse from SRL, and ClickMouse with Mouse :) And add some random Wait time after it kills the Goblin (Wait(5000+Random(5000));

Good job besides that :)

Ziphlon

2008-02-14 17:42:06

From: Hy71194
I reccomend you replace MoveMouseSmooth with MMouse from SRL, and ClickMouse with Mouse :) And add some random Wait time after it kills the Goblin (Wait(5000+Random(5000));

Good job besides that :)


I have all ready gave the last wait time a random but now my other question is the MMouse and the Mouse codes. When I input them they say that it dosnt exist.

Any way to help me? Sorry for being a noob its my first time here and learning the scripts for SCAR (although i have been reading tuts for a week now)

Harry

2008-02-14 17:44:14

repeat
FindMonster
Wait(5000);

O rly? I don't see a random wait there.

Read a tut on how to implant SRL into your scripts :D Good luck.

~ Harry

Cazax

2008-02-14 17:44:31

it say that doesnt exists becouse you have to include SRL.

Program New;
{.include srl/srl.scar}
and at your main loop:

SetupSRL;

Richard

2008-02-15 15:01:33

This is just a basic suggession, put more than one color into the var section and then you dont have the risk of the mouse clicking something completely different.

var area:

Var
x, y, i: integer;
Monster: array [0..3] of integer;

The actual killing part:
Procedure Kill;
Begin
MosterColor[0]:= color here
MosterColor[1]:= color here
MosterColor[2]:= color here
MosterColor[3]:= color here
if (FindColor(x, y, MosterColor[i], number junk here) then
Rest of stuff

gerauchert

2008-02-15 15:44:51

not bad, just read up on some tutorials for scripting with SRL because without it you will either:

a. Get banned
b. Just have ineffective scripts

good luck dude and see the tutorial link in my sig if you need help ;)

Ziphlon

2008-02-15 16:12:52

From: gerauchert
not bad, just read up on some tutorials for scripting with SRL because without it you will either:

a. Get banned
b. Just have ineffective scripts

good luck dude and see the tutorial link in my sig if you need help ;)


Thank you so much gerauchert! Your tut helped me the most in SRl. + rep for you :D