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.
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.SCAR Code: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;
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:
SCAR Code: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.
SCAR Code: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:
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.SCAR Code: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;
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.