SRL Archive - First Scripts

My First Script


joelster134

2008-09-19 08:39:24

Hey this is my first attempt at a willow woodcutter and banker (In DRAYNOR) please psot what im doing wrong /suggestions. and alos please tell me what i should start wth scripting first. and if im trying to hard to early :)




HERE IT IS:

program joelster134_v1;
var

G, F, X, Y, Z, A, B, C, E, S: Integer;
begin
if (findcolor(X, Y, 346525, 235, 235, 255, 236))then
begin
movemousesmooth(X, Y);
ClickMouse(X, Y, True);
wait(1000+random(7500)); //walking to trees procedure
end;

begin;
if (findcolor(G, F, 234556, 463, 346, 346, 767)) then
movemousesmooth(G, F);
Clickmouse(G, F, True);
wait(15000)
clickmouse(G, F, True);
wait(10000)
end; //cutting tree first time
begin;
if (findcolor(Z, A, 32546, 345, 767, 867, 453)) then
movemousesmooth(Z, A,);
clickmouse(Z, A, True);
wait(15000)// cutting tree second time
end;
begin;
if (findcolor(B, C, 2562634, 463 ,346, 634, 342))then
movemousesmooth(B, C);
Clickmouse(B, C, True);
wait(15000) //move to bank
movemousesmooth(325, 235);
clickmouse(325, 235, True); //right click on banker
wait(1500)
movemousesmooth(255, 234);
clickmouse(255, 234, True);//opens bank window
end;
begin;
if (find(E, S, 2352456, 234, 235, 657, 346))then
movemousesmooth(E, S);
Clickmouse(E, S, True);//stores logs
wait(1500)
movemousesmooth(214, 235);
clickmouse(214, 235, True);
wait(2500)
movemousesmooth(235, 266);
clickmouse(235, 266, True); //exits bank
end;
repeat
until false;
end;
begin;
writel('Thank you for using joelster134''s'' cutter and banker')
end;
end.

Lacky

2008-09-19 09:11:31

Well firstly, you can put "
" tags around your script put "[ scar ]" at the start and "
" at the end (without quotation marks and without the space(s)).

Secondly, use SRL please. And don't use clickmouse and movemousesmooth etc. It's not part of SRL and will likely get you banned.

Other than that for you, seems to be a good first script. Just don't use it often if you don't want to get banned.

EDIT: If you head on over to the Tutorials Section, it will help you with making a SRL Script which Includes Anti-Randoms etc.

joelster134

2008-09-19 09:21:16

Cheers lacky, will try fix up and post it again



ON HOLIDAYS WILL BE BACK INA WEEK!!

Lacky

2008-09-19 17:07:18

No problems. I would help more, but I am to tired right now.

Happy Holidays. ^_^

Melon

2008-09-21 08:49:00

[H][/H]movemousesmooth(Z, A,);

, after A should not be there….

sirlaughsalot

2008-09-21 09:09:25

Okay, first things first, put {.include SRL/SRL.Scar} at the top of the script, then use mouse(xcoordvar,ycoordvar,randomness for x, random for y, true or false true clicks left false clicks right), with finding colors, always have tolerance, so instead of findcolor, use findcolortolerance, or findcolorspiral, use findcolorspiraltolerance.

pini3000

2008-09-21 09:15:14

I know to become a srl member, most prefer you do not use reflections too much but try to add some in there and get to grips with it. Once you learn some high end stuff I am sure you can make this script look great.

Look through the current one as reference and see how yours can be improved :)

joelster134

2008-10-07 05:26:11

Thanks guys for feedback will try fix up now ive posted a few scripts….couldnt find this thread for a bit :(

bigk011

2008-10-08 16:12:14

put it in scar tag…

Phoenix13nl

2008-10-08 17:20:55

This one (made by me :P) will totaly beat yours :)

