PDA

View Full Version : AntiRandoms and AntiBan Guide



Method
12-24-2007, 01:24 AM
AntiRandoms and AntiBan - A Guide
by Method

Table of Contents:
Overview
Nicknames and Their Uses
AntiRandom Procedures
Using AntiRandoms Effectively
What about FindFastRandoms?
A Summary of AntiBan Procedures
Using AntiBan Effectively
Closing


Overview -

Antiban and, more importantly, antirandoms are an integral part of almost any script, save ones that cannot receive random events like some Duel Arena Alchers. The purpose of random events are to stop players like you and I from macroing for long periods of time. However, with SRL's Player Switching system, we drastically reduce the amount of random events that are encountered by our players. However, there will always be random events there to stop us, and that is where antirandoms come in. Similarly, antiban helps keep our characters safe by reducing repetitive movement. Both of these features of SRL help make our characters look like legitimate players while they happily hack away at the tree, mine the rocks, or carry away whatever task you have set them to do.


Nicknames and Their Uses -

I'll start off by showing you an excerpt from a sample script.
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'ser';
Players[0].Active := True;
end;
I'm sure all of you who have used a script before have seen a procedure like DeclarePlayers in the script. What we're going to look at here is the Players[0].Nick line. This line is very important if you're going to be using antirandoms in your script. The input for the nickname is very simple. Choose three or four consecutive characters from your player's name, excluding the first character, and put it in there. For example, if my username was Method, my nickname could be 'etho', 'thod', etc. NickNameBMP is no longer necessary, but in order to successfully find randoms, you need to start logged out and use SRL's LoginPlayer to set the NickName correctly.


AntiRandom Procedures -

There are quite a few files in the AntiRandoms.scar file, but there's only a few that are very important. You should include these in an antirandoms procedure that you call yourself in every script that can get a random event. These two functions are:
FindNormalRandoms - Your generic procedure that will handle every random event, though not necessarily solve it. It's essential that you include this or else your autoing time will be severely limited.
FindFight - This will see if you're in a fight with one of the fighting random events (troll, swarm, golem, etc.). However, this will not run away from the fights. You need to do this yourself, which I'll show you in a bit.


Using AntiRandoms Effectively -

While making your script, it's important to add antirandom protection wherever you could encounter a random event. Examples of actions you could receive a random event in include: interacting with an object such as a rock or tree, walking to a new location, talking to an NPC, and more. It's important to call for randoms as often as you can in order to ensure your script runs correctly.

Good places to add antirandoms are in a loop where you're waiting for something to happen, such as a rock to be mined or tree to be cut down. Here is an example of a good antirandoms procedure that you can call in a loop or whenever else you feel you need some protection against random events:

procedure AntiRandoms;
begin
if not LoggedIn then Exit;
FindNormalRandoms; // find random events
if FindFight then
RunAway('N', True, 1, 5000); // if a fight is found, runs to the north, runs far, waits 5000 seconds, then performs action 1 (which is run back)
end;




What about FindFastRandoms? -

FindFastRandoms was a function created by WT-Fakawi in order to cover the random events missed by FindNormalRandoms in versions of SRL lower than version 4 revision 6. As of now, it's obsolete because FindNormalRandoms covers all of the possible randoms that SRL catches. Here is what FindFastRandoms looked like, for historical, purposes.

function FindFastRandoms: Boolean;
var
i: Integer;
begin
for i:=1 to 10 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';
end;
end;
8: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
end;
end;
9: RC;
10: Respond;
end;
wait(1);
end;
end;




A Summary of AntiBan Procedures -

