PDA

View Full Version : [Help] Invalid number of parameters at line 292



Metroidprim1
03-06-2013, 02:56 AM
Hey all,

So I just discovered Simba and am extremely new when it comes to anything involved with code. Anyway, I've attempted to follow YoHoJoSRL's videos and, from what I can tell, followed them correctly (bot attempted to log in when used given script). BUT, now I am getting an error that says: [Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(293:131): Invalid number of parameters at line 292. All I used was the code given during the tutorial
Program testP07;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I P07Include.Simba}

//LOGIN INFO STUFF
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='username';
P07_PlayerPass:='password';
End;

Begin
SetupSRL();
P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
Wait(2000);
If (Not P07_LoggedIn) Then
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;

Writeln(P07_GetUpText);

If P07_BankScreen Then
WriteLn('Bank is Open');
If P07_InvFull Then
WriteLn('Inventory is Full');

End.

and even then it happened.
Any and all help would be great, i'd really like to get back into botting.


EDIT: This is also what my SmartParams looks like whenever it pops up...


(*
Smart Params
============

.. contents::

*)

{$DEFINE SRL_SMART}
{$DEFINE SMART}
{$loadlib libsmartremote}

(*
GetSmartParams
~~~~~~~~~~~~~~

.. code-block:: pascal

function GetSmartParams: TStringArray;

Grabs The Correct Parameters For passing to the SmartClient.

.. note::

By: Brandon.
Modified By: Mormanman, Benland100.

Example:

.. code-block:: pascal

*)
function GetSmartParams: TStringArray;
var
Params: TStringArray;
Page: String;
begin
Page := 'http://oldschool33.runescape.com/,j1';
Params := Explode(',', Page);
Result := Params;
end;

(*
FixSmartSpeed
~~~~~~~~~~~~~

.. code-block:: pascal

procedure FixSmartSpeed;

Fixes Smart's Loading Speed.
Moves the Mouse & Adjusting the Canvas Refresh rate.

.. note::

By: Brandon.

Example:

.. code-block:: pascal

*)
procedure FixSmartSpeed;
var
T: Integer;
begin
T:= GetSystemTime + 2000;
While (Not SmartEnabled) Do
begin
if (GetSystemTime >= T) Then
Break;
Wait(500);
end;

While (GetColor(382, 252) = 0) Do
begin
If RSReady then
Break;
SmartSetRefresh(SmartGetRefresh + 1);
MMouse(4, 4, 0, 0);
SmartSetRefresh(SmartGetRefresh - 1);
if (GetSystemTime >= T) Then
Break;
Wait(500);
end;
end;

(*
SmartGetClientIDs
~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function SmartGetClientIDs: TIntegerArray;

Grabs All Client ID's of the current remote.

.. note::

By: Mormanman.

Example:

.. code-block:: pascal

*)
function SmartGetClientIDs: TIntegerArray;
var
I, Count: Integer;
begin
Count := SmartGetClients(True);
SetLength(Result, Count);
If (Count > 0) then
For I:= 0 to (Count - 1) do
Result[I] := SmartClientID(I);
end;

(*
SmartKillClients
~~~~~~~~~~~~~~~~

.. code-block:: pascal

procedure SmartKillClients;

Kills all Smart clients.

.. note::

By: Mormanman.

Example:

.. code-block:: pascal

*)
procedure SmartKillClients;
var
IDs: TIntegerArray;
I: Integer;
begin
IDs := SmartGetClientIDs;
For I := High(IDs) DownTo 0 Do
If SmartKillClient(IDs[I]) Then
Writeln('Killed Client: ' + ToStr(IDs[I]))
else
Writeln('Failed To Kill Client: ' + ToStr(IDs[I]));
end;

(*
SixHourFix
~~~~~~~~~~

.. code-block:: pascal

procedure SixHourFix;

Kills The Current Smart Client and Restarts it.
Fixes the 6 hour login.

.. note::

By: Brandon.

Example:

.. code-block:: pascal

*)
procedure FreeSRL; Forward;
procedure SetupSRL; Forward;
procedure SixHourFix;
var
Trash: TVariantArray;
Refresh: Integer;
begin
FreeSRL;
Refresh := SmartGetRefresh;
SmartKillClient(SmartCurrentClient);
SetupSRL;

try
CallProc('SMART_FreeDebug', Trash);
CallProc('SMART_SetupDebug', Trash);
except
end;

SmartSetRefresh(Refresh);

try
if (not LoginPlayer) then
srl_Warn('SixHourFix', 'Could not log in player', warn_Terminate);
except
srl_Warn('SixHourFix', 'Players not declared', warn_Terminate);
end;
end;


(*
PairSmart
~~~~~~~~~

.. code-block:: pascal

function PairSmart(ID: Integer): Boolean;

Pairs A Client To The Current Controller.

.. note::

By: Benland100, Brandon.

Example:

.. code-block:: pascal

*)
function PairSmart(ID: Integer): Boolean;
var
I, Count: Integer;
IDs: TIntegerArray;
begin
IDs := SmartGetClientIDs;
Count := Length(IDs);
If (Count > 0) then
For I:= 0 To (Count - 1) Do
If (IDs[I] = ID) and SmartPairClient(ID) then
begin
SetEIOSTarget('libsmartremote', ToStr(ID));
Writeln('Paired with SMART[' + ToStr(ID) + ']');
Result := True;
Exit;
end;
Writeln('** Failed To Pair Client: ' + ToStr(ID) + '; Client Does Not exist **');
end;

(*
InitSmart
~~~~~~~~~

.. code-block:: pascal

function InitSmart(ForceNew: Boolean): Integer;

Initializes A Smart Remote Client.
Terminates the current script upon failure.
Terminates all clients of the current remote upon failure.
ForceNew Creates a new client.

.. note::

By: Benland100, Mormanman, Brandon.

Example:

.. code-block:: pascal

*)
function InitSmart(ForceNew: Boolean): Integer;
var
I, Count: Integer;
IDs: TIntegerArray;
Params: TStringArray;
begin
If (Not ForceNew) then
begin
Ids := SmartGetClientIDs;
Count := Length(IDs);
If (Count > 0) then
For I:= 0 To (Count - 1) Do
begin
If SmartPairClient(IDs[I]) then
begin
Result := IDs[I];
SetEIOSTarget('libsmartremote', ToStr(Result));
Writeln('Paired with SMART[' + ToStr(Result) + ']');
Exit;
end;
end;
end;