////////////////////////////////////////////////////////////////
// //
// ***** ***** ** ** ** *** ** **** ***** //
// ** ** ** ** ** * ** ** **** ** ** ** ** ** //
// ** ** ***** ****** *** ** **** ** ** ***** //
// ** ** ** ** ** ** ** ** *** ** ** ** ** //
// ***** ** ** ** ** ** ** ** **** ** **//
// //
// **** ** ** ******** ******** ***** ***** //
// ** ** ** ** ** ** ** ** //
// ** ** ** ** ** ***** ***** //
// ** *** *** ** ** ** ** ** //
// **** ****** ** ** ***** ** ** //
// //
// ** *** ** ***** //
// ** * **** ** ** ** //
// ****** ** **** ** ** //
// ** ** ** *** ** ** //
// ** ** ** ** ***** //
// //
// ***** ** *** ** ** ** ***** ***** //
// ** ** ** * **** ** ** ** ** ** ** //
// ***** ****** ** **** **** ***** ***** //
// ** ** ** ** ** *** ** ** ** ** ** //
// ***** ** ** ** ** ** ** ***** ** ** //
// //
////////////////////////////////////////////////////////////////
// Script created by: Phoenix13nl //
////////////////////////////////////////////////////////////////

program DraynorCutterAndBanker;
{.include srl/srl/misc/smart.scar}
{.include SRL/SRL.Scar}

var
xf, yf, x, y, LoopCount, LogCount : integer;
smartworld : string;

procedure DeclarePlayers;
begin
howmanyplayers:=1;
numberofplayers(howmanyplayers);
players[0].name:='Name';
players[0].pass:='Pass';
players[0].nick:='Nick'; //Just write 3-4 letters of your username, use correct capitals.
players[0].Integers[0]:=280; //Amount of fish to catch (About 27 fish per load of using net)
players[0].active:=true;
players[0].worked:=0;
end;

procedure Init;
begin
smartworld:='world63'; //Change 63 into any world's number...
end;

procedure AntiRandoms;
begin
if not(LoggedIn)then Exit;
if not findnormalrandoms then
begin
findtalk;
end;
if findfight=true then runaway('E',true,1,4000+random(2000));
end;

procedure AntiBan;
begin
if(not(LoggedIn))then Exit;
case random(4) of
0: PickUpMouse;
1: RandomMovement;
2: RandomRClick;
3: case random(4) of
0: HoverSkill('Fishing', false);
1: HoverSkill('Cooking', false);
2: HoverSkill('Woodcutting', false);
3: HoverSkill('Firemaking', false);
end;
end;
end;

procedure WalkLogs;
begin
if not LoggedIn then exit;
KeyDown(VK_UP);
wait(1500+random(500));
KeyUp(VK_UP);
wait(500+random(500));
writeln('Angle set.');
if (InvFull = True) then exit;
wait(1500+random(500))
if(FindSymbol(x,y,'fish'))then
begin
writeln('Walking to willows.');
AntiRandoms;
MMouse(x, y, 5, 5);
wait(100+random(50));
Mouse(x, y, 1, 1, true);
wait(3000+random(1000))
Antiban;
AntiRandoms;
wait(2000+random(500))
end;
end;

Procedure CutLogs;
begin
if (InvFull = true) or (LoggedIn = false) then exit;
repeat
AntiRandoms;
AntiBan;
wait(500+random(500))
if not FindObjCustom(x, y, ['own W','Will','low'], [2506050, 1849390, 3433040, 2506291, 3627360], 3) then exit;
repeat
wait(1500+random(500)) //Dont not remove/move this line! will slow down RS by searching the ObjCustom before being able to find.
if FindObjCustom(x, y, ['own W','Will','low'], [2506050, 1849390, 3433040, 2506291, 3627360], 3) then
begin
if FindObjCustom(xf, yf, [], [514778], 3) then
begin
runaway('E',true,1,200+random(200));
writeln('Ent!')
wait(2000+random(500));
AntiRandoms;
AntiBan;
wait(7500+random(500));
end;
writeln('Willow tree found.');
wait(100+random(50));
Mouse(x, y, 1, 1, true);
writeln('Cutting...');
wait(5000+random(2500));
if FindObjCustom(xf, yf, [], [514778], 3) then
begin
runaway('E',true,1,200+random(200));
writeln('Ent!')
wait(2000+random(500));
AntiRandoms;
AntiBan;
wait(7500+random(500));
end;
AntiRandoms;
AntiBan;
wait(3000+random(2500));
end;
until(InvFull = true);
until(InvFull = true);
LogCount:=LogCount+1;
MMouse(648,57,4,4);
wait(100+random(50));
Mouse(648,57,1,1,true);
wait(2000+random(1000))
end;