The antiban file is also located inside the core folder within SRL. It looks relatively small, but the functions inside will help keep your characters unbanned and autoing for long periods at a time. The important functions in the antiban file are: RandomRClick, HoverSkill, AlmostLogout, and BoredHuman. Let's see what each does:
RandomRClick - This function does what its name implies: does a random right-click on the screen somewhere. It doesn't do much other than that, really, but is useful for doing random stuff.
HoverSkill - Like RandomRClick, and most of the files within AntiBan.scar, HoverSkill does what you think it would. You can set which skill to hover over, as well as whether to click it or not. It will then navigate to the skills tab and hover/click on the skill you chose.
AlmostLogout - AlmostLogout goes to the logout tab and hovers over the logout button multiple times, simulating a player thinking about logging out after playing for a bit.
BoredHuman - BoredHuman does quite a few things. It moves the mouse around randomly, examining things if it can. Next it searches for randoms (always a plus!) and then moves the screen around using the arrow keys. It finally sets the compass to north and raises the angle to the highest point. It's useful for simulating what someone who was bored would do, but can be quite time consuming because it does the steps quite a few times.
AutoTalking - Some scripts have functions that randomly type in the chatbox as a form of antiban. This can work, to some extent, but is probably more likely to attract attention to your autoing character than not chatting. If someone else tries to start up a conversation with you and you start saying random things, you could be instantly flagged by that person as a macroer, who could then report you. Nevertheless, this is an option you can use if you see fit. Check out Tutorial Island and various scripts for ones with autotalkers or tutorials about them.
There are also other types of antiban that you can create yourself. Ideas you could incorporate could be an auto-responder, random gametab switching, random key sending, and more.


Using AntiBan Effectively -

Like antirandoms, antiban is particularly useful in loops where you're waiting for something to happen. You can easily insert your antiban procedure into a function like the ones mentioned above. You can also make some antiban functions if you want, like some autotalking, random mouse movement, etc. I recommend that your antiban function look somewhat like this, though you can always change it to fit your needs:
procedure AntiBan;
begin
case random(100) of //do a random number so it won't always perform the antiban
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('Mining', False);
3: AlmostLogout;
end;
end;
You can place this function anywhere you'd like to have some antiban, including and especially procedures that wait for something to happen like a tree to fall or rock to be mined.


Closing -

Overall, including antirandoms and (less importantly, but still useful) antiban into your script is a great option that isn't difficult at all. Using the details provided above you should be able to successfully create a script that covers all the random events you might receive as well as include some antiban measures to keep your characters, well, unbanned! Hopefully after reading this tutorial you've learned something and will be able to apply it to your scripts. If you have any questions or comments, feel free to post here and I'll do my best to answer them and fix problems as soon as possible.

Kyle
12-24-2007, 02:02 AM
procedure AntiBan;
begin
case random(100) of //do a random number so it won't always perform the antiban
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('Mining', False);
3: RandomSpam; //made up procedure to say random stuff
4: AlmostLogout;
end;
end;

ok after you do this, were in the main loop do you put anti ban? Great tut thought mabey a sticky...

Method
12-24-2007, 02:04 AM
You can put that procedure anywhere you want to use it. For example, if you want to use it while chopping down a tree, put it in your chopping / waiting for the tree to fall procedure.

Thanks for the comment, by the way. :)

xhackxattackx
12-24-2007, 02:17 AM
You have a good flow to your very good tutorial.

When I'm playing RS I very seldom move my mouse around to other places on the map other than where I'm going and only when I'm going there. When I'm mining I (knock on wood) have not had a random event happen in the last three days. Why would I want to add these "strange" movements to a simple process? Wouldn't that look suspicious and "un-human" like?

Method
12-24-2007, 02:25 AM
They're just an option for you to use to help keep your characters looking legit. From what I've heard and seen, most people don't keep the mouse right over the rock the entire time they're mining or chopping a tree, so moving it around some (keep in mind antiban doesn't ALWAYS occur if you use a random number) can't hurt. If you don't need it, you're free to not use it, but the option is always there.

Anyways, thanks for your comments, I've edited the tutorial a bit stating that antiban isn't always a necessity.

gerauchert
12-24-2007, 02:34 AM
Very nice tut, well explained.

But i would take out the part of the antiban with the RandomSpam. Although sending messages in antiban is randomized...it still will look very suspicious if for some reason you say the exact same thing 2 or 3 times in a row.

Other than that nice work ;)

Method
12-24-2007, 02:39 AM
All right, I've edited that out. You're probably right - saying the same thing twice in a row would definitely be some anti-antiban (haha :p) and would probably lead players to report you.

Dusk412
12-24-2007, 05:00 AM
First you might want to mention you need knowledge of arrays for the procedure DeclarePlayers because I didn't know arrays so this tut didn't really help me lol. Sry.

Method
12-24-2007, 05:14 AM
First you might want to mention you need knowledge of arrays for the procedure DeclarePlayers because I didn't know arrays so this tut didn't really help me lol. Sry.

