SRL Archive - MSI Suggestions

Allow item slot number for DontDrop


any_one

2010-11-24 23:51:09

As the title says, right now I'm powermining using MSI on crandor so I have coins in the first inventory slot. MSI doesn't have a definition for them so I can't set DontDrop, however I would rather keep them (its about 20k). I know this is a fairly minor thing but it would be handy to be able to set an item slot number to not be dropped. As a temporary fix I modified the SRL drop functions because it's faster than figuring out how MSI works :p

Also had to change colour for crandor rocks but that was easy so doesn't really need to be fixed/added.

Coh3n

2010-11-25 01:11:43

From: any_one
As the title says, right now I'm powermining using MSI on crandor so I have coins in the first inventory slot. MSI doesn't have a definition for them so I can't set DontDrop, however I would rather keep them (its about 20k). I know this is a fairly minor thing but it would be handy to be able to set an item slot number to not be dropped. As a temporary fix I modified the SRL drop functions because it's faster than figuring out how MSI works :p

Can you post your changed version?

From: any_one

Also had to change colour for crandor rocks but that was easy so doesn't really need to be fixed/added.

What are the rock types? Are the colors different from others around RS?

any_one

2010-11-25 01:31:10

Yes the rocks are darkish grey, mith and addy look the same (and mith definitely works) but coal is much darker, almost black; specifically, 2107946 -> 855310 [picked, all of the vein was this colour when I picked it]. My changed version isn't worth posting as it's just a hack (ie. I just modified the procedure internally so that it never adds the first slot to the droparray), I will have to change it back if I want it to actually "DropAll".

I suppose alternately I could modify MSI and get it to use DropAllExcept somehow. I know this is a pretty minor thing.. maybe I could try and get an idea of how MSI works and write this myself :)

NCDS

2010-11-25 08:18:52

Would be easy enough to add this to MSI.

If 'Coins' is defined in DontDrop array, we could use SRL's coin finding functions (most likely outdated, but a very simple fix) to determine the slot. I don't see how it would work just defining slots though.

This will need to be added anyways for future things with MSI.

any_one

2010-11-25 08:35:21

Yeah.. still it's a little annoying to have to define every item that you might have in order to not drop it. But I suppose that might be more appropriate for MSI anyway :p

Coh3n

2010-11-25 18:43:06

From: any_one
Yeah.. still it's a little annoying to have to define every item that you might have in order to not drop it. But I suppose that might be more appropriate for MSI anyway :p

We could do only slots, but then you'd have to guess where a gem may end up when mining. :p

I think the simplest fix for this would be to simply make a Coins DTM…

NCDS

2010-11-25 20:04:31

From: Coh3n

I think the simplest fix for this would be to simply make a Coins DTM…

The image of coins changes for different amounts though, IIRC.

Coh3n

2010-11-25 20:11:06

From: NCDS
The image of coins changes for different amounts though, IIRC.

Yeah you're right, quite unfortunate. Perhaps a GetColor would work here?

NCDS

2010-11-25 20:16:08

From: Coh3n
Yeah you're right, quite unfortunate. Perhaps a GetColor would work here?



{*******************************************************************************
function FindCoins(var X, Y: Integer; Area: string): Boolean;
By: ZephyrsFury
Description: Finds coins in Area and stores the coords in x and y.
*******************************************************************************}
function FindCoins(var X, Y: Integer; Area: string): Boolean;
var
B: TBox;
CTS, I, J, H, L: Integer;
Pts, tPts: TPointArray;
ATPA: T2DPointArray;
V: array [0..1] of TVariantArray;
begin
case Lowercase(Area) of
'inv', 'inventory': B := IntToBox(MIX1, MIY1, MIX2, MIY2);
'bank': B := IntToBox(MBx1, MBy1, MBx2, MBy2);
'trade': B := IntToBox(323, 73, 509, 302);
'your trade': B := IntToBox(9, 73, 196, 302);
end;
V[0] := [1606307, 4, 0.09, 1.32]; //Darker colour (top of coins)
V[1] := [2209251, 8, 0.04, 1.08]; //Lighter colour (rest of the coins)
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetLength(tPts, 0);
try
for I := 0 to 1 do
begin
SetColorSpeed2Modifiers(V[I][2], V[I][3]);
FindColorsTolerance(Pts, V[I][0], B.X1, B.Y1, B.X2, B.Y2, V[I][1]);
if (Length(Pts) < 10) then Exit;
ATPA := SplitTPAEx(Pts, 10, 10);
h := High(ATPA);
L := High(tPts) + 1;
SetLength(tPts, L + h + 1);
for J := 0 to H do
tPts[L + j] := MiddleTPA(ATPA[J]);
end;
ATPA := SplitTPAEx(tPts, 20, 20);
H := High(ATPA);
for I := 0 to H do
if (High(ATPA[I]) = 1) then
Break;
if (I > H) then Exit;
Result := True;
MiddleTPAEx(ATPA[I], X, Y);
finally
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
end;
;)

Not sure if it's all up to date, but it's an easy fix even if it's not.

Coh3n

2010-11-25 20:21:08

Ah, wonderful. :)

Coh3n

2010-12-06 04:46:06

I've added a coin check in MSI_DropAll, so now it won't drop coins. :) I tested it with 15k in my inventory.

any_one

2010-12-06 06:05:41

Ah, that's handy! Nice, Coh3n :)

Coh3n

2010-12-06 18:14:05

From: any_one
Ah, that's handy! Nice, Coh3n :)

I changed this already. :p Now you actually can set the slots if you wish:

with Scripts[0] do
begin
Name := SCRIPT_POWER_MINER;
Rocks := [ROCK_GOLD];
DontDrop := [GEM_DIAMOND];
Exceptions := [1, 2, 3, 4]; // Inventory slots you do not want to drop/bank
end;