SRL Archive - SRL Archives

AntiBan


Frt

2009-05-11 15:07:57

I've made several antiban functions that I thought I might share with you so here you go:

var
Skills: array [0..4] of String;

{*******************************************************************************
function Randomize(x, P: Integer): Integer;
By: Frt
Description: Randomizes x by a percentage (P)
*******************************************************************************}
function Randomize(x, P: Integer): Integer;
var
T: Integer;
begin
T := Round(x / 100 * P);
Result := RandomRange(x - T, x + T);
end;

{*******************************************************************************
procedure W(a, b: Integer);
By: Frt
Description: Waits an amount of time specified by a. Also randomizes the number
*******************************************************************************}
procedure W(a: Integer);
begin
Wait(Randomize(a, 15));
end;

{*******************************************************************************
procedure Replier;
By: Frt
Description: Reads InterScarMessage and types it.
*******************************************************************************}
procedure Replier;
begin
if IsFKeyDown(2) then
TypeSend(Readln('What do you want to write?'));
if (not(ReadInterScarMessage('Frt') = '')) then
begin
TypeSend(ReadInterScarMessage('Frt'));
SendInterScarMessage('Frt', '');
end;
end;

{*******************************************************************************
procedure HoverHomeTeleport;
By: Frt
Description: Opens Magic tab and hovers Home teleport
*******************************************************************************}
procedure HoverHomeTeleport;
begin
if GameTab(7) then
begin
W(500);
Mouse(723, 450, 3, 3, true);
W(500);
MMouse(570, 227, 3, 3);
end;
end;

{*******************************************************************************
procedure RandomExamineInv;
By: Frt
Description: Examines a random item in inventory
*******************************************************************************}
procedure RandomExamineInv;
var
Inv, Ran: integer;
begin
if GameTab(4) then
begin
W(500);
Inv := InvCount;
Ran := Random(Inv) + 1;
MouseItem(Ran, False);
W(500);
ChooseOption('Examine');
end;
end;

{*******************************************************************************
procedure QuestOpener;
By: Frt
Description: Opens and closes a quest
*******************************************************************************}
procedure QuestOpener;
var
x, y, Ran, c, t: integer;
begin
Mouse(610, 187, 3, 3, true);
repeat
W(500);
if(FindText(x, y, 'Quests', 4, 548, 205, 611, 226)) then
begin
W(700);
Ran := 15 * Random(10);
t := 291 + Ran;
Mouse(584, t, 20, 3, true);
W(1500);
case Random(2) of
0: PickUpMouse;
end;
W(1500);
Mouse(464, 76, 10, 10, true);
Break;
end;
if(FindText(x, y, 'Achievements', 4, 548, 205, 611, 226)) then
Mouse(702, 217, 3, 3, true);
W(500);
Inc(c);
until(c > 10);
end;

{*******************************************************************************
procedure TypeSendEx(Text: string);
By: Frt
Description: TypeSend modified - doesn't press enter.
*******************************************************************************}
procedure TypeSendEx(Text: string);
var
S: string;
I: Integer;
C: Byte;
Shift: Boolean;
begin
S := 'ABCDEFGHIJKLMNOPQRSTUVWXZ' + '~!@#$%^&*()_+{}|:"<>?';
for I := 1 to Length(Text) do
begin
Shift:= (Pos(Text[i], S) > 0);
if(Shift)then
begin
KeyDown(VK_SHIFT) Wait(40 + Random(40));
while(Pos(Text[i], S) > 0)and(I <= Length(Text))do
begin
C := GetKeyCode(StrGet(Text, I));
TypeByte(c);
I:= I + 1;
if(I > Length(Text))then Break;
end;
end;
if(Shift)then
KeyUp(VK_SHIFT);
Wait(40 + Random(40));
if(I <= Length(Text))then
begin
C:= GetKeyCode(StrGet(Text, I));
TypeByte(C);
Wait(40 + Random(40));
end;
end;
end;

{*******************************************************************************
procedure TypeAndRegret;
By: Frt
Description: Write a random sentence and deletes it again
*******************************************************************************}
procedure TypeAndRegret;
var
Say: string;
i: integer;
begin
case Random(11) of
0: Say := 'hello';
1: Say := 'im so bored..';
2: Say := 'member has more fun things to do';
3: Say := 'im a shark';
4: Say := 'i have a dog';
5: Say := 'i want a little sister';
6: Say := 'bank sale later today';
7: Say := 'buying food';
8: Say := 'rune FTW';
9: Say := 'imo runescape is the best';
10: Say := 'i hate the trade limit';
end;
TypeSendEx(AddMistakes(Say, 25));
W(2000);
for i := 0 to Length(Say) do
begin
KeyDown(vk_Back);
W(10);
KeyUp(vk_Back);
W(50);
end;
end;

{*******************************************************************************
procedure EquipmentHover;
By: Frt
Description: Hovers a random item you are wearing
*******************************************************************************}
procedure EquipmentHover;
var
z: TPoint;
c, i: integer;
begin
if GameTab(5) then
begin
repeat
c := Random(11) + 1;
z := EquipmentCoords(c);
if WearingItem(c) then
begin
MMouse(z.x, z.y, 7, 7);
W(1000);
Break;
end;
Inc(i);
until(i > 10);
end;
end;