Params := GetSmartParams;
If (Length(Params) <> 2) then
begin
Writeln('** Failed To Grab Smart Parameters **');
Writeln('** Please check your internet connection/firewall **');
TerminateScript;
Exit;
end;

{$IFDEF SMART8}
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 503, 's', '', '');
{$ELSE}
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 503, 's', '', '', -1);
{$ENDIF}

If (Result > 0) Then
begin
try
SetEIOSTarget('libsmartremote', ToStr(Result));
Writeln('Loading SMART: ' + Params[0] + Params[1]);
except
WriteLn('** Fatal Error: Pairing Clients; Terminating Script **');
TerminateScript;
end;
end else
begin
Writeln('** Smart Cannot Spawn Clients **');
TerminateScript;
end;
end;

(*
SetupSmart
~~~~~~~~~~

.. code-block:: pascal

procedure SetupSmart(ForceNewClient: Boolean);

Sets Up a new Smart Client and waits until it's on screen.
Terminates The current script upon failure.

.. note::

By: Mormanman.
Modified By: Brandon.

Example:

.. code-block:: pascal

*)
procedure SetupSmart(ForceNewClient: Boolean);
var
T: Integer;
begin
T:= GetSystemTime + 120000;
Smart_CurrentClient:= InitSmart(ForceNewClient);
if (Smart_CurrentClient <= 0) then
begin
writeln('*** Smart Failed To Load ***');
TerminateScript;
end;

if (SRL_SixHourFix) then
SRL_Procs[SRL_OnRSUpdate]:= @SixHourFix;

While (GetColor(382, 252) <> 0) Do
begin
if RSReady then
break;

Wait(100);
if (GetTimeRunning >= 120000) then
begin
Writeln('*** Failed To Detect Clients ***');
TerminateScript;
end;
end;
end;





{* Functions Below Here are From the Original Smart.Simba *}


{*
By: Unknown Author.
Finds a Windows by partial title and Sets it as the target.
*}
function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
if Pos(TitlePrefix, T[I].Title) <> 0 then
begin
Result := True;
if SetAsTarget then SetTarget(T[I]);
Exit;
end;
end;

{*
By: Unknown Author.
Gets the position of the actual mouse (Not Smart's Mouse).
*}
procedure GetRealMousePos(var X, Y : Integer);
var
KMTarget, ITarget: Integer;
begin
{$IFDEF LAPE}
writeln('GetRealMousePos not implemented yet in SRL-5 Lape!');
TerminateScript;
{$ELSE}
KMTarget := GetKeyMouseTarget;
ITarget := GetImageTarget;
FindAndSetTarget('SMART', True);
GetTClient.IOManager.GetMousePos(X, Y);
FreeTarget(GetImageTarget);
SetKeyMouseTarget(KMTarget);
SetImageTarget(ITarget);

// These are not universial offsets, but works somewhat for some Windows themes.
X := X - 8;
Y := Y - 25;
{$ENDIF}
end;

{*
By: Unknown Author.
Returns if the "Real Mouse" (Not Smart's Mouse) Is Within a given Box.
*}
function IsRealMouseInBox(B : TBox): Boolean;
var
P : TPoint;
begin
GetRealMousePos(P.X, P.Y);
Result := PointInBox(P, B);
end;

YoHoJo
03-06-2013, 03:08 AM
That runs and compiles just fine for me.

All I can really say is watch and follow my videos again.
Specifically the SMART 8 one, and the SMART for RS07 one.

Close simba down, open task manager and look for any smart/smart remote and kill those, and then move/overwrite any files the guides say to, and then try that code again.

Metroidprim1
03-06-2013, 03:11 AM
That runs and compiles just fine for me.

All I can really say is watch and follow my videos again.
Specifically the SMART 8 one, and the SMART for RS07 one.

Close simba down, open task manager and look for any smart/smart remote and kill those, and then move/overwrite any files the guides say to, and then try that code again.

Backtracked my steps and realized when I tried to extract smart8 into my plugins folder something went wrong and it didn't actually do anything. Just had to extract the files somewhere else and then cut + paste into my plugins.
Got it working!
Thanks for the quick replies and overall help, I appreciate it.

YoHoJo
03-06-2013, 03:14 AM
Awesome :)
If you don't mind, might want to post your fix on the YouTube video (if you made a comment about having a problem) so other people can be helped out by it too.

Metroidprim1
03-06-2013, 03:22 AM
Awesome :)
If you don't mind, might want to post your fix on the YouTube video (if you made a comment about having a problem) so other people can be helped out by it too.

Will do.
Turned out it's not working 100% just yet though hah. So the client loaded and logged my guy in, then I get the error:

The following DTMs were not freed: [0, 1, 2, 3, SRL - Lamp bitmap, 5, 6, 7, 8, 9]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, SRL - Options Bitmap, 5]

Im attempting to use http://villavu.com/forum/showthread.php?t=97446


program EssenceHarvester;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$I P07Include.Simba}
{$I SRL/srl/misc/SmartGraphics.simba}

//************************************************** *********\\
// 2007 EssenceHarvester \\
// Released by wthomas 3/3/13 \\
// Coming Soon: \\
// AntiBan \\
// more AntiRandoms(golem next) \\
// \\
// \\
// Version 1.07 \\
// Fixed Use Essence -> Banker issue \\
// Changed DTM's \\
// changed Bank detection method \\
// Added Anti Leech \\
// \\
// version 1.06 \\
// fixedBug ismoving \\
// Bixed other small bugs \\
// \\
// \\
// Version 1.05 \\
// Bug fixes \\
// Abiss dection and solving \\
// Paint Proggy \\
// \\
// Version 1.04 \\
// Using findSymbol, colors and DTMs \\
// Fixed Banking issues \\
// Updated Essence finding- less bot like \\
// \\
// Version 1.03 \\
// updated DTM's and demoved old unused color \\
// \\
// Version 1.02Qfx \\
// using DTM's and bruting paths \\
// \\
// Version 1.02 \\
// Added in a Proggy \\
// \\
// Version 1.01 \\
// Fixed a few minor issues with getstate() \\
// Added nice debug notices. \\
// \\
//************************************************** *********\\

const
DEBUG = true;
PicInInvent = 1;
CostPerEssence = 26;
WALKBANK = 1;
BANK = 2;
WALKESS = 3;
MINEESS = 4;
AUBURY = 5;
PORTAL = 6;
Version = 1.07;

