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.
Thanks for any help
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