SRL Archive - Bugs

Invalid Opcode


Gold

2010-08-31 01:32:14

So from everything I've read this is a simba error, not an MSI error (which is what I was trying to run)

Error: Invalid Opcode at line 64
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
File[C:\Users\Name\Simba\Includes\SRL\Logs\SRL Log 30-08-10 0.txt] has not been freed in the script, freeing it now.

Any idea's?

Wizzup?

2010-08-31 11:59:17

What line is line 61?

Gold

2010-08-31 12:05:55

It's line 64 and it's

if CurrDebugLevel <= LevelToDebug then

It's in the debug after I use RunMe for MSI scripts.

Wizzup?

2010-08-31 12:27:40

I don't think it's the line of that file… We're probably looking for an other file. :)

Coh3n

2010-08-31 12:33:37

I'm assuming that's the line that was highlighted? Yesterday I was getting this error on a Writeln() command. Once I commented it out, it worked.

Frement

2010-08-31 12:35:11

What does that error even mean? I'm getting the same on my Qt Creator when I try to compile my programs, but they work even thought I get the problem.

Gold

2010-08-31 12:35:35

Well the OPcode of RunMe.Simba, is just a commented out declare players.

I don't know where else to look

EDIT:
From: Coh3n
I'm assuming that's the line that was highlighted? Yesterday I was getting this error on a Writeln() command. Once I commented it out, it worked.



Yes, it was, I'll try commenting it out.

Alrighty, commented it out first with //, then {} and then I full on deleted it. It seems that with it gone I kept getting errors like

[Error] C:\Users\Name\Simba\Includes\srl/srl/msi/Debug.simba(67:3): Identifier expected at line 66
Compiling failed.

So, I guess I can't get rid of it.

Final EDIT: I'm using Windows Vista, but since it's not in C: I'm not running as Admin. Does that matter?

i luffs yeww

2010-08-31 14:23:41

Doesn't hurt to try. :)

Gold

2010-08-31 14:40:28

Just a note, regular scripts work fine. This only occurs while trying to run MSI.


EDIT: So, any more ideas or am I screwed?

Coh3n

2010-08-31 20:04:07

From: goldrush655
Just a note, regular scripts work fine. This only occurs while trying to run MSI.


EDIT: So, any more ideas or am I screwed?

It's hard to say because I can't recreate the problem as I'm no longer getting the error.

Update MSI and set SAVE_DEBUG and ENABLE_REMOTE both to False and see if you still get the error.

Gold

2010-08-31 23:30:33

Identifier expected Line 50 & 56
<<<<<<< .mine
=======

Identifier expected line 62
>>>>>>> .r243

These are all in the declare players

  with MSI_Players[0] do
begin
Name := 'Name'; // Username
Pass := 'Pass'; // Password
Nick := 'Nick'; // Nickname (3-4 lowercase letters from username)
Pin := ''; // Bank pin; leave as '' if player doesn't have one
Active := True; // Use this player?
Member := True; // Is this player a member?
<<<<<<< .mine
Location := LOC_FE_BANK; // See instructions at the top
Scripts := [SCRIPT_RM_YEWS]; // See instructions at the top
Objects := [[TREE_YEW]]; // See instructions at the top
Loads[0] := 200; // Amount of loads before breaking/switching players
Loads[1] := 200; // Total loads for the player to do
//=======
Location := ; // See instructions at the top
Scripts := []; // See instructions at the top
Objects := [[]]; // See instructions at the top
Loads[0] := 0; // Amount of loads before breaking/switching players
Loads[1] := 0; // Total loads for the player to do
>>>>>>> .r243

i luffs yeww

2010-08-31 23:35:31

Redownload it. It's an error due to downloading the script.

Gold

2010-08-31 23:44:27

Yeah it was, got it to compile now.

Error: Invalid Opcode at line 64
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
File[C:\Users\Name\Simba\Includes\SRL\Logs\SRL Log 31-08-10 8.txt] has not been freed in the script, freeing it now.

Highlighted line is still
if CurrDebugLevel <= LevelToDebug then