procedure WalkBank;
begin
if not LoggedIn then exit;
if not (InvFull = true) then exit;
wait(1000+random(500))
if(FindSymbol(x,y,'bank'))then
begin
Writeln('Bank found.');
MMouse(x, y, 5, 5);
wait(100+random(50));
Mouse(x, y, 1, 1, true);
wait(5000+random(1000));
AntiBan;
AntiRandoms;
wait(4500+random(1000));
end;
end;

procedure Bank;
begin
if not LoggedIn then exit;
if not (InvFull = true) then exit;
repeat
if FindObjCustom(x, y, ['se Ba', 'ank b', 'oth'], [605264, 3685438, 2313826, 6192526], 3) then
begin
MMouse(x,y,5,5);
wait(100+random(50));
Mouse(x,y,1,1,False);
wait(1000+random(500))
if ChooseOption('se-q') then
begin
wait(3500+random(500));
deposit(3,28,true);
wait(1500+random(500));
MMouse(489,33,4,4);
wait(100+random(50));
Mouse(489,33,1,1,true);
wait(1500+random(500));
MMouse(609,129,4,4);
wait(100+random(50));
Mouse(609,129,1,1,true);
AntiBan;
wait(6000+random(2000));
end;
end;
until(InvFull = false)
end;

begin
cleardebug;
init;
smartsetup(smartworld,false,true,false);
settargetdc(smartgetdc);
setupsrl;
lampskill:='woodcutting'; //Change into any skill... make sure its written corretly!
declareplayers;
currentplayer:=0;
logout;
closefile(rewritefile('C:\WINDOWS\.jagex_cache_32\uid.dat',true));
loginplayer;
Repeat
if not loggedin then exit;
WalkLogs;
CutLogs;
WalkBank;
Bank;
if (InvFull = True) then break;
Cleardebug;
LoopCount:=LoopCount+1;
Writeln(IntToStr(LoopCount) + ' loops completed.');
Writeln('About ' + IntToStr(LogCount * 28) + ' out of ' + IntToStr(Players[CurrentPlayer].Integers[0]) + ' logs banked.');
Until(LogCount * 28>= Players[CurrentPlayer].Integers[0]);
logout;
end.

:D

joelster134

2008-10-09 01:24:50

Considering it IS a FISHER im sure it will :p btw this was the script i posted like a day after registering…was my first ever script without ready more then 1 tutorial im gunna fix it up so it's a working wcer& Banker soon

Phoenix13nl

2008-10-10 13:07:12

just meant as a joke lol, i moddified the fishing script for like 5 minutes and then made this :D should work pretty wel.. and my first script wasnt realy great either, its the PowerFisherV1 :P but out new script owns everything :p

IS a FISHER

>>WHAS a FISHER<< :D

in2it

2008-10-11 22:13:02

nice for first script :f:

Andyz55

2008-10-12 00:38:54

You should put {.include srl/srl.scar} right below the program name and then at the bottom of the script (after the begin; , before the writeln) you should put 'setupsrl;' as a function so that you can use srl commands like mouse and mmouse etc. These functions are much less detectible. Also, I recommend using (repeat until (variable=specified amount) by adding another integer variable and then after your first 'begin' put 'variable := 0;' (no quotations) and then at the end were it says 'until (false)' replace the false with 'variable=(amount you want)' because repeat until (false) is quite bannable after someone sees you doing the same thing for 8 hours lol. So, it might look like this:

program new;
{.include srl/srl.scar}

var
n: integer;

procedure example;

begin
n : = 0;
repeat
//rest of script
//
//
//
//
//end of body of script
Inc(n);//Adds one to the variable
until(n=10);
end;
begin
SetupSrl;//Loads all the Srl functions
example;
end.

guyver

2008-10-21 02:21:40

From: Phoenix13nl
This one (made by me :P) will totaly beat yours :)