type
tStatus = record
ID: Integer;
Name: string;
end;
tPointerSet = record
proc:
procedure; name: string;
end;
var
RuneShopDTM, BankDTM, TreeDTM, PortalDTM: integer;
BankSymbolColor, BankTreesColor, RuneShopSymbolColor, PortalColor, BankSymbolTolerance, BankTreeTolerance, RuneShopTolerance, PortalTolerance, banked, StartTime, LastProg: integer;
Pointers: tPointerSet;
logTime: integer;

procedure SetupDTMs;
begin
P07_PlayerName := '';
P07_PlayerPass := '';
BankSymbolColor := 4965868;
BankSymbolTolerance := 5;
BankTreesColor := 1586544;
BankTreeTolerance := 10;
RuneShopSymbolColor := 2265855;
RuneShopTolerance := 50;
PortalColor := 1792734;
PortalTolerance := 100;
RuneShopDTM := DTMFromString('mWAAAAHicY2FgYChkQuA8IG4AilUDcTMDhP 1/khLDDxkVhkOMLGBaAyiGjBnRMAgAAP+kCVo=');
BankDTM := DTMFromString('mlwAAAHicY2dgYGhgYmDoAuJ2IG4C4nogrg biMiDWA8qbQ7EZFJtC8aVLlxj+/GFiePuWAU5//QrB/4HyGjgwIx4MBQA71hTz');
TreeDTM := DTMFromString('mwQAAAHic42RgYGBhYmD4xcjAwA+k2YFYFI i/A/mfGRHifEBaiBFCswKxABCLAjEbEMsCsRgQe4abMbz7/AKC371jCHbUBmO4GBBzAe3DhbmhNCMRGA4AkCoYPQ==');
PortalDTM := DTMFromString('mQwAAAHicY2ZgYChhYmDIBeJyIDZlgGBLIL b29WK4FyUNxm5APgwzImEgAAD34wZS');
SetupSRLStats(1324, 'EssenceHarvester', 'EssenceHarvester');
SRL_SixHourFix := True;
SMART_FixSpeed := True;
AddonTerminate('freeMyDTMs');
MarkTime(LastProg);
MarkTime(StartTime);
MarkTime(logTime);
banked := 0;
SetUpSRL;
SetupP07Include;
end;

function P07_IsMoving: boolean;
begin
Result := Animating(IntToBox(P07_MMCX - 30, P07_MMCY - 30, P07_MMCX + 30, P07_MMCY + 30), 50, 100);
end;

function P07_NotMoving: boolean;
begin
Result := not P07_IsMoving;
end;

function P07_PercentColorMMEx(Color, Tol, StartRadial, EndRadial, StartRadius, EndRadius: Integer): integer;
var
TPA: TPointArray;
begin
FindColorsTolerance(TPA, Color, P07_MMX1, P07_MMY1, P07_MMX2, P07_MMY2, Tol);
FilterPointsPie(TPA, StartRadial, EndRadial, StartRadius, EndRadius, P07_MMCX, P07_MMCY);
Result := ceil((Length(TPA) * 100) / ((Pi * (EndRadius * EndRadius)) * ((EndRadial - StartRadial) / 360.0) - ((Pi * (StartRadius * StartRadius)) * ((EndRadial - StartRadial) / 360.0))));
end;

function P07_PercentColorMM(Color, Tol: Integer): Integer;
begin
Result := P07_PercentColorMMEx(Color, Tol, 0, 360, 0, 76);
end;

function P07_PercentBlackMM: Integer;
begin
Result := P07_PercentColorMM(0, 5);
end;

procedure P07_SetRun(Run: Boolean);
begin
if not P07_TabInventoryTab(12) then
Writeln('cannot set run');
if CountColorTolerance(1711220, 626, 414, 656, 445, 5) < 10 then
MouseBox(626, 414, 656, 445, MOUSE_LEFT);
P07_TabInventoryTab(4)
end;

procedure DebugStr(Str: string);
begin
if Debug then
Writeln(MSToTime(TimeFromMark(StartTime), Time_Bare) + Str);
end;

function InEssMine: boolean;
begin
Result := (P07_PercentBlackMM > 25);
end;

function seeMMSymbol(var x: integer; var y: integer; DTM, color, tolerance: integer; name: string): boolean;
var
angle: extended;
begin
SymbolAccuracy := 0.7;
if findsymbol(x, y, name) then
begin
SMART_DrawBoxEx(false, false, inttobox(x - 5, y - 5, x + 5, y + 5), clGreen);
debugstr(' [INFO] symbol found: ' + name);
result := true;
exit;
end;
if findDTMRotatedSE(DTM, x, y, P07_MMX1, P07_MMY1, P07_MMX2, P07_MMY2, - pi() / 4, pi() / 4, pi() / 64, angle) then
begin
result := true;
SMART_DrawBoxEx(false, false, inttobox(x - 5, y - 5, x + 5, y + 5), clGreen);
debugstr(' [INFO] DTM found: ' + name);
exit;
end
else
begin
if FindColorTolerance(x, y, color, P07_MMX1, P07_MMY1, P07_MMX2, P07_MMY2, tolerance) then
begin
result := true;
SMART_DrawBoxEx(false, false, inttobox(x - 5, y - 5, x + 5, y + 5), clGreen);
debugstr(' [INFO] Color found: ' + name);
end
else
begin
result := false;
end;
end;
end;

function FindColorMinimap(color: integer; tolerance: integer): TpointArray;
var
TPA: TpointArray;
begin
if FindColorsTolerance(TPA, Color, P07_MMX1, P07_MMY1, P07_MMX2, P07_MMY2, Tolerance) then
Result := TPA;
end;

function InRuneShop: Boolean;
var
j: TPoint;
x, y: integer;
begin
if not seeMMSymbol(x, y, RuneShopDTM, RuneShopSymbolColor, RuneShopTolerance, 'magic shop') then
result := false;
j := IntToPoint(P07_MMCX, P07_MMCY);
Result := (Abs(x - j.x) < 20) and (Abs(y - j.y) < 10);
end;

function InBank: Boolean;
var
j: TPoint;
x, y: integer;
begin
if not seeMMSymbol(x, y, BankDTM, BankSymbolColor, BankSymboltolerance, 'bank') then
result := false;
j := IntToPoint(P07_MMCX, P07_MMCY);
Result := (Abs(x - j.x) < 20) and (Abs(y - j.y) < 20);
end;

