Okay, I think I've got this sorted out in revision 184. You can set the number of total loads per player and the number of loads before breaking/switching per player. Here's the .diff if you're interested.
Index: C:/Simba/Includes/SRL/SRL/msi/ItemInfo.scar
===================================================================
--- C:/Simba/Includes/SRL/SRL/msi/ItemInfo.scar (revision 183)
+++ C:/Simba/Includes/SRL/SRL/msi/ItemInfo.scar (revision 184)
@@ -584,7 +584,7 @@
begin
for i := 0 to High(Items) do
begin
- Result[i] := MSI_Items[i].Name;
+ Result[i] := MSI_Items[Items[i]].Name;
if Result[i] = '' then
MSI_Debug('MSI_GetItemNames', 'Invalid item in ItemConstants:' + IntToStr(i), DEBUG_FORCE);
Index: C:/Simba/Includes/SRL/SRL/msi/Mainloop.scar
===================================================================
--- C:/Simba/Includes/SRL/SRL/msi/Mainloop.scar (revision 183)
+++ C:/Simba/Includes/SRL/SRL/msi/Mainloop.scar (revision 184)
@@ -598,7 +598,7 @@
t := (GetSystemTime + ((BreakTime * 60000) + RandomRange(-300000, 300000)));
while GetSystemTime < t do
begin
- Status('BreakTime remaining: '+IntToStr(t - GetSystemTime)+';');
+ Status('BreakTime remaining: '+MsToTime(t - GetSystemTime, Time_Formal)+';');
Wait(RandomRange(2000, 25000));
if LoggedIn then
FindNormalRandoms;
@@ -685,7 +685,6 @@
procedure MSI_SetPlayerInfo;
var
i, j, k: Integer;
- //l: Integer;
script: TScript;
intObjects: array of TIntegerArray;
intItems: array of array of TIntegerArray;
@@ -738,15 +737,6 @@
intItems[j][k] := MSI_VarToIntArray(Items[j][k]);
ItemNames[j][k] := MSI_GetItemNames(intItems[j][k]);
Experiences[j][k] := MSI_GetItemExperiences(intItems[j][k]);
- {
- for l := 0 to High(Items[j][k]) do
- begin
- Writeln('MSI_Players['+IntToStr(i)+'].Items['+IntToStr(j)+']['+IntToStr(k)+']['+IntToStr(l)+'] = '+IntToStr(Items[j][k][l]));
- Writeln('MSI_Players['+IntToStr(i)+'].ItemNames['+IntToStr(j)+']['+IntToStr(k)+']['+IntToStr(l)+'] = '+ItemNames[j][k][l]);
- Writeln('MSI_Players['+IntToStr(i)+'].Experiences['+IntToStr(j)+']['+IntToStr(k)+']['+IntToStr(l)+'] = '+FloatToStr(Experiences[j][k][l]));
- end;
- Writeln('MSI_Players['+IntToStr(i)+'].Objects['+IntToStr(j)+'] = '+IntToStr(Objects[j][k]));
- }
end;
end;
end;
@@ -792,7 +782,7 @@
{******************************************************************************}
{ procedure MSI_MainLoop; }
{ By: Coh3n }
-{ Date: 23 July 2010 }
+{ Date: 24 July 2010 }
{ Description: The MainLoop - performs all actions of the script }
{******************************************************************************}
procedure MSI_MainLoop;
@@ -804,6 +794,7 @@
ScriptStart := TheDate(DATE_DAY) + ' at ' + TheTime;
ScriptStart := Replace(scriptStart, ':', ' ');
+ MSI_SetRev;
// To gain access
if (SaveDebug) then
@@ -879,14 +870,14 @@
MSI_ProgressReport;
with ProgressReportArray[CurrentPlayer] do
- if (LoadsDone >= (MSI_Players[CurrentPlayer].Loads + RandomRange(-10, 0))) then
+ if (LoadsDone >= (MSI_Players[CurrentPlayer].Loads[L_TOTAL] + RandomRange(-10, 0))) then
begin
MSI_UnsetPlayer('MSI_MainLoop', 'Finished total loads!', True);
Break;
end;
Inc(tmpLoads);
- if (tmpLoads >= (BreakAfter + RandomRange(-2, 0))) then
+ if (tmpLoads >= (MSI_Players[CurrentPlayer].Loads[L_BREAK] + RandomRange(-2, 2))) then
begin
MSI_HandleBreaking;
tmpLoads := 0;
@@ -909,6 +900,7 @@
procedure MSI_ScriptTerminate;
begin
Writeln('Thank-you for using MSI Phoenix scripts!');
+ MSI_ProgressReport;
FreeSRL;
MSI_FreeAllItems;
end;
Index: C:/Simba/Includes/SRL/SRL/msi/Globals.scar
===================================================================
--- C:/Simba/Includes/SRL/SRL/msi/Globals.scar (revision 183)
+++ C:/Simba/Includes/SRL/SRL/msi/Globals.scar (revision 184)
@@ -263,6 +263,15 @@
PROG_ADD_ITEMS = 1;
PROG_ADD_LOADS = 2;
+(**
+ * Used for any array indexes in DeclarePlayers
+ *)
+const
+ L_COUNT = 2;
+
+ L_BREAK = 0;
+ L_TOTAL = 1;
+
{==============================================================================\
| Types |
\==============================================================================}
@@ -376,7 +385,7 @@
Location : Integer;
Scripts : TIntegerArray;
Objects : array of TVariantArray;
- Loads : Integer;
+ Loads : array[0..(L_COUNT - 1)] of Integer;
Items : array of array of TVariantArray;
ItemNames : array of array of TStringArray;
Experiences: array of array of TExtendedArray;
@@ -394,10 +403,10 @@
var
ProgressReportArray: TProggyArray;
CurrentScript : Integer;
- MSIRev : String;
ReflectionBroken : Boolean;
+ MSIRev : string;
+ ScriptStart : string;
-
(**
* Arrays that store all the necessary "go-to" information for MSI
*)
@@ -411,9 +420,7 @@
* User-defined variables set during script setup
*)
var
- BreakAfter : Integer;
BreakTime : Integer;
- ScriptStart: string;
SaveDebug : Boolean;
(**
@@ -425,6 +432,3 @@
Stats_ScriptID : string;
Stats_LastTime : Integer;
Stats_CustomVars: array [1..20] of Integer;
-
-
-
Index: C:/Simba/Includes/SRL/SRL/msi/RunMe.scar
===================================================================
--- C:/Simba/Includes/SRL/SRL/msi/RunMe.scar (revision 183)
+++ C:/Simba/Includes/SRL/SRL/msi/RunMe.scar (revision 184)
@@ -10,18 +10,10 @@
| |
| -> Valid arguments for Location[i]: |
| - For banking: |
-| - LOC_VE_BANK |
-| - LOC_VE_TREES |
-| - LOC_VE_OAKS |
-| - LOC_VE_MINE |
-| - LOC_GE_BANK |
-| - LOC_GE_YEWS |
-| - LOC_DB_BANK |
-| - LOC_DB_WILLOWS |
-| - LOC_FE_BANK |
-| - LOC_RM_YEWS |
-| - LOC_PS_WILLOWS |
-| - LOC_PS_DBOX |
+| - LOC_VE_BANK - LOC_DB_BANK - LOC_FE_BANK |
+| - LOC_VE_TREES - LOC_DB_WILLOWS - LOC_RM_YEWS |
+| - LOC_VE_OAKS - LOC_PS_WILLOWS - LOC_GE_BANK |
+| - LOC_VE_MINE - LOC_PS_DBOX - LOC_GE_YEWS |
| |
| - For power skilling: |
| - LOC_POWER_SKILL |
@@ -67,11 +59,10 @@
{.include SRL/SRL/MSI/Setup.scar}
const
- BREAK_AFTER = 5; // How many loads before breaking/switching players
- BREAK_TIME = 15; // How long to break for
- SAVE_DEBUG = False; // Save's the debug box text to a file
+ 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
- WORLD_SMART = 152;
+ WORLD_SMART = 152;
STATS_ID = '';
STATS_PASS = '';
@@ -99,7 +90,8 @@
Location := ; // See instructions at the top
Scripts := []; // See instructions at the top
Objects := [[]]; // See instructions at the top
- Loads := ; // The total loads for the player to do
+ Loads[0] := ; // Amount of loads before breaking/switching players
+ Loads[1] := ; // Total loads for the player to do
end;
{
with MSI_Players[1] do
@@ -113,7 +105,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
with MSI_Players[2] do
@@ -127,7 +120,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
with MSI_Players[3] do
@@ -141,7 +135,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
with MSI_Players[4] do
@@ -155,7 +150,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
with MSI_Players[5] do
@@ -169,7 +165,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
with MSI_Players[6] do
@@ -183,7 +180,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
with MSI_Players[7] do
@@ -197,7 +195,8 @@
Location := ;
Scripts := [];
Objects := [[]];
- Loads := ;
+ Loads[0] := ;
+ Loads[1] := ;
end;
}
@@ -218,6 +217,8 @@
end;
begin
+ ClearDebug;
+
{$IFDEF SIMBA}
AddOnTerminate('MSI_ScriptTerminate');
{$ENDIF}
@@ -240,7 +241,6 @@
{$ENDIF}
// Set global vars
- BreakAfter := BREAK_AFTER;
BreakTime := BREAK_TIME;
SaveDebug := SAVE_DEBUG;
Stats_UserID := STATS_ID;
Index: C:/Simba/Includes/SRL/SRL/msi/Debug.scar
===================================================================
--- C:/Simba/Includes/SRL/SRL/msi/Debug.scar (revision 183)
+++ C:/Simba/Includes/SRL/SRL/msi/Debug.scar (revision 184)
@@ -4,6 +4,7 @@
|==============================================================================|
| For all debugging and progress report routines |
| |
+| * procedure MSI_SetRev; * by RM & Shuttleu |
| * procedure MSI_Debug(); * by Rasta Magician |
| * procedure MSI_AddToProggy(); * by The MSI Team |
| * procedure MSI_GetReportInfo(); * by Coh3n |
@@ -14,12 +15,12 @@
{******************************************************************************}
-{ procedure SetMsiRev; }
+{ procedure MSI_SetRev; }
{ By: Rasta Magician & Shuttleu }
{ Date: 24 July 2010 }
{ Description: Retrieves the user rev of MSI and sets it to var MSIRev }
{******************************************************************************}
-procedure SetMsiRev;
+procedure MSI_SetRev;
var
i: Integer;
s: string;
@@ -250,15 +251,10 @@
WriteFileString(theFile, #13 + #10 + 'This proggie was written ' + TheDate(Date_Formal )+ ' at ' + TheTime + #13 + #10);
end;
- {$IFNDEF SIMBA}
- ClearReport;
- {$ENDIF}
- //ClearDebug;
-
MSI_GetReportInfo;
- MSI_PrintSave(theFile, '{-----------------------------------------------------------------}'); //64 from '{' to '}'
- MSI_PrintSave(theFile, '{ MSI Phoenix Player Report }');
- MSI_PrintSave(theFile, '{------------------------------ ' + PadR(MSIRev, 7) + ' -----------------------------}');
+ 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, '{----------------------------------------------------------------}');
@Garrett: The reason I kept a local variable in MSI_Mainloop to keep track of the current loads is because it wasn't really necessary to have it global when it works just fine local. I would like to minimize global variables as much as possible.
I hope this is what you and RM had in mind.