JAD
2007-04-30 18:38:11
Hey there. If you are a complete beginner, please check out some other tutorials in the beginners section before reading up on this. You must know basic pascal, and some basic SRL stuff like like how to make a color clicker that uses Mouse and MMouse and some other basic SRL functions.
Here's a list of people who have became SRL members after reading this tutorial and requested me to add them to the list:
- Nava2 //Can't believe that…
- The Claw //This either
- skilld u
- cut em2 it
- stur pure
- footballjds
- del_signo
- the scar noob
- Lalaji
- BobboHobbo
- Tim0suprem0
- dudenow12
- CheetahNub
- Negaal
- NaumanAkhlaQ
- itschris917
- hellbb88
- LordGregGreg
- hy71194
- IEatJ00erBaybees
- rudeboialex
- badandymitch
- steth1010
- Dunceiam
- belgin fish
- NewToAutoing
- ashur2good
- Kaitnieks
- WT-Fakawi
- Wizzup?
- Boreas
- Dankness
OK.. well, maybe not the last 5 lol :p If you read this tutorial and became a member after reading it, please post your name and I'll add it to the list! :D
Heres what this tutorial will go over (What I look for when voting on an app):
- Scripting standards. *UPDATED*
- DTMs and Bitmaps.
- Anti randoms.
- Anti ban.
- Multi player/player switching.
- Fail safes (Oh so important!). *UPDATED!*
- for to do statements (Great for looping!)*NEW*
- Important use of cases!*NEW*
Here's all the things that you wouln't need, but you really should have if you want to improve your odds of getting accepted:
- Radial walking ( a huge ++ of your odds of getting accepted).
- Bank Finding, opening and depotising.
- Covered symbol finding (Important in a walking script that you are going to click on symbols with)*NEW*
OK, now lets get started!
Scripting Standards!
Now, this is something that really bugs me when people don't use correct ones (Or close to it anyways) And it makes my head hurt trying to read through there code.
Now, they aren't as hard as they look, there actually is a simple pattern to them:
- 2 spaces to the code after a begin
- 2 spaces to the code after a repeat
- 2 spaces back for an end
- 2 spaces back for an until
- 2 spaces after a case
- 2 spaces after a then without a begin after it
So thats about it. Let me give you an example on How you'd do it:
program JADsUber;
procedure DoStuff;
begin
MMouse(100,100,2,2);
repeat
TypeSend('Jad is so cool!');
until(not(FindColor(x,y,123123,MMX1,MMY1,MMX2,MMY2)));
case random(2) of
0: TypeSend('JADs tutorial is sooo awesome!!!!!');
1: TypeSend('JADs tut is sooo awesome!!!!!');
end;
if(FindColor(x,y,123123,MSX1,MSY1,MSX2,MSY2))then
Mouse(x,y,0,0,true);
end;
begin
repeat
DoStuff;
until(False);
end.
see? I did 2 spaces after every begin and repeat, 2 spaces back for the ends and untils. for the case, you just move the numbers like 0: and 1: up too, then the "end;" to close the case you go back 2 (just like any other end;). And then the if(FindColor thing I put 2 spaces for the next line because there's no begin.
So thats pretty easy right? Its also a lot easier to make sure you have an end for each repeat, and things like that. because if you did it correctly, your last end; will always have no spaces after it.
DTMs and Bitmaps
What is a Bitmap?
Answer: A Bitmap is pretty much a picture on the computer, taking each pixel and turning it to text so you can put the text in SCAR.
What is a DTM?
Answer: A DTM looks for a color, and looks for the next color in a certain distance away from it. For instance, if you clicked somewhere on a log, and another point on the log, it would measure the distance between the 2, take the colors, and then it would look for the first color, checking if the color is the distance away from the first click as you made it before.
Making the bitmap
First, lets start with bitmaps. First I'll tell you how to make one, then we will learn how to use them in a moment. First, open runescape, log in, and press the print screen key located at the top of your key board (On most key boards at least). Different key boards sometimes have different abbreviations for the print screen key, so it may say PrtSC…etc. Your smart though, you can find it ;)
Now open up paint, hold control and press v while holding control. The picture should have popped up in paint now.
Now we are going to chop down the image so it doesn't look for the whole runescape screen. Click on the magnifying glass so you can zoom in on what you want, and be more precise. Use the little rectangular tool in paint, and click and drag to make a box with the picture you want inside the box.
Now right click on the rectangle/box you made, and click copy. Open a new paint, or just click new and erase what you had. Make the white thing as small as possible, hold control and then press v while holding control. Now you have your image chopped down!
Now save it to somewhere you'll remember, open up SCAR, click the tab script, click picture to string. Click open, and look for the picture where you saved it in your files. Double click it and it'll open in to the picture to string window thing. Press ok and in the debug you should have a lot of text saying Bitmap := 'aosignowha' and probably a LOT longer then that :p
Using the bitmap.
Now to use a bitmap, there are many many different ways too. Lets say you made the bitmap of a tree on the main screen. What I'd suggest doing to find it, is Do something like this:
The Bitmap := thing, replace the "Bitmap" with whatever you want to call it (Example, you could call it Willow or Log or even philip :p….etc.) Now make a variable called whatever you replaced "Bitmap" with. Lets say you made the bitmaps name Tree. Now heres what we are going to do:
var Tree, TreeColor: Integer;
procedure AutoColorTheTree;
begin
Tree := BitmapFromString'aoginwagowiaghwagwagawgwg'; //the bitmap.. you get it.
TreeColor := AutoColorThis(Tree,100,MSX1,MSY1,MSX2,MSY2);
Writeln(IntToStr(TreeColor));
end;
So let me explain that. First we have the variables. then in the procedure I declared the bitmap, And then with the TreeColor := thing. What AutoColorThis does is looks for the bitmap that you put after the ( (tree in this instance), and picks a color from there and of course then TreeColor = it because thats what we have it equal.
So then TreeColor = whatever the color was picked at, and then you can have it click the tree or do whatever you want. Here I had it just writeln the color so you can see how it works. The bitmap Has to be visible in the coordinates box you made! So MSX1,MSY1…etc. looks for the bitmap on the main screen.
the 100 is the maximum tolerance to look for the bitmap with. If it does not find the bitmap after exceeding the maximum tolerance, it will writeln Color NOT found! because thats built into that function in SRL. Hope that wasn't too confusing.. lets move on to DTMs! :D
Making DTMs
Well DTMs are mostly used for items in your inventory/bank, because that is when they are most efficient because items in your inventory/bank are never at a different angle, and they have a black outline.
So to make a DTM, first take a screen shot like we did with the Bitmap. Open up paint, paste the screen shot in there, open up SCAR and drag the crosshair of SCAR onto paint.
Now once thats all done, click tools and go to DTM editor. Now a screen should pop up with your screen shot on it. To make the DTM, click some points on an item or whatever you want.
Once you have all the specified points of the item or whatever it is your making, click on the top parent in the right hand corner of the DTM editor. make the tolerance 30 and make the Area Size 3. Click the next parent and change the tolerance and Area…..etc. Do that until all the parents equal 30 tol and Area Size of 3.
Now click DTM to text. You should have some letters and things like that just like the bitmap. name it what you want, and make a variable just like we did with bitmaps. Easy enough right? Hope I explained that well enough! :D
Using the DTM
Note: In the example below, I just made the DTM log. You can make it whatever you want.
Now to use the DTM, all you need to do is something like this:
var Log: Integer;
procedure DoWhatever;
begin
Log := DTMFromString('.....etc');
if(FindDTM(Log,x,y,Coords1,Coords1,Coords2,Coords2))then
begin
Mouse(x,y,2,2,true);
Writeln('clicked the DTM!');
end;
end;
See how that works now? Just in the Coords thing make your own coords box. Just like a bitmap once you make it.
Just so you know though, DTMs are pretty advanced to do on the main screen/mini map or anything other then inventory and bank. So I wouldn't try to use them on there yet, just use bitmaps or color finding for that.
If I didn't explain DTMs well enough, you could always check out Yohojo's tut too :p
Anti randoms
Now, I'll give you the anti randoms functions/procedures I use in my scripts:
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;
///////////////////////////////////////////////////////////////////////////
procedure FindRandoms;
begin
FindFastRandoms;
FindNormalRandoms;
end;
OK, now first of all, in the FindRandoms procedure, (Don't pay attention to the FindFastRandoms function yet, I'll talk about that in a sec) We have FindNormalRandoms;. SRL makes random finding so easy with that. This finds all talking randoms, all fighting randoms, mystery boxes, lunch lady….etc. It does not however find the impossible to solve randoms (Like EvilBob…etc).
Now what FindNormalRandoms doesn't cover, is what FindFastRandoms does. FindFastRandoms was made by WT-Fakawi, and you can use it in your script if you give credits to him for it of course. (Almost everybody uses it.) What it does is looks for things that FindNormalRandoms; doesn't like mods…etc.
Now, to find all talking randoms efficiently, SRL uses this:
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
What that does, is creates a bitmap mask of your current players nick in the Declare players procedure. (The Declare players procedure I talk about in multi player/player switching..) A nick is 3-4 letters of your user name, which to work most efficiently should have no capitals, and not be a word.
Then when a talking random comes, FindNormalRandoms; will find that bitmap mask of the talking random Saying Hello JAD (or whatever your name is).
Anti Ban
Well, here is my custom AntiBan function I made. Please don't copy this and use it in your own script, make something using a case statement like this using custom things you made. Here it is:
procedure AntiBanage;
begin
if(not(LoggedIn))then
Exit;
case Random(13) of
0: RandomRClickEvery(3 + Random(3));
1: begin
HoverSkill('Fishing', false);
wait(2000+random(1000));
GameTab(4);
end;
2: begin
HoverSkill('Cooking', false);
wait(2000+random(1000));
GameTab(4);
end;
3: JADCompass;
4: RandomChatEvery(4 + Random(4));
5: LeaveScreenEvery(10 + Random(4));
6: PickUpMouse;
7: BoredEvery(10 + Random(5));
8: begin
GameTab(1 + Random(12));
wait(1000+random(1000));
GameTab(4);
end;
9: begin
case random(4) of
0: TypeSend('Fishing lvls?');
1: TypeSend('Fishing levels');
2: TypeSend('Cooking lvls');
3: TypeSend('Cooking levels');
end;
end;
10: MouseBox(MSX1,MMY1,MMX2,MMY2,3);
11: AntiBan;
12: SleepAndMoveMouse(600000+random(300000));
end;
end;
OK, now we are going to look at this number by number. First of all though, we have a random 13 case. This will randomly choose one of these anti bans we made so we don't keep doing the same thing, which would almost make us more detectable to Jagex. If its not logged in it exits (A Failsafe, I will be talking about that soon too).
0: RandomRClick performs random right clicking. the parameters are in minutes of when you want it to do it. so I have it every 3-6 minutes randomly.
1: HoverSkill opens the skills tab, and hovers the skill of your choice. The false means not to click, if you put true that would mean click on the skill. Then I have it wait a little, and go back to the inventory tab.
2: I have it do almost exactly the same thing as 1:, but it hovers over the skill cooking.
3: JADCompass; is a procedure I made in my script which I'll be releasing soon :p The procedure just rotates randomly then makes the compass north again. You can make your own procedure for that too.
4: RandomChatEvery does just what you'd think it does. It types random sentances. The numbers are in minutes of when to click just like for 0:.
5: LeaveScreenEvery also does just what you'd think it does. It moves the mouse off the runescape client. The numbers are in minutes of when to click just like for 0: and 4:.
6: PickUpMouse acts just like you picked the mouse up off the mouse pad, and set it back down.
7: BoredEvery just performs bored human actions you'd do when your extremely bored. And I've talked about the numbers 3 times before this already.. :p
8: Just clicks a random game tab, waits a little and clicks back on the inventory tab.
9: I just made my own random chatting to ask fishing or cooking levels.
10: MouseBox moves the mouse randomly to a point in the coordinates box you specified. My coordinate box is of the main screen, so it just moves the mouse to a random spot on the main screen.
11: AntiBan; just does some random stuff :p
12: SleepAndMoveMouse moves the mouse like a bored human would. different then 10: because it doesn't just move straight there.
Multi player
Ahh yes, the almighty multi player. Well first of all, heres how a player array would look for multi player:
procedure DeclarePlayers;
begin
HowManyPlayers := 6; //Number of PLAYERS. active or not.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Player to start on.
//set all user names, passwords and nicks correctly please.
Players[0].Name := 'Jadseven';
Players[0].Pass := 'Password';
Players[0].Nick := 'dsev';
Players[0].Active := True;
Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := '3-4 letters of UserName';
Players[1].Active := False;
Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := '3-4 letters of UserName';
Players[2].Active := False;
Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := '3-4 letters of UserName';
Players[3].Active := False;
Players[4].Name := 'UserName';
Players[4].Pass := 'Password';
Players[4].Nick := '3-4 letters of UserName';
Players[4].Active := False;
Players[5].Name := 'UserName';
Players[5].Pass := 'Password';
Players[5].Nick := '3-4 letters of UserName';
Players[5].Active := False;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
See at the bottom, we used that thing NickNameBMP just like we do for the AntiRandoms thing. Just put it in there and you should be good :D Now you should already know how to fill one out and stuff like that.
Now to switch players, you need a procedure like that near the beginning of your script, and then do something like this:
if(LoadsNumB=Loads)then
begin
NextPlayer(True);
LoadsNumB:=0;
HighestAngle;
MakeCompass('N');
Writeln('Switched players successfully! :)');
end;
Let me explain what I did first of all. You should already know about making a progress report, so this should be easy. LoadsNumB is a variable I made, and I add to it each time I bank something. Loads is a constant that the user sets for how many loads to do before switching players.
So pretty much, if it did the specified number of loads, It switches players.
NextPlayer(True) switches players leaving the ones activity you switched off of to true.
NextPlayer(False) switches players leaving the ones activity you switched off of to false.
Then I make LoadsNumB = 0 again so that it restarts counting the loads.
But heres the problem I encountered before. When you make LoadsNumB = 0, and you want to display how many loads you did in the progress report, it will = 0 again! So you can't make a progress report! Actually, you still can though :D All you need to do is set 2 variables, and add 1 to them each time you do a load.
Then the first variable you make display in the progress report and that never goes to 0, and the other one you just use for counting how many loads the player has done.
Then I just make it go to the highest angle for the new player, make the compass North and Write in the Debug that you switched players.
Continued below…