This is my setup

program MSI_Script;
{$i SRL/SRL/MSI/Setup.simba}

const
BREAK_TIME = 15; // Single player only - how long to break for (in minutes)
SAVE_DEBUG = False; // Save's the debug box text to a file
ENABLE_REMOTE = False; // Do you want to enable the Player Remote?
LEVEL_TO_DEBUG = 10; // The lower the number, the less the script will debug

WORLD_SMART = 152;

STATS_ID = ''; // Temporary stats ID (2 digit number)
STATS_PASS = ''; // Temporary stats password

procedure DeclarePlayers;
var
i: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
SetLength(MSI_Players, HowManyPlayers);
SetLength(ProgressReportArray, HowManyPlayers);

CurrentPlayer := 0;
CurrentScript := 0;

with MSI_Players[0] do
begin
Name := 'Name'; // Username
Pass := 'Pass'; // Password
Nick := 'Nick'; // Nickname (3-4 lowercase letters from username)
Pin := ''; // Bank pin; leave as '' if player doesn't have one
Active := True; // Use this player?
Member := True; // Is this player a member?
Location := LOC_FE_BANK; // See instructions at the top
Scripts := [SCRIPT_RM_YEWS]; // See instructions at the top
Objects := [[TREE_YEW]]; // See instructions at the top
Loads[0] := 1; // Amount of loads before breaking/switching players
Loads[1] := 1; // Total loads for the player to do
end;

Coh3n

2010-09-01 01:05:23

Ahhhh! This doesn't make any sense! Give me some time to think on it and research a little, see if I can come up with something. Sorry again. :o

Wizzup?

2010-09-01 11:08:00

Remember that if the interpreter passes line 60 as ``error'' it sometimes passes the wrong file, which causes Simba to highlight the wrong line on the file. So you may want to look for another line 60.

Gold

2010-09-01 23:14:56

Lines 60-69 of Debug.Simba for MSI
except
Writeln('Debug saving - error occurred');
end;

if CurrDebugLevel <= LevelToDebug then
writeln(DebugMSG)
else
Debugln(DebugMSG);
end;


Lines 60-69 of RunMe.simba

    Pass     := '';
Nick := '';
Pin := '';
Active := True;
Member := False;
Location := ;
Scripts := [];
Objects := [[]];
Loads[0] := ;
Loads[1] := ;

Lines 60-70 of Antiban.simba

20001..999999:
begin
Time := GetSystemTime + HowLong;
while (Time > GetSystemTime) do
begin
MSI_AntiBan(7000 + Random(200), 100);
wait(random(5000));
end;
end;
End;

Lines 60-69 of Locations.Simba

    Constant := LOC_VE_MINE;
end;

LOC_VW_MINE:
with MSI_Locations[Which] do
begin
Name := 'Varrock west mine';
Constant := LOC_VW_MINE;
end;

Lines 60-69 of Scripts.simba

     // ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;

SCRIPT_VE_OAKS:
with MSI_Scripts[whichScript] do
begin
Name := 'Varrock East Oaks';


Lines 60-69 of Stats.simba

   Exit;

Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getinfo');
AddPostVariable (Client, 'sID', Stats_ScriptID);

