danishkahn
2022-08-27 05:39:15
How Long have You Played Runescape?
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Python
C#
Lape
Are you a member of any other communities?
no
Tell us about yourself…
Please show us one (or multiple) of your scripts.
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Python
C#
Lape
Are you a member of any other communities?
no
Tell us about yourself…
From: danishkahn
Have a general interest in programming, machine learning is where i put most of my efforts these day. Have competed recently in the Numerai tournament with silver and bronze medals in multiple rounds. Outside of computers am a carpenter, enjoy being outdoors alot which conflicts with coding, but we make it work, life is about balance at the end of the day :)
Please show us one (or multiple) of your scripts.
program CombatTrainer;
{$DEFINE SRL_USE_REMOTEINPUT}
{$I SRL-F/OSR.simba}
Const
ENEMYTYPE = 'Chicken'; //Enemy(Only Chicken and cow full supported)
FOODTYPE = '';
TRAININGTYPE = 'attack'; //Skill training
PERCSHIFT = 50;
MAXRUNTIME = 600;
REPORTAT = 10; //Reports how often in minutes
BANKITEMS = false; //For item banking
ITEMPICKUP = false; //For item pickups
PNAME = '';
PPASS = '';
PPIN = '';
Type
TEnemy = record
XP : Int32;
UpText : String;
WalkTile, SafeTile: TPoint;
DropsColor, Color1,
Color2, Color3 : TCTS2Color;
Drops : TRSItemArray;
Tiles : TPointArray;
end;
TTrainingSkill = record
StyleType : String;
GetStyle : String;
StartXp : Int32;
Skill : ERSSkill;
end;
TScript = record
XpGained, HpXpGained, KillCount,
StartHpXp, Collected, Banked,
PrayXpGained,PrayStartXp, Buried : Int32;
ResetChat : Boolean;
Status : String;
SafeTile,BankTile : TPoint;
Enemy : TEnemy;
SpotTile,ExtSpotTile : TRectangle;
WeaponSlots, World, DropCount,
StartCount : TIntegerArray;
GateColor : TCTS2Color;
MiscItems,Types,Weapon : TRSItemArray;
TrainingSkill : TTrainingSkill;
RSW : TRSWalker;
TrueRunTime, SinceReport : TStopwatch;
ShutdownTime, StartTime,
ReportTime : Int64;
end;
Var
Bot: TScript;
procedure TScript.WriteMsg(Message: String);
begin
WriteLn('[Bot]: ', Message);
end;
procedure TScript.DeclarePlayers();
begin
login.AddPlayer(PNAME, PPASS, PPIN);
end;
procedure TScript.Report();
var
i: Int32;
begin
XpGained := Stats.GetSkillInfo(Self.TrainingSkill.Skill).XP - Self.TrainingSkill.StartXp;
Wait(250,345);
HpXpGained := Stats.GetSkillInfo(ERSSKILL.HITPOINTS).XP - Self.StartHpXp;
Wait(250,345);
PrayXpGained := Stats.GetSkillInfo(ERSSKILL.PRAYER).XP - Self.PrayStartXp;
Wait(250,345);
for i:= 0 to High(Self.Enemy.Drops) do
Self.DropCount[i] := Inventory.CountItemStack(Self.Enemy.Drops[i]) - Self.StartCount[i];
ClearDebug();
Self.SinceReport.Reset();
ProgressReport(RESULT_REPORTBOX, 'Combat Trainer', 'DanishKahn', '1.0.5',
['Runtime', TRAININGTYPE + ' XP gained', 'Hitpoints XP gained', 'Prayer XP gained',
'Training On', 'Kills', 'Items Collecting', 'Total Collected', 'Until break', 'Until shutdown'],
[SRL.MsToTime(GetTimeRunning, Time_Short),
ToStr(Round(XpGained,2),'(', Round(XpGained / (GetTimeRunning()/1000/60/60)),' / hr)'),
ToStr(Round(HpXpGained,2),'(', Round(HpXpGained / (GetTimeRunning()/1000/60/60)),' / hr)'),
ToStr(Round(PrayXpGained,2),'(', Round(PrayXpGained / (GetTimeRunning()/1000/60/60)),' / hr)'),
ToStr(ENEMYTYPE),
ToStr(Self.KillCount, '(', Round(Self.KillCount / (GetTimeRunning()/1000/60/60)),' / hr)'),
ToStr(Self.Enemy.Drops),
ToSTR(Self.DropCount),
Antiban.TimeUntilBreak(Antiban.Breaks[0]),
SRL.MsToTime(Self.ShutdownTime-GetTimeRunning, Time_Short)]);
end;
procedure TMouse.RandomMovement();
var
S: Int32;
begin
S := Self.Speed;
Self.Speed := 4;
Self.Move(Box(Mouse.Position, 75, 75), True, );
Self.Speed := S;
end;
procedure TScript.BankAntiban(Percent: Double);
var
randP: Double;
begin
if Random() <= (Percent/100) then
begin
Antiban.DebugLn('Bank screen antiban');
randP := Random();
if randP < 0.33 then
Antiban.SmallRandomMouse()
else if (randP >= 0.33) and (randP < 0.66) then
wait(2800, 4000)
else if randP > 0.66 then
begin
// Copied version of 'random right click' antiban, minus the additional debug msg
Mouse.Move(GetClientBounds(), True, MOUSE_DISTRIBUTION_RANDOM);
if ChooseOption.Open() then
begin
if Random() < 0.50 then
Mouse.Move(ChooseOption.Bounds);
Wait(0, 8000, wdLeft);
ChooseOption.Close();
end;
end;
end;
end;
procedure TScript.DoLoseFocus();
begin
Antiban.LoseFocus(SRL.NormalRange(3700,500));
end;
procedure TScript.SetupAntiban();
begin
Antiban.Skills += ERSSKILL.ATTACK;
Antiban.Skills += ERSSKILL.DEFENCE;
Antiban.Skills += ERSSKILL.HITPOINTS;
Antiban.Skills += ERSSKILL.STRENGTH;
// Interval Antiban method
Antiban.AddTask(ONE_MINUTE*4, @Self.DoLoseFocus);
Antiban.AddTask(ONE_MINUTE*16, @Antiban.HoverMSPlayers);
Antiban.AddTask(ONE_MINUTE*24, @Antiban.HoverMSItems);
Antiban.AddTask(ONE_MINUTE*29, @Antiban.HoverMSNPCs);
Antiban.AddTask(ONE_MINUTE*4, @Antiban.RandomRotate);
Antiban.AddTask(ONE_MINUTE*7, @Antiban.HoverSkills);
Antiban.AddBreak(ONE_MINUTE*35, ONE_SECOND*600, 0.2, 0.0);
Antiban.AddTask(ONE_SECOND*100, @Mouse.RandomMovement);
end;
procedure TScript.DoAB();
begin
Antiban.DismissRandom();
if Antiban.DoAntiban() then
if (not RSClient.IsLoggedIn) then
Login.LoginPlayer();
end;
procedure TMouse.HumanMove(Point: TPoint);
var
mPt: TPoint;
S: Int32;
Miss: Double;
Range: Int64;
begin
S := Self.Speed;
Range := Trunc(Power(Self.Position().DistanceTo(Point), 0.80));
Miss := SRL.SkewedRand(0.9, 0.1, 1.5);
mPt.X := Trunc((1-Miss)*Self.Position().X + Miss*Point.X);
mPt.Y := Trunc((1-Miss)*Self.Position().Y + Miss*Point.Y);
mPt.X += SRL.NormalRange(-Range, Range);
mPt.Y += SRL.NormalRange(-Range, Range);
Self.Move(mPt);
Self.Speed := round(S*0.85);
Self.Move(Point);
Self.Speed := S;
end;
procedure PauseRunTime(Task: PBreakTask);
Var T: PBreakTask;
begin
Bot.TrueRunTime.Pause;
Bot.WriteMsg('Pausing Runtime for Break');
T := Task;
end;
procedure ResumeRunTime(Task: PBreakTask);
Var T: PBreakTask;
begin
if getTimeRunning() > Bot.ShutdownTime then
TerminateScript('Time to shutdown');
Bot.TrueRunTime.Resume;
Bot.WriteMsg('Resuming Runtime after Break');
T := Task;
end;
function TScript.AllAvailableEnemies(DotType: ERSMinimapDot): Boolean;
var
k: Int32;
a: Double;
MSBox: TBox;
Dots, TPA: TPointArray;
SearchArea: TBox;
ATPA: T2DPointArray;
Finder: TRSObjectFinder;
begin
if Self.Unreachable() or Self.IsFought() then
begin
Inventory.ClickItem(Self.Enemy.Drops[0],'Examine');
RSW.WebWalk(Self.Enemy.WalkTile);
end;
SearchArea := MainScreen.GetPlayerBox.Expand(250);
repeat
wait(150,340);
Dots := Minimap.GetDots(DotType);
Dots.Sort(MainScreen.GetPlayerBox.Middle);
if Dots.Len() < 1 then Exit;
a := Minimap.GetCompassAngle(False);
for k:= 0 to High(Dots) do
begin
MSBox := Minimap.VecToMsBox(Vec3(Dots[k].X+2, Dots[k].Y+2, 0), a);
if SearchArea.Contains(MSBox) then
begin
Finder.Colors += Self.Enemy.Color1;
Finder.Colors += Self.Enemy.Color2;
Finder.Colors += Self.Enemy.Color3;
Finder.Grow := 2;
Finder.ClusterDistance := 4;
ATPA := MainScreen.FindObject(Finder, MSBox);
ATPA.SortByMiddle(Mainscreen.Bounds.Middle);
if ATPA.Len > 0 then
for TPA in ATPA do
begin
Mouse.HumanMove(TPA.Mean());
wait(150,340);
if MainScreen.IsUpText(Self.Enemy.UpText, 75) then
begin
Mouse.Click(MOUSE_LEFT);
Result:= MainScreen.DidRedClick();
Exit;
end;
end;
end;
end;
//Antiban.RandomRotate();
until Result;
end;
function TScript.Finder(Obj: String): Boolean;
var
i, Attempt : Int32;
UT1, UT2 : String;
TPA : TPointArray;
ATPA : T2DPointArray;
Finder : TRSObjectFinder;
begin
case Obj of
'Bank booth':
begin
Finder.Colors += CTS2(5791589, 30, 1.80, 0.03);
Finder.Colors += CTS2(1068642, 30, 0.24, 0.74);
UT1 := Obj;
end;
'Gate':
begin
Finder.Colors += CTS2(1337747, 5, 0.11, 1.08);
UT1 := 'Open Gate';
UT2 := 'Close Gate';
end;
'Ladder':
begin
Finder.Colors += CTS2(534579, 10, 0.12, 0.72);
Finder.Colors += CTS2(2311772, 10, 0.10, 0.44);
UT1 := 'Climb-';
end;
end;
Attempt := 0;
repeat
Finder.Grow := 3;
Finder.ClusterDistance := 15;
ATPA := MainScreen.FindObject(Finder, Mainscreen.GetPlayerBox.Expand(50));
for i := 0 to min(4, high(ATPA)) do
begin
Attempt += 1;
Self.WriteMsg('Finding ' + Obj + ' ' + ToSTR(Attempt));
if (ATPA.Len > 0) then
begin
ATPA.SortByMiddle(MainScreen.Center);
for TPA in ATPA do
begin
Mouse.HumanMove(TPA.Mean());
Wait(250, 450);
if MainScreen.IsUpText(UT1) then
Exit(True)
else if MainScreen.IsUpText(UT2) then
Exit(False)
end;
end;
Wait(250,600);
case SRL.Dice(50) of
True: Minimap.SetCompassAngle(Minimap.GetCompassAngle() - random(20, 70));
False: Minimap.SetCompassAngle(Minimap.GetCompassAngle() + random(20, 70));
end;
if Attempt >= 6 then
TerminateScript('Unable to find '+ToSTR(Obj));
end;
until Result;
end;
function TScript.IsWeaponSlot(Slot: Int32): Boolean;
var
i: Int32;
begin
for i:=0 to high(Self.WeaponSlots) do
if Self.WeaponSlots[i] = Slot then
Exit(True);
end;
procedure TScript.CheckForWeapon();
var
i : Int32;
Weapons : TRSItemArray;
begin
SetLength(Self.WeaponSlots, 1);
Weapons := ['Black scimitar'];
for i:=0 to high(Weapons) do
if Equipment.FindItem(Weapons[i]) then
begin
SetLength(Self.WeaponSlots, 0);
Exit;
end;
Self.WriteMsg('Could not find the required weapon');
TerminateScript();
end;
function TScript.CheckGate(): Boolean;
begin
if Self.Finder('Gate') then
Exit(True)
else if (not Self.Finder('Gate')) then
Exit(False);
end;
procedure TScript.MoveToTrainingSpot();
begin
begin
Minimap.EnableRun();
RSW.WebWalk(Self.Enemy.SafeTile);
Self.DoAB();
if ToSTR(ENEMYTYPE) <> 'Goblin' then
begin
if CheckGate() then
begin
Mouse.Click(MOUSE_LEFT);
wait(850,1350);
end;
end;
RSW.WebWalk(Self.Enemy.WalkTile);
end;
end;
function TScript.SetMode(): Boolean;
begin
if Combat.GetCombatStyle() <> Self.TrainingSkill.GetStyle then
begin
Combat.SetCombatStyle(Self.TrainingSkill.GetStyle);
end;
Self.WriteMsg(Combat.GetCombatStyle());
Self.WriteMsg(Self.TrainingSkill.GetStyle);
Self.WriteMsg(Self.TrainingSkill.StyleType);
Exit(True);
end;
procedure TScript.AttackTarget();
var
Xp,NoEnemyAttempts : Int32;
T : TCountdown;
begin
NoEnemyAttempts:= 0;
repeat
Xp := XpBar.Read();
repeat
if MainScreen.FindHitsplats(MainScreen.GetPlayerBox.Expand(50)) then
if XpBar.Read() > Xp then break;
if Self.AllAvailableEnemies(ERSMinimapDot.NPC) then
break
else
begin
Inc (NoEnemyAttempts, 1);
if NoEnemyAttempts >= 5 then
begin
RSW.WalkBlind(Self.Enemy.WalkTile);
Wait(250,600);
case SRL.Dice(50) of
True: Minimap.SetCompassAngle(Minimap.GetCompassAngle() - random(20, 70));
False: Minimap.SetCompassAngle(Minimap.GetCompassAngle() + random(20, 70));
end;
NoEnemyAttempts:= 0;
end;
end;
until MainScreen.IsUpText(Self.Enemy.UpText, 75);
NoEnemyAttempts := 0;
if Minimap.HasFlag(500) then
if WaitUntil(Minimap.IsPlayerMoving(300), 75, 1000) then
Minimap.WaitPlayerMoving(300, 6000);
T.Init(SRL.NormalRange(1800,2200));
while (not T.IsFinished) do
begin
if (not RSClient.IsLoggedIn) then Exit;
if Chat.ClickContinue(False) then
T.Restart;
if MainScreen.FindHitsplats(MainScreen.GetPlayerBox.Expand(100)) then
T.Restart;
if (SRL.PercentShift(MainScreen.GetPlayerBox(), 500) >= PERCSHIFT) then
T.Restart();
if XpBar.Read > Xp then
begin
Xp := XpBar.Read();
T.Restart;
end;
Self.CheckHealth();
Wait(350,575);
end;
if XpBar.Read() > Xp then
begin
Wait(130, 850);
Self.KillCount += 1;
if ITEMPICKUP then
Self.GrabItems();
end;
if Inventory.IsFull() then
begin
Self.BoneCheck();
if Inventory.IsFull() then
Exit;
end;
if Self.SinceReport.ElapsedTime > Self.ReportTime then
begin
Self.SinceReport.Reset();
Self.Report();
end;
until Inventory.IsFull();
end;
procedure TScript.CheckHealth();
begin
if Minimap.GetHPPercent() < 40 then
begin
if FOODTYPE <> '' then
begin
Self.WriteMsg('Eating');
wait(250,350);
Inventory.ClickItem(FOODTYPE);
end;
if Minimap.GetHPPercent() < 20 then
begin
Self.WriteMsg('Low Health detected, Running to safe tile');
Self.RSW.WebWalk(Self.Enemy.SafeTile);
WaitUntil(Minimap.GetHPPercent() > 50, 1000, 30000);
end;
end;
end;
procedure TScript.Banking();
var
i,c : Int32;
Amount :TIntegerArray;
begin
if (not RSClient.IsLoggedIn) then Exit;
if (not DepositBox.IsOpen()) then
begin
if RSW.GetMyPos().DistanceTo(Self.Enemy.WalkTile) <= 100 then
begin
Self.WriteMsg('Banking');
RSW.WalkBlind([4599,3317]);
if CheckGate()then
Mouse.Click(MOUSE_LEFT);
wait(850,1350);
end;
end;
RSW.WebWalk(Self.BankTile);
Self.DoAB();
if (not Self.Finder('Bank booth'))then
Exit;
Self.WriteMsg('Opening Bank');
Wait(175,350);
Mouse.Click(MOUSE_LEFT);
if (not MainScreen.DidRedClick) then Exit;
Minimap.WaitPlayerMoving(200, 3000);
if (not WaitUntil(Bank.IsOpen(), 75, 4100)) then Exit;
c := Inventory.CountItem(Self.Enemy.Drops[0]);
Inc(Self.Banked, c);
Wait(35, 450);
for i:=0 to high(Self.Enemy.Drops) do
Bank.DepositItem([Self.Enemy.Drops[i], BANK_DEPOSIT_ALL], True);
Wait(35, 750);
for i:=0 to high(Self.MiscItems) do
if Bank.FindItem(Self.MiscItems[i]) then
begin
Bank.DepositItem([Self.MiscItems[i], BANK_DEPOSIT_ALL], True);
Wait(35, 250);
end;
if FOODTYPE <> '' then
if (not Inventory.FindItem(FOODTYPE, Amount)) then
Bank.WithdrawItem([FOODTYPE, 8], True)
else if Bank.FindItem(FOODTYPE) then
Bank.WithdrawItem([FOODTYPE, 8-Amount.Len()], True);
Bot.BankAntiban(20);
Bank.Close();
if (not WaitUntil((not Bank.IsOpen()), 75, 4100)) then Bank.Close();
Wait(175,350);
Self.Report();
if (getTimeRunning() > Self.ShutdownTime) then
begin
Logout.ClickLogout();
TerminateScript('Time to shutdown');
Exit;
end;
end;
procedure TScript.HoverMSTile(DotType: ERSMinimapDot);
var
Tries : Int32;
a : Double;
MSBox, DropsBox : TBox;
Dots, TPA : TPointArray;
ATPA : T2DPointArray;
Finder : TRSObjectFinder;
begin
DropsBox := MainScreen.GetPlayerBox.Expand(100);
Dots := Minimap.GetDots(DotType);
if Dots.Len() < 1 then Exit;
a := Minimap.GetCompassAngle(False);
for Tries:= 0 to High(Dots) do
begin
MSBox := Minimap.VecToMsBox(Vec3(Dots[Tries].X + 2, Dots[Tries].Y + 2, 0), a);
if DropsBox.Contains(MSBox) then
begin
Finder.Colors += Self.Enemy.DropsColor;
Finder.Grow := 2;
Finder.ClusterDistance := 4;
ATPA := MainScreen.FindObject(Finder, MSBox);
ATPA.SortByMiddle(Mainscreen.GetPlayerBox.Middle);
if ATPA.Len > 0 then
for TPA in ATPA do
begin
Mouse.HumanMove(TPA.Mean());
Exit();
end;
end;
end;
end;
procedure TScript.GrabItems();
var
i : Int32;
DropsBox : TBox;
begin
DropsBox := MainScreen.GetPlayerBox.Expand(150);
for i:=0 to High(Self.Enemy.Drops) do
begin
Self.HoverMsTile(ERSMinimapDot.ITEM);
Wait(550, 700);
if mainscreen.IsUpText('Take ' + ToSTR(Self.Enemy.Drops[i]), 250) then
begin
mouse.click(mouse_left);
wait(132,186);
mouse.click(mouse_right);
repeat
wait(1250,1350);
until(not Minimap.IsPlayerMoving(300));
if ChooseOption.Select('Take Bones') then
Break;
end;
end;
Self.BoneCheck();
end;
procedure TScript.BoneCheck();
var
slot : Boolean;
begin
slot := Inventory.FindItem('Bones');
if slot then
begin
wait(150,250);
Inventory.ClickItem('Bones');
Self.Buried += 1;
end;
end;
function TScript.IsFought(): Boolean;
var
i,Count: Int32;
begin
for i:=0 to CHAT_INPUT_LINE - 1 do
if 'one else is fighting th' in Chat.GetMessage(i, [CHAT_COLOR_BLACK]) then
Inc(Count);
Result := Count >= 3;
end;
function TScript.Unreachable: boolean;
var
i,Count: Int32;
begin
for i:=0 to CHAT_INPUT_LINE - 1 do
if 't reach that' in Chat.GetMessage(i, [CHAT_COLOR_BLACK]) then
Inc(Count);
Result := Count >= 3;
end;
procedure TScript.Free();
begin
RSClient.Image.Clear();
end;
procedure TScript.Run();
begin
if (not RSClient.IsLoggedIn) then
if Login.GetPlayer.Password <> '' then
Login.LoginPlayer
else
begin
Self.WriteMsg('No player credentials');
Exit;
end;
//if Self.SetMode() then
Wait(250,345);
//Self.CheckForWeapon();
repeat
if (not RSClient.IsLoggedIn) then
begin
if Login.Players[0].Password <> '' then
Login.LoginPlayer
else
begin
Logout.ClickLogout();
TerminateScript('Not logged in');
end;
end;
if ENEMYTYPE <> 'Minotaur' then
begin
if RSW.GetMyPos().DistanceTo(Self.Enemy.WalkTile) >= 50 then
begin
Self.WriteMsg('Moving');
Self.MoveToTrainingSpot();
Self.AttackTarget();
end else Self.AttackTarget();
end else Self.AttackTarget();
Self.DoAB();
if BANKITEMS then
if Inventory.IsFull() then
Self.Banking();
if (getTimeRunning() > Self.ShutdownTime) then
begin
Logout.ClickLogout();
TerminateScript('Time to shutdown');
Exit;
end;
until (getTimeRunning() > Self.ShutdownTime);
if (getTimeRunning() > Self.ShutdownTime) then
begin
Logout.ClickLogout();
TerminateScript('Time to shutdown');
Exit;
end;
end;
procedure TScript.Init();
var
i: Int32;
begin
DeclarePlayers();
if (not RSClient.IsLoggedIn) then
if Login.GetPlayer.Password <> '' then
Login.LoginPlayer
else
begin
Self.WriteMsg('No player credentials');
Exit;
end;
with Self do
begin
SetupAntiban();
RSW.Setup('world');
RSW.ScreenWalk := False;
RSW.EnableRunAtEnergy := 85;
MM2MS.ZoomLevel := Options.GetZoomLevel();
Mouse.Speed := Random(12, 19);
Mouse.CanIdle := False;
Mouse.MissChance := 7;
Mouse.Brake := True;
Self.KillCount := 0;
Self.Buried := 0;
Self.StartHpXp := Stats.GetSkillInfo(ERSSKILL.HITPOINTS).XP;
Wait(250,345);
Self.PrayStartXp := Stats.GetSkillInfo(ERSSKILL.PRAYER).XP;
Wait(250,345);
Mouse.Distribution := MOUSE_DISTRIBUTION_GAUSS;
Antiban.OnStartBreak := @PauseRunTime;
Antiban.OnFinishBreak := @ResumeRunTime;
end;
case lowercase(ToStr(TRAININGTYPE)) of
'attack':
with Self.TrainingSkill do
begin
StyleType := 'COMBAT_STYLE_CHOP';
GetStyle := 'Chop';
Skill := ERSSKILL.ATTACK;
Wait(250,345);
StartXp := Stats.GetSkillInfo(Self.TrainingSkill.Skill).XP;
Wait(250,345);
end;
'strength':
with Self.TrainingSkill do
begin
StyleType := 'COMBAT_STYLE_SLASH';
GetStyle := 'Slash';
Skill := ERSSKILL.STRENGTH;
Wait(250,345);
StartXp := Stats.GetSkillInfo(Self.TrainingSkill.Skill).XP;
Wait(250,345);
end;
'defence':
with Self.TrainingSkill do
begin
StyleType := 'COMBAT_STYLE_SLASH';
GetStyle := 'Slash';
Skill := ERSSKILL.DEFENCE;
Wait(250,345);
StartXp := Stats.GetSkillInfo(Self.TrainingSkill.Skill).XP;
Wait(250,345);
end;
'magic':
with Self.TrainingSkill do
begin
StyleType := 'COMBAT_STYLE_SLASH';
GetStyle := 'Slash';
Skill := ERSSKILL.MAGIC;
Wait(250,345);
StartXp := Stats.GetSkillInfo(Self.TrainingSkill.Skill).XP;
Wait(250,345);
end;
end;
(*COMBAT_STYLES =
COMBAT_STYLE_ACCURATE,
COMBAT_STYLE_RAPID,
COMBAT_STYLE_LONGRANGE,
COMBAT_STYLE_BASH,
COMBAT_STYLE_POUND,
COMBAT_STYLE_FOCUS,
COMBAT_STYLE_CHOP,
COMBAT_STYLE_SLASH,
COMBAT_STYLE_LUNGE,
COMBAT_STYLE_BLOCK,
COMBAT_STYLE_FLICK,
COMBAT_STYLE_LASH,
COMBAT_STYLE_DEFLECT,
COMBAT_STYLE_SWIPE,
COMBAT_STYLE_SMASH
*)
case lowercase(ToStr(ENEMYTYPE)) of
'cow':
with Self.Enemy do
begin
SafeTile := [4600,3326];
WalkTile := [4618,3281];
Drops := ['Cowhide'];
DropsColor := CTS2({11513786}11974336, 4, 0.0, 0.07);
UpText := 'Attack Cow';
self.BankTile := [4180 + Random(-2,2),3478 + Random(-2,2)];
Color1 := CTS2(9014931, 5, 0.12, 0.17);
Color2 := CTS2(5462630, 5, 0.10, 0.36);
Color3 := CTS2(6251892, 5, 0.05, 0.09);
end;
'chicken':
with Self.Enemy do
begin
SafeTile := [4758,3266];
WalkTile := [4733,3265];
Drops := ['Feather', 'Bones'];
DropsColor := CTS2(7895446, 4, 0.02, 0.16);
UpText := 'Attack Chicken';
self.BankTile := [4889 + Random(-2,2),3778 + Random(-2,2)];
Color1 := CTS2(1319823, 5, 0.02, 0.75);
Color2 := CTS2(1583525, 20, 0.09, 0.63);
Color3 := CTS2(1319044, 20, 0.10, 0.56);
end;
'goblin':
with Self.Enemy do
begin
SafeTile := [4753,3548];
WalkTile := [4832,3525];
Drops := ['Coins'];
DropsColor := CTS2(13290192, 10, 0.00, 0.08);
UpText := 'Attack Goblin';
self.BankTile := [4889 + Random(-2,2),3778 + Random(-2,2)];
end;
'minotaur':
with Self.Enemy do
begin
//SafeTile := [4758,3266];
WalkTile := [5967,243];
Drops := ['Coins', 'Nature rune', 'Iron arrow', 'Rune essence', 'Mind rune'];
DropsColor := CTS2(13027021, 4, 0.02, 0.16);
UpText := 'Attack Minotaur';
Color1 := CTS2(12437190, 20, 0.16, 0.07);
Color2 := CTS2(5526875, 20, 0.02, 0.04);
Color3 := CTS2(4144964, 20, 0.00, 0.03);
//self.BankTile := [4889 + Random(-2,2),3778 + Random(-2,2)];
end;
end;
Self.Enemy.WalkTile := [Self.Enemy.WalkTile.X + Random(-4,4), Self.Enemy.WalkTile.Y + Random(-4,4)];
Self.MiscItems := ['Clue scroll (Beginner)'];
Self.Weapon := ['scimitar', 'sword', 'battleaxe'];
Self.Types := ['Bronze', 'Iron', 'Steel', 'Black'];
for i:= 0 to High(Self.Enemy.Drops) do
begin
Self.StartCount.Append(Inventory.CountItemStack(Self.Enemy.Drops[i]));
Self.DropCount.Append(Self.StartCount[i]-Self.StartCount[i]);
end;
AddOnTerminate(@Self.Free);
Self.ShutdownTime := (MAXRUNTIME * 60000) + Random(- (MAXRUNTIME * 6000), (MAXRUNTIME * 6000));
Self.ReportTime := (REPORTAT * 60000);
Self.SinceReport.Reset();
Self.TrueRunTime.Start();
end;
begin
RSClient.Image.Clear(Mainscreen.Bounds);
Bot.Init();
Bot.Run();
end.