PDA

View Full Version : [Mining] [SRL][OSRS] Slacky's Universal Miner™



slacky
12-16-2017, 09:37 PM
Slacky's Universal Miner™

9Nla9u_9QYU

A simple universal mining bot. What you see in the video above is that in the first 2 minutes I have setup a mining-bot that runs at varrock east, after that it's the bot that takes over.
It can be setup most places that's not a dungeon, as long as it's a straight path to the bank (deposit-boxes aren't supported).

Requirements:

Simba 1.2 RC6 with leakfixes ([1 - recommended] (https://github.com/slackydev/Simba/releases/tag/Simba-1.2.0-rc6_fixes), [2 - might have bugs] (https://villavu.com/forum/showthread.php?t=117850))
Simply drop it into your Simba folder, and use it. Important: you must have Simba 1.1 installed and set up for SRL-6.
Requires SRL from Github (https://github.com/SRL/SRL/) version 1.0 or later compatible version.
Requires RSWalker from Github (https://github.com/slackydev/RSWalker/releases), version 1.1 or later compatible version.


Keywords:

Easy to configure
Works most places (no dungeons are supported)
Works for just about any ores (need changes for slow rocks as I've just hardcoded a 20sec limit)
Supports banking, and power-mining (no deposit boxes)
First slot can be used for a pickaxe - otherwise start with empty inv.
Configs can be shared with others
Break-handling (between 5 min and 7 hours)
A number of Antiban measures
Feels fatigue - Slows down the bot - Recharges with breaks
https://image.prntscr.com/image/dAoIltDiTeKNEX1KwLPvbg.png



program Universal_Miner_V034;
{$DEFINE SMART}
{$I SRL/OSR.simba}
{$I SRL/utils/slackdebug.simba}
{$I RSWalker/Walker.simba}
{$H-}{$R+}{$X+}
{$DEFINE SMARTDEBUG}
{================================================= =============================]
| Universal Miner ™
|
| Steps to use:
| 1. For longer runs you need to declare login details bellow
| 2. Start the script at your mining site, and run setup.
[================================================== ============================}
type
EDropStyle = (dsRegular, dsIntense, dsAdaptive);

const
LOGIN_NAME = '';
LOGIN_PASS = '';
RS_WORLD = -1; // preferred world
IS_MEMBER = False; //
SHIFT_DROP = True; // use shift to drop
INTENSE_DROP = dsRegular; // dsIntense, and dsAdaptive = mine some drop some (Often higher XP)

CONFIG_PATH = IncludePath+'Universal_Miner/';
CONFIG_FILE = 'config.cfg';
CONFIG_MAP = 'map.png';

INTENSITY_LEVEL = 88;
CHANCE_OF_MISS = 1;

type
TClickHistory = record
Data: TRectArray;
end;

TStatistics = record
Trips: Int32;
StartInfo: TSkillInfo;
CurrLvl: Int32;
Count: Int32;
PrcToNextLvl: Int32;
Gains,Rem,CurrXP:Double;
XPPerOre: Int32;
DismissedRandoms: Int32;
Isset_XPPerOre: Boolean;
end;

TMiner = record
PlayerBox: TBox;
ConfigPath: String;

StartTime: Int64;
QuickDeposit: Boolean;
BotStats: TStatistics;
StatsDebugTick: Int64;

RockSpots, BankSpots: TPointArray;
RockColors, BankColors: array of TCTS2Color;
BankPath: TPointArray;

ClickOrder: TClickHistory;
ProggyArea: TBox;
FailCount: Int32;

Antiban: TAntiban;
end;


var
Bot: TMiner;
RSW: TRSWalker;

NativeClient: Int32;

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// WIN API stuff

const WINAPI_CC = {$IFDEF CPU386}' stdcall'{$ELSE}' win64'{$ENDIF};
const ffi_winapi = {$IFDEF CPU386}ffi_stdcall{$ELSE}ffi_win64{$ENDIF};

type
_EnumWindowsProc = function(wnd:DWORD; Param:Pointer): LongBool;
TEnumWindowsProc = native(_EnumWindowsProc, ffi_winapi);

function GetAsyncKeyState(vKey: Int32): Int16; external 'GetAsyncKeyState@user32.dll' + WINAPI_CC;
function GetForegroundWindow(): PtrUInt; external 'GetForegroundWindow@user32.dll' + WINAPI_CC;
function GetWindowThreadProcessId(wnd: PtrUInt; out dwProcessId: DWORD): DWORD; external 'GetWindowThreadProcessId@user32.dll' + WINAPI_CC;
function EnumChildWindows(hWndParent: DWORD; func: TEnumWindowsProc; Param: Pointer): LongBool; external 'EnumChildWindows@user32.dll' + WINAPI_CC;
function GetClientRect(wnd: DWORD; out Rect: TBox): Boolean; external 'GetClientRect@user32.dll' + WINAPI_CC;

function GetKeyDown(): Char;
var
key: Word;
keys: array of Word;
begin

keys := [VK_A..VK_Z];
keys += [VK_0..VK_9];
keys += [VK_OEM_PERIOD, VK_OEM_MINUS];
for Key in keys do
if GetAsyncKeyState(key) and $8000 <> 0 then
begin
while GetAsyncKeyState(key) and $8000 <> 0 do Wait(10);
if key = VK_OEM_PERIOD then key := Ord('.');
if key = VK_OEM_MINUS then key := Ord('-');
Exit(Char(key));
end;
end;

function IsKeyDown2(vKey: Word): Boolean;
begin
Result := GetAsyncKeyState(vKey) and $8000 <> 0;
end;

function HasFocus(PID: PtrUInt): Boolean;
var tmp: DWORD;
begin

GetWindowThreadProcessId(GetForegroundWindow(), tmp);
Result := tmp = PID;
end;

function GetRSAppletWnd(PID: DWORD): DWORD;
function GetNativeClient(Handle: DWORD; Param: Pointer): LongBool; static;
var B: TBox;
begin
GetClientRect(handle, B);
if (B.Width = 765+1) and (B.Height = 503+1) then
DWORD(Param^) := handle;
Result := True;
end;
var
p: TSysProc;
client: DWORD;
begin
for p in GetProcesses() do
if p.Pid = PID then
Break;
EnumChildWindows(p.Handle, @GetNativeClient, @Result);
if Result = 0 then Result := NativeClient;
end;


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// UTILITY FUNCTIONS

function StrToTPA(s:String): TPointArray;
var
i: Int32;
Arr: TExtArray;
begin
Arr := s.ExtractNumbers();
SetLength(Result, Length(Arr) div 2);
for i:=0 to High(Result) do
begin
Result[i].x := Trunc(Arr[i*2]);
Result[i].y := Trunc(Arr[i*2+1]);
end;
end;

function StrToCTS2(s:String): array of TCTS2Color;
var
i: Int32;
Arr: TExtArray;
begin
Arr := s.ExtractNumbers();
SetLength(Result, Length(Arr) div 4);
for i:=0 to High(Result) do
begin
Result[i].Color := Trunc(Arr[i*4]);
Result[i].Tolerance := Trunc(Arr[i*4+1]);
Result[i].HueMod := Arr[i*4+2];
Result[i].SatMod := Arr[i*4+3];
end;
end;

procedure TMouse.Move(P: TPoint); override;
var
dist: Double;
q: TPoint;
maxSpeed := Random(20,22);
minSpeed := Random(4,6);
begin
q := Self.GetPosition;
dist := Hypot(q.x-p.x, q.y-p.y);
self.Speed := Trunc(minSpeed + (maxSpeed-minSpeed) * Power(dist / 1000, 1/2));
inherited;
end;


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// MISC BOT FUNCTIONS

function WorldToMSTile(Me, ObjLoc: TPoint; Height:Double=0; Offx,Offy:Double=0): TRectangle;
var
Angle: Double;
begin
ObjLoc := Point(MM2MS.MMCX, MM2MS.MMCY) + (ObjLoc - Me);
Angle := Minimap.GetCompassAngle(False);
ObjLoc := ObjLoc.Rotate(Angle, Point(MM2MS.MMCX, MM2MS.MMCY));
Result := Minimap.VecToMSRect(Vec3(ObjLoc.x - offx, ObjLoc.y - offy, Height), Angle);
end;

procedure TClickHistory.Push(x: TRectangle);
begin
Insert(x, Self.Data, 0);
end;

function TClickHistory.Pop(): TRectangle;
begin
if Length(Self.Data) < Length(Bot.RockSpots) then
Exit(Self.Data[High(Self.Data)]);
Result := Self.Data[High(Self.Data)];
SetLength(Self.Data, High(Self.Data));
end;


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// OVERRIDES AND METHODS FOR FATIGUE

procedure WaitFatigue(t: Double; Exp: Double=0.2);
begin
System.Wait(Trunc(2*t * (1-Power(System.Max(0.0001, Bot.Antiban.EnergyLevel/100),Exp))));
end;

procedure Wait(min, max:Double; weight:EWaitDir=wdMean); override;
var t:Double;
begin
t := PerformanceTimer();
inherited(min, max, weight);
WaitFatigue(PerformanceTimer()-t,0.2);
end;

procedure WaitEx(mean, dev:Double); override;
var t:Double;
begin
t := PerformanceTimer();
inherited(mean, dev);
WaitFatigue(PerformanceTimer()-t, 0.2);
end;


// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// MINER

function TMiner.GetTimeRunning(): Int64;
begin
if Self.StartTime = 0 then Exit(0);
Result := GetTickCount() - Self.StartTime;
end;


procedure TMiner.DeclarePlayers();
begin
with Players.New()^ do
begin
LoginName := LOGIN_NAME;
Password := LOGIN_PASS;
IsActive := True;
IsMember := IS_MEMBER;
World := RS_WORLD;
end;
Players.SetCurrent(0);
end;

procedure TMiner.SetupAntiban();
begin
Antiban.Init(SKILL_MINING);
Antiban.AddTask([@Antiban.LoseFocus, ONE_MINUTE*7, 0.15]);
Antiban.AddTask([@Antiban.HoverPlayers, ONE_MINUTE*9, 0.15]);
Antiban.AddTask([@Antiban.CheckSkill, ONE_MINUTE*13, 0.15]);
Antiban.AddTask([@Antiban.CheckStats, ONE_MINUTE*18, 0.15]);
Antiban.AddTask([@Antiban.OpenRandomTab, ONE_MINUTE*20, 0.15]);
Antiban.AddTask([@Antiban.RandomCompass, ONE_MINUTE*40, 0.15]);
Antiban.AddTask([@Antiban.DoMiscStuff, ONE_MINUTE*45, 0.15]);
Antiban.AddTask([@Antiban.VeryShortBreak,ONE_MINUTE*50, 0.15]);

Antiban.AddBreak([1.0 * ONE_HOUR, 05 * ONE_MINUTE, 0.33, 0.25]);
Antiban.AddBreak([3.5 * ONE_HOUR, 40 * ONE_MINUTE, 0.85, 0.15]);
Antiban.AddBreak([17 * ONE_HOUR, 07 * ONE_HOUR, 0.95, 0.10]);
end;

function TMiner.HasBanking(): Boolean;
begin
Result := (Self.BankColors <> []) and (Self.BankPath <> []) and (Self.BankSpots <> []);
end;

procedure TMiner.DoAntiban();
begin
if Self.Antiban.DoAntiban() then
Players.GetCurrent()^.Login(); // if we got logged out
end;

procedure TMiner.PostAction(CheckAntiban: Boolean = True);
begin
WaitEx(500,70);
if CheckAntiban then Self.DoAntiban;
end;

procedure TMiner.ProcessWhileWaiting();
var
n,atNextLvl,atCurrLvl:Int32;
begin
BotStats.Gains := BotStats.Count * BotStats.XPPerOre;
BotStats.CurrXP := BotStats.StartInfo.XP + BotStats.Gains;
BotStats.CurrLvl := srl.GetLevelAtXP(Ceil(BotStats.CurrXP));
atNextLvl := srl.GetXPAtLevel(BotStats.CurrLvl+1);
atCurrLvl := srl.GetXPAtLevel(BotStats.CurrLvl);
BotStats.Rem := atNextLvl - BotStats.CurrXP;
BotStats.PrcToNextLvl := 100 - Round((BotStats.Rem / (atNextLvl - atCurrLvl)) * 100);

if GetTickCount() - StatsDebugTick > 2000 then
begin
ClearDebug();
WriteLn('+---| STATS |----------------------------------------');
WriteLn('|- Trips / Drops : ', BotStats.Trips);
WriteLn('|- Ores Mined : ', BotStats.Count);
WriteLn('|- Experience Gained : ', BotStats.Gains);
WriteLn('|- Experience Per Hour : ', Round(BotStats.Gains / (GetTimeRunning()/1000/60/60)) );
WriteLn('|- Dismissed Randoms : ', BotStats.DismissedRandoms);
WriteLn('|- Time Since Break : ', SRL.MsToTime(Self.Antiban.TimeSinceBreak, Time_Short));
WriteLn('|- Energy Level : ', Self.Antiban.EnergyLevel);
WriteLn('|- Script Runtime : ', SRL.MsToTime(GetTimeRunning, Time_Short));
WriteLn('+----------------------------------------------------');

{$IFDEF SMARTDEBUG}
ProggyArea := Smart.Image.DrawSkillReport([288,2], clProgBrown, Trunc(BotStats.CurrXP), Trunc(BotStats.Gains), BotStats.Count, 'Mining');
{$ENDIF}

StatsDebugTick := GetTickCount();
end;
Self.DoAntiban;
end;


function TMiner.Contains(R: TRectangle; Colors: array of TCTS2Color): Boolean;
var
TPA: TPointArray;
i, count: Int32;
begin
for i:=0 to High(Colors) do
begin
count += srl.FindColors(TPA, Colors[i], R.Bounds);
if count > 150 then //XXXXXXXXXXXX
Exit(True);
end;
end;


function TMiner.Find(Locations: TPointArray): TRectArray;
var
i: Int32;
me: TPoint;
rect: TRectangle;
begin
me := RSW.GetMyPos();
for i:=0 to High(Locations) do
begin
rect := WorldToMSTile(me, Locations[i], 0,0,0).Expand(-2);
if MainScreen.GetBounds.Contains(rect.Bounds) then
Result += rect;
end;

if (Length(Result) = 0) then
begin
if (Self.FailCount in [2,6]) then
Minimap.RandomCompass(0,359)
else if (Self.FailCount = 7) then
begin
WriteLn('Trying to recover from failure');
Logout.ClickLogout();
Wait(1000,30000,wdLeft);
Players.GetCurrent^.Login();
MainScreen.SetAngle(True);
WaitEx(500,150);
end else if (Self.FailCount > 10) then
TerminateScript('Not close enough to objects: ('+ ToStr(me.x) +','+ToStr(me.y)+') -> '+ ToStr(locations));

Inc(Self.FailCount);
WaitEx(600,150);
end else
Self.FailCount := 0;
end;


function TMiner.DoWork(): Boolean;
var
i: Int32;
T: TCountDown;
TRA: TRectArray;
next: TRectangle;
tmpCurrXP, invCount: Int32;

function MaybeMiss(): Boolean;
var
R: TRectangle;
begin
Result := True;
if Random()*100 <= CHANCE_OF_MISS then
begin
R := Minimap.PointToMsRect(Point(MM2MS.MMCX+Random(-6,6), MM2MS.MMCY+Random(-6,6)));
Mouse.Move(R, True);
WaitEx(65,10);
if MainScreen.IsUpText(['Walk here', 'Mine', 'Rocks']) then
Exit();
Result := False;
end;
end;

function ClickRock(rect: TRectangle): Int8;
begin
mouse.Move(rect, Random(10) = 0);
WaitEx(65,10);
if not Mainscreen.IsUpText(['Mine', 'Rocks']) then
Exit(1);

if (not MaybeMiss()) then
Exit(0);

if (not ((Random() <= 0.05) and ChooseOption.Select('Mine Rocks'))) and
(not Mouse.Click(ctRed)) then
begin
Wait(400,7000,wdLeft);
Self.DoAntiban;
WaitFatigue(Random(1500,3000), 0.6);
Exit(0);
end;

ClickOrder.Push(TRA[i]);
for 6 to Round(srl.TruncatedGauss(0,12)) do
begin
Mouse.Click(mouse_Left);
WaitEx(65,10);
end;

WaitEx(300,60);
Result := 2;
end;

begin
invCount := Inventory.Count;
TRA := Find(self.RockSpots);

if (Self.BotStats.StartInfo = []) and (Self.BotStats.XPPerOre = 0) then
begin
Self.BotStats.StartInfo := Stats.GetSkillInfo(SKILL_MINING);
Self.BotStats.XPPerOre := BotStats.StartInfo.XP;
end;

for i:=0 to High(TRA) do
begin
if not Contains(TRA[i], Self.RockColors) then
Continue;

WaitFatigue(Random(700,1200), 0.1);
case ClickRock(TRA[i]) of
0: Exit;
1: Continue;
2: Minimap.WaitPlayerMoving(False);
end;

next := ClickOrder.Pop();
if (Self.Antiban.EnergyLevel > 40) or (Random() < 0.05) then
begin
if(Random() > 0.05) then
Mouse.Move(next, Random() < 0.1)
else if(Random() < 0.05) then
begin
Mouse.Move(srl.DefaultClientBounds, True, rndRandom);
WaitFatigue(5000, 0.6);
end;
end;

TRA := Find(self.RockSpots); // update the TRA in case we moved
T.Init(srl.NormalRange(20000,25000)); //XXXXXXXXXXXX
while (not T.IsFinished) and Contains(TRA[i], Self.RockColors) do
begin
if(Chatbox.GotLevelUp()) then
if(Random(9) = 0) then
Chatbox.HandleLevelUp()
else
Break;

if 'inventory is too full' in Chatbox.GetNotification() then
Break;

Self.ProcessWhileWaiting();
Wait(30);
end;

if (Inventory.Count > invCount) then
begin
Inc(Self.BotStats.Count);
if (not Self.BotStats.Isset_XPPerOre) then //XXXXXXXXXXXX
begin
Self.BotStats.XPPerOre := Stats.GetSkillInfo(SKILL_MINING).XP - Self.BotStats.XPPerOre;
Self.BotStats.Isset_XPPerOre := Self.BotStats.XPPerOre > 0;
end;
end;

Exit(True);
end;
end;


procedure TMiner.DoBanking();
function OpenBank(): Boolean;
var Rect: TRectangle;
begin
for 0 to 3 do
begin
for Rect in Find(self.BankSpots) do
if Contains(Rect, Self.BankColors) and BankScreen.OpenAt(srl.RandomPoint(Rect.Mean, Trunc(Rect.Radius))) then
Exit(True);
Wait(800,1300);
end;
end;

function BankInventory(): Boolean;
var
slots: TIntArray;
t: TCountDown;
begin
if Self.QuickDeposit then
Exit(BankScreen.DepositAll);

slots := Inventory.GetUsedSlots();
slots.Remove(0); //reserved
while Length(slots) > 0 do
begin
Inventory.MouseSlot(slots[0]);
ChooseOption.Select('Deposit-All');
t.Init(2000);
while Inventory.IsSlotUsed(slots[0]) and (not t.IsFinished) do WaitEx(90,10);
slots := Inventory.GetUsedSlots();
slots.Remove(0);
end;
Wait(1, 1200, wdLeft);
Result := not Inventory.IsFull();

if Inventory.Count = 0 then
Self.QuickDeposit := True;
end;

function Walk(path: TPointArray): Boolean;
begin
for 0 to 2 do
if RSW.WalkPath(Path) then
Exit(True)
else
Wait(800, 3200, wdRight);
end;

begin
if(not Walk(self.BankPath)) then
TerminateScript('Failed to walk path [1]');
Self.DoAntiban;

if(not OpenBank()) then
TerminateScript('Failed to open bank');
PostAction(False);

if(not BankInventory()) then
TerminateScript('Failed to deposit items');
PostAction;

if(not Walk(self.BankPath.Reversed)) then
TerminateScript('Failed to walk path [2]');
Self.DoAntiban;
end;


procedure TMiner.IntenseDrop(Test: function: Boolean of Object);
var
p: TPoint;
Slots: TIntArray;
n: Int32 = 3;
begin
if Test() then Exit;

if Random(5) = 0 then
n := Random(2,4);

p := Mouse.GetPosition();
Slots := Inventory.GetUsedSlots();
if (Length(Slots) >= 3)then
begin
if(not Self.QuickDeposit) then Slots.Remove(0);

SetLength(Slots, Min(Length(Slots), n));
Inventory.DropItems(Inventory.ErrorPattern(Slots,2 ));
Mouse.Move(p,20);
end;
end;

procedure TMiner.DropInventory();
begin
if Self.QuickDeposit then
Inventory.DropItems(Inventory.ErrorPattern(DROP_PA TTERN_SNAKE))
else
Inventory.DropItemsExcept([0], Inventory.ErrorPattern(DROP_PATTERN_SNAKE));
end;


procedure TMiner.Run();
var
loc: TPoint;

procedure TryDropWhileMining();
begin
if (not HasBanking) and (INTENSE_DROP in [dsIntense,dsAdaptive]) then
begin
if (INTENSE_DROP = dsIntense) then
Self.IntenseDrop(@Self.DoWork)
else if (INTENSE_DROP = dsAdaptive) and (Self.Antiban.EnergyLevel > INTENSITY_LEVEL) then
Self.IntenseDrop(@Self.DoWork);
end;
end;

begin
Self.StartTime := GetTickCount();
Self.SetupAntiban();
MainScreen.SetAngle(True);

if Inventory.Count = 0 then
Self.QuickDeposit := True;

if Self.HasBanking() then
begin
loc := RSW.GetMyPos();
if (Distance(loc, self.BankPath[high(self.BankPath)]) < Distance(loc, self.BankPath[0])) and
(not RSW.WalkPath(self.BankPath.Reversed)) then
TerminateScript('Failed to walk from bank on startup');
end;

repeat
if (Random(5000) <> 0) and Inventory.IsFull() then
begin
if HasBanking then Self.DoBanking()
else Self.DropInventory();
Inc(BotStats.Trips);
end;

if Self.DoWork() then
begin
TryDropWhileMining();
Self.DoAntiban;
end else
Players.GetCurrent()^.Login();
Wait(1);
until False;
end;

procedure TMiner.Init();
var
W, H: Integer;
begin
GetClientDimensions(W, H);

self.PlayerBox := Minimap.VecToMsRect(Vec3(MM2MS.MMCX,MM2MS.MMCY,2)) .Expand(7).Bounds;
self.DeclarePlayers();
Mouse.Speed := 10;
Players.GetCurrent()^.Login();

Inventory.ShiftDrop := SHIFT_DROP;
end;



// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Crazy config generation

procedure TMiner.Setup();
var
r: String;
DefaultBox: TBox = [75,40, 425,140];
client2: TClient;

type
TButtonBox = record
TextTPA: TPointArray;
Bounds: TBox;
end;

function SlowMSToMM(MS: TPoint): TPoint;
var
x,y: Int32;
best,test: TPoint;
begin
for x:=MM2MS.MMCX-52 to MM2MS.MMCX+52 do
for y:=MM2MS.MMCY-52 to MM2MS.MMCY+52 do
begin
test := Minimap.PointToMs([x,y],0);
if Distance(test, MS) < Distance(best, MS) then
begin
best := test;
Result := Point(x,y);
end;
end;
end;

procedure WaitReleaseKey();
begin
while client2.GetIOManager.IsMouseButtonDown(0) do Wait(10);
end;

function GetClick(out p: TPoint): Boolean;
begin
if not HasFocus(smart.PID) then Exit();
if client2.GetIOManager.IsMouseButtonDown(0) then
begin
client2.GetIOManager.GetMousePos(p.x,p.y);
Result := p.InBox(GetClientBounds);
WaitReleaseKey();
end;
end;

function GetButton(txt: String): TButtonBox;
begin
Result.TextTPA := TPAFromText(txt, StatChars07);
Result.Bounds := GetTPABounds(Result.TextTPA).ExpandFunc(8);
end;

function DrawButton(p: TPoint; var Button: TButtonBox): TButtonBox;
begin
Button.TextTPA.Offset(p);
Button.Bounds.Offset(p);
smart.Image.DrawBox(Button.Bounds, True, 2502198);
smart.Image.DrawBox(Button.Bounds.ExpandFunc(-1), True, 4607315);
smart.Image.DrawTPA(Button.TextTPA, $FFFFFF);
end;

function MessageBox(Text: String; Area:TBox=[]): string;
var
xstart: Int32;
TPA: TPointArray;
box: TBox;
begin
if (Area.x1 = Area.x2) then Area := chatbox.GetBounds;
smart.Image.DrawBox(Area.ExpandFunc(-0), False, $1F2F33);
smart.Image.DrawBox(Area.ExpandFunc(-1), False, $3F4A5A);
smart.Image.DrawBox(Area.ExpandFunc(-2), False, $1F2F33);
smart.Image.DrawBox(Area.ExpandFunc(-3), True, $171D20);

TPA := TPAFromText(Text, SmallChars07);
box := GetTPABounds(TPA);
xstart := (box.Width + Area.Width) div 2 - box.Width;
OffsetTPA(TPA, Point(Area.x1+xstart, Area.y1+20));
smart.Image.DrawTPA(TPA, $FFFFFF);
end;

function Query(Text: String; Alts:TStringArray; Area:TBox=[]): string;
var
i,xstart,CurrWidth: Int32;
p: TPoint;
Buttons: array of TButtonBox;
xOffset: TIntArray;
begin
if (Area.x1 = Area.x2) then Area := chatbox.GetBounds;

// query
MessageBox(Text, Area);

// buttons
for i:=0 to High(Alts) do
begin
Buttons += GetButton(Alts[i]);
xOffset += CurrWidth;
CurrWidth += Buttons[i].Bounds.X2+20;
end;
CurrWidth -= 20;

xstart := (CurrWidth + Area.Width) div 2 - CurrWidth;
for i:=0 to High(Buttons) do
DrawButton(Point(Area.x1+xstart+xOffset[i], Area.y1+50), Buttons[i]);

// handling
while True do
begin
if GetClick(p) then
for i:=0 to High(Buttons) do
if PointInBox(p, Buttons[i].Bounds) then
begin
smart.Image.DrawBox(Area, True, 0);
Exit(Alts[i]);
end;
Wait(1);
end;
end;

function QueryStr(Text: String; Area:TBox=[]): string;
var
i: Int32;
pt, p: TPoint;
chr: Char;
B: TBox;
TPA: TPointArray;
Button: TButtonBox;
begin
if (Area.x1 = Area.x2) then
Area := chatbox.GetBounds;

// query
smart.Image.DrawBox(Area.ExpandFunc(-0), False, $1F2F33);
smart.Image.DrawBox(Area.ExpandFunc(-1), False, $3F4A5A);
smart.Image.DrawBox(Area.ExpandFunc(-2), False, $1F2F33);
smart.Image.DrawBox(Area.ExpandFunc(-3), True, $171D20);

TPA := TPAFromText(Text, SmallChars07);
OffsetTPA(TPA, Point(Area.x1+40, Area.y1+20));
smart.Image.DrawTPA(TPA, $FFFFFF);
B := GetTPABounds(TPA);

// button
Button := GetButton('OK');
DrawButton(Point(Area.x1+48, Area.y1+50), Button);

// handling
pt.x := B.x2+5;
pt.y := Area.y1+20;
repeat
while not HasFocus(smart.PID) do Wait(10);

if GetClick(p) then
if PointInBox(p, Button.Bounds) then
begin
smart.Image.DrawBox(Area, True, 0);
Exit(Result);
end;

chr := GetKeyDown();
if chr <> #0 then
begin
Result += Lowercase(chr);
Keyboard.PressKey(VK_BACK);
smart.Image.DrawText(Result,'SmallChars07', pt, False, $FFCCAA);
end;

if IsKeyDown2(VK_BACK) and (Result <> '') then
begin
TPA := TPAFromText(Result, 'SmallChars07');
TPA.Offset(pt);
smart.Image.DrawBox(GetTPABounds(TPA), True, $171D20);
while IsKeyDown2(VK_BACK) do Wait(50);
SetLength(Result, Length(Result)-1);
smart.Image.DrawText(Result, 'SmallChars07', pt, False, $FFCCAA);
end;
until False;
end;

function SetupLocations(): TPointArray;
var
p, me, worldPt: TPoint;
rect: TRectangle;
begin
me := RSW.GetMyPos();

while True do
begin
if GetClick(p) then
begin
worldPt := (SlowMSToMM(p) - Point(MM2MS.MMCX, MM2MS.MMCY)) + me;

rect := WorldToMSTile(me, worldPt);
if Mainscreen.GetBounds.Contains(rect.Bounds) then
begin
smart.Image.DrawTPA(rect.ToTPA.Connect, $FFFF);
case Query('Are you happy?', ['Add more', 'Retry', 'Yes']) of
'Retry': smart.Image.DrawTPA(rect.ToTPA.Connect, 0);
'Add more': Result += worldPt;
'Yes': begin Result += worldPt; Break; end;
end;
end;
end;
Wait(1);
end;
smart.Image.Clear();
end;

function SetupColors(Locations: TPointArray): array of TCTS2Color;
var
i: Int32;
p,me: TPoint;
IsValid: Boolean;
R: array of TRectangle;
Color: TCTS2Color;
TPA: TPointArray;

function MarkColors(Colors: array of TCTS2Color): TPointArray;
var
i,j: Int32;
TPA: TPointArray;
begin
for i:=0 to High(Colors) do
for j:=0 to High(R) do
if srl.FindColors(TPA, Colors[i], R[j].Bounds.ExpandFunc(-1)) then
begin
TPA := R[j].Filter(TPA);
smart.Image.DrawTPA(TPA, $FF);
Result += TPA;
end;
end;
begin
me := RSW.GetMyPos();
SetLength(R, Length(Locations));
for i:=0 to High(Locations) do
begin
R[i] := WorldToMSTile(Me, Locations[i]);
smart.Image.DrawTPA(R[i].ToTPA.Connect, $00FF00);
end;

while True do
begin
if GetClick(p) then
begin
Color := CTS2(GetColor(p), 13);
for i:=0 to High(R) do
if R[i].Contains(p) then
begin
IsValid := True;
break;
end;
if(not IsValid) then
continue;

TPA := MarkColors(Result + Color);
case Query('Are you happy?', ['Add more', 'Retry', 'Reset', 'Yes']) of
'Retry': smart.Image.DrawTPA(TPA, 0);
'Add more': Result += Color;
'Yes': begin Result += Color; Break; end;
'Reset': begin smart.Image.DrawTPA(TPA, 0); Result := []; end;
end;
end;
Wait(1);
end;
smart.Image.Clear();
end;

function RecordPath(): TPointArray;
var
worldPt,p: TPoint;
t: UInt64;
begin
t := GetTickCount()+8000;
while True do
begin
if GetClick(p) then
begin
t := GetTickCount()+2500;
worldPt := RSW.GetMyPos();
Mouse.Click(p, mouse_Left);

Result += worldPt;
end;

if (GetTickCount() > t) and (not Minimap.isPlayerMoving()) then
case Query('Are we there yet?', ['No', 'Yes']) of
'Yes': Exit(Result+RSW.GetMyPos());
'No' : t := GetTickCount()+2500;
end;
Wait(1);
end;
end;

procedure GenerateMap(MapPath:String; Pad:Int32=160);
var
pt,sz: TPoint;
map,slice: TMufasaBitmap;
TPA: TPointArray;
B: TBox;
begin
TPA := Self.BankPath + Self.RockSpots + Self.BankSpots;

sz := Point(High(RSW.WorldMap[0]),High(RSW.WorldMap));
B := TPA.Bounds.ExpandFunc(Pad);
B.LimitTo(Box(0,0,sz.x,sz.y));

map.Init(client.GetMBitmaps);
map.SetSize(B.Width, B.Height);
for pt in TPA do
begin
slice.Init(client.GetMBitmaps);
slice.DrawMatrix(RSW.WorldMap.Crop(Box(
Max(0,pt.x-Pad),
Max(0,pt.y-Pad),
Min(sz.x,pt.x+Pad),
Min(sz.y,pt.y+Pad)
)));
slice.DrawTransparent(pt.x-B.x1-Pad,pt.y-B.y1-Pad, map);
slice.Free();
end;
map.SaveToFile(MapPath);
map.Free();

Self.BankPath.Offset ([-B.x1,-B.y1]);
Self.RockSpots.Offset([-B.x1,-B.y1]);
Self.BankSpots.Offset([-B.x1,-B.y1]);
end;

function LoadConfig(): Boolean;
begin
if not FileExists(ConfigPath+CONFIG_FILE) then
Exit(False);

BankPath := StrToTPA (ReadINI('settings', 'BankPath', ConfigPath+CONFIG_FILE));
RockSpots := StrToTPA (ReadINI('settings', 'RockSpots', ConfigPath+CONFIG_FILE));
RockColors := StrToCTS2(ReadINI('settings', 'RockColors', ConfigPath+CONFIG_FILE));
BankSpots := StrToTPA (ReadINI('settings', 'BankSpots', ConfigPath+CONFIG_FILE));
BankColors := StrToCTS2(ReadINI('settings', 'BankColors', ConfigPath+CONFIG_FILE));
Result := True;
end;

procedure SaveConfig();
var
f: PtrInt;
begin
CreateDirectory(CONFIG_PATH);
CreateDirectory(ConfigPath);

GenerateMap(ConfigPath+CONFIG_MAP);
CloseFile(CreateFile(ConfigPath+CONFIG_FILE));

f := RewriteFile(Self.ConfigPath+CONFIG_FILE, True);
WriteFileString(f, '[settings]' + #13#10);
WriteFileString(f, 'BankPath = '+ToStr(BankPath) + #13#10);
WriteFileString(f, 'RockSpots = '+ToStr(RockSpots) + #13#10);
WriteFileString(f, 'RockColors = '+ToStr(RockColors)+ #13#10);
WriteFileString(f, 'BankSpots = '+ToStr(BankSpots) + #13#10);
WriteFileString(f, 'BankColors = '+ToStr(BankColors)+ #13#10);
CloseFile(f);
end;

label
START, QUERY_CONFIG;

begin
client2.Init(PluginPath);
client2.GetIOManager.SetTarget2(GetRSAppletWnd(SMA RT.PID));

START:
r := Query('Do you wish to run setup?', ['Yes','No'], DefaultBox);
if r = 'No' then
begin QUERY_CONFIG:
Self.ConfigPath := CONFIG_PATH + QueryStr('Name of config: ', DefaultBox) + '/';

if not LoadConfig() then
case Query('Failed to load config, try again?', ['Yes','No'], DefaultBox) of
'Yes': goto QUERY_CONFIG;
'No' : goto START;
end;

client2.Free();
Exit();
end;

r := MessageBox('Preparing, please stand by...', DefaultBox);
minimap.SetCompassAngle(0);
RSW.Init('world.png');

Query('Click the rocks you wish to mine...', ['OK'], DefaultBox);
RockSpots := SetupLocations();

Query('Click some colors for us to use...', ['OK'], DefaultBox);
RockColors := SetupColors(RockSpots);

if('Banking' = Query('Select style:', ['Banking','Powermining'], DefaultBox)) then
begin
Query('Please walk to your bank', ['OK'], DefaultBox);
BankPath := RecordPath();

Query('Click valid bankers, or booths...', ['OK'], DefaultBox);
BankSpots := SetupLocations();

Query('Click some colors for us to use...', ['OK'], DefaultBox);
BankColors := SetupColors(BankSpots);
end;

Self.ConfigPath := CONFIG_PATH + QueryStr('Save config as: ', DefaultBox) + '/';
SaveConfig();

RSW.Free();
client2.Free();
end;


begin
NativeClient := GetNativeWindow();

smart.EnableDrawing := True;
srl.Setup([]);
srl.Options := [soDebugAntiban];
AddOnTerminate(@smart.Free);

Bot.Init();
Bot.Setup();

RSW.Init(Bot.ConfigPath+CONFIG_MAP);
AddOnTerminate(@RSW.Free);
//RSW.MemScanEnabled := False;

Bot.Run();
end.



Other notes:

Video will over time probably get outdated.
You can keep track over changes on my GitHub (https://github.com/slackydev/Simba-Misc/blob/master/Universal_Miner.simba)
Remember to be max zoomed out, and max brightness.
You can find things that needs, or might need a fix or adjustment in the source by searching for //XXX


WARNING: Use at your own risk.

Flight
12-17-2017, 03:59 PM
It's about time... It's great to see some life from the include and being put to use. This script is a great example of much of what SRL (OSR) provides as powerful tool for script-writers as well as showcasing its abilities. Just watching the video and skimming through the script it's obvious the variety of fields this script touches; it's very advanced at least in my opinion. Job very well done Slacky!

I hope this sparks some other projects featuring this include.

KeepBotting
12-17-2017, 09:18 PM
Very nice release. Could do without the WinAPI dependency but other than that it looks quite slick and functional.

R0b0t1
12-18-2017, 04:22 AM
I have been needing something to test new Simba versions with so this is appreciated. There are no antirandoms? Do the SRL antirandoms work anymore? Or, wait, can't all randoms be turned off or ignored?

Like KeepBotting, I agree the dependency on WinAPI is a little odd, but at least this is a script that works.

slacky
12-18-2017, 05:59 AM
If WinAPI makes my job easier, I will use the WinAPI.

Joopi
12-18-2017, 09:20 AM
R0b0t1; yeah all randoms can be ignored. Only Ironmen will ever solve those for Unobtainable Items™.
Scratch that or else figuring out what an Ironman is will be yet another endless project of yours

carib0u
12-29-2017, 12:05 PM
Thank you for your time.

Will post an update!

Dan the man
01-03-2018, 09:14 PM
How did I miss this? Looks amazing. Love the concept!

P1nky
01-03-2018, 09:27 PM
Awesome and creative!

slacky
01-05-2018, 02:23 AM
I added some basic WriteLn progress info to it just so that people can keep tabs on it.

And here's my first run after this addition (Mining and banking copper+tin at Varrock):


+-- STATS -----------------------------------------------------
|- Trips / Drops : 115
|- Ores Mined : 3237
|- Experience Gained : 55029
|- Experience Per Hour : 9277
|- Script Runtime : 5 Hours, 55 Minutes and 53 Seconds
+--------------------------------------------------------------

klamor
01-05-2018, 03:21 PM
Nice release! Too bad I don't play OSRS :/

You say "Create your own miner". Does that mean you need to script your own paths for mining other locations or...? I'm still not fully informed on how RSWalker works.

slacky
01-05-2018, 09:06 PM
You say "Create your own miner". Does that mean you need to script your own paths for mining other locations or...? I'm still not fully informed on how RSWalker works.
No. The bot doesn't know of any locations. In the first 2 minutes of the video posted, I created a bot that runs at varrock east, including the path. The path for banking was generated automatically from running the setup. So, there isn't any scripting involved, just run the setup.


RSWalker works much like SPS - you usually use a regular path making tool for paths, but this bot doesn't require that.

Hellzonee
01-07-2018, 10:48 PM
Looking at the video this looks awesome, wonder if you can configure this for woodcutting as well. I would assume it would be a bit more difficult since you cant depend on color change so much.

slacky
01-08-2018, 06:52 AM
Looking at the video this looks awesome, wonder if you can configure this for woodcutting as well. I would assume it would be a bit more difficult since you cant depend on color change so much.
That can probably be done, but would require a number of tweaks and additions, and disabling certain features. I might look into making one based off the core of this if I find time for it.

klamor
01-09-2018, 10:50 PM
No. The bot doesn't know of any locations. In the first 2 minutes of the video posted, I created a bot that runs at varrock east, including the path. The path for banking was generated automatically from running the setup. So, there isn't any scripting involved, just run the setup.


RSWalker works much like SPS - you usually use a regular path making tool for paths, but this bot doesn't require that.

My bad, I didn't actually get a chance to watch the video until just now. Looks amazing! Can't wait to see what you do with it next.

Overdrive
01-13-2018, 04:36 PM
Thanks for the release, looks promosing!

Cooked Terd
01-22-2018, 07:08 AM
Hello, I am trying to use your universal miner script. I am getting the error at bottom Exception in Script: Plugin(libLayer32) has not been found
Mind helping out? I am simply wanting to power mine.

EDIT: Have used simba many years ago. Just got back to OSRS last week. New computer as well. Thanks

slacky
01-22-2018, 07:23 AM
Hello, I am trying to use your universal miner script. I am getting the error at bottom Exception in Script: Plugin(libLayer32) has not been found
My bad, left some traces of a test I did in the script. Fixed now
Hopefully there aren't any other bugs left.

Cooked Terd
01-22-2018, 07:38 AM
My bad, left some traces of a test I did in the script. Fixed now
Hopefully there aren't any other bugs left.

Exception in Script: Unable to find file 'SRL/OSR.simba' used from 'C:\Simba\Scripts\Universal_Miner_V020.simba'

slacky
01-22-2018, 07:44 AM
Exception in Script: Unable to find file 'SRL/OSR.simba' used from 'C:\Simba\Scripts\Universal_Miner_V020.simba'
You wanna read the requirements, and grab the files needed.

Cooked Terd
01-22-2018, 07:45 AM
You wanna read the requirements, and grab the files needed.

Thought I had done all of that, i'll double check again. Must not have grabbed something or put it in right folder. Thanks.
EDIT: Ive got RSWalker and SRL-OSR and srl6 in my includes folder, the leak fixes in my Simba folder, updated srl. Still same. Where is the SRL/OSR simba fie I am missing? I know this is bothersome to you but help would be appreciative. Followed the OSRS setup guide that is stickied.

slacky
01-22-2018, 07:47 AM
Thought I had done all of that, i'll double check again. Must not have grabbed something or put it in right folder. Thanks.
The SRL include files is expected to be placed in C:\Simba\Includes\SRL\

Cooked Terd
01-22-2018, 08:04 AM
The SRL include files is expected to be placed in C:\Simba\Includes\SRL\

Man I know I'm being a pain. Which file exactly? Currently it is the srl file in your thread. I put them to Includes folder. Ive got AeroLib, Reflection, RSWalker, SRL-OSR then the ones that come upon download. Sorry to be such a bother. Its been years since ive worked with simba and I wasn't too great then but this is first time ive looked at any of this stuff in awhile.

Citrus
01-22-2018, 08:16 AM
Man I know I'm being a pain. Which file exactly? Currently it is the srl file in your thread. I put them to Includes folder. Ive got AeroLib, Reflection, RSWalker, SRL-OSR then the ones that come upon download. Sorry to be such a bother. Its been years since ive worked with simba and I wasn't too great then but this is first time ive looked at any of this stuff in awhile.

Download SRL from the GitHub linked in the OP
Unzip it and rename the folder to 'SRL'
Move the folder into Simba's Includes folder.
Finished.

Cooked Terd
01-22-2018, 08:33 AM
Download SRL from the GitHub linked in the OP
Unzip it and rename the folder to 'SRL'
Move the folder into Simba's Includes folder.
Finished.

Did exactly that. Same error line I'm getting. I'm not getting what I'm doing wrong. Obviously something. Downloaded the SRL link, extracted it, renamed to SRL, moved the folder to the Includes folder. Same error when trying to run script.

slacky
01-22-2018, 08:40 AM
Did exactly that. Same error line I'm getting. I'm not getting what I'm doing wrong. Obviously something. Downloaded the SRL link, extracted it, renamed to SRL, moved the folder to the Includes folder. Same error when trying to run script.
printscreen the includes folder. and the folder SRL that's within there.

Cooked Terd
01-22-2018, 08:44 AM
printscreen the includes folder. and the folder SRL that's within there.

https://i.imgur.com/SAV3POo.png https://i.imgur.com/2yROmkT.png

slacky
01-22-2018, 08:51 AM
https://i.imgur.com/2yROmkT.png
see, if we look at the path in the latter image, the path says:
C:\Simba\Includes\SRL\SRL\
When in your case it should be
C:\Simba\Includes\SRL\
(this is where the contents is supposed to be, like OSR.simba)

Cooked Terd
01-22-2018, 08:55 AM
see, if we look at the path in the latter image, the path says:
C:\Simba\Includes\SRL\SRL\
When in your case it should be
C:\Simba\Includes\SRL\
(this is where the contents is supposed to be, like OSR.simba)

I feel like an idiot. Thanks. I hadn't noticed that. Now however there is this. https://i.imgur.com/EtyqN3i.png

slacky
01-22-2018, 08:57 AM
I feel like an idiot. Thanks. I hadn't noticed that. Now however there is this. https://i.imgur.com/EtyqN3i.png
That's because you aint running it with Simba 1.2, but Simba 1.1.

Launch the Simba 1.2 (which was linked in the requirements).
In Simba 1.2, navigate to the file menu, select "Open", navigate to the script.. Select it.
Run.

Cooked Terd
01-22-2018, 09:09 AM
That's because you aint running it with Simba 1.2, but Simba 1.1.

Launch the Simba 1.2 (which was linked in the requirements).
In Simba 1.2, navigate to the file menu, select "Open", navigate to the script.. Select it.
Run.
Okay I got you. I launched the simba 1.2 with fixes and opened script there. Now ive got this. Error: Plugin(SimpleOCR32) has not been found

I appreciate your time and effort. Really liked Simba and was wanting to use it VS OSBot or something sketchy like that. Where can I find the pugin I am missing? https://i.imgur.com/T0OQEkq.png

slacky
01-22-2018, 09:15 AM
Okay I got you. I launched the simba 1.2 with fixes and opened script there. Now ive got this. Error: Plugin(SimpleOCR32) has not been found

I appreciate your time and effort. Really liked Simba and was wanting to use it VS OSBot or something sketchy like that. Where can I find the pugin I am missing? https://i.imgur.com/T0OQEkq.png
Right. You need to enable SRL plugins, and run an update.

So, you go back into Simba 1.1, and then follow these steps (Updater in Simba 1.2 is bugged):
1. Menu -> View -> Extensions
2. Select: srl.sex
3. Check the Enable box.
4. Close extensions form.

5. Menu -> Plugins -> Check For Update
6. Wait for the plugins to update, accept overwrite if it asks.
7. Once updated. Close Simba 1.1.
8. Restart Simba 1.2, run the bot.

^^ this is basic Simba setup protocol that one should always have done.

Cooked Terd
01-22-2018, 09:21 AM
Right. You need to enable SRL plugins, and run an update.

So, you go back into Simba 1.1, and then follow these steps (Updater in Simba 1.2 is bugged):
1. Menu -> View -> Extensions
2. Select: srl.sex
3. Check the Enable box.
4. Close it.

5. Menu -> Plugins -> Check For Update
6. Wait for the plugins to update, accept overwrite if it asks.
7. Once updated. Close Simba 1.1.
8. Restart Simba 1.2, run the bot.

^^ this is basic Simba setup protocol that one should always have done.

Did all that when I first downloaded it as I followed the guide. Just now went back into Simba 1.1 and no plugin updates available and I had that extension selected already. Maybe its a lost hope for me. Who knows?

slacky
01-22-2018, 09:25 AM
Did all that when I first downloaded it as I followed the guide. Just now went back into Simba 1.1 and no plugin updates available and I had that extension selected already. Maybe its a lost hope for me. Who knows?
So what you wanna do is (Still in Simba 1.1):
1. Menu -> Plugins -> Settings -> Override update
2. Menu -> Plugins -> Update

This should force plugins to be downloaded anyway.

PS: RSWalker folder is suppsoed to be named `RSWalker` not, `RSWalker-0.8b` (just sayin' before that's brought up)

Citrus, I see you watching, I gotta go out, take over.

Cooked Terd
01-22-2018, 09:43 AM
So what you wanna do is (Still in Simba 1.1):
1. Menu -> Plugins -> Settings -> Override update
2. Menu -> Plugins -> Update

This should force plugins to be downloaded anyway.

PS: RSWalker folder is suppsoed to be named `RSWalker` not, `RSWalker-0.8b` (just sayin' before that's brought up)

Citrus, I see you watching, I gotta go out, take over.

Appreciate all the help. As I do each of these things another thing pops up. Just going to give up at this point.

slacky
01-22-2018, 09:53 AM
Appreciate all the help. As I do each of these things another thing pops up. Just going to give up at this point.
if it's the plugins that wouldn't update you can get them manually from https://github.com/SRL/SRL-Plugins

Also, giving up after all the effort I have put into helping you, that's not very nice.

So, for anyone else struggeling, just download this Simba install, it's already set up - the _current_ version of the bot is included as well:
https://files.fm/u/bjc55upe

Mark
01-22-2018, 10:20 AM
@slacky great release and well done to you and @Olly for all the work on simba and OSR include.??
Maybe a guide with pictures/video is required for these guys having trouble.

ry0240
01-31-2018, 11:45 PM
Every time I try to run the setup I get this error in SRl/Shared/Time

Error: Invalid floating point operation at line 303

It happens after I go to setup banking and try to walk the path to the bank, or if I try to do powermining the script acts like it's about to start but then pops up with the same error.

justforfun
02-02-2018, 07:57 PM
Hey! Script looks great!

I was having trouble setting up the simba but the pre loaded simba folder by slacky made the script compile. However, after compiling, the script directly asks for loading the config and no setup. What am i doing wrong? How to make the bot setup?

I have selected osbuddy rs-window using the 'Plus' marker in simba before compiling the script. Help would be appreciated. @Slacky @Flight

Thanks!

slacky
02-02-2018, 09:38 PM
Hey! Script looks great!

I was having trouble setting up the simba but the pre loaded simba folder by slacky made the script compile. However, after compiling, the script directly asks for loading the config and no setup. What am i doing wrong? How to make the bot setup?

I have selected osbuddy rs-window using the 'Plus' marker in simba before compiling the script. Help would be appreciated. @Slacky @Flight

Thanks!
The variant that doesn't use SMART requires you to have a config already, you will have to make the config through the SMART version. Which can later be used by that version of the bot.

justforfun
02-03-2018, 05:43 AM
The variant that doesn't use SMART requires you to have a config already, you will have to make the config through the SMART version. Which can later be used by that version of the bot.

Thank you!

justforfun
02-03-2018, 08:39 AM
The variant that doesn't use SMART requires you to have a config already, you will have to make the config through the SMART version. Which can later be used by that version of the bot.


Hey, i have run the script through smart and it runs the setup now. After selecting the rocks and colours, it gives an error and stops when you start to define the bank path. The same error occurs when i chose power mining.

Error: Division by zero at line 303
Execution failed.

The error is in the time.simba file in SRL.

Edit: I ran this script in a non-smart version with osbuddy, loaded the preset of "veast-coptin". The same error popped up when the bot was starting to mine rocks. It walked from bank to the mine, performed anti ban and then stopped.

error: https://ibb.co/cOfQOm

slacky
02-03-2018, 04:48 PM
Hey, i have run the script through smart and it runs the setup now. After selecting the rocks and colours, it gives an error and stops when you start to define the bank path. The same error occurs when i chose power mining.

Error: Division by zero at line 303
Execution failed.

The error is in the time.simba file in SRL.

Edit: I ran this script in a non-smart version with osbuddy, loaded the preset of "veast-coptin". The same error popped up when the bot was starting to mine rocks. It walked from bank to the mine, performed anti ban and then stopped.

error: https://ibb.co/cOfQOm
uhm, this is a tricky one. I am unsure as to why that call would fail, and return zero, I have personally never seen that happen. But if you are on a old or special/weird System, or on an old operating system then that could possibly happen (lacking a high performance timer). I can perhaps add a fix to SRL itself, and actually verify that the call worked (check if it returns True), if not fall back to `GetTickCount`.

But, your personal quickfix, and for others experiencing the exact same error is this:
in that file, you will see the following lines:

{$IFDEF WINDOWS}
function PerformanceTimer(): Double;
var
frequency,count: UInt64;
function QPF(out F: UInt64): LongBool; static; external 'QueryPerformanceFrequency@Kernel32.dll '+{$IFDEF CPU386}'stdcall'{$ELSE}'win64'{$ENDIF};
function QPC(out C: UInt64): LongBool; static; external 'QueryPerformanceCounter@Kernel32.dll '+{$IFDEF CPU386}'stdcall'{$ELSE}'win64'{$ENDIF};
begin
QPF(frequency);
QPC(count);
Result := count / frequency * 1000;
end;
{$ELSE}
function PerformanceTimer(): Double;
begin
Result := GetTickCount();
end;
{$ENDIF}


what I want you to do is to change the following line:
> {$IFDEF WINDOWS}
into
> {$IFDEF MY_WINDOWS_DOESNT_SUCK}
now, save the file. And you should be able to run the script.

This will disable the usage of the high performance timer. If you at any point update SRL, you will have to manually re-apply this again.

justforfun
02-03-2018, 06:13 PM
uhm, this is a tricky one. I am unsure as to why that call would fail, and return zero, I have personally never seen that happen. But if you are on a old or special/weird System, or on an old operating system then that could possibly happen (lacking a high performance timer). I can perhaps add a fix to SRL itself, and actually verify that the call worked (check if it returns True), if not fall back to `GetTickCount`.

But, your personal quickfix, and for others experiencing the exact same error is this:
in that file, you will see the following lines:

{$IFDEF WINDOWS}
function PerformanceTimer(): Double;
var
frequency,count: UInt64;
function QPF(out F: UInt64): LongBool; static; external 'QueryPerformanceFrequency@Kernel32.dll '+{$IFDEF CPU386}'stdcall'{$ELSE}'win64'{$ENDIF};
function QPC(out C: UInt64): LongBool; static; external 'QueryPerformanceCounter@Kernel32.dll '+{$IFDEF CPU386}'stdcall'{$ELSE}'win64'{$ENDIF};
begin
QPF(frequency);
QPC(count);
Result := count / frequency * 1000;
end;
{$ELSE}
function PerformanceTimer(): Double;
begin
Result := GetTickCount();
end;
{$ENDIF}


what I want you to do is to change the following line:
> {$IFDEF WINDOWS}
into
> {$IFDEF MY_WINDOWS_DOESNT_SUCK}
now, save the file. And you should be able to run the script.

This will disable the usage of the high performance timer. If you at any point update SRL, you will have to manually re-apply this again.

Thanks! The pc i have is running windows 7 and has 8Gb ram, an okay nvidia graphics card. Although lately it is running a bit laggy. I have never had any problem in running rs but SMART is a different thing altogether. It lags, graphics get stuck even with chrome running side by side. I have updated java but it still persists. I dont know why.

icyxen
02-15-2018, 05:58 PM
Would be really nice if you could help me make a config for the mining guild iron ores at the bank deposit box, somehow I can't get the walker to work when it's underground.

StickToTheScript
02-15-2018, 11:13 PM
Would be really nice if you could help me make a config for the mining guild iron ores at the bank deposit box, somehow I can't get the walker to work when it's underground.

That would be because the map being used for the script doesn't have that location on it. You would have to change the script to load a new map that happens to have the location.

jsand
02-16-2018, 02:08 AM
Hey Slacky, Getting this error;

The following bitmaps were not freed: [0, Minimap mask, Smart[3684] Image, 3]
Error: Type expected at line 10
Compiling failed.

Couldn't figure out what it meant through forum search, any idea?


edit: Downloaded your folder, now i get this error:
Error: Duplicate declaration "TAntibanTask" at line 51
Compiling failed.

StickToTheScript
02-16-2018, 03:32 PM
Hey Slacky, Getting this error;

The following bitmaps were not freed: [0, Minimap mask, Smart[3684] Image, 3]
Error: Type expected at line 10
Compiling failed.

Couldn't figure out what it meant through forum search, any idea?


edit: Downloaded your folder, now i get this error:
Error: Duplicate declaration "TAntibanTask" at line 51
Compiling failed.

The new error is because the SRL-OSR include has been updated after this release. Slacky had implimented the TAntibanTask into the include, hence the reason you are getting a 'Duplicate Declaration' error. For all those duplication errors you get in this script, just delete the variable/constant/record/function/procedure.

icyxen
02-16-2018, 08:40 PM
That would be because the map being used for the script doesn't have that location on it. You would have to change the script to load a new map that happens to have the location.

Yeah I tried some different stuff yesterday but I found a solution.

Smalfinn
02-22-2018, 01:47 PM
I start the script and it runs for about 5mins then I get:

+---| STATS |----------------------------------------
|- Trips / Drops : 2
|- Ores Mined : 47
|- Experience Gained : -200690
|- Experience Per Hour : -1174114
|- Dismissed Randoms : 0
|- Time Since Break : 10m 38s
|- Energy Level : 85.4613340677577
|- Script Runtime : 10m 15s
+----------------------------------------------------
Terminating: Not close enough to objects: (-63,-77) -> [{X = 160, Y = 164}, {X = 164, Y = 160}]
Successfully executed.
Is this the script or something I've done wrong?

slacky
02-22-2018, 03:14 PM
I start the script and it runs for about 5mins then I get:

+---| STATS |----------------------------------------
|- Trips / Drops : 2
|- Ores Mined : 47
|- Experience Gained : -200690
|- Experience Per Hour : -1174114
|- Dismissed Randoms : 0
|- Time Since Break : 10m 38s
|- Energy Level : 85.4613340677577
|- Script Runtime : 10m 15s
+----------------------------------------------------
Terminating: Not close enough to objects: (-63,-77) -> [{X = 160, Y = 164}, {X = 164, Y = 160}]
Successfully executed.
Is this the script or something I've done wrong?
Where is this?

Given how it crashed, it sounds like an area the bot doesn't like, but then again (-63,-77), makes very little sense. I don't really see how that can happen, so you might wanna try to recreate the config, it could be bad.

Smalfinn
02-22-2018, 03:32 PM
Where is this?

Given how it crashed, it sounds like an area the bot doesn't like, but then again (-63,-77), makes very little sense. I don't really see how that can happen, so you might wanna try to recreate the config, it could be bad.

Its the mine in the lumbridge swamp, 2 copper rocks; I've re-created the config twice, same error.

slacky
02-22-2018, 03:51 PM
Its the mine in the lumbridge swamp, 2 copper rocks; I've re-created the config twice, same error.
Hmm. I am not running into that issue there, perhaps you should try to update RSWalker, there might be a bug in it that I've fixed recently without thinking much of it (just uploaded a release so that it's in sync with my personal one).

I've just had my acc running in lumby swamps for 13 minutes at the first two copper rocks, without any issues.
https://i.imgur.com/gTWKuGw.png

Edit: Here is the config I just created: 28381

Smalfinn
02-22-2018, 04:10 PM
Hmm. I am not running into that issue there, perhaps you should try to update RSWalker, there might be a bug in it that I've fixed recently without thinking much of it (just uploaded a release so that it's in sync with my personal one).

I've just had my acc running in lumby swamps for 13 minutes at the first two copper rocks, without any issues.
https://i.imgur.com/gTWKuGw.png

Edit: Here is the config I just created: 28381

Odd; I was using 1.02 version of RSWalker, I'll update to 1.03 and use your config instead and see how I go thanks!

No good, got this error:

+---| STATS |----------------------------------------
|- Trips / Drops : 0
|- Ores Mined : 12
|- Experience Gained : 204
|- Experience Per Hour : 4318
|- Dismissed Randoms : 0
|- Time Since Break : 03m 05s
|- Energy Level : 91.2302126918155
|- Script Runtime : 02m 50s
+----------------------------------------------------
Terminating: Not close enough to objects: (-36,-96) -> [{X = 164, Y = 164}, {X = 160, Y = 160}]
Successfully executed.

slacky
02-22-2018, 04:26 PM
Odd; I was using 1.02 version of RSWalker, I'll update to 1.03 and use your config instead and see how I go thanks!

No good, got this error:

+---| STATS |----------------------------------------
|- Trips / Drops : 0
|- Ores Mined : 12
|- Experience Gained : 204
|- Experience Per Hour : 4318
|- Dismissed Randoms : 0
|- Time Since Break : 03m 05s
|- Energy Level : 91.2302126918155
|- Script Runtime : 02m 50s
+----------------------------------------------------
Terminating: Not close enough to objects: (-36,-96) -> [{X = 164, Y = 164}, {X = 160, Y = 160}]
Successfully executed.
Humm humm, tricky. Ensure that you are max zoomed out, max brightness ingame. Uhm, I did update the script in the first post to my personal version, but I don't think it would change the issue you face.

A final thingy you could try, which I don't know if will work properly, it's a longshot, is to add a single line of code to the script in the very bottom of it.
First find, which is in the last few lines off the script:

RSW.Init(Bot.ConfigPath+CONFIG_MAP);
AddOnTerminate(@RSW.Free);

In the blank line bellow that you paste in:

RSW.MemScanEnabled := False;

Smalfinn
02-22-2018, 04:36 PM
Humm humm, tricky. Ensure that you are max zoomed out, max brightness ingame. Uhm, I did update the script in the first post to my personal version, but I don't think it would change the issue you face.

A final thingy you could try, which I don't know if will work properly, it's a longshot, is to add a single line of code to the script in the very bottom of it.
First find, which is in the last few lines off the script:

RSW.Init(Bot.ConfigPath+CONFIG_MAP);
AddOnTerminate(@RSW.Free);

In the blank line bellow that you paste in:

RSW.MemScanEnabled := False;


Updated to V28 and added RSW.MemScanEnabled := False;

Will report back soon.

Nope, same old story:

+---| STATS |----------------------------------------
|- Trips / Drops : 2
|- Ores Mined : 31
|- Experience Gained : 527
|- Experience Per Hour : 5988
|- Dismissed Randoms : 0
|- Time Since Break : 06m 17s
|- Energy Level : 88.372338603645
|- Script Runtime : 05m 16s
+----------------------------------------------------
Terminating: Not close enough to objects: (35,29) -> [{X = 164, Y = 164}, {X = 160, Y = 160}]
Successfully executed.

slacky
02-22-2018, 05:34 PM
Updated to V28 and added RSW.MemScanEnabled := False;

Will report back soon.

Nope, same old story:

+---| STATS |----------------------------------------
|- Trips / Drops : 2
|- Ores Mined : 31
|- Experience Gained : 527
|- Experience Per Hour : 5988
|- Dismissed Randoms : 0
|- Time Since Break : 06m 17s
|- Energy Level : 88.372338603645
|- Script Runtime : 05m 16s
+----------------------------------------------------
Terminating: Not close enough to objects: (35,29) -> [{X = 164, Y = 164}, {X = 160, Y = 160}]
Successfully executed.

Very very peculiar, well, since it seems to be an occational thingy, I have adjusted the bot to allow it to fail there a few times, and try to counter it first by waiting a little, if that doesn't work, then by turning the compass after a couple of failures, and again later after a few more failures, and if the error continues, it will log out and log in again (with a 1-30 sec break between). If it still continues to fail, it will error as before.
So just update your bot to v29.

Smalfinn
02-22-2018, 06:18 PM
Very very peculiar, well, since it seems to be an occational thingy, I have adjusted the bot to allow it to fail there a few times, and try to counter it first by waiting a little, if that doesn't work, then by turning the compass after a couple of failures, and again later after a few more failures, and if the error continues, it will log out and log in again (with a 1-30 sec break between). If it still continues to fail, it will error as before.
So just update your bot to v29.

Okay I'll give that a go!

Just a small note, the first time I loaded the script it changed the camera angle, it doesnt do that anymore?

slacky
02-22-2018, 09:26 PM
Okay I'll give that a go!

Just a small note, the first time I loaded the script it changed the camera angle, it doesnt do that anymore?
It only forces the angle to north if you are running a setup, otherwise the config would be off.

Note
03-07-2018, 01:37 AM
{$I SRL/utils/slackdebug.simba}

Any idea where i can download this? I'm using the pre installed simba download thats in the OP.

Yes i have manually tried updating the srl no luck.

Cheers Don't worry im a knob:duh:

P.s

I would like to run the script via osb however i get this error for compiling

Variable "RSWUtils" not used at line 2, column 25 in file "C:\Simba\Includes\RSWalker\Utilities.pas"
Error: Unknown declaration "GotLevelUp" at line 613
Compiling failed.

slacky
03-07-2018, 04:51 AM
I would like to run the script via osb however i get this error for compiling

Variable "RSWUtils" not used at line 2, column 25 in file "C:\Simba\Includes\RSWalker\Utilities.pas"
Error: Unknown declaration "GotLevelUp" at line 613
Compiling failed.
Sounds like the version for none-smart isn't compatible with that SRL version I shipped with it. Meh. Not much to do with that.

I really do recommend that people DON'T use the preinstalled pack in OP, it doesn't contain the latest bot, nor the latest SRL and RSWalker. And it will not be updated.
Figure out how to setup it all, a bunch of people seem to manage it afaict, so there should not be any issues.
The latest, released none-smart version of this script is found in the github link posted in OP.

justforfun
03-13-2018, 09:49 PM
Hey, i manually updated te rswalker and SRL. updated no smart version of script from your git hub. It has a windowsoverlay include. Where to get that from?

Edit: nevermind, got from here. https://github.com/Olly-/libWindowOverlay/releases

wit1
03-15-2018, 02:18 AM
Working as intended, thanks a ton man!

sjhale
03-23-2018, 10:39 PM
Unknown declaration "Self" at line 38
I'm getting this error what am i doing wrong?

Shout
03-23-2018, 10:59 PM
Unknown declaration "Self" at line 38
I'm getting this error what am i doing wrong?

Probably not following the instructions on setting it up

sjhale
03-23-2018, 11:59 PM
Probably not following the instructions on setting it up

ConvertTime64(GetTickCount() - Self.StartTime, Year, Month, Week, Day, Hour, Minute, Second);

i looked over and checked all folder versions and requirements idk whats wrong with it all my other scripts work just fine.

StickToTheScript
03-24-2018, 05:12 AM
ConvertTime64(GetTickCount() - Self.StartTime, Year, Month, Week, Day, Hour, Minute, Second);

i looked over and checked all folder versions and requirements idk whats wrong with it all my other scripts work just fine.

I think you may be using the improper version of Simba. You'll want to use version 1.2 or higher.

TheRedGlow
03-29-2018, 04:51 PM
Great script, thanks!

Walking hell
03-31-2018, 07:44 AM
it works good so far 25min and going strong :spot:

edit:

+---| STATS |----------------------------------------
|- Trips / Drops : 12
|- Ores Mined : 328
|- Experience Gained : 5904
|- Experience Per Hour : 3687
|- Dismissed Randoms : 0
|- Time Since Break : 45m 17s
|- Energy Level : 86.9931105048083
|- Script Runtime : 01h 36m 04s
+----------------------------------------------------

so far so good.

evasiv
04-03-2018, 04:17 PM
Got 61-68 mining on iron ores with this, averaged 45k xp/h. Thanks for sharing

ghost619
04-04-2018, 11:04 PM
Getting this error. any help?
Error: Unknown declaration "Smart" at line 332
Compiling failed.
Error: Unknown declaration "smart" at line 715
Compiling failed.


I'm trying to use it with the osrs client so i commented out smart and smartdebug but getting above error

edit2 - tried using it through smart but script crashed with following error:
Error: Division by zero at line 311
Execution failed.
The following bitmaps were not freed: [0, Minimap mask, Smart[24928] Image]

Grendal
04-15-2018, 09:59 AM
Few errors when running for 20mins+
The following bitmaps were not freed: [0, Minimap mask, Smart[4752] Image]
and
Error: Out of memory
Compiling failed.

slacky
04-16-2018, 08:29 AM
Few errors when running for 20mins+
The following bitmaps were not freed: [0, Minimap mask, Smart[4752] Image]
and
Error: Out of memory
Compiling failed.
Out of memory (at least when it's that fast) may indicate that you are not using my build of Simba 1.2 as recommended in the first post.. But instead the official build (which many tend to recommend).
The official Simba 1.2Rc6 build will for sure cause such a problem.

Grendal
04-16-2018, 08:40 AM
No i'm using 1.2 rc6 changed it to 'simba' and left the other 1.1 as a different name, RW 1.05 (also tried release 1.1 but found 1.05 or 1.04 more stable), and could only get around 4 trips before it shows up as an error message like above. I have tested this in long distances to the bank.

slacky
04-16-2018, 09:10 AM
No i'm using 1.2 rc6 changed it to 'simba' and left the other 1.1 as a different name, RW 1.05 (also tried release 1.1 but found 1.05 or 1.04 more stable), and could only get around 4 trips before it shows up as an error message like above. I have tested this in long distances to the bank.
There exists more than 1 version of Simba 1.2 rc6, my version has some fixes to prevent the problem you describe hence the name `1.2 RC6 - fixes`.. If you are using a Simba 1.2 rc6 that's NOT the one linked to in the first post / in my signature then you will without a doubt have Simba run out of memory quite quickly.

And I was saying people tend to recommend the version a Simba 1.2rc6 that lacks the fixes my version has, which can be problematic.

Grendal
04-16-2018, 09:29 AM
There exists more than 1 version of Simba 1.2 rc6, my version has some fixes to prevent the problem you describe hence the name `1.2 RC6 - fixes`.. If you are using a Simba 1.2 rc6 that's NOT the one linked to in the first post / in my signature then you will without a doubt have Simba run out of memory quite quickly.

And I was saying people tend to recommend the version a Simba 1.2rc6 that lacks the fixes my version has, which can be problematic.

Thanks for your quick replies and will test this one then, think it might of been that. Also your runecrafter is having problems as well with your '1.2 rc6 fixes' other than that, great work!

Aspect
04-18-2018, 04:15 AM
Using a clean isntall after following your setup guide
https://villavu.com/forum/showthread.php?t=118211
I'm getting a
"Error: Unknown declaration "w_GetArea" at line 98"
If I comment this line out, it runs and complies successfully.

*Update, after checking the updated released on the guthub page, this one seems to compile fine.
However off topic, I'm having issues with SMART.

It spawns to a grey screen with the controls and does nothing.
I have java 32 Bit Versions jre7, and jre 1.8.0
64 bit :jre10.0.1

Whenever I spawn a client, it makes a file in the Simba folder with the current SMART ID number as the name and extension.
I get a message within Simba that reads
"[FATAL]: Timed out waiting for client. Make sure OSRS is setup correctly"


The debug window shows:

SMART: Located 0 clients
SMART: Located 0 clients
SMART: Setting the client's controller to our TID
SMART: Attempting to connect to localhost:51667
Current Simba version: 1206
Latest Simba Version: 1100
Loading plugin libsmartremote32 at C:\Simba\Plugins\
Plugin libsmartremote32 already loaded: 0
SMART: EIOS Requesting Target
SMART: Client possibly paired to us
SMART: Already paired: Incrementing refcount
SMART: Target Identifier: 0xf557190
SMART: EIOS requested image buffer
SMART: Base: 0x132a0000 Off: 4124

If I run the script below, the script is executed and nothing at all happens:
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}

begin
end.

Edited environmental variables and restarted PC and got the same result.
Oldscool Runescape is installed on My PC and running correctly.
28436

slacky
04-18-2018, 04:27 AM
Ye, wasn't updated for latest RSWalker. Should work now.

Aspect
04-18-2018, 05:00 AM
Any idea on what might be causing my SMART issue?

slacky
04-18-2018, 08:20 AM
Any idea on what might be causing my SMART issue?
Seems like you have an outdated SMART version. Try override update, then update plugins from Simba 1.1 again. You want SMART 8.5+
If you continue to have troubles then you can get the plugins and extensions easily from https://github.com/SRL/SRL-Plugins

Tho currently things seems.. shits having issues
https://i.imgur.com/Y9VH3WQ.png

Edit: Updated SRL to reflect some changes RS has made - needed to spawn smart.

Aspect
04-18-2018, 12:02 PM
working fine after updating plugins with 1.1, then switching back.

Grendal
04-20-2018, 09:21 AM
Are you planning on adding any worldhops for higher leveled ores?

slacky
04-20-2018, 12:49 PM
Are you planning on adding any worldhops for higher leveled ores?
nope. Nothing more is planned for this script.

Grendal
04-30-2018, 08:22 AM
Just hit a ban with this when banking. I don't know if someone reported but yeah. (Varrock)

JSmooth
04-30-2018, 06:03 PM
Just hit a ban with this when banking. I don't know if someone reported but yeah. (Varrock)

F2p/p2p? lvl 3 with no other skills or combat, other skills, etc?

Hellzonee
04-30-2018, 07:42 PM
Does this still work?

Grendal
04-30-2018, 09:04 PM
F2p/p2p? lvl 3 with no other skills or combat, other skills, etc?

F2P, level 50 and trained other skills and quested was also in total.

slacky
04-30-2018, 10:08 PM
F2P, level 50 and trained other skills and quested was also in total.
Popular spot for both humans and bots, which makes it a extra risky place to bot, specially if you bot rocks that pisses of people (guaranteed a lot of reports then).
Also referring you to this old heatmap of bots banned: http://i.imgur.com/Z1GokFE.png

Grendal
05-01-2018, 01:49 AM
"specially if you bot rocks that pisses of people (guaranteed a lot of reports then)".
Perhaps, i should look at that heatmap again. I banked in other spots fine just avoid this spot.

JSmooth
05-01-2018, 06:14 AM
F2P, level 50 and trained other skills and quested was also in total.

Surprising. I would have assumed total would help a lot. The problem I see with the heat map is that the only way avoiding the high traffic areas would help is if jagex specifically has some sort of extra bot checks for these areas. Otherwise, it's more correlation and not causation. Yes, most bots go to catherby, varrock mines, etc., ergo the most bots get banned there.

slacky
05-03-2018, 06:28 AM
Surprising. I would have assumed total would help a lot. The problem I see with the heat map is that the only way avoiding the high traffic areas would help is if jagex specifically has some sort of extra bot checks for these areas. Otherwise, it's more correlation and not causation. Yes, most bots go to catherby, varrock mines, etc., ergo the most bots get banned there.
Where there are people there will most definitely be reports right, I'd claim without having any actual research on it (only a small number of observations), that if your bot doesn't interfere too much with humans activities it will last longer, as there will most definitely be less (unique) reports, so it will normally take longer for the bot to be picked up on by the system.

So yeah, I'd say Jagex has «some sort of extra bot checks for these areas», it's their report system, that will be nature have that effect.

My general suggestion is to not interfere with player activities more than necessary, rather run your bot at sub-optimal spots.

Hellzonee
05-05-2018, 02:28 AM
hey slacky I was wondering if you could give tips on what this bot could be useful for? Some of these guys getting busted for banking but I just want to level my mining so dropping is an option for me. Have you gotten to 99 with this?

slacky
05-05-2018, 02:44 AM
hey slacky I was wondering if you could give tips on what this bot could be useful for? Some of these guys getting busted for banking but I just want to level my mining so dropping is an option for me. Have you gotten to 99 with this?
I have never gotten 99 with it, don't think i could either. Would at least have to be doing other shit as well on the account, not just mining. I've gotten around 80 (f2p) with fairly fresh accounts without doing any other shit, with a mix of power mining and banking.

Hellzonee
05-05-2018, 02:53 AM
I have never gotten 99 with it, don't think i could either. Would at least have to be doing other shit as well on the account, not just mining. I've gotten around 80 (f2p) with fairly fresh accounts without doing any other shit, with a mix of power mining and banking.

Interesting, and thanks for the quick response. I currently have a p2p account with plenty of quests and other skills trained so I feel a bit more confident with this.

gothguydante
05-07-2018, 06:10 PM
worked great only stopped cause pc went into hibernate

+---| STATS |----------------------------------------
|- Trips / Drops : 70
|- Ores Mined : 1963
|- Experience Gained : 33371
|- Experience Per Hour : 3513
|- Dismissed Randoms : 0
|- Time Since Break : 19m 22s
|- Energy Level : 84.419791807416
|- Script Runtime : 09h 30m 37s

randy marsh
05-07-2018, 10:20 PM
Hmm for some reason it repated clicks on ore when mining looks rather bottish!

slacky
05-07-2018, 10:30 PM
Hmm for some reason it repated clicks on ore when mining looks rather bottish!
I am unable to properly follow what you are saying. But if it doesn't look anything like the demo / video then I suggest you try to setup a new bot:
1) Be sure to not click for colors on a rock that is depleted, that will obviously go horribly bad.
2) Select rocks properly, don't miss, it should cover that rock perfectly, and preferably not cover other rocks, it gotta be positioned WELL.
3) Keep trying to set it up a few times, it will work when done right, try another location see if it keeps happening then.

If all else fails (it should not), go to the includes folder, find the Universal_miner folder, and upload your flawed config here so that I can look at it. I will not look at it before at best tomorrow.

PS: Make sure you are fully zoomed out and all.

/bed time

randy marsh
05-07-2018, 11:40 PM
ty i got it working

nixter243
05-10-2018, 10:59 PM
I cant seem to click on the smart window to click yes. Any idea how to fix so I can click on run setup?

JSmooth
05-11-2018, 08:52 AM
I cant seem to click on the smart window to click yes. Any idea how to fix so I can click on run setup?

On the bottom left is a button to enable or disable clicking on the SMART screen, if thats what you mean?

slacky
05-11-2018, 12:33 PM
I cant seem to click on the smart window to click yes. Any idea how to fix so I can click on run setup?
Updated the script, I just added a fix that may solve such issues.

If it doesn't, there's a fallback which simply means if that happens, you stop the script once logged in, you manually target SMART (client area) with simba, and start the script again.. at which point you should be able to click the buttons.

randy marsh
05-15-2018, 12:54 PM
If i wanted to use this without smart would that be possible?

slacky
05-16-2018, 04:40 AM
If i wanted to use this without smart would that be possible?
There's an experimental, undocumented, version of this that doesn't use smart on my Github, it relies on you already having configs created. You will get no help with that version what so ever, and it's internally different in a few ways. You will have to look for it yourself.

shiftlid
05-16-2018, 06:14 AM
Had it running for a few hours, no errors for me.

momotron
05-31-2018, 03:23 PM
How would I go about using it without smart? The usual way is bringing up errors.

JSmooth
05-31-2018, 07:09 PM
How would I go about using it without smart? The usual way is bringing up errors.

He literally answered that 2 posts before you...


There's an experimental, undocumented, version of this that doesn't use smart on my Github, it relies on you already having configs created. You will get no help with that version what so ever, and it's internally different in a few ways. You will have to look for it yourself.

momotron
05-31-2018, 09:07 PM
He literally answered that 2 posts before you...

Oh my bad, that's a nooby mistake, my bad. I'll get on it, although I swear I went through the posts looking for an answer before asking? Maybe that was a different thread or I just missed it, either way, thanks.

kyle12308
05-31-2018, 09:35 PM
Oh my bad, that's a nooby mistake, my bad. I'll get on it, although I swear I went through the posts looking for an answer before asking? Maybe that was a different thread or I just missed it, either way, thanks.

You are forgiven. Don't let it happen again. /s

xWolfe
07-12-2018, 09:36 PM
Im having trouble running the bot today after the update happened

Getting this error message:

Error: Unknown declaration "ExpandFunc" at line 729

can anyone help??

slacky
07-12-2018, 10:58 PM
Im having trouble running the bot today after the update happened

Getting this error message:

Error: Unknown declaration "ExpandFunc" at line 729

can anyone help??
Get an older version of SRL (eg 1.6.3), 2+ is not fully backwards compatible with version 1+

Mullet Dude
07-15-2018, 06:38 PM
Hey Slacky, script looks amazing! I unfortunately am getting an error trying to run it.

Error: Unknown declaration "ExpandFunc" at line 729

Any idea as to what is going on?

slacky
07-15-2018, 09:24 PM
Hey Slacky, script looks amazing! I unfortunately am getting an error trying to run it.

Error: Unknown declaration "ExpandFunc" at line 729

Any idea as to what is going on?
What could it be.. I wonder... hum hum. I guess scrolling up 1 post above your own wasn't an option, so i'll just lay it down, again..:


https://image.prntscr.com/image/CdOBW90vS8Gn-_LHNJisxw.png


https://i.imgur.com/nBmcgmR.png


https://image.prntscr.com/image/1bHYUcZvQDK7GmLWP3g_ow.png

Walking hell
09-08-2018, 06:52 PM
Updated the script, I just added a fix that may solve such issues.

If it doesn't, there's a fallback which simply means if that happens, you stop the script once logged in, you manually target SMART (client area) with simba, and start the script again.. at which point you should be able to click the buttons.

once it worked, and i try again i dint use for a week or so and try again and i got this issue to with the latest script version, also i noticed it doesnt show my mouse in debug, that might be the issue

justforfun
09-15-2018, 12:52 PM
Hey slacky! I have downloaded your files and downloaded the plugins and everything. The Script is compiling now but it is giving error

Error: Access violation at line 209
Execution failed.
The following bitmaps were not freed: [0, Minimap mask]

In the drawing.simba file. I do not know how to fix this.

Last time when i was able to run your script was earlier this year when you shared a folder of simba which i downloaded and it worked. Hope you can help me this time too, thanks!

Pntbllfrk
10-13-2018, 07:40 PM
Thanks for the script, after downgrading my SRL/RSWalker it works great.

sharklasers
10-15-2018, 11:24 PM
workin' fine. Thanks

sharklasers
10-16-2018, 11:13 AM
Hey slacky! I have downloaded your files and downloaded the plugins and everything. The Script is compiling now but it is giving error

Error: Access violation at line 209
Execution failed.
The following bitmaps were not freed: [0, Minimap mask]

In the drawing.simba file. I do not know how to fix this.

Last time when i was able to run your script was earlier this year when you shared a folder of simba which i downloaded and it worked. Hope you can help me this time too, thanks!

I have this error too. What u wanna do is start SMART through another script, then start the mining script. Idk what causes this problem or how to actually fix it, instead of putting a bandaid on it

potatoer
10-27-2018, 04:43 AM
There's an experimental, undocumented, version of this that doesn't use smart on my Github, it relies on you already having configs created. You will get no help with that version what so ever, and it's internally different in a few ways. You will have to look for it yourself.

I know i shouldn't even ask but is it possible to create a config without the simba client?:kiss:

27Ronin
10-27-2018, 06:20 PM
Hey, I got everything setup properly following the varrock east mine video, but the RSWalker pathing fails to take me back to the mine for some reason.

Edit: Tried mining without banking and the bot doesn't choose a new rock to mine unless i manually rotate the screen for some reason, I also eventually received this: "Error: Index out of range (index:4, low:0, high:3) at line 491".

boscolamhk
11-03-2018, 04:06 AM
when I click run, the following error happens:

Error: Unknown declaration "ExpandFunc" at line 730

and the line of script with error:

Result.Bounds := GetTPABounds(Result.TextTPA).ExpandFunc(8);

Any ideas on how to fix it? I just have Simba newly setup and can run SMART successfully.

Pntbllfrk
11-03-2018, 03:59 PM
when I click run, the following error happens:

Error: Unknown declaration "ExpandFunc" at line 730

and the line of script with error:

Result.Bounds := GetTPABounds(Result.TextTPA).ExpandFunc(8);

Any ideas on how to fix it? I just have Simba newly setup and can run SMART successfully.



https://villavu.com/forum/showthread.php?t=117996&p=1392774#post1392774

anth_
11-05-2018, 04:42 PM
If WinAPI makes my job easier, I will use the WinAPI.

Just to clarify, does WinAPI work on UNIX?

I'm on OpenBSD at the moment and was going to give a crack at compiling Simba/SMART - Cross-platform stuff is nice! ;-)

robotman247
11-05-2018, 09:02 PM
Hi slacky im currently trying to learn how to write scripts for RSPS
is it possible to edit this for rsps use?
thanks in advance!

teraflux
11-20-2018, 11:36 PM
Works Great! The only thing I'd say for those having trouble with it, is make sure you're using an SRL version that is less than 2.00 and greater than 1.00, I'm using this one: https://github.com/SRL/SRL/releases/tag/1.6.3

Riumi
12-05-2018, 07:03 PM
Hey, I got everything setup properly following the varrock east mine video, but the RSWalker pathing fails to take me back to the mine for some reason.

Edit: Tried mining without banking and the bot doesn't choose a new rock to mine unless i manually rotate the screen for some reason, I also eventually received this: "Error: Index out of range (index:4, low:0, high:3) at line 491".

I also encountered this problem when powermining in varrock east mine, the bot doesnt choose a new rock for some reason.

abonil1
12-09-2018, 01:53 AM
Hello,

I can't seem to press yes during the setup component. Some help would be much appreciated!

Sorry quite new to this Simba thing.

The Moose
12-09-2018, 02:11 AM
I'm having the same issue. He mentioned in a previous reply to try stopping the script, then restarting and manually selecting the SMART client using simba. I haven't been able to get that to work either, but might be worth a try.

Edit: I was able to click the buttons, but not reliably setup the script using them. It looks like after selecting the client, everything has an unknown x and y offset, so randomly clicking I could get the buttons to react, but not reliably enough to do anything

abonil1
12-09-2018, 02:55 AM
Yeah I tried Slacky's suggested solution but it doesn't seem to work for me

Edit:
Managed to click "yes" to setup (although i had to click on "no" to select "yes - so essentially off-centered) but as The Moose mentioned, the x and y is not accurate and I was unable to select any rocks.

superfonz
12-11-2018, 01:59 AM
I was able to press yes and click the rocks but the script probably cant find it at the rocks at the location soo idk what to do, i looked at the script and cant find the coordinates.

BotBoy
12-11-2018, 06:47 PM
I was able to press yes and click the rocks but the script probably cant find it at the rocks at the location soo idk what to do, i looked at the script and cant find the coordinates.

I've been running without too many issues, but I have been using the powerminer option, and I have found it works best in a 3up rock spot, rather than a 2. Also, make sure you select more than one color for the rocks you are trying to mine. I have found using the windows magnify tool helps for accurately picking colors.
When I used the banking option, the script failed to find the banker and logged out. When I checked it later that day, that account had been locked.

Overall this is an amazing script!

superfonz
01-05-2019, 12:48 AM
I've been running without too many issues, but I have been using the powerminer option, and I have found it works best in a 3up rock spot, rather than a 2. Also, make sure you select more than one color for the rocks you are trying to mine. I have found using the windows magnify tool helps for accurately picking colors.
When I used the banking option, the script failed to find the banker and logged out. When I checked it later that day, that account had been locked.

Overall this is an amazing script!

I just ended up making my own script lol

ownagelouis
01-06-2019, 07:39 PM
powerminer version works awesome!!

jst94
01-09-2019, 09:54 PM
Works great with powermining iron ores!

Note
01-31-2019, 09:31 AM
+---| STATS |----------------------------------------
|- Trips / Drops : 22
|- Ores Mined : 556
|- Experience Gained : 19460
|- Experience Per Hour : 21688
|- Dismissed Randoms : 0
|- Time Since Break : 55m 42s
|- Energy Level : 86.5459761185638
|- Script Runtime : 53m 50s
+----------------------------------------------------
Successfully executed.


:) Works great simple 2min setup, It says time since break? but i don't see a break manager or am i blind

Pythius
02-27-2019, 06:53 AM
+---| STATS |----------------------------------------
|- Trips / Drops : 70
|- Ores Mined : 1803
|- Experience Gained : 32454
|- Experience Per Hour : 4309
|- Dismissed Randoms : 0
|- Time Since Break : 43m 29s
|- Energy Level : 59.475103636812
|- Script Runtime : 07h 31m 56s
+----------------------------------------------------
[19:26:58][RND] Losing focus



+---| STATS |----------------------------------------
|- Trips / Drops : 39
|- Ores Mined : 1084
|- Experience Gained : 19512
|- Experience Per Hour : 6711
|- Dismissed Randoms : 0
|- Time Since Break : 06m 55s
|- Energy Level : 52.7835441732776
|- Script Runtime : 02h 54m 26s
+----------------------------------------------------
[14:47:46][BREAK] Pausing for 41 Minutes and 7 Seconds
[14:53:17][BREAK] 36 Minutes and 7 Seconds left



+---| STATS |----------------------------------------
|- Trips / Drops : 55
|- Ores Mined : 1461
|- Experience Gained : 51135
|- Experience Per Hour : 9938
|- Dismissed Randoms : 0
|- Time Since Break : 05h 08m 51s
|- Energy Level : 21.1330828257112
|- Script Runtime : 05h 08m 42s
+----------------------------------------------------

Easy to set up. Working like a charm.

ghost619
04-20-2019, 02:22 AM
having a problem with this script misclicking and ending up on other side of fence then running back to mine rocks.

rx_tom
06-14-2019, 11:05 PM
Anyone getting an ExpandFunc error during compile?

Mr Moan
08-26-2019, 03:44 AM
Anyone getting an ExpandFunc error during compile?

you arent using the right version of SRL.

Mr Moan
08-27-2019, 05:33 PM
for those interested
i converted Slacky's Universal Miner Script to Simba 1.3 with the latest SLR/RSWalker.
You can find a copy here: https://github.com/BrettMoan/Simba-Misc/blob/master/Universal_Miner.simba

Any feedback would be appreciated as to any issue you find with-it. I refrained from trying to add additional functionality (such as running away & banking when attacked), but did try to fix the wait behavior inside ClickRock()

KillaKev
09-07-2019, 12:04 AM
for those interested
i converted Slacky's Universal Miner Script to Simba 1.3 with the latest SLR/RSWalker.
You can find a copy here: https://github.com/BrettMoan/Simba-Misc/blob/master/Universal_Miner.simba

Any feedback would be appreciated as to any issue you find with-it. I refrained from trying to add additional functionality (such as running away & banking when attacked), but did try to fix the wait behavior inside ClickRock()

I tried it out with the latest SRL but I am unable to click any of the options in the setup boxes. it works fine with Slackys script and a older version of SRL.

Edit: Scatch that, the mistake was on my end. So far it runs perfectly with Simba 1.3 and the latest SRL. I'll let you know how it goes.

alimb2
02-19-2020, 10:19 PM
working great, thanks!

gothguydante
05-27-2020, 11:35 AM
i have it compiling but i'm not getting anything to happen other then smart window open no pop ups nothing

whoisspacecheetah
06-02-2020, 04:06 AM
i have it compiling but i'm not getting anything to happen other then smart window open no pop ups nothing

try using with runelite or Vanilla client instead of smart

madnessguy
09-08-2020, 11:08 PM
unfortunately i've got banned using it at lvl 57.