s := PostHTTPPageEx(Client, STATS_LINK);
sa := Explode(#10'GLUE'#10, s);
if (Length(sa) = 5) then



From: Wizzup?
Remember that if the interpreter passes line 60 as ``error'' it sometimes passes the wrong file, which causes Simba to highlight the wrong line on the file. So you may want to look for another line 60.


Those are all the lines 60 that I can think of that may somehow affect the script.

Coh3n

2010-09-02 01:12:45

Hmm, it may be in Stats.simba as it sends/receives information from the internet, but I don't have enough experience in that area to know for sure. Replace your entire Stats.simba with the following, and see if anything changes.

{==============================================================================\
| MSI Group Scripting Include |
| Stats.scar |
|==============================================================================|
| All Banking related routines. |
| |
| * procedure Stats_CheckOutput(); * by nielsie95 |
| * procedure Stats_GetScriptInfo(); * by nielsie95 |
| * procedure Stats_SendReport(); * by nielsie95 |
| * procedure Stats_SendAccountInfo(); * by nielsie95 |
| * procedure Stats_ManageAccounts(); * by nielsie95 |
| * procedure MSI_SendStats; * by Coh3n |
| |
\_____________________________________________________________________________}

{******************************************************************************}
{ procedure Stats_CheckOutput(s: string); }
{ By: nielsie95 }
{ Date: 10 June 2010 }
{ Description: }
{******************************************************************************}
procedure Stats_CheckOutput(s: string);
{var
i: Integer;
sa: TStringArray; }
begin
{ sa := Explode(#10, s);
for i := 0 to High(sa) do
if (Trim(sa[i]) <> '') then
if StartsWith('ERROR(1)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_UserID := '';
Stats_Password := '';
end
else if StartsWith('ERROR(2)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_ScriptID := '';
end
else
WriteLn('STATS: "' + sa[i] + '"');
}
end;

{******************************************************************************}
{ procedure Stats_GetScriptInfo( ... ); }
{ By: nielsie95 }
{ Date: 10 June 2010 }
{ Description: }
{******************************************************************************}
function Stats_GetScriptInfo(out Version, News, Link: string;
out OutDated: Boolean; out LastUpdate_HoursAgo: Integer): Boolean;
{var
Client: Integer;
s: string;
sa: TStringArray;}
begin
{Result := False;
if (Stats_ScriptID = '') then
Exit;

Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getinfo');
AddPostVariable (Client, 'sID', Stats_ScriptID);

s := PostHTTPPageEx(Client, STATS_LINK);
sa := Explode(#10'GLUE'#10, s);
if (Length(sa) = 5) then
begin
Result := True;
Version := sa[0];
News := sa[1];
Link := sa[2];
OutDated := sa[3] = '1';
LastUpdate_HoursAgo := StrToIntDef(sa[4], -1);
end
else
Stats_CheckOutput(s);

FreeHTTPClient(Client );
}
end;

{******************************************************************************}
{ procedure Stats_SendReport; }
{ By: nielsie95 }
{ Date: 10 June 2010 }
{ Description: }
{******************************************************************************}
var
Stats_GlobalVars: array[1..24] of Integer;

procedure Stats_SendReport;
{var
i, Client, Time: Integer;
s: string;}
begin
{ if (Stats_UserID = '') and (Stats_Password = '') and (Stats_ScriptID = '') then
Exit;

Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'submit');

Time := (GetTimeRunning - Stats_LastTime) div 1000 div 60;
if (Time < 5) then
Time := 0
else
Stats_LastTime := GetTimeRunning;
AddPostVariable(Client, 'sTime', IntToStr(Time));

if (Stats_UserID <> '') and (Stats_Password <> '') then
begin
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
end
else
begin
AddPostVariable(Client, 'uID', '-1');
AddPostVariable(Client, 'uPass', '');
end;

if (Stats_ScriptID <> '') then
begin
AddPostVariable (Client, 'sID', Stats_ScriptID);

for i := Low(Stats_CustomVars) to High(Stats_CustomVars) do
begin
AddPostVariable(Client, 'rndCustom' + IntToStr(i),
IntToStr(Stats_CustomVars[i]));
Stats_CustomVars[i] := 0;
end;
end
else
begin
AddPostVariable (Client, 'sID', '-1');
end;

for i := Low(Stats_GlobalVars) to High(Stats_GlobalVars) do
begin
case i of
1: s := IntToStr(SRL_Logs - Stats_GlobalVars[i]);
2: s := IntToStr(Banks - Stats_GlobalVars[i]);
3: s := IntToStr(RandSolved[rand_Death] - Stats_GlobalVars[i]);
else if ((i - 3) < Length(RandSolved) - 1) then
s := IntToStr(RandSolved[i - 3] - Stats_GlobalVars[i]);
end;
AddPostVariable(Client, 'rndGlobal' + IntToStr(i), s);
Stats_GlobalVars[i] := Stats_GlobalVars[i] + StrToInt(s);
end;

s := PostHTTPPageEx(Client, STATS_LINK);
Stats_CheckOutput(s);
FreeHTTPClient(Client);

if (SRL_Procs[srl_OnSendStats] <> nil) then
SRL_Procs[srl_OnSendStats]();
}
end;

{******************************************************************************}
{ procedure Stats_SendAccountInfo; }
{ By: nielsie95 }
{ Date: 10 June 2010 }
{ Description: }
{******************************************************************************}
procedure Stats_SendAccountInfo;
{var
i, Client: Integer;
Accounts: TStringArray;}
begin
{if (Stats_UserID = '') and (Stats_Password = '') then
Exit;

Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'setaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
if (Stats_ScriptID <> '') then
AddPostVariable (Client, 'sID', Stats_ScriptID)
else
AddPostVariable (Client, 'sID', '-1');

SetLength(Accounts, HowManyPlayers);
for i := 0 to HowManyPlayers - 1 do
Accounts[i] := Implode('.|?stat?|.', [Players[i].Name, Players[i].Loc,
IntToStr(Integer(Players[i].Active))]);

AddPostVariable(Client, 'accInfo', Implode(#10'ACC'#10, Accounts));
Stats_CheckOutput(PostHTTPPageEx(Client, STATS_LINK));
FreeHTTPClient(Client);
}
end;

{******************************************************************************}
{ procedure Stats_ManageAccounts; }
{ By: nielsie95 }
{ Date: 10 June 2010 }
{ Description: }
{******************************************************************************}
procedure Stats_ManageAccounts;
{var
i, ii, Client: Integer;
s: string;
Accounts, Stats: TStringArray;}
begin
{if (Stats_UserID = '') and (Stats_Password = '') then
Exit;

Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getaccounts');
AddPostVariable(Client, 'uPass', Stats_Password);
AddPostVariable(Client, 'uID', Stats_UserID);

s := PostHTTPPageEx(Client, STATS_LINK);
Accounts := Explode(#10'ACC'#10, s);
for i := 0 to High(Accounts) do
begin
Stats := Explode('.|?stat?|.', Accounts[i]);
if (Length(Stats) = 3) then
begin
for ii := 0 to HowManyPlayers - 1 do
if (LowerCase(Players[ii].Name) = LowerCase(Stats[0])) then
begin
Players[ii].Loc := Stats[1];
Players[ii].Active := Stats[2] = '1';
Break;
end;
end
else
begin
Stats_CheckOutput(s);
Break;
end;
end;

FreeHTTPClient(Client);
stats_SendAccountInfo;
}
end;

{******************************************************************************}
{ procedure MSI_SendStats; }
{ By: Coh3n }
{ Date: 10 June 2010 }
{ Description: }
{******************************************************************************}
procedure MSI_SendStats;
begin
Stats_SendReport;
Stats_ManageAccounts;
end;

Gold

2010-09-03 15:27:20

Wasn't stats.

Still got

Error: Invalid Opcode at line 61
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
File[C:\Users\Name\Simba\Includes\SRL\Logs\SRL Log 03-09-10 0.txt] has not been freed in the script, freeing it now.


This being line 61

      Writeln('Debug saving - error occurred'); 

Of Debug.simba

Coh3n

2010-09-03 15:29:34

I commented out that line (which got rid of the error for me). I committed it a few days ago. Are you on the latest revision? I think it's 245 right now.

Blumblebee

2010-09-03 15:47:36

I know back a while ago I was working on a form. Now when I had an error with some code in the form (which was an include to a different script) it would highlight the wrong line, and usually the line highlighted was 5-15 lines about the actual error. E: But I guess if you've already fixed it then my post is irrelevant…

Gold

2010-09-03 15:53:02

Completely deleted my MSI folder and reloaded it at Rev 245

WriteFileString: Invalid Internal Handle of File: 1
[0:00:36]: [ Nick ] ---- Scanning for randoms...
[0:00:38]: [ Nick ] -- MSI_BestTool
[0:00:39]: [ Nick ] ---- CurrentSkill level: 73
[0:00:39]: [ Nick ] -- MSI_BestTool: Rune Hatchet
[0:00:39]: [ Nick ] -- MSI_FindTool - GameTab: 26
[0:00:40]: [ Nick ] ---- Found DTM: Rune Hatchet
[0:00:40]: [ Nick ] -- MSI_FindTool: True
Error: Invalid Opcode at line 64
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
File[C:\Users\Name\Simba\Includes\SRL\Logs\SRL Log 03-09-10 0.txt] has not been freed in the script, freeing it now.


This is my entire Debug.simba

{==============================================================================\
| MSI Group Scripting Include |
| Debug.scar |
|==============================================================================|
| For all debugging and progress report routines |
| |
| * procedure MSI_Debug(); * by Rasta Magician |
| * procedure MSI_AddHeader(); * by Rasta Magician |
| * procedure MSI_CloseHeader(); * by Rasta Magician |
| * procedure MSI_SubDebug(); * by Rasta Magician |
| * procedure MSI_SetRev; * by RM & Shuttleu |
| * function MSI_MirrorTPA(): TPointArray; * by RM |
| * procedure MSI_AddToProggy(); * by The MSI Team |
| * procedure MSI_GetReportInfo(); * by Coh3n |
| * function MSI_PrintSave; * by Naum |
| * procedure MSI_ProgressReport(); * by Coh3n |
\_____________________________________________________________________________}

var
CurrDebugLevel: integer;

{******************************************************************************}
{ procedure MSI_Debug(); }
{ By: Rasta Magician }
{ Date: 8 Aug 2010 }
{ Description: Debugs }
{******************************************************************************}
procedure MSI_Debug(debug: string);
var
DebugMSG, path, str: string;
begin
//Status(debug);

//player name
try
DebugMSG := DebugMSG + '[ ' + Capitalize(Players[CurrentPlayer].Nick)+' ] ';
except end;

//structure
DebugMSG := DebugMSG + Replicate('-', CurrDebugLevel * 2) + ' ';

//debug message
DebugMSG := DebugMSG + debug;

//save to file
if (SaveDebug) then
try
path := AppPath + 'Includes\SRL\SRL\msi\MSI Logs\';
if FileExists(path + scriptStart + '.txt') then
begin
theFile := OpenFile(path + scriptStart + '.txt', False);
ReadFileString(theFile, str, FileSize(theFile));
CloseFile(theFile);
end;

theFile := RewriteFile(path + scriptStart + '.txt', False);

WriteFileString(theFile, str + #13 + #10 + DebugMSG);
CloseFile(theFile);
except
//Writeln('Debug saving - error occurred');
end;

if CurrDebugLevel <= LevelToDebug then
writeln(DebugMSG)
else
Debugln(DebugMSG);
end;

{******************************************************************************}
{ procedure MSI_AddHeader(); }
{ By: Rasta Magician }
{ Date: 8 Aug 2010 }
{ Description: creates a new header, }
{ meaning all following debugs will go a level below this one }
{******************************************************************************}
procedure MSI_AddHeader(header: string);
begin
MSI_Debug(header);
inc(CurrDebugLevel);
end;

{******************************************************************************}
{ procedure MSI_CloseHeader(); }
{ By: Rasta Magician }
{ Date: 8 Aug 2010 }
{ Description: Closes header, debugs result }
{******************************************************************************}
procedure MSI_CloseHeader(closer: string);
begin
Dec(CurrDebugLevel);
MSI_Debug(closer);
end;

{******************************************************************************}
{ procedure MSI_SubDebug(); }
{ By: Rasta Magician }
{ Date: 8 Aug 2010 }
{ Description: allows for a one-time-only sub-debug }
{******************************************************************************}
procedure MSI_SubDebug(debug: string);
begin
Inc(CurrDebugLevel);
MSI_Debug(debug);
Dec(CurrDebugLevel);
end;

{******************************************************************************}
{ procedure MSI_SetRev; }
{ By: Rasta Magician & Shuttleu }
{ Date: 27 July 2010 }
{ Description: Retrieves the user rev of MSI and sets it to var MSIRev }
{******************************************************************************}
procedure MSI_SetRev;
var
i: Integer;
s: string;
begin
try
i:= OpenFile(IncludePath + 'SRL/SRL/MSI/.svn/entries', True)
ReadFileString(i, s, 20);
CloseFile(i);
MSIRev:= Trim(Between('dir', 'http', s));
except
MSI_SubDebug('Error setting revision number');
finally

end;


end;

{******************************************************************************}
{ function MirrorTPA(TPA: TPointArray): TPointArray; }
{ By: Rasta Magician }
{ Date: 28 July 2010 }
{ Description: Mirrors the TPA (reverses the order); used mainly in reverting }
{ the reflection paths }
{******************************************************************************}
function MSI_MirrorTPA(TPA: TPointArray): TPointArray;
var
i, h: integer;
begin
h := 0;
SetLength(Result, Length(TPA));
for i:= High(TPA) DownTo 0 do
begin
Result[h] := TPA[i];
Inc(h);
end;
end;

{******************************************************************************}
{ procedure MSI_AddToProggy(whatToAdd, wObject, wItem, quantity: Integer); }
{ By: The MSI Team }
{ Date: 04 August 2010 }
{ Description: Adds specified element to the progress report - if parameter }
{ is unused, set to -1 }
{******************************************************************************}
procedure MSI_AddToProggy(whatToAdd, wObject, wItem, quantity: Integer);
begin
if (quantity = 0) then
Exit;

with ProgressReportArray[CurrentPlayer].ScriptInfo[CurrentScript] do
case whatToAdd of
PROG_ADD_EXP:
begin
IncEx(PlayerGainedExp, quantity);
IncEx(Stats_CustomVars[STATS_EXP], quantity);
end;

PROG_ADD_ITEMS:
begin
IncEx(PlayerItemAmounts[wObject][wItem], quantity);

case MSI_Scripts[MSI_Players[CurrentPlayer].Scripts[CurrentScript]].SkillConstant of
SKILL_WOODCUTTING:
IncEx(Stats_CustomVars[STATS_LOGS], quantity);

SKILL_MINING:
IncEx(Stats_CustomVars[STATS_ORES], quantity);

SKILL_FISHING:
IncEx(Stats_CustomVars[STATS_FISH], quantity);

else
MSI_SubDebug('MSI_AddToProggy: Invalid skill!');
end;
end;

PROG_ADD_LOADS:
begin
Inc(PlayerLoads);
Inc(Stats_CustomVars[STATS_LOADS]);
Inc(ProgressReportArray[CurrentPlayer].LoadsDone);
end;

else
MSI_Debug('MSI_AddToProggy: Invalid addition choice to progress report!');
end;

MSI_SendStats;
end;

{******************************************************************************}
{ procedure MSI_GetReportInfo; }
{ By: Coh3n & Shuttleu }
{ Date: 22 July 2010 }
{ Description: Gets the necessary proggy info that isn't automatically reset }
{ during runtime }
{******************************************************************************}
procedure MSI_GetReportInfo;
var
level, skill, i: Integer;
begin
for i := 0 to High(MSI_Players) do
with ProgressReportArray[i] do
begin
if (i = CurrentPlayer) then
begin
skill := MSI_Scripts[MSI_Players[i].Scripts[CurrentScript]].SkillConstant;
level := GetSkillLevel(skill);
if (level > ScriptInfo[CurrentScript].PlayerSkillLevel) then
ScriptInfo[CurrentScript].PlayerSkillLevel := level;
end;

PlayerLoc := MSI_Players[i].Location;
PlayerStatus := MSI_Players[i].Active;
end;
end;

{******************************************************************************}
{ procedure MSI_PrintSave(theFile: integer; s: string); }
{ By: Naum }
{ Date: 30 August 2010 }
{ Description: Prints the string in the debug box also saves the report }
{******************************************************************************}
Procedure MSI_PrintSave(theFile: Integer; s: string);
Begin
Writeln(s);
if (saveDebug) then
WriteFileString(theFile, s + #13 + #10);
End;

{******************************************************************************}
{ procedure MSI_ProgressReport; }
{ By: Coh3n }
{ Date: 12 August 2010 }
{ Description: Prints the progress report of each player }
{******************************************************************************}
procedure MSI_ProgressReport;
var
i, j, k, l, theFile: Integer;
path: String;
begin
try
if (StrToInt(MSIRev) < 100) then
MSIRev := '000';

if (saveDebug) then
begin
path := AppPath + 'Includes\SRL\SRL\MSI\MSI Progress Reports\';
theFile := ReWriteFile(path + scriptStart + '.txt', False);
WriteFileString(theFile, 'Progress Report Saved:' + #13 + #10);
WriteFileString(theFile, #13 + #10 + 'This proggie was written ' + TheDate(Date_Formal )+ ' at ' + TheTime + #13 + #10);
end;

ClearDebug;
MSI_GetReportInfo;

MSI_PrintSave(theFile, '{----------------------------------------------------------------}'); //64 from '{' to '}'
MSI_PrintSave(theFile, '{ MSI Phoenix Player Report }');
MSI_PrintSave(theFile, '{------------------------- Revision ' + MSIRev + ' -------------------------}');
MSI_PrintSave(theFile, '{ ' + PadR('Time Running: ' + TimeRunning, 59) + '}');
MSI_PrintSave(theFile, '{----------------------------------------------------------------}');

for i := 0 to (HowManyPlayers - 1) do
begin
with ProgressReportArray[i] do
begin
MSI_PrintSave(theFile, '{ }');
MSI_PrintSave(theFile, '{ ' + PadR('Player ' + IntToStr(i) + ': ' + Capitalize(playerName), 59) + '}'); //playerName
MSI_PrintSave(theFile, '{ ' + PadR('Location: ' + MSI_Locations[playerLoc].Name, 59) + '}'); //playerLoc
MSI_PrintSave(theFile, '{ ' + PadR('Time: ' + MsToTime(playerTime, Time_Short), 59) + '}'); //playerTime
MSI_PrintSave(theFile, '{ ' + PadR('Total Loads: ' + IntToStr(LoadsDone), 59) + '}'); //playerLoads
MSI_PrintSave(theFile, '{ ' + PadR('Active: ' + Capitalize(BoolToStr(playerStatus)), 59) + '}'); //playerStatus

if (not PlayerStatus) then //falseReason
MSI_PrintSave(theFile, '{ ' + PadR('Reason: ' + FalseReason, 57) + '}');

MSI_PrintSave(theFile, '{ }');

for j := 0 to High(ScriptInfo) do //scriptInfo
with ScriptInfo[j] do
begin
MSI_PrintSave(theFile, '{ ' + PadR('Script: ' + Name, 59) + '}'); //scriptName
MSI_PrintSave(theFile, '{ ' + PadR('Time: ' + MsToTime(Runtime, Time_Short), 57) + '}'); //scriptRuntime
MSI_PrintSave(theFile, '{ ' + PadR('Skill: ' + skillName, 57) + '}'); //skillName
MSI_PrintSave(theFile, '{ ' + PadR('Loads: ' + IntToStr(playerLoads), 57) + '}'); //playerLoads
MSI_PrintSave(theFile, '{ ' + PadR('Exp: ' + GroupDigits(playerGainedExp, ','), 57) + '}'); //playerGainedExp

if (playerSkillLevel < 1) then
MSI_PrintSave(theFile, '{ ' + PadR('Level: Not yet defined', 57) + '}')
else
MSI_PrintSave(theFile, '{ ' + PadR('Level: ' + IntToStr(playerSkillLevel), 57) + '}'); //playerSkillLevel

for k := 0 to High(MSI_Players[i].Items[j]) do
for l := 0 to High(MSI_Players[i].Items[j][k]) do //itemConstants
begin
MSI_PrintSave(theFile, '{ ' + PadR('Item: ' + MSI_Players[i].ItemNames[j][k][l], 55) + '}');
MSI_PrintSave(theFile, '{ ' + PadR('Amount: ' + GroupDigits(PlayerItemAmounts[k][l], ','), 55) + '}'); //playerItemAmounts
end;

MSI_PrintSave(theFile, '{ }');
end;
end;

MSI_PrintSave(theFile, '{----------------------------------------------------------------}');
end;

MSI_PrintSave(theFile, '{----------------------------------------------------------------}');

if (saveDebug) then
CloseFile(theFile);
except
MSI_SubDebug('Error in printing report!');
end;
end;

Wizzup?

2010-09-03 17:42:23

Perhaps it is the exception?

Gold

2010-09-03 18:06:00

From: Wizzup?
Perhaps it is the exception?


You're gonna have to speak like I'm 3 :D

I'm not sure what you mean.

Wizzup?

2010-09-04 05:06:31

From: goldrush655
You're gonna have to speak like I'm 3 :D

I'm not sure what you mean.


See if you can turn SaveDebug off (to False).

Gold

2010-09-04 13:03:30

So that got rid of

WriteFileString: Invalid Internal Handle of File: 1

But not

Error: Invalid Opcode at line 64
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
File[C:\Users\Name\Simba\Includes\SRL\Logs\SRL Log 04-09-10 1.txt] has not been freed in the script, freeing it now.

Here is my setup

program MSI_Script;
{$i SRL/SRL/MSI/Setup.simba}

const
BREAK_TIME = 15; // Single player only - how long to break for (in minutes)
SAVE_DEBUG = False; // Save's the debug box text to a file
ENABLE_REMOTE = False; // Do you want to enable the Player Remote?
LEVEL_TO_DEBUG = 10; // The lower the number, the less the script will debug

WORLD_SMART = 152;

STATS_ID = ''; // Temporary stats ID (2 digit number)
STATS_PASS = ''; // Temporary stats password

procedure DeclarePlayers;
var
i: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
SetLength(MSI_Players, HowManyPlayers);
SetLength(ProgressReportArray, HowManyPlayers);

CurrentPlayer := 0;
CurrentScript := 0;

with MSI_Players[0] do
begin
Name := 'Username'; // Username
Pass := 'Password'; // Password
Nick := 'Nick'; // Nickname (3-4 lowercase letters from username)
Pin := ''; // Bank pin; leave as '' if player doesn't have one
Active := True; // Use this player?
Member := False; // Is this player a member?
Location := LOC_FE_BANK; // See instructions at the top
Scripts := [SCRIPT_RM_YEWS]; // See instructions at the top
Objects := [[TREE_YEW]]; // See instructions at the top
Loads[0] := 1; // Amount of loads before breaking/switching players
Loads[1] := 2; // Total loads for the player to do
end;

Wizzup?

2010-09-04 13:13:48

Does everyone get this? If so, we'll have to run it through a debugger…

Gold

2010-09-04 13:16:21

From: Wizzup?
Does everyone get this? If so, we'll have to run it through a debugger…


From the sounds of it, there are only 1 or 2 people who have gotten this error (counting myself)

Coh3n

2010-09-05 19:21:40

From: Wizzup?
Does everyone get this? If so, we'll have to run it through a debugger…

I was getting it on a line with a Writeln() command. Once I commented it out, it went away. The code was something like:

except
Writeln('Blah blah...');
end;

Gold

2010-09-08 20:05:43

So have there been any updates or anything?

Wizzup?

2010-09-12 04:01:01

No; as far as I know it is a problem in the interpreter. Did you file a bug on our bug tracker?

mastaraymond

2010-09-14 08:37:53

If one could provide an example code, we might be able to run it through the debugger and figure it out..

massive630

2010-09-20 14:50:19

ive been getting the exact same problem as Gold. none of those fixes work for me either. even when i have the line commented out i still get the same…