SRL Archive - MSI Bugs

Woodcutter inventory problem


topiser

2010-08-03 08:36:28

I set up the script and got it to run fine and dany on VE oaks and i loved it. My only problem is that once it reaches the bank and checks in the inventory or after getting a full inventory and checks it before dropping while im power chopping, the script has an error.
Error: Out Of Range at line 294

It stops the script and highlights line 294 in the MainLoop.
Here's the code from 293 to 310 so you dont have to bother looking yourself.
begin
SetLength(intItems[k][i], Length(Items[k][i]));
SetLength(exps[k][i], Length(intItems[k]));

intItems[k][i] := MSI_VarToIntArray(Items[k][i]);
exps[k][i] := Experiences[k][i];

for j := 0 to High(intItems[k][i]) do
begin
itemCount := CountItems('dtm', MSI_Items[intItems[k][i][j]].DTM, []);
expCount := Round(exps[k][i][j] * itemCount);

MSI_AddToProggy(PROG_ADD_EXP, -1, -1, expCount); //adds exp to script
MSI_AddToProggy(PROG_ADD_ITEMS, i, j, itemCount); //adds amount of item

MSI_Debug('MSI_CountItems', 'Found ' + IntToStr(itemCount) + ' of item '
+ MSI_Items[intItems[k][i][j]].Name, DEBUG_FUNCTIONS);
end;

I'd appriciate any help.

Shuttleu

2010-08-03 08:38:07

it would be easier if we had the script to look at

~shut

topiser

2010-08-03 09:46:33

I assumed since we were in the MSI section everyone would have it?

Shuttleu

2010-08-03 09:50:22

oh sorry, i didnt realize :facepalm:

~shut

EDIT: have you got the latest msi, srl, reflection and simba?

topiser

2010-08-03 10:39:07

Yeah updated everything with the simba updater and then cause the walking was failing i used svn to get the latest version of reflection.

Coh3n

2010-08-03 11:59:58

Can you post how you setup your DeclarePlayers please?

topiser

2010-08-03 12:09:55

From: Coh3n
Can you post how you setup your DeclarePlayers please?


Sure.
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 := 'pliser'; // Username
Pass := 'a password :D'; // Password
Nick := 'plis'; // 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_VE_OAKS; // See instructions at the top
Scripts := [SCRIPT_POWER_CHOP]; // See instructions at the top
Objects := [[TREE_OAK],[TREE_NORMAL]]; // See instructions at the top
Loads[0] := 10; // Amount of loads before breaking/switching players
Loads[1] := 100; // Total loads for the player to do
end;

Coh3n

2010-08-03 13:02:17

You haven't setup the Objects part properly. ;)

Each set of brackets (inside the brackets) represents the objects for each script. What you want is this:

Objects := [[TREE_OAK, TREE_NORMAL]];
That should get rid of you problem. :)

topiser

2010-08-03 13:26:17

Ah thanks a lot. Works great now :D