What happens if I tell SPS to walk to x, and the player is already at position x, will it try to walk to x or detect that the player already is at position x and then just be done?
I just finished my first fully working script!
Thanks for the awesome guide!
Very good guide, it's useful for those who never saw a code before too. Thanks!
I have read this tutorial nearly three times and it is an amazing resource to start scripting; however, it's missing an important section.. Implementation of Antiban. You briefly cover case statements, but don't include a scripting example using them. This is where the antiban section comes. I am curious on a few various ways to actually trigger a basic antiban every cycle. This could be an invaluable resource for this guide. Kudos Mayor! Thank you for this.
Like Quentini said,
I'm affraid to get banned without anti-ban
Anti-ban is actually very easy to implement depending on how basic or advanced you want to go. You should just do a Google search for any old anti-ban tutorials or look at other people's scripts to see how they implemented theirs.
@The Mayor - That is something to add to your list though.![]()
New to scripting? Procedures & Functions for Beginners
Do you use your computer at night? Just get f.lux
More specifically, add in whatever procedures/functions you want to activate during an "antiban" within a random output case statement procedure like so:
Simba Code:procedure antiban;
var
i: integer;
begin
i := random(100);
case i of
0..10: doSomething;
11..20: doSomethingElse;
21..50: doSomethingElseElse;
51..100: doSomethingElseElse;
end;
end;
Every time antiban; is called, the integer i will be assigned a random number between 0 and 100, and then based on that random number, the case statement will pick something to do. As you can see, you can adjust the ranges of each antiban however you like, or even increase the range from 100 to 1000 or anything.
Here's a more complex example from one of my scripts:
As you can see, I made events such as going AFK or idle less common than random mouse movement events. As mentioned by Inc and Mayor, you can also look at other scripts for examples.Simba Code:{PROCEDURE -- antiBan
Purpose: Make us look more like a human and less like a bot.
Comments: None.}
procedure antiBan;
var
i, afk, idle, mSpeed: integer;
begin
if not isLoggedIn then
exit;
i := random(antibanThreshold); //Rather than have a definite range for i, like 0 to 100, I allow the user to set the range themselves, customizing the frequencies
afk := (AFKTime + random(1500));
idle := (idleTime + random(500));
mSpeed := mouseSpeed;
failsafe.pause;
case i of
1..100:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Small Random Mouse');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Small Random Mouse');
smallRandomMouse();
end;
101..200:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Pick Up Mouse');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Pick Up Mouse');
pickUpMouse();
end;
201..300:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Sleep and Move Mouse');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Sleep and Move Mouse');
sleepAndMoveMouse(random(2000) + 500);
end;
301..380:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Idling for ' + toStr(idle) + 'ms');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Idling for ' + toStr(idle) + 'ms');
case i of
301..350:
begin
mouseOffClient(OFF_CLIENT_RANDOM);
wait(idle);
end;
351..400: sleepAndMoveMouse(idle + 500);
end;
recalcAB;
end;
381..420:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Hover Skill');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Hover Skill');
if not gameTabs.isTabActive(TAB_BACKPACK) then
exit;
hoverSkill(SKILL_RUNECRAFTING);
sleepAndMoveMouse(random(50, 450));
end;
421..428:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - AFKing for ' + toStr(afk) + 'ms');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - AFKing for ' + toStr(afk) + 'ms');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(afk);
mouseSpeed := mspeed;
ClarityDebug('New mouse speed - ' + toStr(mspeed));
scriptStatus('New mouse speed - ' + toStr(mspeed));
recalcAB;
end;
429..450:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - New mouse speed of ' + toStr(mspeed));
scriptStatus('Performing antiban. (' + ToStr(i) + ') - New mouse speed of ' + toStr(mspeed));
mouseSpeed := mspeed;
end;
451..antibanThreshold:
begin
failsafe.start;
exit;
end;
end;
failsafe.start;
end;
If you want, you can and should write custom antiban procedures that are relevant to your script's activity! In my opinion, just a few random mouse movements and camera rotations is not very effective.
Last edited by Clarity; 11-14-2014 at 04:49 AM.
Scripts: ClarityNex | ClaritySlayer | ClarityElfThief | ClarityBurialArmour | ClarityMudRunes | ClarityWells | ClarityProTables | ClarityArmadyl | ClarityHarps
ClarityDominonTower | ClarityAltar | ClarityCitadel | ClarityBarrows | ClarityEsswraith | ChampionScrollCamperTools & Extensions: OpenGL ID Highlight Tool | SRL-6 Messaging System | SRL Companion | Item DTM Generator | BBCode Converter
Great tutorial.
I'll see what I can make.
I'm thinking about making a TBoxArray from these slots:
But I can't manage to do it. I have the slot's margin color (from ACA) and the size (48x52 px) but I don't know how to code it. Could someone help me with this?
Edit: What measurement does simba use as "distance"? I thought it was pixels, but as I tested-tried various funtions, like SplitTPAEx, now I don't get it. BTW it works now with SplitTPAEx(TPA, w:=2, h:=2).
Last edited by Torol; 11-17-2014 at 09:39 PM.
I have been abusing these forums too long without any contribution. But after reading your informative thread, I think it's time to start. I have got some ideas for small projects and I will start from there!
Thanks for your guide.
Dat cliffhanger.Hey wait a minute, that gets nearly 200k per hour on f2p, should I put this in the junior members section
Anyway thanks for giving an old timer a rerun on Simba. Cheers!
Thanks again for such an extensive tutorial. I have finally made a decent first script as a result.
I have one question though, I cannot find the DTM Editor in the Tools tab anymore? Can you point me to a direction to where I can create my own DTM?
Cheers, Ecer.


Time to get back into learning to script again!![]()
Amazingly informative. I'm pretty proficient in Java and a lot of this seems similar. Although I'm pretty sure that's a bad thing because I feel like I'm gonna type java if else statements. Also the lack of "{" and "}" is messing with me. Thanks for the tutorial!
Thanks for the awesome tutorial, I think i'm gonna scripting for simba/srl a shot. I've been stuck in the .NET/javascript/css world for a long time now and this might be a nice break.
There are currently 2 users browsing this thread. (0 members and 2 guests)