function AtPortal: boolean;
var
j: TPoint;
x, y: integer;
begin
if not seeMMSymbol(x, y, PortalDTM, PortalColor, PortalTolerance, 'underground') then
result := false;
j := IntToPoint(P07_MMCX, P07_MMCY);
Result := (Abs(x - j.x) < 20) and (Abs(y - j.y) < 20);
end;

procedure WalktoAubury;
var
x, y: integer;
angle: extended;
begin
P07_makeCompassNorth;
if seeMMSymbol(x, y, RuneshopDTM, RuneShopSymbolColor, RuneShopTolerance, 'magic shop') then
begin
debugstr(' [INFO] Found shop ');
Mouse(x + 4, y, 2, 2, mouse_left);
wait(4000);
P07_setRun(TRUE);
P07_FFlag;
waitfunc(@ inRuneShop, 1000, 20000);
P07_FFlag;
DebugStr(' [INFO] Should be in the shop now');
end
else
begin
if FindDTMRotatedSE(TreeDTM, x, y, MMX1, MMY1, MMX2, MMY2, - pi() / 8, pi() / 8, pi() / 16, angle) then
begin
debugstr(' [INFO] Found tree DTM');
Mouse(x, y, 2, 2, mouse_left);
P07_FFlag;
waitfunc(@ P07_NotMoving, 100, 20000);
P07_FFlag;
debugstr(' [INFO] Should be south of the bank');
end
else
begin
writeln('***[WARINING]*** cant see shop or trees walking anyway');
Mouse(P07_MMCX + 15, P07_MMCY + 30, 2, 2, mouse_left);
P07_FFlag;
waitfunc(@ P07_NotMoving, 100, 20000);
P07_FFlag;
debugstr(' [INFO] Should be south of the bank');
end;
end;
end;

procedure BankEssence;
var
CTS, I, x, y: Integer;
TPA: TPointArray;
ATPA: array of TPointArray;
begin
if P07_BankScreen then
begin
P07_Deposit(2, 28, TRUE);
exit;
end;
P07_MakeCompassNorth;
P07_MakeCameraAngleHigh;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.91);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 6188918, MSX1, MSY1, MSX2, MSY2, 5);
ColorToleranceSpeed(CTS);
wait(100);
SMART_DrawDotsEx(false, TPA, clred);
ATPA := SplitTPA(TPA, 3);
for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
SMART_DrawBoxEx(false, false, getTPABounds(ATPA[i]), clBlue);
MMouse(x, y, 2, 2);
wait(50);
if (P07_IsUpTextMultiCustom(['sence'])) then
begin
MouseBox(7, 350, 500, 470, mouse_left);
exit;
end;
if (P07_IsUpTextMultiCustom(['se', 'ooth'])) then
begin
clickMouse2(MOUSE_RIGHT);
wait(700);
if P07_ChooseOptionMulti(['uickly']) then
begin
writeln('bank is open');
wait(1000);
P07_Deposit(2, 28, TRUE);
banked := banked + 28 - PicInInvent;
Stats_IncVariable('Pure Essence (Mined)', 28 - PicInInvent);
debugstr(' [INFO] updated banked ess log');
end;
Break;
end;
wait(100);
end;
Mouse(P07_MMCX, P07_MMCY + 10, 2, 2, mouse_left);
wait(300);
end;
end;

procedure WalktoBank;
var
x, y: integer;
angle: extended;
begin
P07_makeCompassdegree(randomrange( - 20, 20));
if seeMMSymbol(x, y, BankDTM, BankSymbolColor, BankSymboltolerance, 'bank') then
begin
debugstr(' [INFO] Found bank');
Mouse(x, y, 2, 2, mouse_left);
P07_setRun(TRUE);
waitfunc(@ P07_NotMoving, 100, 20000);
P07_FFlag;
end
else
begin
if FindDTMRotatedSE(TreeDTM, x, y, MMX1, MMY1, MMX2, MMY2, - pi() / 8, pi() / 8, pi() / 64, angle) then
begin
debugstr(' [INFO] Found tree colors');
Mouse(x, y, 2, 2, mouse_left);
waitfunc(@ P07_NotMoving, 100, 20000);
P07_FFlag;
debugstr(' [INFO] Should be south of the bank');
end
else
begin
debugstr(' [INFO] cant see bank or trees walking north');
Mouse(P07_MMCX + 15, P07_MMCY - 30, 2, 2, mouse_left);
waitfunc(@ P07_NotMoving, 100, 20000);
P07_FFlag;
debugstr(' [INFO] Should be south of the bank');
end;
end;
end;

procedure teleportAubury;
var
CTS, I, x, y: Integer;
TPA: TPointArray;
ATPA: array of TPointArray;
begin
P07_MakeCompassNorth;
P07_MakeCameraAngleHigh;
begin
if CountColorTolerance(5923683, MSX1, MSY1, MSX2, MSY2, 20) > 20000 then
begin
debugstr(' [INFO] Outside ess shop trying to re-enter');
if seeMMSymbol(x, y, RuneshopDTM, RuneShopSymbolColor, RuneShopTolerance, 'magic shop') then
Mouse(x, y + 15, 5, 10, mouse_left);
P07_FFlag;
end;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.92);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1226735, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);
SMART_DrawDotsEx(false, TPA, clred);
ATPA := SplitTPA(TPA, 5);
for I := 0 to High(ATPA) do
begin
if length(ATPA[i]) < 5 then
continue;
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
wait(50);
SMART_DrawBoxEx(false, false, getTPABounds(ATPA[i]), clGreen);
if (P07_IsUpTextMultiCustom(['alk-to', 'bury'])) then
begin
clickMouse2(mouse_right);
wait(300);
if P07_ChooseOptionMulti(['Teleport']) then
debugstr(' [INFO] Chose Option Teleport');
wait(2000);
P07_FFlag;
Break;
end;
wait(100);
end;
debugstr(' [INFO] Couldnt See Aubury, checking under us');
MMouse(P07_MSCX, P07_MSCY, 5, 5);
wait(50);
if (P07_IsUpTextMultiCustom(['alk-to', 'bury'])) then
begin
clickMouse2(mouse_right);
wait(300);
if P07_ChooseOptionMulti(['Teleport']) then
debugstr(' [INFO] Chose Option Teleport');
end;
end;
end;