You don't really need any knowledge of arrays. It's very easy to copy and paste one of the player's information, then change the number to one higher. It takes no knowledge other than how to count. Anyways, there's plenty of tutorials that are easily accessible if you'd like to learn about the Player array and DeclarePlayers.

FrÕzÑ_§ÕµL
12-26-2007, 08:31 PM
Very nice work :) I'm sure it will help the new people to SRL a lot.

Yes gerauchert is right, so in my scripts I use this: (along with autoresponding and autotalking every 8-12 minutes);
case Random(16) of
0: SendKeysWait('hi...', 150, 75);
1: SendKeysWait('yo...', 150, 75);
2: SendKeysWait('sup...', 150, 75);
3: SendKeysWait('wc lv', 150, 75);
4: SendKeysWait('whats ', 150, 75);
5: SendKeysWait('bore..', 150, 75);
6: SendKeysWait(Tree, 150, 75);
7: SendKeysWait('man i', 150, 75);
8: SendKeysWait('lol...', 150, 75);
9: SendKeysWait('soo...', 150, 75);
10: SendKeysWait('weathr', 150, 75);
11: SendKeysWait('well..', 150, 75);
12: SendKeysWait('ths is', 150, 75);
13: SendKeysWait('ugh..', 150, 75);
14: SendKeysWait('i cbf', 150, 75);
15: SendKeysWait('na...', 150, 75);
end;
Wait(Random(250));
SendKeysWait(#8 + #8 + #8 + #8 + #8 + #8, 150, 75);
This means that it types something in slowly, as if you are going to say some thing, but then decides not to and deletes it :) means people won't notice that you are repeating anything, and you won't get loggedout/banned by jagex!

footballjds
12-26-2007, 10:00 PM
nice tut, but a question, if i have the pass and stoof in there but start logged in, do i need the:NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);?

Method
12-26-2007, 10:01 PM
Yes, you do. Unless you start logged out and use LoginPlayer, you need to have the NickNameBMP line.

ExotiQ
12-27-2007, 02:45 PM
Thank you mate!! This helped me alot.

Method
12-29-2007, 05:04 PM
Thanks, I'm glad to hear that. It's nice to know at least some people are getting something out of this. :)

mickaliscious
01-04-2008, 04:15 AM
Could you possibly put in big red letters: "Don't use FindFastRandoms!" ?

That would be great as a lot of members apps still contain FindFastRandoms even though that hasn't been needed since SRL 4 came out.

Also, NickNameBMP isn't need for Revision 9 but you must use SRL's LoginProcedure for findtalk to work successfully.

Here is a good example of an AntiRandoms procedure you could include:

procedure AntiRandoms;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
if FindFight then RunTo('N',True);
end;

Covers all the basics.


You left out FindFight in your tut.

Method
01-04-2008, 04:52 AM
I added a section about FindFastRandoms and also added FindFight too. I guess I forgot about FindFight when I was writing this up - thanks for reminding me. Also, thank you for the example antirandoms procedure. I also forgot to add one and have added it to the guide as well.

FEAR
01-17-2008, 07:33 PM
Nice tutorial, I was searching for a Antirandom and Antiban tutorial. I was gonna use it on my script but didnt know what to put or where to put. Now I know thanks to you:)

~~ FEAR ~~

Pure1993
02-03-2008, 01:21 PM
program RatingForMethodsTut;
{.include SRL/SRL.scar}
begin
Writeln(' Method"s Tutorial is:');
repeat
Writeln(' Perfect!!!!! :) ');
wait(100);
Writeln('5 Star Rating'!!!);
wait(100);
c := c + 1;
until (c=1000);
end.

I think that says it all. :) Really nice!

Prince
02-03-2008, 04:40 PM
Awesome tut, taught me a lot, the nickname bmp isnt working for me so how would i use the loginplayer procedure? exuse me for being a lazy ass and not using the search button

thanks,
prince

eurostylz
02-03-2008, 05:44 PM
Thanks for the guide, it got me one step closer to making a nice script :D

stampede10343
02-04-2008, 01:31 AM
really nice tutorial, knew most of it but it is very helpful, and i didnt know that about the NickNames, thanks

kaslim
02-21-2008, 11:43 AM
Nice tut pretty informative, can the scar actually solve mimes, prison petes, mazes and evil bobs?