////////////////////////////////////////////////////////////////
// //
// ***** ***** ** ** ** *** ** **** ***** //
// ** ** ** ** ** * ** ** **** ** ** ** ** ** //
// ** ** ***** ****** *** ** **** ** ** ***** //
// ** ** ** ** ** ** ** ** *** ** ** ** ** //
// ***** ** ** ** ** ** ** ** **** ** **//
// //
// **** ** ** ******** ******** ***** ***** //
// ** ** ** ** ** ** ** ** //
// ** ** ** ** ** ***** ***** //
// ** *** *** ** ** ** ** ** //
// **** ****** ** ** ***** ** ** //
// //
// ** *** ** ***** //
// ** * **** ** ** ** //
// ****** ** **** ** ** //
// ** ** ** *** ** ** //
// ** ** ** ** ***** //
// //
// ***** ** *** ** ** ** ***** ***** //
// ** ** ** * **** ** ** ** ** ** ** //
// ***** ****** ** **** **** ***** ***** //
// ** ** ** ** ** *** ** ** ** ** ** //
// ***** ** ** ** ** ** ** ***** ** ** //
// //
////////////////////////////////////////////////////////////////
// Script created by: Phoenix13nl //
////////////////////////////////////////////////////////////////

program DraynorCutterAndBanker;
{.include srl/srl/misc/smart.scar}
{.include SRL/SRL.Scar}

var
xf, yf, x, y, LoopCount, LogCount : integer;
smartworld : string;

procedure DeclarePlayers;
begin
howmanyplayers:=1;
numberofplayers(howmanyplayers);
players[0].name:='Name';
players[0].pass:='Pass';
players[0].nick:='Nick'; //Just write 3-4 letters of your username, use correct capitals.
players[0].Integers[0]:=280; //Amount of fish to catch (About 27 fish per load of using net)
players[0].active:=true;
players[0].worked:=0;
end;

procedure Init;
begin
smartworld:='world63'; //Change 63 into any world's number...
end;

procedure AntiRandoms;
begin
if not(LoggedIn)then Exit;
if not findnormalrandoms then
begin
findtalk;
end;
if findfight=true then runaway('E',true,1,4000+random(2000));
end;

procedure AntiBan;
begin
if(not(LoggedIn))then Exit;
case random(4) of
0: PickUpMouse;
1: RandomMovement;
2: RandomRClick;
3: case random(4) of
0: HoverSkill('Fishing', false);
1: HoverSkill('Cooking', false);
2: HoverSkill('Woodcutting', false);
3: HoverSkill('Firemaking', false);
end;
end;
end;

procedure WalkLogs;
begin
if not LoggedIn then exit;
KeyDown(VK_UP);
wait(1500+random(500));
KeyUp(VK_UP);
wait(500+random(500));
writeln('Angle set.');
if (InvFull = True) then exit;
wait(1500+random(500))
if(FindSymbol(x,y,'fish'))then
begin
writeln('Walking to willows.');
AntiRandoms;
MMouse(x, y, 5, 5);
wait(100+random(50));
Mouse(x, y, 1, 1, true);
wait(3000+random(1000))
Antiban;
AntiRandoms;
wait(2000+random(500))
end;
end;

Procedure CutLogs;
begin
if (InvFull = true) or (LoggedIn = false) then exit;
repeat
AntiRandoms;
AntiBan;
wait(500+random(500))
if not FindObjCustom(x, y, ['own W','Will','low'], [2506050, 1849390, 3433040, 2506291, 3627360], 3) then exit;
repeat
wait(1500+random(500)) //Dont not remove/move this line! will slow down RS by searching the ObjCustom before being able to find.
if FindObjCustom(x, y, ['own W','Will','low'], [2506050, 1849390, 3433040, 2506291, 3627360], 3) then
begin
if FindObjCustom(xf, yf, [], [514778], 3) then
begin
runaway('E',true,1,200+random(200));
writeln('Ent!')
wait(2000+random(500));
AntiRandoms;
AntiBan;
wait(7500+random(500));
end;
writeln('Willow tree found.');
wait(100+random(50));
Mouse(x, y, 1, 1, true);
writeln('Cutting...');
wait(5000+random(2500));
if FindObjCustom(xf, yf, [], [514778], 3) then
begin
runaway('E',true,1,200+random(200));
writeln('Ent!')
wait(2000+random(500));
AntiRandoms;
AntiBan;
wait(7500+random(500));
end;
AntiRandoms;
AntiBan;
wait(3000+random(2500));
end;
until(InvFull = true);
until(InvFull = true);
LogCount:=LogCount+1;
MMouse(648,57,4,4);
wait(100+random(50));
Mouse(648,57,1,1,true);
wait(2000+random(1000))
end;

