It seems that if you include a file that has a function/procedure that is not properly terminated by having a semicolon after end, Simba will completely crash after inputting a .
EX:
Main.simba
Code:
program Main;
{$I Custom/CustomHelpers.simba}
begin
end.
Custom/CustomHelpers.simba
Code:
{
This is just a file with custom helpers for scripts
These are all custom for SoulPlay and there is no guarantee they work anywhere else
They are made for myself
They should be well documented, and well written
There is no guarantee they actually will be though
}
//check to see if key is down
//if it is, terminate
procedure checkEStop(key: Char = '\');
begin
if isKeyDown(GetKeyCode(key)) then
TerminateScript();
end
{
Try to click on a color, and ensure that name is the uptext before clicking
cluster to control dist for clusters.
fMin/fMax to control filter size
}
function clickOn(color:TCTS2Color; name:String; cluster:Integer = 2; fMin: Integer = 50; fMax:Integer = 500; eStop:Char = '\'): boolean;
var
TPA, toClick: TPointArray;
ATPA: T2DPointArray;
begin
if (SRL.FindColors(TPA, color, MainScreen.GetBounds) > 0) then //If we find colours at all then...
begin
MainScreen.FilterPlayerBox(TPA);
ATPA := TPA.Cluster(cluster);
ATPA.FilterSize(fMin, fMax);
ATPA.SortByIndex(MainScreen.GetMiddle);
for toClick in ATPA do
begin
checkEStop(eStop);
Mouse.Move(toClick[Random(Length(toClick))], MOUSE_MOVE);
if MainScreen.IsUpText(name) then
begin
if Mouse.Click(ctRed) then
begin
Result := true;
Break;
end;
end;
end;
end;
end
The error here is that the second function in CustomHelpers is not ; terminated.
The error should have straight forward output to console when trying to compile.
Instead, if you input a "." anywhere in Main.simba, Simba will throw an error.
The log is:
Code:
Program exception!
Stacktrace:
Exception class: ESyntaxError
Message: 'SemiColon' expected found 'end of file'
$000000010026756E
$0000000100267266
$0000000100267E7D
$000000010026A8D8
$000000010026A3A6
$000000010026FFD7
$0000000100265A29
$000000010026883B
$0000000100264FD7
$0000000100266DA1
$000000010025ED9B
$000000010025B0E8
$000000010025B687
$00000001004648F2
$0000000100463F48
$0000000100465774
$000000010026521E
Simba Version: 1300
This error is reasonable, but does not give any information about where it occurs. It also should be in the console, and not in an error log. Additionally, this error should not appear when simply editing the "Main" script, it should occur when compiling.