Method
02-21-2008, 08:25 PM
Nice tut pretty informative, can the scar actually solve mimes, prison petes, mazes and evil bobs?

SRL has a solver for the Evil Bob random (I believe), but none of the others yet.

andrewrox424
02-26-2008, 06:45 AM
wow thanks, didnt know you could do that.

Blaze
03-15-2008, 06:53 PM
wow, a little overwhelming.. but I'll see if I can do it! thanks a lot!

Torrent of Flame
03-17-2008, 09:46 PM
This Errr... wont work. FindMime, etc are out of date.

elf5380
04-05-2008, 04:36 PM
really helpfull i think i got my first script pretty anti bannable now :)

Becks
04-13-2008, 03:27 PM
Unknown identifier 'FindMime'

Above says there outdated what are the new functions for that?

Baked0420
04-13-2008, 05:22 PM
thanks for the tut, it helped a lot

ozozo
04-14-2008, 09:09 PM
Nice tutorial.

Method
04-15-2008, 03:23 AM
I've reworded the FindFastRandoms section and placed the text above the function and in bold. Plus, I've pointed out (in red) that it's obsolete. That should clear up any misconceptions about FFR.

It is no longer necessary. Use FindNormalRandoms instead.

Torrent of Flame
04-16-2008, 07:34 PM
=D I told you you would have to delete it some time Method :P

ape
04-16-2008, 07:46 PM
Your tutorial is very informative. I must comment on the random auto talkers used in some scripts. (in my opinion) For a bot to be safe it should have at least 1 different response for every 10 minutes you plan on using it. The responses should include some spelling mistakes since no "human" is perfect. The more random responses included increases your chances of not getting banned. If you don't type anything at all that is kinda dumb, its nearly impossible to find someone that doesn't type something or at least some glow1:spam and stuff. (just my 2 cents of advice :) )

kuikmaa
04-16-2008, 07:58 PM
Very Nice! Excellent guide to two of the most popular tools in SCAR scripting. You managed to incorporate knowledge that will help both the SCAR beginner, and the expert alike. Well Done

Method
04-17-2008, 01:23 PM
=D I told you you would have to delete it some time Method :P

I never deleted it, I just moved my explanation above the actual function so people wouldn't continue using it.


Very Nice! Excellent guide to two of the most popular tools in SCAR scripting. You managed to incorporate knowledge that will help both the SCAR beginner, and the expert alike. Well Done

Thanks, I hope you enjoyed it. :)