{*******************************************************************************
procedure AlmostFriendOrEnemy;
By: Frt
Description: Almost adds last chatter as friend or enemy
*******************************************************************************}
procedure AlmostFriendOrEnemy;
var
CName: string;
i: integer;
begin
if LastChatter(CName) then
begin
case Random(2) of
0: GameTab(8);
1: GameTab(9);
end;
W(500);
Mouse(595, 445, 5, 5, true);
W(1000);
TypeSendEx(CName);
W(1500);
for i := 0 to Length(CName) do
begin
KeyDown(vk_Back);
W(10);
KeyUp(vk_Back);
W(50);
end;
TypeSend('');
end;
end;

{*******************************************************************************
procedure HoverEmotion;
By: Frt
Description: Hovers a random emotion
*******************************************************************************}
procedure HoverEmotion;
var
x, y: integer;
begin
if GameTab(12) then
begin
W(700);
MMouse(569 + Random(100), 226 + Random(200), 5, 5);
W(1200);
GetMousePos(x, y);
case Random(2) of
0: MMouse(x, y, 20, 20);
end;
W(500);
GameTab(4);
end;
end;

{*******************************************************************************
procedure HoverSong;
By: Frt
Description: Hovers a random song
*******************************************************************************}
procedure HoverSong;
var
Ran, t: integer;
begin
if GameTab(13) then
begin
W(700);
Ran := 15 * Random(12);
t := 276 + Ran;
MMouse(584, t, 20, 3);
W(1500);
case Random(3) of
0: PickUpMouse;
end;
W(1500);
end;
end;

{*******************************************************************************
procedure SplitPrivateChat;
By: Frt
Description: Splits private chat and unsplits again.
*******************************************************************************}
procedure SplitPrivateChat;
begin
if GameTab(11) then
begin
Mouse(696, 358, 10, 10, true);
W(500);
case Random(2) of
0: PickUpMouse;
end;
W(1500);
Mouse(696, 358, 10, 10, true);
end;
end;

{*******************************************************************************
procedure HouseOption;
By: Frt
Description: Opens the house menu and hovers one of the buttons
*******************************************************************************}
procedure HouseOption;
begin
if GameTab(11) then
begin
Mouse(694, 428, 5, 5, true);
W(1000);
case Random(4) of
0: MMouse(616, 313, 5, 5);
1: PickUpMouse;
2: MMouse(632, 361, 50, 5);
3: MMouse(634, 395, 50, 5);
end;
W(1000);
Mouse(721, 233, 4, 4, true);
end;
end;

{*******************************************************************************
procedure FrtAntiBan(Rand: Integer);
By: Frt
Description: Performs antiban with a chance out of Rand
*******************************************************************************}
procedure FrtAntiBan(Rand: Integer);
begin
if not LoggedIn then
Exit;
Replier;
FindNormalRandoms;
case Random(Rand) of
0:
case random(14) of
0: PickUpMouse;
1: RandomMovement;
2: RandomRClick;
3: HoverSkill(Skills[Random(5)], false);
4: HoverHomeTeleport;
5: RandomExamineInv;
6: SleepAndMoveMouse(1000 + Random(2000));
7: TypeAndRegret;
8: EquipmentHover;
9: AlmostFriendOrEnemy;
10: HoverEmotion;
11: HoverSong;
12: SplitPrivateChat;
13: HouseOption;
end;
end;
end;

{*******************************************************************************
procedure SetupFrtAntiBan;
By: Frt
Description: Sets up skills. User can declare skills in script
Example: Skills := ['attack', 'hunter', 'prayer', 'runecrafting', 'thieving'];
*******************************************************************************}
procedure SetupFrtAntiBan;
var
i: Integer;
Possible: array of String;
begin
Possible := ['Attack', 'Defence', 'Strength', 'Hitpoints', 'Mining', 'Smithing', 'Woodcutting', 'Firemaking', 'Magic',
'Fletching', 'Hunter', 'Summoning', 'Fishing', 'Construction', 'Herblore', 'Agility', 'Thieving', 'Crafting',
'Ranged', 'Slayer', 'Farming', 'Prayer', 'Runecrafting', 'Cooking'];
for i := 0 to 4 do
begin
if (Skills[i] = '') then
Skills[i] := Possible[Random(24)];
end;
end;

Rich

2009-05-12 11:07:49

TypeAndRegret could be:

{*******************************************************************************
procedure TypeAndRegret;
By: Frt
Description: Write a random sentence and deletes it again
*******************************************************************************}
procedure TypeAndRegret(Texts : TStringArray);
var
i, Say: integer;

begin
Say:= Random(High(Texts));
TypeSendEx(AddMistakes(Texts[Say], 25));
W(2000);
for i := 0 to Length(Say) do
begin
KeyDown(vk_Back);
W(10);
KeyUp(vk_Back);
W(50);
end;
end;

It makes it neater, and the user can set what they want to type, and regret.

Zlakata

2009-05-13 01:18:56

Antibans are never enough but it seems some of them already exists or are very similar to some you have there. But the regret one is pretty cool :)