procedure startMining;
var
i, c, x, y: integer;
begin
if P07_Containstext(GetBlackChatMessage, ['rock', 'ine', 'axe', 'pic']) and not P07_InvFull then
exit;
P07_makeCompassdegree(60);
c := 0;
if seeMMSymbol(x, y, PortalDTM, PortalColor, PortalTolerance, 'underground') then
begin
debugstr(' [INFO] Found portal on MM');
Mouse(round((x + P07_MMCX) / 2), round((y + P07_MMCY) / 2), 2, 2, MOUSE_LEFT);
P07_FFlag;
debugstr(' [INFO] Correcting position');
MiddleTPAEx(FindColorMinimap(11513529, 200), x, y);
Mouse(x, y, 2, 2, MOUSE_LEFT);
P07_FFlag;
P07_MakeCameraAngleLow;
MMouse(MSCX + randomrange( - 100, 100), MSCY + randomrange( - 150, 0), 0, 0);
repeat
inc(c);
P07_makeCompassdegree(P07_getcompassangle + 30);
wait(50);
if P07_Containstext(P07_getUptext, ['Mine', 'Rune', 'Essence']) then
begin
clickmouse2(mouse_left);
debugstr(' [INFO] Mining Essence');
wait(500);
break;
end;
until (C > 12);
end
else
begin
debugstr(' [INFO] We are not at an ess node, trying to find one');
c := 45 + 90 * randomrange(0, 3);
for i := 0 to 2 do
begin
Mouse(MMCX + round(50 * cos(c)), MMCY - round(50 * sin(c)), 5, 5, mouse_left);
P07_FFlag;
if seeMMSymbol(x, y, PortalDTM, PortalColor, PortalTolerance, 'underground') then
begin
debugstr(' [INFO] We are almost at an ess node');
exit;
end;
end;
end;
end;

procedure findPortal;
var
MTPA: TpointArray;
CTS, I, x, y: Integer;
TPA: TPointArray;
begin
if seeMMSymbol(x, y, PortalDTM, PortalColor, PortalTolerance, 'underground') then
begin
debugstr(' [INFO] Found portal color on MM');
if not atportal then
Mouse(x, y, 5, 5, mouse_left);
P07_FFlag;
debugstr(' [INFO] Standing by portal');
P07_makeCameraAngleHigh;
P07_makeCompassDegree(P07_getCompassAngle + randomrange( - 40, 40));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 3.19);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10868705, MSX1, MSY1, MSX2, MSY2, 11);
ColorToleranceSpeed(CTS);
SMART_DrawDotsEx(false, TPA, clBlue);
wait(100);
x := MiddleTPA(TPA).x;
y := MiddleTPA(TPA).y;
MMouse(x, y, 2, 2);
if (P07_IsUpTextMultiCustom(['use', 'ortal'])) then
begin
SMART_DrawBoxEx(false, false, getTPABounds(TPA), clGreen);
wait(100);
clickMouse2(MOUSE_LEFT);
wait(200);
if not InessMine then
debugstr(' [INFO] Teleported to Varrock');
exit;
end;
wait(100);
end
else
begin
end;
end;

procedure Random_Abiss;
var
c, d: integer;
begin
c := 0;
d := 0;
if P07_PercentBlackMM < 75 then
exit;
writeln('[WARNING] Random Found: Abiss Attempting to Solve');
P07_makeCompassNorth;
P07_MakeCameraAngleLow;
MMouse(250, 106, 5, 5);
P07_makeCompassdegree(P07_getcompassangle + 10);
wait(50);
if P07_Containstext(P07_getUptext, ['Operate', 'Appendage']) then
begin
repeat
inc(d);
if P07_Containstext(P07_getUptext, ['Operate', 'Appendage']) then
clickmouse2(mouse_left);
wait(700);
until (P07_PercentBlackMM < 75) or (d > 15);
end;
end;

function getState(): Integer;
var
angle: extended;
x, y: integer;
begin
P07_TabInventoryTab(4);
Random_abiss;
if not InEssMine then
if not (seeMMSymbol(x, y, BankDTM, BankSymbolColor, BankSymboltolerance, 'bank') or seeMMSymbol(x, y, RuneShopDTM, RuneShopSymbolColor, RuneShopTolerance, 'magic shop')) then
if not FindDTMRotatedSE(TreeDTM, x, y, MMX1, MMY1, MMX2, MMY2, - 180, 180, 1, angle) then
if not InEssMine then
begin
writeln('[FATAL] terminal error, cant see bank or rune shop ending script now');
terminatescript;
end;
if P07_invFull then
begin
if InEssMine then
begin
result := PORTAL;
exit;
end
else if not inbank then
begin
result := WALKBANK;
exit;
end
else
begin
result := BANK;
exit;
end;
end;
if not InEssMine then
begin
if not inruneshop then
begin
result := WALKESS;
exit;
end
else
begin
result := AUBURY;
exit;
end;
end
else
begin
result := MINEESS;
exit;
end;
end;

procedure Loop();
begin
with Pointers do
begin
case getState() of
WALKBANK:
begin
name := 'Walk:Bank';
Proc := @ WalktoBank;
end;
BANK:
begin
name := 'Bank Essence';
Proc := @ BankEssence;
end;
WALKESS:
begin
name := 'Walk:Aubury';
Proc := @ walktoAubury;
end;
MINEESS:
begin
name := 'Mine essence';
Proc := @ startMining;
end;
AUBURY:
begin
name := 'Teleport:Essence';
Proc := @ teleportAubury;
end;
PORTAL:
begin
name := 'Teleport:Varrock';
Proc := @ findPortal;
end;
end;
end;
end;

procedure proggy;
var
t: integer;
timestr: string;
begin
wait(10);
t := banked + P07_invCount - PicInInvent;
SMART_ClearCanvas;
SMART_DrawText(360, 360, 'smallchars', 'Essence Mined: ' + inttostr(t), clBlack);
SMART_DrawTextEx(false, 360, 380, 'smallchars', 'Exp earned: ' + inttostr(t * 5), clBlack);
SMART_DrawTextEx(false, 360, 400, 'smallchars', 'Money Gained : ' + inttostr(t * CostPerEssence), clBlack) SMART_DrawTextEx(false, 360, 420, 'smallchars', 'Time Running : ' + Copy(MSToTime(TimeFromMark(StartTime), Time_Bare), 0, 5), clBlack) if TimeFromMark(LogTime) > (5 * 60000) then
begin
marktime(LogTime);
Stats_Commit;
end;
end;

procedure freeMyDTMs;
begin
freeDTM(RuneShopDTM);
freeDTM(BankDTM);
freeDTM(TreeDTM);
freeDTM(PortalDTM);
end;