Sneakyman
04-19-2008, 02:02 PM
Great! This will help me more to understand this scripting again. Lost everything how this worked ;(. But well, keep posting this great tutorials. It will help everyone, not only now but over years it will help other people too!

WhoCares357
04-19-2008, 02:11 PM
Very good tutorial. I like it so much. You used enough examples and you not only explained each line in the example, you explained it outside of the script well, also. The only thing I would suggest is making it a little longer by adding more anti-ban (like chat anti-ban, etc.).

9/10
Good job.

Method
04-21-2008, 12:20 AM
Very good tutorial. I like it so much. You used enough examples and you not only explained each line in the example, you explained it outside of the script well, also. The only thing I would suggest is making it a little longer by adding more anti-ban (like chat anti-ban, etc.).

9/10
Good job.

I didn't want to add random talking (or talking at all, to be honest) because there are already many good tutorials on autotalkers out there in the Tutorial Island forum and in scripts. I believe I might've suggested that as an alternative form of anti-ban (if not I'll add it), but I don't really feel like it's absolutely necessary in a script.

andrewcoleman
04-22-2008, 06:52 PM
Nice tutorial, I'll be using this in making my first script.

Baked0420
04-25-2008, 07:10 PM
In this tutorial it says, FindNonInventoryRandoms - FindNonInventoryRandoms does quite a few things. The most important function it calls is probably SolveNonTalkingRandoms. This will see if you're missing any gametabs and if so, will figure out where you are and will react accordingly.

well in one of the scripts I use it says ** Warning in GameTab: 4 does not exist**

and jus now it said ** Warning in GameTab: 0 is no valid GameTab**

can someone please tell me what a GameTab is exactly, and is it an error in the script? I think it is, but it does a whole load of essences fine then it says the GameTab 4 thing over and over so I don't know where the error is or what.

Ashur2Good
05-18-2008, 01:43 AM
Nice guide, it's well written and looks neat :)

Good job! :D

-Ashur

PhantomCode
05-31-2008, 05:45 AM
Great tut, thanks.

Griff
06-04-2008, 10:40 PM
OK i understand everything thanks a lot with mycript. If someone could jsut help me out with how to get a character do just to a certain amount of loads in a script.

Method
06-04-2008, 10:58 PM
OK i understand everything thanks a lot with mycript. If someone could jsut help me out with how to get a character do just to a certain amount of loads in a script.

It's good to hear you understand it. There are many tutorials here on loops (including while do, for to do, and repeat until) that will help you with doing a certain amount of loads. Try searching and you should be able to come up with some good results.

Griff
06-05-2008, 01:12 AM
Ok I searched method, and learned a lot about loops! Thanks for the info, and, again, great tut!

Griff
07-25-2008, 07:49 PM
When I try and do the anti-random while chopping, I get an error type mismatch in script

Method
07-25-2008, 09:33 PM
The example procedure I listed isn't one you should just copy and paste (which is why you're getting an error I'm assuming). You probably have Chopping declared as a variable other than a boolean, which is why the error is a type mismatch.

If you didn't copy the procedure I posted, feel free to make a topic in the Scripting Help forum for more help.

Ransom
08-06-2008, 02:31 PM
Thank you for this tutorial. It was well written and taught me how useful ways to implement this stuff.

Ransom

Magiic
08-17-2008, 08:57 PM
i don't know if youu should include bored human i mean it is pretty obvious imo because you don't examine everything you come accross and im sure it got me banned lol oh well good tut rep++

randy marsh
08-29-2008, 08:41 PM
I am using this anti ban:
Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
6: DoEmote(400 +Random(90));
end;
end;



But it dos it to much lol how do i sort this!

noidea
08-29-2008, 09:02 PM
case Random(30) of
1: RandomRClick;
8: HoverSkill('Woodcutting', False);
13: RandomMovement;
28: BoredHuman;
15: DoEmote(400 +Random(90));

Try making the options like higher like that so it doesn't just have to be 1,2,3,4,5,6.

randy marsh
08-29-2008, 09:18 PM
Ok thanks for help, so what do the numbers stand for then?

zuricho
08-29-2008, 09:53 PM
I think the numbers are just the numbers that have to be randomly picked from the Random(30) then once the number is picked it will do that antiban.

Method
08-30-2008, 01:06 AM
The numbers just represent cases of what will be done if that number is picked from the Random(30). If you want it to be even more random, you can do something like if (Random(15) < 5) then doSomeStuff; within each case, depending on how often you call your AntiBan procedure.

koolkats102
10-06-2008, 01:31 AM
Thank You...Was looking for a Anti-random, so i could properly put it in my script :D

suph4l33t
11-01-2008, 11:36 AM
Thanks!

guinner
11-28-2008, 01:39 AM
great tutorial, I have bee looking for one like this since I started usign scripts. Thank you.

Ampd Up
04-17-2015, 08:04 PM
Just got linked here from a different tutorial. Is some of the AntiRandom stuff no longer relevant because of the new way that OSRS handles randoms? Isn't every random dismiss-able now?

Kyle
04-17-2015, 08:21 PM
Just got linked here from a different tutorial. Is some of the AntiRandom stuff no longer relevant because of the new way that OSRS handles randoms? Isn't every random dismiss-able now?

Typically when a thread is over 8 years old, it is no longer relevant..

Ampd Up
04-17-2015, 08:41 PM
Apologies, I was just going through all the welcome to SRL stuff and was brought here.

sizzayin
10-10-2016, 02:19 PM
Great tutorial, thank you for this

acow
10-10-2016, 02:22 PM
Great tutorial, thank you for this

Gee you sure do read fast! /s

poobear12
10-10-2016, 02:39 PM
Gravedigger (http://https://en.m.wikipedia.org/wiki/Gravedigger)

Had me all excited about the title :p

dan1
10-10-2016, 04:14 PM
Great tutorial, thank you for this
Rofl. What a post. This man is going hard.

rsbotter123
08-25-2019, 08:00 PM
Great guide ill be using this soon, thank you.