PDA

View Full Version : Implementing Randoms and Anti-ban into YOUR script.



Junior
04-09-2007, 05:57 PM
All About anti-ban and randoms

BY: Junior

I don’t know if a tutorial like this was already made, but I see a lot of people asking how to implement/add anti-ban or randoms into there script. These procedures and functions are NOT mine, there come straight out of SRL. You will need the newest version of SRL for this tutorial, found in the Download SRL here section (http://www.villavu.com/forum/showthread.php?t=2802?t=3410).

EDIT: Yes, there also is a tutorial on this by WhiteShadow. Link here (http://www.villavu.com/forum/showthread.php?t=633).

So, your probably here wondering how to implement some anti-ban into your script, well you came to the right place. Anti-ban is simply a procedure, function, or a collection of both coded into your script to make it seem more human like and solve some randoms for you, don’t expect to have all randoms solved, ill talk about that later on anyway. It can be from making a random mouse movement, to clicking on something, rotating the screen, or whatever floats your boat. Now, I will start with the basics, and move on to more procedures and then to functions, and how to actually use functions efficiently.

First I will talk about: How to make random mouse movements
This isn’t that important, but its better then just leaving the mouse sit. For something like this, I will use the procedure MouseBox. MouseBox is a procedure were your mouse moves to a random coordinate in a box you set as the area. I’ll show you how its coded.
MouseBox(MSx1, MSy1, MSx2, MSy2, 3); This will move the mouse to a random coordinate on the main screen, or you can change the area you whatever you wish. The last number in that procedure is the type of click you want. 1 = left click, 2 = right click, 3 = NO click. I’ll leave it to 3 so it just moves the mouse for us. If you don’t know what MSx1, MSy1, are etc… Those are cords that are already set for the main screen. The others are MIx1, MIy1, MIx2, MIy2 for the Inventory, and there’s MMx1, MMy1, MMx2, MMy2. Those are set for the Mini map.
Now for those of you that don’t know this, there is a procedure where it hovers over your skills as if you were checking the exp. This procedure is called… HoverSkill. HoverSkill is coded like this. HoverSkill('Attack', False) This will hover over the skill you put into the string (''), and the last part where it says False, it is there for if you want there to be any clicking. Obviously, false means no clicking. You can also insert the word Random into the hover skill string, that makes it hover over any random skill. The word False or a identifier resulting only True or False is considered a boolean by the way. There is also procedures such as AntiBan, BoredHuman, and PickUpMouse. Check this (http://www.srl-forums.com/forum/Manual.php?do=AntiBan) or this (http://www.srl-forums.com/forum/Manual.php?do=xAntiBan) out for more procedures.

Now, I will talk about: Combining procedures and functions
into a group, or choose a random one out of the ones you provided. I will use the procedures I used above in a special procedure to select a random one. This procedure is called a case. Cases can be used in many ways, but ill show you this way. I will start off by doing this. case Random(10) of That is basically choosing a random number from the range of 0 to 10. Now ill code out the whole procedure for you.

case Random(10) of
2: MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
4: HoverSkill('Attack', False); // or HoverSkill('Random', False);
6: MouseBox(MIx1, MIy1, MIx2, MIy2, 3);
9: BoredHuman;
end; //You need this end, think of a case as like a 'begin'

Now ill explain, the case will chose a random number from the range of 0 - 10. If it picks a number that matches the number in the case (either 2, 4, 6, or 9) then it will perform that procedure that the number has. Like me when I first started out with cases, I didn’t know this. If the number is not there, and in this case there 1, 3, 5, 7, 8, or 10, NO procedure or function will be performed, it will just exit out of the case. For more about cases, look here (http://www.villavu.com/forum/showthread.php?t=1002?t=1155&highlight=cases).

Now I will talk about: Random Chatting/ Auto-talking
I will not get into detail with this, but most people like auto talkers and such. Personally, I never use them because I think there’s not need if you auto correctly. To detect chat in the chat box, you the function InChat, or InChatMulti. This function is a Boolean, you should now what that is by now (read above if you dont). It is coded like this.
if (InChat('yo')) then TypeSend('whats up?'); That’s saying if the word "yo" appears in the chat box, then you will type "whats up". Remember, if there is more then 1 procedure after a then you need a begin. Most people don't know this, I sure didn’t when I started scripting. An example of what I am saying

if (InChat('yo')) then
begin
Wait(500 + Random(500));
TypeSend('whats up?');
end;

//InChatMulti works the same way, just coded like below.
if (InChatMulti('he', 'ell', 'llo')) then Without the begin, it will only wait, but type what’s in the TypeSend procedure regardless. And remember for every begin, you need an end. There is also a procedure where it chats for you, randomly. This procedure is called RandomChatEvery. That procedure is coded like this, RandomChatEvery(2 + Random(2)); the integers (numbers) in that procedure mean that it will random chat every 2 plus a random 2 minutes. This wasn’t much on auto talking/random chatting, but there’s a better tutorial on this made by WT-Fakawi. This link (http://www.villavu.com/forum/showthread.php?t=1143?t=1310), all credits go to Fawki. Or take a look at this link (http://www.srl-forums.com/forum/Manual.php?do=AutoTalk) for a SRL manual page.

Now I will talk about: Finding and solving Random Events
This is what you guys want to know isn’t it? Well, its easy to tell you the truth. You will only need a couple of procedures for random events to be solved. First you will need a DeclarePlayers procedure.

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

Players[0].Name := 'Usernamehere';
Players[0].Pass := 'Passwordhere';
Players[0].Nick := 'Nicknamehere'; //3 - 4 letters of YOUR username, example: sern
Players[0].Active :=True;
end;

You will also need a procedure to create a bitmap of your nickname, and this is VERY VERY important, or NO talkin random event will be solved for you. The procedure is simply
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
That will need to be in the main loop towards the beginning , it only needs to be called once per player. Say a Frog comes up now, or a Old Man, or Rick, or anyone who says your name, the procedure that is used in functions to look for your name is the NickNameBMP, that I posted above. The most popular used random finding procedure is called FindNormalRandoms. It will look for all normal randoms. Some randoms like ScapeRune, Mime, Maze, and some others can NOT be solved by the difficultness of them. So for these you will need different functions. They are called FindScapeRune, FindMime, FindMaze. There is also a function that detects whether you are dead or not, called WeAreDead. The function FindTalk finds talking randoms, and you can also use FTWait(1000 + Random(500)), which waits while finding talking randoms, although FTWait, is NOT a function. To see more functions for finding randoms or to detect anything else like finding a fight, check out this link (http://www.srl-forums.com/forum/Manual.php?do=AntiRandoms).

This will explain: Skill based randoms and how to solve them
Skill base randoms are considered ents, whirlpools, and gas (while mining). There are special functions for these. The procedure FindEnt(TreeColor: integer) is used to… find an ent. Where it says TreeColor, that’s the color of the tree, obviously. So it would look like FindEnt(21321432); //NOT an actual tree color. There’s nothing really to explain about these, but this link (http://www.srl-forums.com/forum/Manual.php?)will provide you with what procedures or funtions to use during what skill your macroing on. Look at the left for the word Skill Includes, and all skills will be listed.

Let me explain how to: Use random event solving function in a loop
Can you see how almost every random event solver is a function, that is useful in a way. If your in a loop during your script, randoms can cause you to stop what your doing. An example will be like cutting a tree, or fishing, or mining. During any of these a random event can stop your actions. In many scripts people use time marks for waiting for a rock to be mined, or cutting down a tree. This procedure will show you what I am talking about by using these functions to break out of a loop. First I will set a time mark for how long you want to cut a tree, mine, etc.. And then while your still under the time mark it will check for a ent, gas, or anything else you put in your procedure. If it finds any of these it will break out of the loop, exit or whatever you want it to do. Ill show you how it works.
MarkTime(WaitTime); //VARIABLE for that procedure
while (TimeFromMark(WaitTime) < 10000) do //WHILE the time is under your set time, in this procedure its 10 seconds, DO the following.
begin //remember why you need the begin?
If (FindEnt(TreeColor)) or (FindNormalRandoms) then break;
case Random(5) of
2: MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
5: MouseBox(MIx1, MIy1, MIx2, MIy2, 3);
end;
end;

See how I used if … then break? that means if it finds the ent or the function FindNormalRandoms results true, it will break out of that loop, meaning you don’t have to wait all that extra time waiting for the TimeMark. If you don’t understand this, I can help. This is just a more sufficient way of macroing, makes for faster procedures instead of just waiting there. This can be used for every function which is boolean, not just what I used above.

I tried to make this tutorial as noob proof as possible. Please if you don’t understand anything, do NOT PM me, post here instead. And if there is anything else you will like me to explain, just tell me what it is. If you read this whole tutorial and want to see a sample script, check out the sample script I attatched, and remembers its just an example script, it doesn’t actually compile/work.

Synthroids
04-10-2007, 11:18 AM
Added to my Firefox Toolbar. Good tutorial! Taught me alot actually. This is my second day scripting now and I have to say, implementing anti-randoms into my scripts has been running through my mind a lot. Good job on the "Noob Proofing", I understood everything well and the format you wrote it in works wonders.

You spent a lot of time on this, I hope you get the credit you deserve :P

Junior
04-10-2007, 08:36 PM
Thanks, im glad I could help somebody. I will be adding more when stuff comes to mind :)
Or if theres anything I should add let me know.

arti
04-11-2007, 09:57 PM
Thanks. I understand a lot of this and helped me understand AntiRandoms better. Much appreciated! Good work.

tgeo888
04-11-2007, 10:10 PM
Very useful :D

crapkiller
04-14-2007, 09:11 PM
How do you make it switch players? Do you just put NextPlayer; ? If you have multi players that is.

Junior
04-15-2007, 02:40 AM
My tutorial doesnt talk about or even explain how to use multi-players/player switching. Look around for other tutorials, this only talk about anti-randoms and anti-ban.

thisisme
04-21-2007, 09:44 AM
this a off topic subject

but why cant i find you air crafter script on forum?
i have the version 1.8 but i will not use it if its because i get banned for using it

enoyhs
04-22-2007, 11:14 AM
Very good tutorial ;)

Thanks alot ;)

wobbii
04-28-2007, 06:26 PM
nice tut :) very good

BeaconofBacon
05-02-2007, 06:01 PM
Very grateful. I was having problems earlier, but thanks to you, I've gotten them figured out. Thanks alot!

Macho Man67
05-12-2007, 04:24 PM
Thanks for the tutorial!!!It helped me better understand how to add antirandoms to my scripts(like I even have a working script). I give this tutroial an A+!!!!!!

Junior
05-13-2007, 04:01 AM
Thanks a lot guys, didn't know my tutorial would help out this much.
Hope all you get better at scripting.
:)

I Karma I
05-13-2007, 05:08 AM
Thanks Junior, this is gonna help me, I'm gonna implement these tommorrow. Thanks again!

EDIT: 400th post! Woot!

Alligaattor
06-10-2007, 09:22 AM
Thanks, very useful tut!

Ty again mate!

gerauchert
06-10-2007, 08:58 PM
thanks so much helped alot :(h):

emiel
07-10-2007, 08:11 AM
Was already searching for a Antirandom and Anti-ban tutorials

Thanks alot!

one question

can you change Attack in the HoverSkill to Random, so it will go onto random skills?

Junior
07-13-2007, 02:51 AM
Yes, you can do that emiel. As a matter of fact im also adding that to my first post, thanks.

BobboHobbo
07-13-2007, 05:23 AM
Nice TUT for the newbies Rep+

yanix
07-14-2007, 08:52 AM
good work and ill use it soon on my power cutter and my power miner

dark4mdawn
08-11-2007, 08:52 PM
looks good might read mre thouroughly later

mat_de_b
08-12-2007, 04:51 PM
Awesome Tutorial, very useful...

pathway27
09-04-2007, 01:38 PM
Thanks To YA

Hoopo
09-05-2007, 01:51 PM
ty added this on my scrip and i think its working fine for now.

mickaliscious
09-08-2007, 04:22 PM
Thanks, put some of these in my nooby first script.

Appeljuice
09-08-2007, 05:39 PM
couple questions, cant you put the NickNameBmp inside the declare players procedure? and do you only have to put findnormalrandoms once in the script or like in every procedure?

red_hair_power
09-12-2007, 04:31 PM
yay i wont be banned anymore!!

King of the Nites
09-13-2007, 03:12 AM
Quick question I am a total noob at scripting and I was wondering if I should put all of the randoms and anti ban like all right by each other or are they separated by other parts of the script? I have alreaddy made a willow chopper and dropper but i don't have anti randoms.:confused:

EvilChicken!
09-18-2007, 02:28 PM
Nice guide!

10/10!

Explained a lot to me and I hope you get the credit you deserve for this.:D

deathie
10-24-2007, 08:59 PM
Thanks, this will come in handy soon. Nice guide 5 stars.

teh_lulz
10-28-2007, 09:45 PM
Very nice tutorial, just one question though. Does it really matter which part of the script you put the anti-random functions in?

ssskibum16
10-29-2007, 01:10 AM
Thanks for these tips im gonnna try and incorperate them into the scrip. Nice Job of explaning its very clear.

tylanbo
11-02-2007, 05:46 AM
case Random(10) of


That is basically choosing a random number from the range of 0 to 10. Now ill code out the whole procedure for you.


Actually, a random(x) returns x values of integer, meaning if you put random(10) it would return ten ints.

0,1,2,3,4,5,6,7,8,9

That's ten integers, notice it stops at 9 instead of 10. That's a common misconception about the random() procedure.

owner
12-09-2007, 05:41 PM
Nice.
Thanx :D

ub3rn00b
12-10-2007, 03:14 AM
wow tks for the help can wait to strat working on my first script

joshuaman76
12-11-2007, 01:41 AM
thx for the help it is helping me write bigger and better scripts

L3ss Than 33
12-23-2007, 11:33 PM
Thank you!
I am currently in the process of writing my first script. Wish me luck! :)

Dusk412
12-25-2007, 05:45 AM
Thanks your AntiBan explanation was very helpful and your AntiRandom somewhat but not enough detail. I prefer to just read the description in the includes folder lol. Thanks.

Jackrawl
12-25-2007, 05:49 AM
04-09-2007, 01:57 PM

Yawn*
I'm surprised that any of this stuff would work now, it's almost last year.

Griff
07-27-2008, 03:23 AM
when you are doing in anti-chat procedure, should this line be
if (InChat('yo')) then Writeln('whats up?'); ??
or should it be typesend