begin
SetupDTMs;
writeln('script Version ' + floattostr(Version) + ' Starting');
P07_loginPlayer;
wait(1000);
while P07_LoggedIN do
begin
proggy;
Loop();
with Pointers do
begin
Proc() wait(1000);
end;
end;
end.

and my SmarGraphics is:

{$DEFINE SMART_GRAPHICS}
{*
Smart Grahpics
==============

The Smart Grahpics include contains functions that will paint graphics on to the
SMART screen. Used to make scripts look nicer and sometimes to display
progress reports. Also used as a useful debugging tool. This is for Simba 0.99 and above.

*}

var
SMART_Canvas: TMufasaBitmap;
SMART_DebugSetup, SMART_Reset: Boolean;

{*
Authors: Coh3n, Brandon.

Declares everything needed for setting up SmartDebug.
There is no need to call this in scripts.
*}
procedure SMART_SetupDebug;
begin
SmartSetDebug(True);
SMART_Canvas := TMufasaBitmap.Create;
SMART_Canvas.SetPersistentMemory(SmartDebugArray, 765, 553);
SMART_DebugSetup := true;
if not SMART_Reset then
AddOnTerminate('SMART_FreeDebug');
end;

{*
Author: Brandon.

Creates an array of specific colours for use with FastSetPixels.
*}
Function ColorsFromTPA(TPA: TPointArray; Color: Integer): TIntegerArray;
var
I, L: Integer;
begin
SetLength(Result, Length(TPA));
L:= High(TPA);
For I:= 0 To L Do
Result[I]:= Color;
end;

{*
Authors: Coh3n, Brandon.

Clears an Area of the canvas Specified by the box.
*}
procedure SMART_ClearCanvasArea(Area: TBox);
{$IFDEF SMART}
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

SMART_Canvas.Rectangle(Area, 0);

{$ELSE}
begin
{$ENDIF}
end;

{*
Author: Coh3n, Brandon.

Clears the entire Smart Canvas.
*}
procedure SMART_ClearCanvas;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

If (SMART_CANVAS.TransparentColorSet) then
SMART_CANVAS.FastDrawClear(SMART_CANVAS.GetTranspa rentColor)
else
SMART_CANVAS.FastDrawClear(0);
end;

{*
Author: Mormanman.
Clears the MainScreen of Smart.
*}
procedure SMART_ClearMS;
begin
SMART_ClearCanvasArea(IntToBox(MSBox.X1 + SRL_NAVBAR_INGAME_X,
MSBox.Y1 + SRL_NAVBAR_INGAME_Y, MSBox.X2, MSBox.Y2 + SRL_NAVBAR_INGAME_Y));
end;

{*
Authors: Sir R. Magician, Brandon.

Draws a TPA with a specified Colour onto Smart's Canvas.
Clears the Canvas first if Clear is set to true.
*}
procedure SMART_DrawDotsEx(Clear: boolean; Pixels: TPointArray; Color: TColor);
{$IFDEF SMART}
var
P: TPointArray;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if Clear then SMART_ClearCanvas;
P := CopyTPA(Pixels);
OffsetTPA(P, Point(SRL_NAVBAR_INGAME_X, SRL_NAVBAR_INGAME_Y));
SMART_Canvas.DrawTPA(P, Color);
{$ELSE}
begin
{$ENDIF}
end;

{*
Authors: Sir R. Magician, mormanman, Brandon.

Draws a 2-Dimensional Array of Pixels on Smart.
Clears the Canvas first if Set to True.
*}
procedure SMART_DrawDotsMulti(Clear: boolean; pixels : T2DPointArray);
{$IFDEF SMART}
var
h, color : integer;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if Clear then SMART_ClearCanvas;

for h := 0 to High(pixels) do
begin

color := h div 10 + h mod 10;
case color of
0 : color := clWhite;
1 : color := clYellow;
2 : color := clBlue;
3 : color := clLime;
4 : color := 26367;//orange
5 : color := clPurple;
6 : color := clAqua;
7 : color := clFuchsia;
8 : color := clGreen;
9 : color := clRed;
end;

SMART_DrawDotsEx(False, pixels[h], color);
end;
{$ELSE}
begin
{$ENDIF}
end;

{*
Author: mormonman.

Draws the box of each TPA in the ATPA and write the index number in the top
left corner and a cross at the point found by MiddleTPA.
*}
procedure SMART_DebugATPA(Clear: Boolean; ATPA: T2DPointArray);
{$IFDEF SMART}
var
i, h, len: Integer;
B: TBox;
MP: TPoint;
TPA: TPointArray;
Points: T2DPointArray;
begin
len := Length(ATPA);
if (len < 1) then
Exit;
SetLength(Points, len);

for i := 0 to High(ATPA) do
begin
B := GetTPABounds(ATPA[i]);
len := Length(ATPA[i]);
if (len > 0) then
begin
TPA := LoadTextTPA(ToStr(i), SmallChars, h);
OffsetTPA(TPA, Point(B.X1+1, B.Y1+1));
end;
CombineTPAWrap(FindTPAEdges(TPAFromBox(B)), TPA, Points[i]);
MP := MiddleTPA(ATPA[i]);
TPA := [Point(MP.x-1, MP.y), Point(MP.x+1, MP.y), Point(MP.x, MP.y-1),
Point(MP.x, MP.y+1), Point(MP.x-2, MP.y), Point(MP.x, MP.y),
Point(MP.x+2, MP.y), Point(MP.x, MP.y-2), Point(MP.x, MP.y+2)];
CombineTPAWrap(Points[i], TPA, Points[i]);
end;

SMART_DrawDotsMulti(Clear, Points);
{$ELSE}
begin
{$ENDIF}
end;

{*
Author: mormonman

Draws the TPA bounds and puts a cross at the point created by MiddleTPA.
*}
procedure SMART_DebugTPA(Clear: Boolean; TPA: TPointArray);
begin
SMART_DebugATPA(Clear, [TPA]);
end;

{*
Author: Sir R. Magician

Clears the SMART canvas, then draws a red TPA (Dots).
*}
procedure SMART_DrawDots(Dots: TPointArray);
begin
SMART_DrawDotsEx(True, Dots, clRed);
end;

{*
Author: Coh3n

Draws a single colored dot (Color) at the set point (Point) on the SMART canvas.
Will clear the SMART canvas if set to do so (Clear).
*}
procedure SMART_DrawDot(Clear: Boolean; Point: TPoint; Color: TColor);
begin
SMART_DrawDotsEx(Clear, [Point], Color);
end;

