PDA

View Full Version : Battlescape thieving bot



bilsma
01-31-2013, 09:02 PM
Can somebody make one it must look like this


rogram BSScript;
{$I SRL/SRL.scar}

var HP_Check: Integer;

const Username = '';
Password = '';
Script = 1; // 1 = Paladin Thiever
// 2 = Black Knight Killer
// 3 = Magic Axe Killer
// 4 = Hill Giant Killer
// 5 = Fire Rune Buyer
// 6 = Nature Rune Buyer
Eating = True; // Defines if the script eats (Sharks).

GTAB_COMBAT = 'combat';
GTAB_STATS = 'stats';
GTAB_QUEST = 'quest';
GTAB_INV = 'inventory';
GTAB_EQUIP = 'equip';
GTAB_PRAYER = 'prayer';
GTAB_MAGIC = 'magic';
GTAB_FRIENDS = 'friends';
GTAB_IGNORE = 'ignore';
GTAB_LOGOUT = 'logout';
GTAB_OPTIONS = 'options';
GTAB_EMOTES = 'emotes';
GTAB_MUSIC = 'music';

FMSX1 = 7; //Main Screen top-left corner X value.
FMSY1 = 5; //Main Screen top-left corner Y value.
FMSX2 = 517; //Main Screen bottom-right corner X value.
FMSY2 = 337; //Main Screen bottom-right corner Y value.

FMMX1 = 555;
FMMY1 = 5;
FMMX2 = 724;
FMMY2 = 151;

FMSCX = 263; //Main Screen center X value.
FMSCY = 206; //Main Screen center Y value.

FMIX1 = 547; //Inventory top-left corner X value.
FMIY1 = 205; //Inventory top-left corner Y value.
FMIX2 = 740; //Inventory bottom-right corner X value.
FMIY2 = 467; //Inventory bottom-right corner Y value.

procedure ClickTab(x, y: Integer);
begin
if not (GetColor(x, y) = 1778795) then begin
Mouse(x, y, 1, 1, True);
end;
end;

procedure F_SetAngle(Highest : Boolean);
begin
KeyDown((Integer(not Highest) * 2) + 38);
Sleep(1000 + Random(300));
KeyUp((Integer(not Highest) * 2) + 38);
Wait(500 + Random(100));
end;

procedure F_GameTab(GTab: String);
begin
case GTab of
'combat': ClickTab(532, 176);
'stats': ClickTab(567, 171);
'quest': ClickTab(599, 172);
'inventory': ClickTab(632, 171);
'equip': ClickTab(666, 171);
'prayer': ClickTab(706, 174);
'magic': ClickTab(737, 171);
'friends': ClickTab(569, 469);
'ignore': ClickTab(598, 470);
'logout': ClickTab(632, 470);
'options': ClickTab(671, 476);
'emotes': ClickTab(698, 482);
'music': ClickTab(740, 469);
end;
end;

function FullHP: Boolean;
begin
F_GameTab(GTAB_STATS);
if (CountColorTolerance(65535, 647, 209, 661, 222, 15) = CountColorTolerance(65535, 659, 221, 673, 234, 15)) then begin
Result := True;
end else begin
F_GameTab(GTAB_INV);
Result := False;
end;
end;

procedure AlchAddyPlate;
var x, y: Integer;
begin
if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin
Mouse(x, y, 2, 3, True);
end;
end;

procedure Alch;
var x, y: Integer;
begin
if (FindColorTolerance(x, y, 4873802, FMIX1, FMIY1, FMIX2, FMIY2, 5)) then begin
F_GameTab(GTAB_MAGIC);
Mouse(716, 335, 1, 1, True);
Wait(400+Random(100));
AlchAddyPlate;
Wait(1700+Random(100));
F_GameTab(GTAB_INV);
end;
end;

procedure ClickAttack(x, y: Integer);
begin
Mouse(x, y, 0, 0, True);
Wait(200 + Random(500));
Wait(2200 + Random(500));
end;

procedure ClickPickpocket(x, y: Integer);
begin
Mouse(x, y, 0, 0, False);
Wait(200 + Random(500));
Mouse(x, y+40, 1, 1, True);
Wait(1500 + Random(300));
end;

function F_InFight: Boolean;
var x, y: Integer;
begin
Result := False;
if (FindColorTolerance(x, y, 65280, 221, 119, 283, 169, 5)) then begin
Result := True;
end;
end;

procedure RelocateToNPC;
var x, y: Integer;
begin
if (FindColorTolerance(x, y, 195836, FMMX1, FMMY1, FMMX2, FMMY2, 10)) then begin
Mouse(x, y, 1, 1, True);
Wait(2500+Random(500));
end;
end;

function F_FightAt(x, y: Integer): Boolean;
begin
Result := False;
{if (FindColorTolerance(x, y, 65280, x-30, y-10, x+30, y, 5)) then begin
Result := True;
end;}
end;

