Simba Code:
program HoodzFighter;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/SmartGraphics.simba}
{$I SRL-OSR/SRL/misc/Al_functions.simba}
{$i SRL-OSR/SRL/Reflection/Reflection.simba}
{$I F_AntiRandoms.simba}
var
x, y, Hp, PRAYER, AddCount, FoodDTM, TabDTM, BoneDTM, StartXp, StartXpHp, GainedHPStart, GainedCBStart, LastNPC, LootCount, RunE: Integer;
StrengthPot1, StrengthPot2, StrengthPot3, StrengthPot4, SuperStrengthPot1, SuperStrengthPot2, SuperStrengthPot3, SuperStrengthPot4: integer;
Attackpot1, AttackPot2, AttackPot3, AttackPot4, SuperAttackpot1, SuperAttackpot2, SuperAttackpot3, SuperAttackpot4: integer;
Pray1, Pray2, Pray3, Pray4: Integer;
LootArray, Pray: TIntegerArray;
LootNameArray: array of string;
UsePots: Boolean;
PlayerLoc: TBox;
CP, CCP: TPoint;
const
USERNAME = '';
PASSWORD = '';
FOODNAME = 'lobster';
NPCNAME = 'Iron dragon'; {exact spelling with capital}
Location = 'sos1'; {built in locations (see thread)}
TRAININGMODE = 2;
ANTIBANTRAININGMODE = skill_strength; {skill_range, skill_strength, skill_magic, skill_attack, skill_defence}
WORLD = 75;
RIGHTCLICKONLY = true; {testing}
LOOT = true; {looting? true/false, see line 38 and 39 for loot information!}
CPDISTANCE = 16; {amount of max tiles you want to search for loot and npcs (start tile is where you start the script)}
HPPERCENTAGE = 50; {hp percentage you want to eat}
USEPRAY = true; {prayer disabled/enabled, testing}
PRAYPERCENTAGE = 50; {prayer percentage you want to drink, testing}
EATFORSPACE = true; {eat for space (looting)}
B2P = false; {b2p disabled, will be added @beta 2 release}
PICKUPARROWS = false; {need to wait for gear functions (beta 2 release?)}
procedure Loot_Setup;
begin
LootNameArray := ['Iron arrow'];
LootArray := [884];
end;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := USERNAME;
Pass := PASSWORD;
Active := True;
end;
end;
procedure Setup;
begin
BoneDTM := DTMFromString('m6wAAAHic42ZgYChlYWAoAuJqIM4A4hIgroDShUCcB8UFQFzLyMBQD8VVQNwExBVQXAPELUBcB+VvWraMoamykmHf1q1AWxjxYlYgCcOEAH6TUDESAADRUBBD');
StrengthPot1 := DTMFromString('mlwAAAHicY2dgYOAAYmEgZmWAAH4g5oSKiwKxBBDzQNkCUDWyQLx1sy6QZMSKWaHmYcPYdUAwFAAA8p8CiA==');
StrengthPot2 := DTMFromString('mlwAAAHicY2dgYGAFYgEg5gFiTiBmYoAADiAWBGIJIOaDirFB1coA8bKlmkCSEStmhZqLDWPXAcFQAADZCAJJ');
StrengthPot3 := DTMFromString('mlwAAAHicY2dgYGAHYkYgFgRiPiDmYIAALiAWAmJpIJaEyoOAMBDLArHqtNlQnZiYFUjiwth1QDAUAADcfgJO');
StrengthPot4 := DTMFromString('mlwAAAHicY2dgYHBmYmBwBGJrILZngvA9gdgLiNkZGRjEgZgbiP8A1f4CYh4gWwSIlyzWBPIYsWJWIIkLY9cBwVAAAHvkBc4=');
SuperStrengthPot1 := DTMFromString('mggAAAHicY2NgYGADYh4gZmGAAH4gZgViQSBmhIrxArEAEEsC8folS6AyqJgNahY6xlSJMJeBAQDO8AKf');
SuperStrengthpot2 := DTMFromString('mbQAAAHicY2VgYGAHYh4g5maAACYonwvKB8mLAPGhnTuBJCMKZgaSrGiYEQsGAwCvBAKr');
SuperStrengthpot3 := DTMFromString('mggAAAHicY2NgYGABYj4g5gRiHiBmYoAAEFscyuaHyksC8fkzZ4AkIwZmBZLYMKZKCIYAAPROAxQ=');
SuperStrengthpot4 := DTMFromString('mlwAAAHicY2fidgYGAHYkYgFgRiPiDmYIAALiAWAmJpIJaEyoOAMBDLArHqtNlQnZiYFUjiwth1QDAUAADcfgJO');
AttackPot1 := DTMFromString('mlwAAAHicY2dgYOAAYh4gZgJiQQYI4IBiMSDmBWIZKFsIKi8LxLrrtwJJRqyYlQE3wK4DgqEAAOlZAmY=');
AttackPot2 := DTMFromString('mlwAAAHicY2dgYGAHYkYgFgRiPiDmYIAALiAWAmJpIJaEyoOAMBDLArHqtNlQnZiYFUjiwth1QDAUAADcfgJO');
AttackPot3 := DTMFromString('mggAAAHicY2NgYGAHYk4gZgNiRiDmY4AAfiCWhbIFgFgYiKWB2PDYGahKVMzFgB1gqoRgCAAAxSACbg==');
AttackPot4 := DTMFromString('mlwAAAHicY2dgYOBggAAQzQPEQkDMBMScULYkVJ4biMWBWACIZYE45vwVIMmIFXMx4AbYdUAwFAAADP8C0Q==');
SuperAttackPot1 := DTMFromString('mbQAAAHicY2VgYGABYjYg5mOAABBfFMoWgYrLArGOwRYgyYiCWYEkOmbEgsEAAG5MAag=');
SuperAttackPot2 := DTMFromString('mbQAAAHicY2VgYOAEYg4g5meAABBfEMoG0SJALAvEwsIBQJIRBbMCSXTMiAWDAQBMhwEa');
SuperAttackPot3 := DTMFromString('mbQAAAHicY2VgYGCFYn4GCGBHYosCsRAQywKxq8clIMmIglmR9MMwIxYMBgCC6gH6');
SuperAttackPot4 := DTMFromString('mggAAAHicY2NgYLjJDMGPgfgOEF8B4ttAzM3IwCAExMJALA3E/ED8D6j+zu3bDDeuXQOyGFEwF5AEYXTAiANDAABVfgvK');
TabDTM := DTMFromString('m1gAAAHic42JgYOAFYmkg5gJiESBmBWJ+BgSQhmKQOh4kvjRUXgKqlw2IRYE4KykJSDISxP8ZiAOETYJgBAAAz9MDgg==');
Pray1 := DTMFromString('mWAAAAHicY2FgYLjLxMDwFIivAfF9INZgZGBQg2IDEN7eBVTFCMdsDKiAEQ2DAACFtgWq'); {1 dose}
Pray2 := DTMFromString('mWAAAAHicY2FgYGBjYmDgAmJ+IGYAYg1GBgYTINaCYvnKGKAEIxxzMaACRjQMAgBrxQHl');
Pray3 := DTMFromString('mWAAAAHicY2FgYGhlYmBoB+JGIO4DYg1GBgYzRgitB8QWl+YDVTHCMTsDKmBEwyAAACq5BJc=');
Pray4 := DTMFromString('mWAAAAHicY2FgYIhmYmCIAuIUIA4FYjVGBgYzINYFYi0gTr26BqiKEY65GFABIxoGAQACtAQp'); {4 dose}
Pray := [Pray1, Pray2, Pray3, Pray4];
case LowerCase(FoodName) of
'lobster':
begin
FoodDTM := DTMFromString('m6wAAAHic42ZgYHBhYmDwgmJPIHYEYhsgNodiOyB2BWIfIA5gZGCIAeIoIPYD4lAoDoPyfYDYC4idgHhHshjQdEaisAaQJBYTZyIEIwEA/ycJgA==');
end;
'salmon':
begin
FoodDTM := DTMFromString('mggAAAHicY2NgYOCGYhDgA2IJIBYGYi4gFgJifiBmhMqDxA44SkBFUDErAyZgxaoSYR4DAwCTLQG6');
end;
'trout':
begin
FoodDTM := DTMFromString('mggAAAHicY2NgYOAGYmEglgBiPgYIAIlxQTEIMAIxPxALAXF5UhxUBBWzAklWBkyAqRKCIQAAnDwB2A==');
end;
'shark':
begin
FOODDTM := DTMFromString('mlwAAAHicY2dgYOACYkYgZgViESCWYoAALiiWgfKZoXK8QCwMxDnBtlCdmJidATfArgOCoQAAsEwBww==');
end;
'monkfish':
begin
FOODDTM := DTMFromString('mggAAAHicY2NgYNjGzMCwGYhPAfE6IN4ExEeAmIuRgUEAiPmgNCsQMwFxSbI/w+ryEqBORhTMDiRBGB0w4sAQAADtDAeJ');
end;
end;
Loot_Setup;
AddOnTerminate('ClearTheDTM');
end;
procedure H_Mouse(TP: TPoint);
begin
case random(4) of
0..2: AL_BrakeMMouse(TP, Random(2), Random(2), True);
3: AL_BrakeMMouse(TP, Random(2), Random(2), False);
end;
end;
procedure TheStatus(Status: string);
var
GainedXp, GainedXpHp, GainedXpHour, GainedXpHourHp, GainedHP, GainedCB: Integer;
begin
ClearDebug;
GainedXp := Round((R_GetSkillExp(Skill_Attack) + R_GetSkillExp(Skill_Strength) + R_GetSkillExp(Skill_Defence) + R_GetSkillExp(Skill_Magic) + R_GetSkillExp(Skill_Range)) - StartXp);
GainedXpHp := Round(R_GetSkillExp(Skill_Hitpoints) - StartXpHp);
GainedXpHour := Round((GainedXp) / (GetTimeRunning / 3600000.0));
GainedXpHourHp := Round((GainedXpHp) / (GetTimeRunning / 3600000.0));
GainedHP := Round(R_GetMaxSkillLevel(Skill_Hitpoints) - GainedHPStart);
GainedCB := Round((R_GetMaxSkillLevel(Skill_Attack) + R_GetMaxSkillLevel(Skill_Defence) + R_GetMaxSkillLevel(Skill_Strength) + R_GetMaxSkillLevel(Skill_Magic) + R_GetMaxSkillLevel(Skill_Range)) - GainedCBStart);
Writeln('Cb xp: ' + IntToStr(GainedXp));
Writeln('Cb xp/hour: ' + IntToStr(GainedXpHour));
Writeln('Hp xp: ' + IntToStr(GainedXpHp));
Writeln('Hp xp/hour: ' + IntToStr(GainedXpHourHp));
Writeln('Status: ' + Status);
Writeln('Hp: ' + IntToStr(GetHealthPercent) + '%');
Writeln('Prayer: ' + IntToStr(GetPrayerPercent) + '%');
Writeln('Hp random eat: ' + IntToStr(HP) + '%');
Writeln('Prayer random pot: ' + IntToStr(PRAYER) + '%');
Writeln('Gained levels: ' + '(HP: +' + IntToStr(GainedHP) + ' CB: +' + IntToStr(GainedCB) + ')');
if (LOOT) then
Writeln('Times looted: ' + IntToStr(LootCount));
Writeln('Time running: ' + MsToTime(GetTimeRunning, 3));
end;
procedure AntiBan;
begin
case Random(10000) of
0..1:
begin
Al_HoverSkill(ANTIBANTRAININGMODE, False);
Sleep(800 + Random(500));
end;
2..3:
begin
Al_HoverSkill(Skill_Hitpoints, False);
Sleep(800 + Random(500));
end;
4..10:
begin
MakeCompass(RandomRange(0, 360));
Sleep(800 + Random(500));
end;
11..26:
begin
AL_HumanRandomMouse;
Sleep(800 + Random(500));
end;
18:
begin
AdjustMouseSpeed(2, 10, 20);
Sleep(800 + Random(500));
end;
19:
begin
RandomRClick;
Sleep(800 + Random(500));
end;
20:
begin
HoverMovingObject;
Sleep(800 + Random(500));
end;
21:
begin
MMouseOffClient('top');
Sleep(800 + Random(500));
end;
22:
begin
MMouseOffClient('left');
Sleep(800 + Random(500));
end;
23:
begin
MMouseOffClient('right');
Sleep(800 + Random(500));
end;
24:
begin
MMouseOffClient('bottom');
Sleep(800 + Random(500));
end;
25..26:
begin
if IsRunOn(False) then
begin
SetRun(True);
end
end;
29..31:
begin
RandomTab(False);
Sleep(1000 + Random(500));
AL_GameTab(Tab_Inv);
end;
end;
Exit;
end;
procedure GenerateRun;
begin
if (not LoggedIn) then
Exit;
RunE := RandomRange(7, 30);
TheStatus('Run energy generated at (' + IntToStr(RunE) + '%)');
end;
procedure GenerateHP;
begin
if (not LoggedIn) then
Exit;
HP := RandomRange(HPPERCENTAGE - 7, HPPERCENTAGE + 7);
TheStatus('HP generated at (' + IntToStr(HP) + '%)');
end;
procedure GeneratePrayer;
begin
if (not LoggedIn) then
Exit;
PRAYER := RandomRange(PRAYPERCENTAGE - 7, PRAYPERCENTAGE + 7);
TheStatus('PRAY generated at (' + IntToStr(PRAYER) + '%)');
end;
procedure Setup_Player;
begin
LogInPlayer;
SetAngle(0);
SetRun(True);
SetFightMode(TrainingMode);
AL_GameTab(Tab_Inv);
GenerateHp;
GeneratePrayer;
GenerateRun;
end;
procedure BankHandler;
begin
if (BankScreen) then
begin
TheStatus('banking');
QuickDeposit('inv');
if (FindDTM(FoodDTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
begin
H_Mouse(Point(x, y));
Sleep(20 + Random(70));
AL_FastClick(Mouse_Right);
Sleep(20 + Random(70));
AL_WaitOption('All', 200);
Sleep(360 + Random(200));
CloseBank;
end
else
begin
TheStatus('No food found, terminating script :( ');
CloseBank;
TerminateScript;
end;
end;
end;
procedure InteractBank;
var
MSLoc: TPoint;
BankTimer, I, Q: Integer;
BankObj: TRSObjectArray;
BankIDs: TIntegerArray;
begin
if (not LoggedIn) then
Setup_Player;
TheStatus('Opening bank');
BankIDs := [2100];
BankObj := R_GetObjectsDistance(0, 15);
for I := 0 to High(BankObj) do
begin
if (BankScreen) then
BankHandler;
for Q := 0 to High(BankIDs) do
begin
if (BankObj[I].ID = BankIDs[Q]) then
begin
MSLoc := R_TileToMS(BankObj[I].Tile);
if (not PointInBox(MSLoc, MSBox)) then
R_BlindWalk(BankObj[I].Tile);
MSLoc := R_TileToMS(BankObj[I].Tile);
H_Mouse(MSLoc);
Sleep(400 + Random(200));
if (R_IsUpText('Bank')) or (R_IsUpText('Open')) then
begin
case Random(6) of
0..4: AL_FastClick(Mouse_Left);
5:
begin
AL_FastClick(Mouse_Right);
Sleep(120 + Random(25));
AL_WaitOptionMulti(['Bank', 'Open'], 250);
end;
end;
Sleep(250 + Random(150));
Flag;
MarkTime(BankTimer);
repeat
if (TimeFromMark(BankTimer) > 5000) then
InteractBank;
Sleep(250 + Random(100));
until (BankScreen);
end
else
InteractBank;
Sleep(3500 + Random(200));
BankHandler;
Exit;
end;
end;
end;
end;
procedure InteractSOSDoor(Tile: TPoint; HeadingDirection: string);
var
MSLoc: TPoint;
Answers: array of string;
I: Integer;
begin
if (not LoggedIn) then
Setup_Player;
TheStatus('Interacting SOS door (Tile: ' + ToStr(Tile) + ' HeadingDirection: ' + HeadingDirection);
Answers := ['Recover', 'Virus scan my computer then', 'Game', 'Only on the', 'couple', 'tell them anything', 'No', 'no', 'give him my', 'Memorable', 'To recover my account', 'famous', 'report abuse', 'Use the recover', 'Nowhere', 'Nobody', 'To help me recover my password', 'Talk to any'];
MSLoc := R_TileToMS(Tile);
if (not PointInBox(MSLoc, MSBox)) then
begin
R_BlindWalk(Tile);
repeat
sleep(300 + Random(100));
until (not R_isWalking);
end;
MakeCompass(HeadingDirection);
Sleep(1200 + Random(200));
MSLoc := R_TileToMS(Tile);
H_Mouse(MSLoc);
Sleep(200 + Random(100));
if (R_IsUpText('Open')) then
begin
AL_FastClick(Mouse_Right);
if (not AL_WaitOption('Open', 500)) then
InteractSOSDoor(Tile, HeadingDirection);
end
else
begin
AL_FastClick(Mouse_Right);
Sleep(200 + Random(200));
if (not AL_WaitOption('Open', 500)) then
InteractSOSDoor(Tile, HeadingDirection);
end;
repeat
Sleep(20 + Random(20));
until (not R_isWalking);
Sleep(3400 + Random(200));
repeat
ClickContinue(True);
Sleep(850 + Random(200));
until (not ClickToContinue);
for I := 0 to High(Answers) do
begin
if (FindNPCChatText(Answers[I], ClickLeft)) then
begin
Sleep(1400 + Random(100));
repeat
ClickContinue(True);
Sleep(850 + Random(200));
until (not ClickToContinue);
Sleep(1300 + Random(500));
end;
end;
end;
procedure InteractDoor(Tile: TPoint; ClosedDoorId: Integer);
var
MSLoc: TPoint;
Door: TRSObject;
begin
if (not LoggedIn) then
Setup_Player;
TheStatus('Interacting with door');
MSLoc := R_TileToMS(Tile);
Door := R_GetObjectAt(3, Tile);
if (Door.ID = ClosedDoorId) then
begin
if (not PointInBox(MSLoc, MSBox)) then
begin
R_BlindWalk(Tile);
repeat
sleep(200 + Random(100));
until (not R_isWalking);
end;
MSLoc := R_TileToMS(Tile);
H_Mouse(MSLoc);
Sleep(200 + Random(100));
if (R_isUpText('Open')) then
begin
AL_FastClick(Mouse_Right);
if (not AL_WaitOption('Open', 500)) then
InteractDoor(Tile, ClosedDoorId);
Sleep(1000 + Random(300));
repeat
Sleep(200 + Random(300));
until (not R_isWalking) and (not R_IsAnimating);
Sleep(1200 + Random(2000));
Exit;
end
else
begin
MakeCompass(Rs_GetCompassAngleDegrees + 90 + RandomRange( - 10, 10));
InteractDoor(Tile, ClosedDoorId);
end;
end;
end;
procedure InteractObject(Tile: TPoint; UpText: string);
var
MSLoc: TPoint;
begin
if (not LoggedIn) then
Setup_Player;
TheStatus('Interacting with object');
MSLoc := R_TileToMS(Tile);
if (not PointInBox(MSLoc, MSBox)) then
begin
R_BlindWalk(Tile);
repeat
sleep(200 + Random(100));
until (R_isWalking);
end;
MSLoc := R_TileToMS(Tile);
H_Mouse(MSLoc);
Sleep(200 + Random(100));
if (R_isUpText(UpText)) then
begin
AL_FastClick(Mouse_Right);
if (not AL_WaitOption(UpText, 500)) then
InteractObject(Tile, UpText);
Sleep(1000 + Random(300));
repeat
Sleep(200 + Random(300));
until (not R_isWalking) and (not R_IsAnimating);
Sleep(1200 + Random(2000));
end
else
begin
MakeCompass(Rs_GetCompassAngleDegrees + 90 + RandomRange( - 10, 10));
InteractObject(Tile, UpText);
end;
end;
procedure WalkLoc(TPA: TPointArray; Reverse: Boolean);
begin
if (not LoggedIn) then
Setup_Player;
TheStatus('Walking to destination');
if (Reverse) then
R_WalkPathEx(TPA, True, 0);
if (not Reverse) then
R_WalkPath(TPA);
repeat
Sleep(200 + Random(100));
until (not R_IsWalking);
end;
procedure MonkHandler;
var
MSLoc: TPoint;
Abbot: array of TNPC;
I, UpTextTimer: Integer;
begin
repeat
TheStatus('Healing at monk (Abbot Langley)');
Abbot := R_GetNpcs('Abbot Langley');
for I := 0 to High(Abbot) do
begin
MSLoc := R_TileToMS(Abbot[I].Tile);
if (PointInBox(MSLoc, MSBox)) then
begin
H_Mouse(MSLoc);
MarkTime(UpTextTimer);
repeat
Sleep(5 + Random(10));
until (R_isUpText('Abbot Langley')) or (TimeFromMark(UpTextTimer) > 2000);
if (R_isUpText('Abbot Langley')) then
begin
AL_FastClick(Mouse_Left);
UpTextTimer := 0;
Sleep(500 + Random(200));
MarkTime(UpTextTimer);
repeat
Sleep(20 + Random(25));
until (TimeFromMark(UpTextTimer) > 1500) or (FindNPCChatText('reet', Nothing));
ClickContinueEx(True, True);
FindNPCChatText('heal', ClickLeft);
Sleep(RandomRange(500, 700));
repeat
ClickContinue(True);
Sleep(350 + Random(200));
until (not ClickToContinue);
end;
end
else
begin
R_BlindWalk(Abbot[I].Tile);
repeat
Sleep(20 + Random(25));
until (not R_isWalking);
end;
end;
until (getHealthPercent = 100);
end;
procedure Restock;
begin
if (NPCNAME = 'Guard') and (LOCATION = 'varrock') then
begin
WalkLoc([Point(3273 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3268 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3263 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3258 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3254 + RandomRange( - 1, 1), 3425 + RandomRange( - 1, 1)), Point(3253 + RandomRange( - 1, 1), 3420 + RandomRange( - 1, 1))], false);
InteractBank;
WalkLoc([Point(3273 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3268 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3263 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3258 + RandomRange( - 1, 1), 3428 + RandomRange( - 1, 1)), Point(3254 + RandomRange( - 1, 1), 3425 + RandomRange( - 1, 1)), Point(3253 + RandomRange( - 1, 1), 3420 + RandomRange( - 1, 1))], true);
end;
if (NPCNAME = 'Dwarf') then
begin
R_BlindWalk(Point(3018 + RandomRange( - 1, 1), 9850 + RandomRange( - 1, 1)));
InteractObject(Point(3019, 9850), 'Climb-up');
WalkLoc([Point(3015 + RandomRange( - 1, 1), 3452 + RandomRange( - 1, 1)), Point(3019 + RandomRange( - 1, 1), 3456 + RandomRange( - 1, 1)), Point(3022 + RandomRange( - 1, 1), 3461 + RandomRange( - 1, 1)), Point(3026 + RandomRange( - 1, 1), 3465 + RandomRange( - 1, 1)), Point(3031 + RandomRange( - 1, 1), 3468 + RandomRange( - 1, 1)), Point(3036 + RandomRange( - 1, 1), 3470 + RandomRange( - 1, 1)), Point(3041 + RandomRange( - 1, 1), 3470 + RandomRange( - 1, 1)), Point(3046 + RandomRange( - 1, 1), 3470 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3471 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3476 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3481 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3486 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3491 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3496 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3501 + RandomRange( - 1, 1)), Point(3054 + RandomRange( - 1, 1), 3505 + RandomRange( - 1, 1)), Point(3052 + RandomRange( - 1, 1), 3510 + RandomRange( - 1, 1)), Point(3056 + RandomRange( - 1, 1), 3514 + RandomRange( - 1, 1)), Point(3060 + RandomRange( - 1, 1), 3518 + RandomRange( - 1, 1)), Point(3065 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3070 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3075 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3080 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3084 + RandomRange( - 1, 1), 3517 + RandomRange( - 1, 1)), Point(3085 + RandomRange( - 1, 1), 3512 + RandomRange( - 1, 1)), Point(3086 + RandomRange( - 1, 1), 3507 + RandomRange( - 1, 1)), Point(3089 + RandomRange( - 1, 1), 3502 + RandomRange( - 1, 1)), Point(3092 + RandomRange( - 1, 1), 3498 + RandomRange( - 1, 1)), Point(3093 + RandomRange( - 1, 1), 3493 + RandomRange( - 1, 1))], False);
InteractBank;
WalkLoc([Point(3015 + RandomRange( - 1, 1), 3452 + RandomRange( - 1, 1)), Point(3019 + RandomRange( - 1, 1), 3456 + RandomRange( - 1, 1)), Point(3022 + RandomRange( - 1, 1), 3461 + RandomRange( - 1, 1)), Point(3026 + RandomRange( - 1, 1), 3465 + RandomRange( - 1, 1)), Point(3031 + RandomRange( - 1, 1), 3468 + RandomRange( - 1, 1)), Point(3036 + RandomRange( - 1, 1), 3470 + RandomRange( - 1, 1)), Point(3041 + RandomRange( - 1, 1), 3470 + RandomRange( - 1, 1)), Point(3046 + RandomRange( - 1, 1), 3470 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3471 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3476 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3481 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3486 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3491 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3496 + RandomRange( - 1, 1)), Point(3051 + RandomRange( - 1, 1), 3501 + RandomRange( - 1, 1)), Point(3054 + RandomRange( - 1, 1), 3505 + RandomRange( - 1, 1)), Point(3052 + RandomRange( - 1, 1), 3510 + RandomRange( - 1, 1)), Point(3056 + RandomRange( - 1, 1), 3514 + RandomRange( - 1, 1)), Point(3060 + RandomRange( - 1, 1), 3518 + RandomRange( - 1, 1)), Point(3065 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3070 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3075 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3080 + RandomRange( - 1, 1), 3520 + RandomRange( - 1, 1)), Point(3084 + RandomRange( - 1, 1), 3517 + RandomRange( - 1, 1)), Point(3085 + RandomRange( - 1, 1), 3512 + RandomRange( - 1, 1)), Point(3086 + RandomRange( - 1, 1), 3507 + RandomRange( - 1, 1)), Point(3089 + RandomRange( - 1, 1), 3502 + RandomRange( - 1, 1)), Point(3092 + RandomRange( - 1, 1), 3498 + RandomRange( - 1, 1)), Point(3093 + RandomRange( - 1, 1), 3493 + RandomRange( - 1, 1))], True);
InteractObject(Point(3019, 3450), 'Climb-down');
end;
if (NPCNAME = 'Monk') then
MonkHandler;
if (NPCNAME = 'Man') and (LOCATION = 'edgeville') then
begin
InteractDoor(Point(3101, 3509), 6821);
R_BlindWalk(Point(3094 + RandomRange( - 1, 1), 3493 + RandomRange( - 1, 1)));
InteractBank;
R_BlindWalk(Point(3101 + RandomRange( - 1, 1), 3509 + RandomRange( - 1, 1)));
InteractDoor(Point(3101, 3509), 6821);
R_BlindWalk(Point(3096 + RandomRange( - 1, 1), 3510 + RandomRange( - 1, 1)));
end;
if (NPCNAME = 'Minotaur') and (LOCATION = 'sos1') then
begin
R_BlindWalk(Point(1879 + RandomRange( - 1, 1), 5222 + RandomRange( - 1, 1)));
InteractSOSDoor(Point(1878 + Random(1), 5223), 'n');
InteractSOSDoor(Point(1878 + Random(1), 5226), 'n');
InteractObject(Point(1881, 5232), 'Climb-up');
InteractObject(Point(1859, 5244), 'Climb-up');
WalkLoc([Point(3085 + RandomRange( - 1, 1), 3425 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3429 + RandomRange( - 1, 1)), Point(3089 + RandomRange( - 1, 1), 3434 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3439 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3444 + RandomRange( - 1, 1)), Point(3090 + RandomRange( - 1, 1), 3449 + RandomRange( - 1, 1)), Point(3090 + RandomRange( - 1, 1), 3454 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3459 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3464 + RandomRange( - 1, 1)), Point(3093 + RandomRange( - 1, 1), 3464 + RandomRange( - 1, 1)), Point(3098 + RandomRange( - 1, 1), 3464 + RandomRange( - 1, 1)), Point(3099 + RandomRange( - 1, 1), 3469 + RandomRange( - 1, 1)), Point(3099 + RandomRange( - 1, 1), 3474 + RandomRange( - 1, 1)), Point(3099 + RandomRange( - 1, 1), 3479 + RandomRange( - 1, 1)), Point(3096 + RandomRange( - 1, 1), 3483 + RandomRange( - 1, 1)), Point(3092 + RandomRange( - 1, 1), 3486 + RandomRange( - 1, 1)), Point(3094 + RandomRange( - 1, 1), 3491 + RandomRange( - 1, 1))], False);
InteractBank;
WalkLoc([Point(3081 + RandomRange( - 1, 1), 3421 + RandomRange( - 1, 1)), Point(3085 + RandomRange( - 1, 1), 3425 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3429 + RandomRange( - 1, 1)), Point(3089 + RandomRange( - 1, 1), 3434 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3439 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3444 + RandomRange( - 1, 1)), Point(3090 + RandomRange( - 1, 1), 3449 + RandomRange( - 1, 1)), Point(3090 + RandomRange( - 1, 1), 3454 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3459 + RandomRange( - 1, 1)), Point(3088 + RandomRange( - 1, 1), 3464 + RandomRange( - 1, 1)), Point(3093 + RandomRange( - 1, 1), 3464 + RandomRange( - 1, 1)), Point(3098 + RandomRange( - 1, 1), 3464 + RandomRange( - 1, 1)), Point(3099 + RandomRange( - 1, 1), 3469 + RandomRange( - 1, 1)), Point(3099 + RandomRange( - 1, 1), 3474 + RandomRange( - 1, 1)), Point(3099 + RandomRange( - 1, 1), 3479 + RandomRange( - 1, 1)), Point(3096 + RandomRange( - 1, 1), 3483 + RandomRange( - 1, 1)), Point(3092 + RandomRange( - 1, 1), 3486 + RandomRange( - 1, 1)), Point(3094 + RandomRange( - 1, 1), 3491 + RandomRange( - 1, 1))], True);
InteractObject(Point(3081, 3420), 'Climb-down');
InteractSOSDoor(Point(1858 + Random(1), 5238), 's');
InteractSOSDoor(Point(1858 + Random(1), 5235), 's');
R_BlindWalk(Point(1865 + RandomRange( - 2, 2), 5218 + RandomRange( - 2, 2)));
InteractSOSDoor(Point(1867, 5217 + Random(1)), 'e');
InteractSOSDoor(Point(1870, 5217 + Random(1)), 'e');
end;
end;
function IsInCombat: Boolean;
var
NpcHP, NpcAnimation: Integer;
begin
Sleep(100 + Random(100));
NpcHP := R_InteractingNPC.Hitpoints;
NpcAnimation := R_InteractingNPC.Animation;
Result := (NpcHP > 0) or (NpcAnimation > 0);
if (Result) then
LastNPC := R_InteractingNPC.Index;
end;
procedure B2PHandler;
begin
if (InvFull) and (FindDTM(BoneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
end;
end;
procedure Eating_Food;
var
Q, P: Integer;
begin
if (not LoggedIn) then
Setup_Player;
AL_GameTab(Tab_Inv);
TheStatus('eating food');
AL_GameTab(Tab_Inv);
Wait(120 + Random(200));
if (AL_GameTab(Tab_Inv)) then
begin
if (FindDtm(FoodDTM, Q, P, MIX1, MIY1, MIX2, MIY2)) then
begin
H_Mouse(Point(Q, P));
Sleep(150 + Random(100));
AL_FastClick(Mouse_Left);
Sleep(3000 + Random(1000));
GenerateHP;
end
else if (not B2P) then
Restock;
if (B2P) then
B2PHandler;
end;
end;
procedure Drinking_PrayerPots;
var
a, b, IP: Integer;
begin
if (not LoggedIn) then
Setup_Player;
AL_GameTab(Tab_Inv);
TheStatus('drinking prayer potions');
AL_GameTab(Tab_Inv);
Wait(120 + Random(200));
if (AL_GameTab(Tab_Inv)) then
begin
for IP := 0 to High(Pray) do
begin
if (FindDTM(Pray[IP], a, b, MIX1, MIY1, MIX2, MIY2)) then
begin
H_Mouse(Point(a, b));
Sleep(150 + Random(100));
AL_FastClick(Mouse_Left);
Sleep(3000 + Random(1000));
GeneratePrayer;
end
end;
end
end;
procedure DropBones;
begin
if (B2P) then
Exit;
AL_GameTab(Tab_Inv);
repeat
if (FindDTM(BoneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
H_Mouse(Point(x, y));
Sleep(60 + Random(100));
AL_FastClick(Mouse_Right);
Sleep(60 + Random(100));
AL_WaitOption('Drop', 250);
Sleep(750 + Random(200));
end;
until (not FindDTM(BoneDTM, x, y, MIX1, MIY1, MIX2, MIY2));
end;
procedure Loot_Items;
var
I, Q, U: Integer;
MSLoc: TPoint;
Items: TGroundItemArray;
begin
Items := R_GetGroundItemsDistance(15);
for Q := 0 to High(Items) do
begin
for I := 0 to High(LootArray) do
begin
if (Items[Q].ID = LootArray[I]) then
begin
if (InvFull) and (not EATFORSPACE) then
begin
if (not B2P) then
begin
TheStatus('Inventory = full, making some space');
DropBones;
end
else
begin
TheStatus('Inventory = full, not looting since EATFORSPACE = false');
Exit;
end;
end;
if (InvFull) then
begin
if (B2P) then
begin
TheStatus('Inventory = full, making some space');
Eating_Food;
end
else
begin
TheStatus('Inventory = full, making some space');
DropBones;
if (InvFull) then
Eating_Food;
end;
end;
if (PointInBox(Items[Q].Tile, PlayerLoc)) then
begin
MSLoc := R_TileToMS(Items[Q].tile);
if (PointInBox(MSLoc, MSBox)) then
begin
H_Mouse(MSLoc);
Sleep(150 + Random(20));
for U := 0 to High(LootNameArray) do
begin
if (R_isUpText('Take ' + LootNameArray[U])) then
begin
TheStatus('Looting item (' + LootNameArray[U] + ')');
AL_FastClick(Mouse_Left);
Flag;
Inc(LootCount);
Sleep(1000 + Random(300));
end
else
begin
TheStatus('Looting item (' + LootNameArray[U] + ')');
AL_FastClick(Mouse_Right);
Sleep(160 + Random(24));
AL_WaitOption('Take ' + LootNameArray[U], 300);
Inc(LootCount);
Flag;
Sleep(1000 + Random(300));
end;
end;
end
else
begin
TheStatus('Loot item is not on screen, walking to it');
R_BlindWalk(Point(Items[Q].Tile.x + RandomRange( - 1, 1), Items[Q].Tile.y + RandomRange( - 1, 1)));
repeat
Sleep(25 + Random(15));
until (not R_isWalking);
Loot_Items;
end;
end;
end;
end;
end;
end;
procedure AttackNPC;
var
AttackTimer, TimerUpText, I: Integer;
TempNPCLoc: TPoint;
TempNPC: array of TNPC;
begin
TempNPC := R_GetNPCS(NPCNAME);
for I := 0 to High(TempNPC) do
begin
TempNPCLoc := R_TileToMs(TempNPC[I].Tile);
if (PointInBox(TempNPC[I].Tile, PlayerLoc)) and not (LastNPC = TempNPC[I].Index) and (not TempNPC[I].InCombat) and (R_IsValidTNPC(TempNPC[I])) then
begin
if (PointInBox(TempNPCLoc, MSBox)) then
begin
H_Mouse(Point(TempNPCLoc.x + randomrange( - 3, 3), TempNPCLoc.y + randomrange( - 3, 3)));
MarkTime(TimerUpText);
repeat
if (TimeFromMark(TimerUpText) > 470) then
Break;
Sleep(10 + Random(25));
until (R_IsUpText('Attack ' + NPCNAME)) or (TimeFromMark(TimerUpText) > 500);
if (R_IsUpText('Attack ' + NPCNAME)) then
begin
AddCount := 0;
TheStatus('Attacking (' + NPCNAME + ')');
if (RIGHTCLICKONLY) then
begin
AL_FastClick(Mouse_Right);
Sleep(20 + Random(19));
AL_WaitOption('tta', 40 + Random(120));
end;
if not (RIGHTCLICKONLY) then
case Random(10) of
0..8: AL_FastClick(Mouse_Left);
9:
begin
AL_FastClick(Mouse_Right);
Sleep(20 + Random(19));
AL_WaitOption('tta', 40 + Random(120));
end;
end;
repeat
Sleep(20 + Random(20));
until (not R_isWalking);
MarkTime(AttackTimer);
repeat
Sleep(50 + Random(50));
until (IsInCombat) or (TimeFromMark(AttackTimer) > 650 + Random(250));
Exit;
end
else
begin
if (AddCount > 2) then
begin
AL_FastClick(Mouse_Right);
Sleep(20 + Random(19));
AL_WaitOption('tta', 40 + Random(120));
end;
Inc(AddCount);
Exit;
end;
end;
if (not PointInBox(TempNPCLoc, MSBox)) then
begin
TheStatus('Npc is not on screen, walking to it');
R_BlindWalk(Point(TempNPC[I].Tile.x + 1, TempNPC[I].Tile.y));
repeat
Sleep(25 + Random(15));
until (not R_isWalking);
end;
end;
end;
end;
procedure StrengthPotProc;
var
I: Integer;
StrengthPotArray: TIntegerArray;
begin
StrengthPotArray := [StrengthPot1, StrengthPot2, StrengthPot3, StrengthPot4, SuperStrengthPot1, SuperStrengthPot2, SuperStrengthPot3, SuperStrengthPot4];
for I := 0 to High(StrengthPotArray) do
begin
if (FindDTM(StrengthPotArray[I], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
TheStatus('Drinking pot: Strength potion(' + IntToStr(I) + ')');
Al_MissMouse(point(x, y), RandomRange( - 5, 5), RandomRange( - 5, 5));
Sleep(150 + Random(50));
if (R_IsUpText('Drink')) then
Al_FastClick(Mouse_Left);
Exit;
end
else
begin
TheStatus('out of pots, USEPOTS := false');
USEPOTS := false;
end;
end;
end;
procedure AttackPotProc;
var
I: Integer;
AttackPotArray: TIntegerArray;
begin
AttackPotArray := [AttackPot1, AttackPot2, AttackPot3, AttackPot4, SuperAttackPot1, SuperAttackPot2, SuperAttackPot3, SuperAttackPot4];
for I := 0 to High(AttackPotArray) do
begin
if (FindDTM(AttackPotArray[I], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
TheStatus('Drinking pot: Attack potion(' + IntToStr(I) + ')');
Al_MissMouse(point(x, y), RandomRange( - 5, 5), RandomRange( - 5, 5));
Sleep(150 + Random(50));
if (R_IsUpText('Drink')) then
Al_FastClick(Mouse_Left);
Exit;
end
else
begin
TheStatus('out of pots, USEPOTS := false');
USEPOTS := false;
end;
end;
end;
procedure ClearTheDTM;
begin
FreeDTM(FoodDTM);
FreeDTM(AttackPot1);
FreeDTM(AttackPot2);
FreeDTM(AttackPot3);
FreeDTM(AttackPot4);
FreeDTM(SuperAttackPot1);
FreeDTM(SuperAttackPot2);
FreeDTM(SuperAttackPot3);
FreeDTM(SuperAttackPot4);
FreeDTM(StrengthPot1);
FreeDTM(StrengthPot2);
FreeDTM(StrengthPot3);
FreeDTM(StrengthPot4);
FreeDTM(SuperStrengthPot1);
FreeDTM(SuperStrengthPot2);
FreeDTM(SuperStrengthPot3);
FreeDTM(SuperStrengthPot4);
FreeDTM(TabDTM);
FreeDTM(BoneDTM);
FreeDTM(Pray1);
FreeDTM(Pray2);
FreeDTM(Pray3);
FreeDTM(Pray4);
end;
procedure Setup_Location;
begin
CP := R_GetTileGlobal;
PlayerLoc := IntToBox(CP.x - CPDistance, CP.y - CPDistance, CP.x + CPDistance, Cp.y + CPDistance);
if (NPCNAME = 'Man') and (LOCATION = 'edgeville') then
PlayerLoc := IntToBox(3091, 3507, 3100, 3513);
if (NPCNAME = 'Dwarf') then
PlayerLoc := IntToBox(3012, 9841, 3030, 9856);
end;
procedure SetRunOrb(Run: Boolean);
begin
if (Run) then
begin
if (not isUsingRun) then
MouseBox(545, 135, 591, 149, Mouse_Left);
end
else
begin
if (isUsingRun) then
MouseBox(545, 135, 591, 149, Mouse_Left);
end;
end;
procedure RunCheck;
begin
if (not IsUsingRun) and (GetRunEnergy > RunE) then
begin
SetRunOrb(True);
GenerateRun;
end;
end;
begin
DeclarePlayers;
SMART_World := World;
SetupSRL();
MouseSpeed := 28;
SetupReflection;
Setup;
ClearDebug;
LogInPlayer;
StartXp := (R_GetSkillExp(Skill_Attack) + R_GetSkillExp(Skill_Strength) + R_GetSkillExp(Skill_Defence) + R_GetSkillExp(Skill_Magic) + R_GetSkillExp(Skill_Range));
StartXpHp := (R_GetSkillExp(Skill_Hitpoints));
GainedHPStart := (R_GetMaxSkillLevel(Skill_Hitpoints));
GainedCBStart := (R_GetMaxSkillLevel(Skill_Attack) + R_GetMaxSkillLevel(Skill_Defence) + R_GetMaxSkillLevel(Skill_Strength) + R_GetMaxSkillLevel(Skill_Magic) + R_GetMaxSkillLevel(Skill_Range));
GenerateHP;
GeneratePrayer;
GenerateRun;
USEPOTS := false;
Setup_Location;
SetRunOrb(true);
LastNPC := - 1;
repeat
if (not LoggedIn) then
begin
LogInPlayer;
SetAngle(0);
SetRun(True);
SetFightMode(TrainingMode);
AL_GameTab(Tab_Inv);
GenerateHp;
GeneratePrayer;
GenerateRun;
end;
if (LoggedIn) then
begin
F_FindNormalRandoms;
R_FindNormalRandoms;
CCP := R_GetTileGlobal;
RunCheck;
if (not PointInBox(CCP, PlayerLoc)) then
R_BlindWalk(AL_MiddleBox(PlayerLoc));
if (IsInCombat) then
begin
TheStatus('in combat');
if (getHealthPercent > HP) then
Antiban;
if not (getHealthPercent > HP) then
Eating_Food;
if (USEPRAY) then
if not (getPrayerPercent > PRAYER) then
begin
Drinking_PrayerPots;
end;
if (USEPOTS) then
begin
if (R_GetSkillLevel(Skill_Attack) < (R_GetMaxSkillLevel(Skill_Attack) + 2)) then
AttackPotProc;
if (R_GetSkillLevel(Skill_Strength) < (R_GetMaxSkillLevel(Skill_Strength) + 2)) then
StrengthPotProc;
end;
end
else
begin
if (LOOT) then
Loot_Items;
AttackNPC;
end;
end;
until (false);
end.