{*
Authors: mormonman, Brandon.

Draws an array of boxes onto the SMART canvas. Set Color to -1 for it to use
different colors (like in SMART_DrawDotsMulti).
Fill will fill each box with a color.
*}
procedure SMART_DrawBoxes(Clear, Fill: Boolean; TBA: TBoxArray; Color: Integer);
{$IFDEF SMART}
var
i, colour, temp: Integer;
Box: TBox;
TPAEdges: TPointArray;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if Clear then SMART_ClearCanvas;

if (Length(TBA) < 1) then Exit;
for i := 0 to High(TBA) do
begin
Box := TBA[i];
if (Color > 0) then
begin
Temp := color;
end else
begin
colour := i div 5 + i mod 5;
case colour of
0 : Temp := clWhite;
1 : Temp := clYellow;
2 : Temp := clBlue;
3 : Temp := clLime;
4 : Temp := clGreen;
end;
end;

if Fill then
begin
Box := IntToBox(Min(TBA[i].X1, TBA[i].X2), Min(TBA[i].Y1, TBA[i].Y2) + SRL_NAVBAR_INGAME_Y,
Max(TBA[i].X1, TBA[i].X2), Max(TBA[i].Y1, TBA[i].Y2) + SRL_NAVBAR_INGAME_Y);
if (Box.X1 < 0) then Box.X1 := 0;
if (Box.X2 < 0) then Box.X2 := 0;
if (Box.Y1 < 0) then Box.Y1 := 0;
if (Box.Y2 < 0) then Box.Y2 := 0;
SMART_Canvas.Rectangle(Box, Temp)
end else
begin
FindTPAEdgesWrap(TPAFromBox(Box), TPAEdges);
SMART_DrawDotsEx(False, TPAEdges, Temp);
end;

end;

{$ELSE}
begin
{$ENDIF}
end;

{*
Author: mormonman, Brandon.

Draws a single colored (color) box (Box) on the SMART canvas. Will clear the
canvas if set to do so (Clear).
Fill will fill in the box with the specified Color.
*}
procedure SMART_DrawBoxEx(Clear, Fill: boolean; Box: TBox; color: TColor);
begin
SMART_DrawBoxes(Clear, Fill, [Box], color);
end;

{*
Author: mormonman

Clears the SMART canvas, then draws a single red box, specified by 'Box'.
*}
procedure SMART_DrawBox(Box: TBox);
begin
SMART_DrawBoxEx(True, False, Box, clRed);
end;

{*
Author: Coh3n

Draws a box on the RS mainscreen, even if the coordinates are outside client
boundaries.
Fill will Fill in the box with the specified Color.
*}
procedure SMART_DrawBoxMS(Clear, Fill: Boolean; Box: TBox; Color: TColor);
begin
if (Box.X1 < MSX1) then Box.X1 := MSX1;
if (Box.Y1 < MSY1) then Box.Y1 := MSY1;
if (Box.X2 > MSX2) then Box.X2 := MSX2;
if (Box.Y2 > MSY2) then Box.Y2 := MSY2;
SMART_DrawBoxEx(Clear, Fill, Box, Color);
end;

{*
Author: mormonman

Draws a line a set color (Color) from point 1 (TP1) to point 2 (TP2). Will
clear the SMART canvas if set to do so (Clear).
*}
procedure SMART_DrawLine(Clear: Boolean; TP1, TP2: TPoint; Color: TColor);
var
TempMufasa: TMufasaBitmap;
TempTBitmap: TBitmap;
begin
{$IFDEF SMART}
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if (Clear) then
SMART_ClearCanvas;

TempTBitmap := TBitmap.Create;
TempTBitmap.Width := Max(1, iAbs(TP2.X - TP1.X));
TempTBitmap.Height := Max(1, iAbs(TP2.Y - TP1.Y));
TempTBitmap.Canvas.Pen.COLOR := Color;

TempTBitmap.Canvas.moveto(0, 0);
TempTBitmap.Canvas.LineTo(iAbs(TP2.X - TP1.X), iAbs(TP2.Y - TP1.Y));

TempMufasa := TMufasaBitmap.Create;
TempMufasa.LoadFromTBitmap(TempTBitmap);
if (SMART_Canvas.TransparentColorSet) then
TempMufasa.SetTransparentColor(SMART_Canvas.GetTra nsparentColor);

FastDrawTransparent(Min(TP1.X, TP2.X), Min(TP1.Y, TP2.Y) + SRL_NAVBAR_INGAME_Y, TempMufasa.Index, SMART_Canvas.Index);

TempMufasa.Free;
TempTBitmap.Free;
{$ENDIF}
end;

{*
Author: mormonman

Draws an ellipse on the SMART canvas defined by 'Center', 'XRadius', and
'YRadius'. If 'Fill' is true it will fill the ellipse, otherwise it draws just
the border. Will clear the SMART canvas if set to do so (Clear).
*}
procedure SMART_DrawEllipse(Clear: Boolean; Center: TPoint; XRadius, YRadius: Integer; Fill: Boolean; Color: TColor);
{$IFDEF SMART}
var
TPA: TPointArray;
TempMufasa: TMufasaBitmap;
TempTBitmap: TBitmap;
begin
if Fill then
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if Clear then
SMART_ClearCanvas;

TempTBitmap := TBitmap.Create;
TempTBitmap.Canvas.Brush.COLOR := Color;

TempTBitmap.Width := (XRadius * 2);
TempTBitmap.Height := (YRadius * 2);

TempTBitmap.Canvas.Ellipse(Center.X - XRadius, Center.Y - YRadius, Center.X + XRadius, Center.Y + YRadius);

TempMufasa := TMufasaBitmap.Create;
TempMufasa.LoadFromTBitmap(TempTBitmap);
if (SMART_Canvas.TransparentColorSet) then
TempMufasa.SetTransparentColor(SMART_Canvas.GetTra nsparentColor);

FastDrawTransparent(0, SRL_NAVBAR_INGAME_Y, TempMufasa.Index, SMART_Canvas.Index);
TempMufasa.Free;
TempTBitmap.Free;
end else
begin
TPA := TPAFromEllipse(Center.X, Center.Y, XRadius, YRadius);

if (Length(TPA) >= 1) then
SMART_DrawDotsEx(Clear, TPA, Color);
end;
{$ELSE}
begin
{$ENDIF}
end;