// Black Knight: 460553 (CCT: 150);
// Paladin: 7434875 (CCT: 150);
// Magic Axe: 2843259 (CCT: 100);
// Hill Giant: 8039378 (CCT: 100);
procedure Attack(Color, CCT: Integer; Click: String);
var AttackTP: TPoint;
AttackTPA: TPointArray;
AttackATPA: T2DPointArray;
i, x, y, AttackHigh: Integer;
begin
if (FindColorsSpiralTolerance(x, y, AttackTPA, Color, FMSX1, FMSY1, FMSX2, FMSY2, 15)) then
begin
SortTPAFrom(AttackTPA, Point(MSCX, MSCY));
AttackATPA := TPAtoATPAEx(AttackTPA, 10, 10);
AttackHigh := High(AttackATPA);
for i := 0 to AttackHigh do
begin
if (i > 15) then begin
RelocateToNPC;
Break;
end;
AttackTP := MiddleTPA(AttackATPA[i]);
if not (F_FightAt(AttackTP.X, AttackTP.Y)) then begin
MMouse(AttackTP.X, AttackTP.Y, 3, 3);
Wait(100);
if (CountColorTolerance(1040102, 73, 3, 381, 19, 70)>CCT) then
begin
GetMousePos(x, y);
case Click of
'pickpocket': ClickPickpocket(x, y);
'attack': ClickAttack(x, y);
end;
Break;
end;
end;
end;
end;
end;

function HP_Checks: Boolean;
begin
Result := False;
if (HP_Check >= 5) then begin
HP_Check := 0;
Result := True;
end;
Inc(HP_Check);
end;

procedure Eat;
var x, y: Integer;
begin
if (HP_Checks) then begin
if not (FullHP) then begin
F_GameTab(GTAB_INV);
if (FindColorTolerance(x, y, 6782103, FMIX1, FMIY1, FMIX2, FMIY2, 9)) then begin
Mouse(x, y, 2, 3, True);
end;
end else begin
Writeln('HP is full.');
end;
F_GameTab(GTAB_INV);
end;
end;

function F_LoggedIn: Boolean;
begin
Result := True;
if (GetColor(180, 112) = 11184810) then begin
Result := False;
end;
end;

procedure F_LogIn;
begin
Mouse(273, 193, 2, 2, True);
TypeSend(Username);
Wait(300);
TypeSend(Password);
Wait(2000);
Wait(500+Random(500));
end;

procedure F_LogOut;
begin
F_GameTab(GTAB_LOGOUT);
Wait(100);
Mouse(639, 376, 1, 1, True);
end;

procedure PaladinThiever;
begin
repeat
ClearDebug;
Writeln('Preparing to pickpocket.');
Attack(5552103, 100, 'pickpocket');
Alch;
if (Eating) then begin
Eat;
end;
until(False);
end;

procedure BlackKnightKiller;
begin
repeat
ClearDebug;
Writeln('Preparing to attack.');
Attack(1184277, 150, 'attack');
F_GameTab(GTAB_INV);
F_GameTab(GTAB_STATS);
while (F_InFight) do begin
if (Eating) then begin
Eat;
end;
Wait(1000);
ClearDebug;
Writeln('We are fighting.');
end;
until(False);
end;

procedure MagicAxeKiller;
begin
repeat
ClearDebug;
Writeln('Preparing to attack.');
Attack(2843259, 100, 'attack');
F_GameTab(GTAB_INV);
F_GameTab(GTAB_STATS);
while (F_InFight) do begin
if (Eating) then begin
Eat;
end;
Wait(1000);
ClearDebug;
Writeln('We are fighting.');
end;
until(False);
end;

procedure HillGiantKiller;
begin
repeat
ClearDebug;
Writeln('Preparing to attack.');
Attack(8039378, 100, 'attack');
F_GameTab(GTAB_INV);
F_GameTab(GTAB_STATS);
while (F_InFight) do begin
if (Eating) then begin
Eat;
end;
Wait(1000);
ClearDebug;
Writeln('We are fighting.');
end;
until(False);
end;

procedure FireBuyer;
begin
repeat
Mouse(284, 84, 0, 0, False);
Wait(150);
Mouse(284, 164, 0, 0, True);
Wait(150);
until(False);
end;

procedure NatureBuyer;
begin
repeat
Mouse(333, 132, 0, 0, False);
Wait(150);
Mouse(333, 212, 0, 0, True);
Wait(150);
until(False);
end;

procedure Debug;
begin
Writeln(IntToStr(CountColorTolerance(65535, 710, 210, 741, 236, 15)));
end;

begin
SetupSRL;
if not (F_LoggedIn) then begin F_LogIn; end;
case Script of
0: Debug;
1: PaladinThiever;
2: BlackKnightKiller;
3: MagicAxeKiller;
4: HillGiantKiller;
5: FireBuyer;
6: NatureBuyer;
end;
end.

bilsma
01-31-2013, 09:24 PM
Somebody help it wont work

Kevin
01-31-2013, 09:38 PM
If this is a request, you should put it in the requests section as opposed to a section dedicated to currently existing scripts.

As it stands this kinda looks like a really poor quality AIO script that does a variety of things that I seriously doubt work:
procedure NatureBuyer;
begin
repeat
Mouse(333, 132, 0, 0, False);
Wait(150);
Mouse(333, 212, 0, 0, True);
Wait(150);
until(False);
end;
This is just permanently making clicks in static locations. There is literally nothing to this that even signifies it's doing what the procedure claims.

Where did you find this script anyway? And if you do legitimately want to request something, say what it is you actually want.

bilsma
01-31-2013, 10:11 PM
I want a script for battle-scape that can thiev paladin at edge the reward is rune scimitar and it will be nice if it bank it to

Lemonade
02-01-2013, 04:40 PM
Well i see in the first line the problem... "rogram BSScript;" it should be "program BSScript;"

Silentcore
02-01-2013, 05:40 PM
Whats the whole point of botting in Battlescape if there's random events that are really random. Ex: 5-2:

Kevin
02-01-2013, 05:57 PM
I just realized... it's name is BSScript...

Sjoe
02-01-2013, 06:02 PM
http://villavu.com/forum/forumdisplay.php?f=95

here mate, don't think anyone would help with this..

Try and make your own ! :)