JAD
02-28-2007, 09:53 PM
Well.. this maybe a fairly long tutorial, but it may help you a LOT so just keep on reading, should be over before you know it :p a lot of people after they've read a beginner tutorial maybe thinking "what do I do next?" or "where can i go to learn the next steps to scripting?" or they might even get discouraged saying "I've read a beginners tut, and I have been searching for ways to become one but i just can't find anything to read!" well, if you were thinking any of these things, then you've come to the right place! well heres what I would suggest doing to becoming a scripter. this is going to be kind of based on how I got where I am today in scripting, and I am going to be posting a lot of tuts on this forum that you can read, and will teach you how
to become a scripter :) Heres the chapters:
Chapter 1..... OK lets get started!
Chapter 2.....Learning basic SCAR commands for scripting!
Chapter 3..... Learning to make actual scripts using SRL commands!
Chapter 4..... Adding extra features to your scripts!
Chapter 5..... How to solve pesky errors in your scripts.
the End :( ..... what to do after you have done the above.
Chapter 1..... Lets get started!
If you have SRL AND SCAR installed already, skip chapter 1.
OK, if you don't already have SCAR (shite compared to auto rune is what it stands for) then download it at Dylock.net
then once you have done that, Open scar and you should see something like this:
program New;
begin
end.
if you see that then thats great! you have successfully installed SCAR!
now in SCAR click "File" and click "Download Includes" it should take a minute for them to download. then once you have done that, go to:
http://www.villavu.com/forum/showthread.php?t=2802?t=3410
read that tutorial and download SRL. once you have downloaded SRL, take out what was in SCAR before, copy and past this into it:
program New;
{.include SRL/SRL.scar}
begin
ClearDebug;
SetupSRL;
end.
Now hit the green arrow which will run it. if you get something like this:
SRL Compiled in 782msec.
Successfully executed
in the little debug box in SCAR (or something like that, the amount of msec's maybe different) then you have successfully installed SRL! WOOT! Moving on..
Chapter 2..... Learning SCAR commands for scripting!
well, if you have read the above chapter 1, you maybe thinking "Well this is boring, when do i get to script!" Well it starts right here! if you don't know basic scar commands, or you haven't read a beginner tutorial to scripting SCAR then I would strongly suggest going to either of these links:
http://www.villavu.com/forum/showthread.php?t=4625
thats whocares357's guide to learning to script SCAR as a beginner. very good guide. this is the guide i first started with.
http://www.villavu.com/forum/showthread.php?t=581
another good guide to learning to script SCAR as a beginner. I read this guide after i read whocares357's, I just kinda scrolled through it and zipped past the stuff it talked about in his, cause i understood variables and all that from whocares guide already. you may choose to read this guide first though, both are very good.
http://www.villavu.com/forum/showthread.php?t=2027
another good guide. I didn't really read it too much because when i read the tuts above, i read really slowly so i can understand them :p so really i just kinda scrolled through it and looked at some stuff that wasn't in the other 2 or wasn't explained well in the other 2.
Also you could just open SCAR and press f1 to open a tutorial, not as well explained as the ones above though if you ask me.
OK now once you have read a tut or 2, you should now understand almost everything they talked about. Moving on..
Chapter 3.....learning how to make actual scripts using SRL commands!
OK now that you understand basic SCAR commands, you should read one of my other tutorials to learn SRL commands and how to use them. should be pretty simple if you understand what was taught above :):
http://www.villavu.com/forum/showthread.php?t=6366
just go there and read that. just mess around with some things from there, that will teach you a lot of things. after you read that you should know how to use some very basic but important SRL commands. you should also be able to make a basic color clicker, an auto talker, a progress report to add to scripts and more! that tutorial only features some of the many SRL commands. to learn all of them, download the SRL manual from here:
http://www.villavu.com/forum/showthread.php?t=2802?t=3410
Moving on..
Chapter 4.....Adding extra features to your scripts!
OK now's where this tutorial gets fun! you should now know about making some scripts and things, you might even know how to make a simple power miner from reading my other tutorial. heres where we will add extra features to our scripts to make it look cool. i took some of these examples out of my power miner which i have posted in the SRL free scripts section. now lets begin, I'm going to go straight to some examples first
Anti Ban
function DoAntiBan: Boolean;
begin
AntiBan;
wait(50 + random(100));
BoredEvery(3 + random(3));
wait(100 + random(100))
RotateEvery(7 + random(4));
wait(750 + random(250));
LeaveScreenEvery(5 + random(7));
wait(500 + random(150));
end;
OK now here is some cool anti ban procedures i took out of my power miner. lets break this down. the AntiBan makes the script randomly do some random chatting and other things. then it will do BoredHuman things that you'd do if you have been bored out of your mind mining rune ess or something for 5 hours straight :p the RotateEvery makes it rotate the screen around a few times for anti ban. LeaveScreenEvery makes the mouse leave off the runescape screen which normal people probably do a lot when playing. the timing is in minutes, and in this: (3 + random(3)) it will wait 3-6 minutes randomly and then it will do whatever was said to do. I hope you go that, now lets go to the next part of this chapter.
Options and DTM's
this maybe very confusing but I will do my best to explain it :p first of all, this is now for intermediates here. to learn DTM's (which I am using in my next example) I would suggest going to yohojo's tutorial here:
http://www.villavu.com/forum/showthread.php?t=564
thats a very good tutorial and explains using DTM's very well. now lets go the the options part of this section :p :
procedure DropOre;
var Ore, x, y: Integer;
begin
if (not (loggedin)) then
Exit;
Ore := DTMFromString('78DA63AC64666078CBC8800EFEC36820604 C0' +
'7AAF98CAE86118904D2B94035CF08A8A903AA7944404D2B11 E694' +
'02D5FC22A0A604A8E63E7E3500A8CD0ECB');
GameTab(4);
if (DropCeptPick = false) then
begin
repeat
if FindDTM(Ore, x, y, 820, 471, 995, 733) then
begin
MMouse(x, y, 0, 0);
wait(200 + random(100));
Mouse(x, y, 4, 6, false);
if (ChooseOption(x, y, 'rop')) then
end;
until (not (FindDTM(Ore, x, y, 820, 471, 995, 733)));
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = false) then
begin
DropTo(2, 28);
end;
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = true) then
begin
DropAll;
end;
end;
end;
OK now don't freak out! I know this may seem confusing at first but it really isn't. lets break it down. I have a procedure name first of course. then I have a failsafe, if(not(LoggedIn)then Exit so if its not logged in it will not try to do this procedure. then we have a DTM, which you should know about if you read yohojo's tutorial for DTM's. GameTab(4) just opens the 4th game tab (inventory) easy enough so far eh? now heres where its a little more complicated :p but I'll try to keep it easy :p :
if (DropCeptPick = false) then
begin
repeat
if FindDTM(Ore, x, y, 820, 471, 995, 733) then
begin
MMouse(x, y, 0, 0);
wait(200 + random(100));
Mouse(x, y, 4, 6, false);
if (ChooseOption(x, y, 'rop')) then
end;
until (not (FindDTM(Ore, x, y, 820, 471, 995, 733)));
OnlyDropOres is a constant in the script which I did not post. and the user set that to true, It will only drop ores, because it will only drop the DTM (which in this case is a DTM of the ore) then we have it repeat. if FindDTM, just means if it finds the DTM of course. Ore is what we named the DTM. and you should know about the x,y and the numbers after that. so now, if it finds the DTM then it will begin the part where it moves the mouse to the DTM, waits 200-300 miliseconds of course, then it clicks the mouse. then the
if (ChooseOption(x, y, 'rop'))then means it will click on the rop, rop aka Drop. we pick something like rop because its something nobody would ussually say in all chat or something like that. and then of course it will repeat that until it doesn't find the DTM. Next part:
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = false) then
begin
DropTo(2, 28);
end;
OK, this is more simple. now in DropCeptPick, this is an option I made because when random events come, sometimes you may want the script to drop the stuff from randoms. so for this option, if you want it to drop everything except the pick, and (Players[CurrentPlayer].Boolean1 = false) then it will drop everything besides whats in the first inventory slot (your pick :) ) the .Boolean1 is what i had in the declare players section of my script. false for pick not equipped, true for equipped. so now we got that (hopefully) lets go to the last part:
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = true) then
begin
DropAll;
end;
end;
end;
so what this does is if DropCeptPick=true and your pick is equiped it drops everything in inventory. same as above. the extra "end;"s are just for closing the begins above it. so as you can see, options can be pretty cool, and you can use your own ideas as I did here. Moving on..
Chapter 5.....How to solve pesky errors in your scripts.
Well when your scripting, unfortunately there will always be errors that you will encounter, but before you go asking for help in the scripting part of the section, try reading one of my other tutorials:
http://www.villavu.com/forum/showthread.php?t=6413
if that doesen't help you at all, then try for a minute figuring out the problem on your own. if you still can't get it, then ask for some help :) or you can just add me on MSN: runescapemacro@hotmail.com and you can always feel free to pm me too :)
the End :( .....what to do after you have done the above.
well, after you have done the above I would just suggest reading through the SRL manual a lot and trying to learn some things, you could go to the tutorial Island section too and read some things on radial walking and Forms. theres probably other things for tuts that you might want to learn too. after that though, best way to learn to script is looking at other people's scripts and trying to see what you can make out of them. if you want a good example, click on My PowerMiner in my sig :D also just ask as many questions as possible, thats how you learn, unless of course the question can be answered without asking it :p well thats my tut. feel free to plus rep me or post any compliments or ways to improve this tut :) thanks for reading.
to become a scripter :) Heres the chapters:
Chapter 1..... OK lets get started!
Chapter 2.....Learning basic SCAR commands for scripting!
Chapter 3..... Learning to make actual scripts using SRL commands!
Chapter 4..... Adding extra features to your scripts!
Chapter 5..... How to solve pesky errors in your scripts.
the End :( ..... what to do after you have done the above.
Chapter 1..... Lets get started!
If you have SRL AND SCAR installed already, skip chapter 1.
OK, if you don't already have SCAR (shite compared to auto rune is what it stands for) then download it at Dylock.net
then once you have done that, Open scar and you should see something like this:
program New;
begin
end.
if you see that then thats great! you have successfully installed SCAR!
now in SCAR click "File" and click "Download Includes" it should take a minute for them to download. then once you have done that, go to:
http://www.villavu.com/forum/showthread.php?t=2802?t=3410
read that tutorial and download SRL. once you have downloaded SRL, take out what was in SCAR before, copy and past this into it:
program New;
{.include SRL/SRL.scar}
begin
ClearDebug;
SetupSRL;
end.
Now hit the green arrow which will run it. if you get something like this:
SRL Compiled in 782msec.
Successfully executed
in the little debug box in SCAR (or something like that, the amount of msec's maybe different) then you have successfully installed SRL! WOOT! Moving on..
Chapter 2..... Learning SCAR commands for scripting!
well, if you have read the above chapter 1, you maybe thinking "Well this is boring, when do i get to script!" Well it starts right here! if you don't know basic scar commands, or you haven't read a beginner tutorial to scripting SCAR then I would strongly suggest going to either of these links:
http://www.villavu.com/forum/showthread.php?t=4625
thats whocares357's guide to learning to script SCAR as a beginner. very good guide. this is the guide i first started with.
http://www.villavu.com/forum/showthread.php?t=581
another good guide to learning to script SCAR as a beginner. I read this guide after i read whocares357's, I just kinda scrolled through it and zipped past the stuff it talked about in his, cause i understood variables and all that from whocares guide already. you may choose to read this guide first though, both are very good.
http://www.villavu.com/forum/showthread.php?t=2027
another good guide. I didn't really read it too much because when i read the tuts above, i read really slowly so i can understand them :p so really i just kinda scrolled through it and looked at some stuff that wasn't in the other 2 or wasn't explained well in the other 2.
Also you could just open SCAR and press f1 to open a tutorial, not as well explained as the ones above though if you ask me.
OK now once you have read a tut or 2, you should now understand almost everything they talked about. Moving on..
Chapter 3.....learning how to make actual scripts using SRL commands!
OK now that you understand basic SCAR commands, you should read one of my other tutorials to learn SRL commands and how to use them. should be pretty simple if you understand what was taught above :):
http://www.villavu.com/forum/showthread.php?t=6366
just go there and read that. just mess around with some things from there, that will teach you a lot of things. after you read that you should know how to use some very basic but important SRL commands. you should also be able to make a basic color clicker, an auto talker, a progress report to add to scripts and more! that tutorial only features some of the many SRL commands. to learn all of them, download the SRL manual from here:
http://www.villavu.com/forum/showthread.php?t=2802?t=3410
Moving on..
Chapter 4.....Adding extra features to your scripts!
OK now's where this tutorial gets fun! you should now know about making some scripts and things, you might even know how to make a simple power miner from reading my other tutorial. heres where we will add extra features to our scripts to make it look cool. i took some of these examples out of my power miner which i have posted in the SRL free scripts section. now lets begin, I'm going to go straight to some examples first
Anti Ban
function DoAntiBan: Boolean;
begin
AntiBan;
wait(50 + random(100));
BoredEvery(3 + random(3));
wait(100 + random(100))
RotateEvery(7 + random(4));
wait(750 + random(250));
LeaveScreenEvery(5 + random(7));
wait(500 + random(150));
end;
OK now here is some cool anti ban procedures i took out of my power miner. lets break this down. the AntiBan makes the script randomly do some random chatting and other things. then it will do BoredHuman things that you'd do if you have been bored out of your mind mining rune ess or something for 5 hours straight :p the RotateEvery makes it rotate the screen around a few times for anti ban. LeaveScreenEvery makes the mouse leave off the runescape screen which normal people probably do a lot when playing. the timing is in minutes, and in this: (3 + random(3)) it will wait 3-6 minutes randomly and then it will do whatever was said to do. I hope you go that, now lets go to the next part of this chapter.
Options and DTM's
this maybe very confusing but I will do my best to explain it :p first of all, this is now for intermediates here. to learn DTM's (which I am using in my next example) I would suggest going to yohojo's tutorial here:
http://www.villavu.com/forum/showthread.php?t=564
thats a very good tutorial and explains using DTM's very well. now lets go the the options part of this section :p :
procedure DropOre;
var Ore, x, y: Integer;
begin
if (not (loggedin)) then
Exit;
Ore := DTMFromString('78DA63AC64666078CBC8800EFEC36820604 C0' +
'7AAF98CAE86118904D2B94035CF08A8A903AA7944404D2B11 E694' +
'02D5FC22A0A604A8E63E7E3500A8CD0ECB');
GameTab(4);
if (DropCeptPick = false) then
begin
repeat
if FindDTM(Ore, x, y, 820, 471, 995, 733) then
begin
MMouse(x, y, 0, 0);
wait(200 + random(100));
Mouse(x, y, 4, 6, false);
if (ChooseOption(x, y, 'rop')) then
end;
until (not (FindDTM(Ore, x, y, 820, 471, 995, 733)));
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = false) then
begin
DropTo(2, 28);
end;
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = true) then
begin
DropAll;
end;
end;
end;
OK now don't freak out! I know this may seem confusing at first but it really isn't. lets break it down. I have a procedure name first of course. then I have a failsafe, if(not(LoggedIn)then Exit so if its not logged in it will not try to do this procedure. then we have a DTM, which you should know about if you read yohojo's tutorial for DTM's. GameTab(4) just opens the 4th game tab (inventory) easy enough so far eh? now heres where its a little more complicated :p but I'll try to keep it easy :p :
if (DropCeptPick = false) then
begin
repeat
if FindDTM(Ore, x, y, 820, 471, 995, 733) then
begin
MMouse(x, y, 0, 0);
wait(200 + random(100));
Mouse(x, y, 4, 6, false);
if (ChooseOption(x, y, 'rop')) then
end;
until (not (FindDTM(Ore, x, y, 820, 471, 995, 733)));
OnlyDropOres is a constant in the script which I did not post. and the user set that to true, It will only drop ores, because it will only drop the DTM (which in this case is a DTM of the ore) then we have it repeat. if FindDTM, just means if it finds the DTM of course. Ore is what we named the DTM. and you should know about the x,y and the numbers after that. so now, if it finds the DTM then it will begin the part where it moves the mouse to the DTM, waits 200-300 miliseconds of course, then it clicks the mouse. then the
if (ChooseOption(x, y, 'rop'))then means it will click on the rop, rop aka Drop. we pick something like rop because its something nobody would ussually say in all chat or something like that. and then of course it will repeat that until it doesn't find the DTM. Next part:
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = false) then
begin
DropTo(2, 28);
end;
OK, this is more simple. now in DropCeptPick, this is an option I made because when random events come, sometimes you may want the script to drop the stuff from randoms. so for this option, if you want it to drop everything except the pick, and (Players[CurrentPlayer].Boolean1 = false) then it will drop everything besides whats in the first inventory slot (your pick :) ) the .Boolean1 is what i had in the declare players section of my script. false for pick not equipped, true for equipped. so now we got that (hopefully) lets go to the last part:
if (DropCeptPick = true) and (Players[CurrentPlayer].Boolean1 = true) then
begin
DropAll;
end;
end;
end;
so what this does is if DropCeptPick=true and your pick is equiped it drops everything in inventory. same as above. the extra "end;"s are just for closing the begins above it. so as you can see, options can be pretty cool, and you can use your own ideas as I did here. Moving on..
Chapter 5.....How to solve pesky errors in your scripts.
Well when your scripting, unfortunately there will always be errors that you will encounter, but before you go asking for help in the scripting part of the section, try reading one of my other tutorials:
http://www.villavu.com/forum/showthread.php?t=6413
if that doesen't help you at all, then try for a minute figuring out the problem on your own. if you still can't get it, then ask for some help :) or you can just add me on MSN: runescapemacro@hotmail.com and you can always feel free to pm me too :)
the End :( .....what to do after you have done the above.
well, after you have done the above I would just suggest reading through the SRL manual a lot and trying to learn some things, you could go to the tutorial Island section too and read some things on radial walking and Forms. theres probably other things for tuts that you might want to learn too. after that though, best way to learn to script is looking at other people's scripts and trying to see what you can make out of them. if you want a good example, click on My PowerMiner in my sig :D also just ask as many questions as possible, thats how you learn, unless of course the question can be answered without asking it :p well thats my tut. feel free to plus rep me or post any compliments or ways to improve this tut :) thanks for reading.