{*
Author: mormonman

Draws a circle on the SMART canvas defined by 'Center' and 'Radius'. If 'Fill'
is true it will fill the circle, otherwise it draws just the border. Will
clear the SMART canvas if set to do so (Clear).
*}
procedure SMART_DrawCircle(Clear: Boolean; Center: TPoint; Radius: Integer; Fill: Boolean; Color: TColor);
begin
SMART_DrawEllipse(Clear, Center, Radius, Radius, Fill, Color);
end;

{*
Author: mormonman

Draws an array of polygons on the SMART canvas in the set color. Will clear the
SMART canvas if set to do so (Clear).
*}
procedure SMART_DrawPolygons(Clear: Boolean; Polygons: T2DPointArray; color: TColor);
{$IFDEF SMART}
var
i, h, Hi: Integer;
begin
if (Clear) then
SMART_ClearCanvas;

if (Length(Polygons) < 1) then
Exit;

for h := 0 to High(Polygons) do
begin
Hi := High(Polygons[h]);
if (Hi < 2) then Exit;

for i := 0 to Hi - 1 do
SMART_DrawLine(False, Polygons[h][i], Polygons[h][i+1], color);

SMART_DrawLine(False, Polygons[h][Hi], Polygons[h][0], color);
end;
{$ELSE}
begin
{$ENDIF}
end;

{*
Authors: Flight & Coh3n

Draws text on the SMART canvas. Used mainly for progress reports. Parameters
are as follows:
* Clear: Clear the SMART canvas before drawing
* Shadow: if set to true, will add a shadow to the text
* TSA: the string array of what to be printed; each element is a different line
* Placement: the point to start the text drawing
* Font: the font to use (see Simba/Fonts/)
* Colour: the color of the font
*}
procedure SMART_DrawTextMulti(Clear, Shadow: Boolean; TSA: TStringArray; Placement: TPoint; Font: string; Colour: TColor);
var
i, h, TPH: Integer;
TTP, SArr: TPointArray;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if (Clear) then
SMART_ClearCanvas;

TPH := High(TSA);

for i := 0 to TPH do
begin
TTP := LoadTextTPA(TSA[i], Font, h);
OffsetTPA(TTP, Point(Placement.x, Placement.y+(i*h)));
SMART_DrawDotsEx(False, TTP, Colour);
if Shadow then
begin
SArr := CopyTPA(TTP);
OffsetTPA(SArr, Point(1, 1));
ClearTPAFromTPAWrap(SArr, TTP, SArr);
SMART_DrawDotsEx(False, SArr, 65536);
end;
end;
end;

{*
Author: Coh3n

Draws shadowed line of text on the SMART canvas. Parameters are as follows:
* Clear: Clear the SMART canvas before drawing
* x, y: the coords of where to place the text
* font: the font to use (see Simba/Fonts/)
* Text: the text to draw to the SMART canvas
* Colour: the color of the font
*}
procedure SMART_DrawTextEx(Clear: Boolean; x, y: Integer; font, Text: string; Color: TColor);
begin
SMART_DrawTextMulti(Clear, true, [Text], Point(x, y), font, Color);
end;

{*
Author: Coh3n

Same as SMART_DrawTextEx, except clears the canvas before drawing.
*}
procedure SMART_DrawText(x, y: Integer; font, Text: string; Color: TColor);
begin
SMART_DrawTextEx(False, x, y, font, Text, Color);
end;

{*
Author: Coh3n

Draws a bitmap (Bitmap) on the SMART canvas at given coordinates (Placement).
Will clear the canvas beforehand if specified to do so (Clear).
*}
procedure SMART_DrawBitmap(Clear: Boolean; Bitmap: Integer; Placement: TPoint);
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if (Clear) then
SMART_ClearCanvas;

FastDrawTransparent(Placement.X, Placement.Y + SRL_NAVBAR_INGAME_Y, Bitmap, SMART_Canvas.Index);
end;

{*
Authors: Coh3n, Brandon.

Frees the SMART_Canvas bitmap.
*}
procedure SMART_FreeDebug;
begin
try
if (SMART_DebugSetup) then
begin
SMART_Canvas.ResetPersistentMemory;
SMART_Canvas.Free;
SMART_DebugSetup := False;
SMART_Reset := True;
end;
except
Writeln('Failed to free SMART_Canvas bitmap: '+ExceptionToString(ExceptionType, ExceptionParam));
end;
end;

YoHoJo
03-06-2013, 03:29 AM
Lines about things beeing freed are not errors, just hints for the scripter/information.
Errors will be in the debug box above or below those lines though.

Metroidprim1
03-06-2013, 03:37 AM
Here's a copy + pasted log of simba. Not sure what the problem is but the script isn't running.


Loading extension C:\Simba\Extensions\associate.sex
Extension Enabled
Loading extension C:\Simba\Extensions\extension.sex
Extension Enabled
Extensions Updater Enabled!
Loading extension C:\Simba\Extensions\srl.sex
Extension Enabled
SRL Updater Enabled!
Plugins Updater Enabled!
SPS Updater Enabled!
MSI Updater Enabled!
Simba news:

Simba 0.99 has been released. The release pages will be updated in a few
days.

The latest Simba is Simba 992. Changes from 991 are mostly just lape
updates: http://villavu.com/forum/showthread.php?t=94351


Thank you for using Simba,
Hakuna Matata.

[Hint] C:\Simba\Scripts\107EssenceHarvester.simba(468:3): Variable 'MTPA' never used at line 467
[Hint] C:\Simba\Scripts\107EssenceHarvester.simba(469:3): Variable 'I' never used at line 468
[Hint] C:\Simba\Scripts\107EssenceHarvester.simba(628:3): Variable 'TIMESTR' never used at line 627
Compiled successfully in 905 ms.
SRL Compiled in 16 msec
Paired with SMART[3380]
Checking P07Include VersionNumber
Local : 1.7 / Latest : 1.7
You Have The Latest Version of P07Include
script Version 1.07 Starting
Error: Exception: Access violation at line 78
The following DTMs were not freed: [0, 1, 2, 3, SRL - Lamp bitmap, 5, 6, 7, 8, 9]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, SRL - Options Bitmap, 5]

YoHoJo
03-06-2013, 03:46 AM
post: Error: Exception: Access violation at line 78
and then lines like
75-82 on the script's thread and see what help you can get there.

MrVirtuous
06-15-2013, 05:36 AM
I know you fixed it already and said how to, but this is what I posted on the youtube video which I think makes it more clear on how to fix this problem.

"If you're having that problem. It is because you didn't correctly move all the files from smart8 to plugins. Most likely because you didn't have permission to move a file. Just move the files with administrator permission and it should be fixed. "