SRL Archive - Non-RuneScape Scripts

BattleScape Bot Need Help


Lost in the Trap

2013-01-05 20:31:27

I am new to this forum. Im trying to make a bot to theive and make money on Battlescape. I need help so here is what i have so far.

program BattlescapeBot;

{
Name: BattlescapeBot Theiver
Author: Sit blackboy

Version: 1.0

I'm new so expect this to work worse then the flu
}

{$DEFINE SMART}
{$i SRL]SRL.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{$i SPS\SPS.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

FailSafeDetect := False; // CHANGE THIS TO TRUE only if the new version keeps running passed berries.
Players[0].Name := ''; // you know the score..
Players[0].Pass := '';
Players[0].Active := True;
Players[0].Pin := '';
end;

procedure ProgressReport;
begin
writeln('+- BattlescapeBot Progress Report -+');
writeln('+- by Sit blackboy @ villavu.com -+');
writeln('Loads Done: ' + ToStr(LoadsDone));
writeln('Loads Collected: ' + ToStr(LoadsDone * 27));
writeln('Times Theived: ' + ToStr(TimesDied));
writeln('Natures Used: ' + ToStr(GlorysUsed));
writeln('Time Running: ' + ToStr(MsToTime(TimeFromMark(TimeRan), Time_Short)));
end;

procedure AntiBanAndChecks;
begin
FindNormalRandoms;
if(NOT LoggedIn) then
LogInPlayer;
end;
procedure ClickClosestMM;
var
x, y, i, k, j: Integer;
TPA: TPointArray;
Closest: TPoint;
begin
SymbolAccuracy := 0.7;
if(FindSymbols(TPA, 'transportation')) then
begin
if(Length(TPA) = 0) then
exit;

if(Length(TPA) = 1) then
begin
Mouse(TPA[0].x, TPA[0].y, 0, 0, true);
end else
begin
k := 1000;
for i := 0 to high(TPA) do
begin
j := Distance(MMCX, MMCY, TPA[i].x, TPA[i].y);
if(j < k) then
begin
k := j;
Closest := TPA[i];
end;
end;
Mouse(Closest.x, Closest.y, 0, 0, true);
end;
end;
SymbolAccuracy := 0.8;
end;
procedure SetupColors;
begin
GuardColor := ;
PaladinColor := ;
BankerColor := ;
AdamantPlatebodyColor :=;
RuneScimitarColor :=;
end;
function ClickPaladinNEW: Boolean;
var
x, y, i, h, trys, CTS, ThisColor: Integer;
TPA, TTA, TPAText, TPAMulti, TPASkull: TPointArray;
CPA: T2DPointArray;
upText: String;
mid: TPoint;

begin
if(NOT IsUpTextMultiCustom(['ast', 'kinetic'])) then
begin
writeln('ClickPaladinNEW() No spell selected!');
Result := True;
Exit;
end;
if((LastPoint.x <> 0) AND (NOT LastPoint.y <> 0)) then
begin
MMouse(LastPoint.x, LastPoint.y, 1, 1);
wait(100 + random(100));
end;

if(IsUpTextMultiCustom(['aladin', 'Paladin', 'Paladin'])) then
begin
WasThereLastTime := True;
ClickMouse2(true);
Result := True;
exit;
end else if(WasThereLastTime) then
begin
ClickMouse2(false);
wait(50 + random(100));
WasThereLastTime := False;
if(ChooseOptionMulti(['Theif -^ Paladin', 'Theif -> Paladin'])) then
Exit;
end;

SafeChecking;
if(WeAreDead) then
Exit;

writeln('Searching for Paladin...');
ThisColor := PaladinColor;
trys := 0;

repeat
FindColorsSpiralTolerance(x, y, TPA, BerriesColor, MSX1, MSY1, MSX2, MSY2, 25);

if(Length(TPA) = 0) then
begin
if(ThisColor = PaladinColor) then
ThisColor := PaladinColoryellow
else
ThisColor := PaladinColor;
continue;
end;
begin
LoginPlayerToLob;
SelectWorld(RandomWorld(true, false));
LogInPlayer;
end;

wait(1000 + random(1000));
Mouse(545, 23, 6, 6, true);
SetAngle(SRL_ANGLE_HIGH);

SPS_Setup(RUNESCAPE_SURFACE, ['10_6','9_6','10_7','11_7','11_6']); // only 10_6 needed

while(true) do
begin
WeAreDead := false;

while(NOT WeAreDead) do
begin
// This timer deals with SMARTManager
if(TimeFromMark(TimeRan) > 19440000) then
begin
{$IFDEF SMARTManager}
SMARTManager; // UNCOMMENT when running with smart manager..
{$ENDIF}
end;

AntiBanAndChecks;
WalkToLogCustom;
ProgressReport;
AntiBanAndChecks;

TheifPaladin;

if(NOT StartOver) then
begin
ProgressReport;
WaitForRegain;

ProgressReport;
WalkAlongRiver;
SafeChecking;
if(WeAreDead) then
break;

ProgressReport;

ClickPaladin;
Inc(LoadsDone);
ProgressReport;
SafeChecking;
if(WeAreDead) then
break;

GotoCave;
if(WeAreDead) then
break;
ProgressReport;


Teleport;

AntiBanAndChecks;
ProgressReport;

DoBanking(true, true);

AntiBanAndChecks;
ProgressReport;
end else
begin
writeln('Starting over...');
StartOver := False;
end;
end;


writeln('Looks like we died...Recovering..');
Players[0].Active := True;
if(NOT LoggedIn) then
LogInPlayer;

RecoverFromDeath;
end;
UnloadDTMs;
end.

Thanks for any help

Echo_

2013-01-05 20:32:53

Some of the things you are trying to use (SMART, SPS, some SRL functions) only work with the official game, not with private servers.

Lost in the Trap

2013-01-05 20:36:54

Can you point me in the correct direction on how to do this

Echo_

2013-01-05 20:47:24

Since you can't use SPS for walking, you will have to do it the old fashioned way:
DDTMs:
http://villavu.com/forum/showthread.php?t=32608

Radialwalk:
http://villavu.com/forum/showthread.php?t=11584

Another good tutorial:
http://villavu.com/forum/showthread.php?t=19162

For logging in, you will either have to write a custom login function or simply log in to the game before you start the script.

I don't know if battlescape has randoms, if it does then you will have to write some code to deal with those.

Other than that, there's just parts that are RuneScape specific and will be different for Battlescape like window constants (ex. MMX1), FindSymbol (the bitmaps used by this function are RuneScape specific), IsUpTextMultiCustom (the uptext is also RuneScape specific).

Lost in the Trap

2013-01-05 20:54:12

Alright thanks ill come back when im closer to having it done, and yes battlescape has its own custom randoms

rj

2013-01-05 20:57:47

From: Echo_
Since you can't use SPS for walking, you will have to do it the old fashioned way:
DDTMs:
http://villavu.com/forum/showthread.php?t=32608

Radialwalk:
http://villavu.com/forum/showthread.php?t=11584

Another good tutorial:
http://villavu.com/forum/showthread.php?t=19162

For logging in, you will either have to write a custom login function or simply log in to the game before you start the script.

I don't know if battlescape has randoms, if it does then you will have to write some code to deal with those.

Other than that, there's just parts that are RuneScape specific and will be different for Battlescape like window constants (ex. MMX1), FindSymbol (the bitmaps used by this function are RuneScape specific), IsUpTextMultiCustom (the uptext is also RuneScape specific).


Would ddtms or radial walk be more reliable?

Justin

2013-01-05 21:01:55

From: rjj95
Would ddtms or radial walk be more reliable?


I'd say radial walking would be.

Echo_

2013-01-05 21:04:33

From: rjj95
Would ddtms or radial walk be more reliable?


I would use DDTMs and if they fail, use RadialWalk as a backup.

Also there's TPAWalk found in MapWalk.simba

rj

2013-01-05 21:05:53

From: Echo_
I would use DDTMs and if they fail, use RadialWalk as a backup.


Grr one for radial one for ddtm.. Which One to choose.. How do they compare to sps walking (I know it can't be used on rsps but still)

Justin

2013-01-05 21:16:24

From: rjj95
Grr one for radial one for ddtm.. Which One to choose.. How do they compare to sps walking (I know it can't be used on rsps but still)


Try not to thread-hijack, if you have questions make your own thread

mcbain

2013-01-07 02:49:35

{$i SPS\SPS.simba} – Can't be used for walking in a RSPS (I think so anyway)
And you are defining smart, which only works for the real rs. So this can't be used for an RSPS.

Echo_

2013-01-07 03:03:00

From: mcbain
{$i SPS\SPS.simba} – Can't be used for walking in a RSPS (I think so anyway)
And you are defining smart, which only works for the real rs. So this can't be used for an RSPS.


Read my previous posts…

Mr[S]

2013-01-07 03:22:51

So what year does this battlescape copy of RS?

rj

2013-01-07 09:58:41

From: Mr[S]
So what year does this battlescape copy of RS?


It's a mix of a few years

Lost in the Trap

2013-01-07 19:15:13

My intentions for the bot were to originally have it High alch. I do not know which will be more stable High Alch or bank. Suggestions
Men=Addy Kites
Warrior=Rune dagger
Guard=Addy Plate
Paladin=Rune Scimitar
Randoms:Yes
Only has to click to thieve.
Npc Move:Yes