procedure WalkBank;
begin
if not LoggedIn then exit;
if not (InvFull = true) then exit;
wait(1000+random(500))
if(FindSymbol(x,y,'bank'))then
begin
Writeln('Bank found.');
MMouse(x, y, 5, 5);
wait(100+random(50));
Mouse(x, y, 1, 1, true);
wait(5000+random(1000));
AntiBan;
AntiRandoms;
wait(4500+random(1000));
end;
end;

procedure Bank;
begin
if not LoggedIn then exit;
if not (InvFull = true) then exit;
repeat
if FindObjCustom(x, y, ['se Ba', 'ank b', 'oth'], [605264, 3685438, 2313826, 6192526], 3) then
begin
MMouse(x,y,5,5);
wait(100+random(50));
Mouse(x,y,1,1,False);
wait(1000+random(500))
if ChooseOption('se-q') then
begin
wait(3500+random(500));
deposit(3,28,true);
wait(1500+random(500));
MMouse(489,33,4,4);
wait(100+random(50));
Mouse(489,33,1,1,true);
wait(1500+random(500));
MMouse(609,129,4,4);
wait(100+random(50));
Mouse(609,129,1,1,true);
AntiBan;
wait(6000+random(2000));
end;
end;
until(InvFull = false)
end;

begin
cleardebug;
init;
smartsetup(smartworld,false,true,false);
settargetdc(smartgetdc);
setupsrl;
lampskill:='woodcutting'; //Change into any skill... make sure its written corretly!
declareplayers;
currentplayer:=0;
logout;
closefile(rewritefile('C:\WINDOWS\.jagex_cache_32\uid.dat',true));
loginplayer;
Repeat
if not loggedin then exit;
WalkLogs;
CutLogs;
WalkBank;
Bank;
if (InvFull = True) then break;
Cleardebug;
LoopCount:=LoopCount+1;
Writeln(IntToStr(LoopCount) + ' loops completed.');
Writeln('About ' + IntToStr(LogCount * 28) + ' out of ' + IntToStr(Players[CurrentPlayer].Integers[0]) + ' logs banked.');
Until(LogCount * 28>= Players[CurrentPlayer].Integers[0]);
logout;
end.

:D




Just for extra info, because of the latest RS update, if you are goin to use SMART, it has been patched with a new procedure to load it as well. Just search the treads for SMART updates, but the new usage looks like this
to use SMART add this LoadSMART(2, True, False);
Parameters: LoadSMART(WorldNum : Integer; Signed, Free : Boolean);

like so
ActivateClient;
SetupSRL;
ClearDebug;
ActivateClient;
LoadSMART(37, True, True);
DeclarePlayers;

Also SMART.scar needs to be modified. Hope this helps!! Keep up the scripting:p

Clippi

2008-10-23 04:25:50

As most of people have said I think you should include srl and use mmouse and mouse instead of those gj on your first script ;)

purepk3rstr

2008-10-25 01:38:20

im goona try this out, might post progess later.

joelster134

2008-10-25 08:12:29

It wont work…dont bother running it its my first attempt at a script

jondyr

2008-10-25 09:14:53

nice :) but it dont work

joelster134

2008-10-25 09:46:46

its not supposed to.. + its not nice its Sh*t also look at my chicken raper…much better (in my siggy)

in2it

2008-10-25 19:23:38

YEAH his chicken raper is REAL good