SRL Archive - Reflection Development

R_DebugInv


**BANNED The Man

2011-02-04 14:15:15

So this will loop through your inventory and return the Item ID at each slot to Simba's Debug.
The reason it goes to debug is because at the moment we can't get the absolute co-ords for Inventory afaik.

{*******************************************************************************
procedure R_DebugInv;
by: Dynamite
Description: Debugs your inventory to Simba's Debug
*******************************************************************************}
procedure R_DebugInv;
var
InvLoopNumber:integer;
InvArray:array of TInvenItem;
begin
InvLoopNumber := 1;
for i := 1 to 28 do
ItemSlot := GetInven(i);
SMART_DrawTextEx(ClearScreen, (ItemSlot.CentrePoint.x) - 5, (ItemSlot.CentrePoint.y) - 25, 'UpChars', IntToStr(GetItemIDAt(i)), Color);
Inc(InvLoopNumber);
Continue;
end;

-Boom

Sir R. M8gic1an

2011-02-04 15:06:03

This is cool, although I'm not sure it belongs in the include…

perhaps utilities.simba ?

~RM

mormonman

2011-02-04 16:40:24

{*******************************************************************************
procedure DumpInvEx(all: Boolean);
By: 3Garrett3
Description: Prints out the inventory, `all' specifies whether or not to dump
empty inventory spaces.
*******************************************************************************}
procedure DumpInvEx(all: Boolean);
var
i : Integer;
Inv : TInvItem;
begin
for i := 1 to 28 do
begin
if (all or R_ItemExists(i)) then
begin
Inv := GetInvItemAt(i);
Writeln('Slot: '+ ToStr(i));
Writeln(' Name: '+Inv.Name);
Writeln(' ID: '+ToStr(Inv.ID));
Writeln(' Actions: '+ ToStr(Inv.Actions));
Writeln(' StackSize: '+ ToStr(Inv.StackSize));
end;
end;
end;

{*******************************************************************************
procedure DumpInv;
By: 3Garrett3
Description: Prints out all inventory items, including empty slots.
*******************************************************************************}
procedure DumpInv;
begin
DumpInvEx(True);
end;

:D

**BANNED The Man

2011-02-04 16:55:00

Gai :P
Oh well, I am working on an "on canvas" debug.
What are the parameters for: SMART_DrawTextEx
Ubuntu won't let me search for files including those words :(

-Boom

mormonman

2011-02-04 17:29:26

simba/includes/srl/srl/misc/paintsmart.scar
simba/includes/reflection/core/refpaint.simba

**BANNED The Man

2011-02-04 18:52:26

Thank you :)
Could someone please test this and tell me how it goes

program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i srl\srl\misc\paintsmart.scar}
{$i reflection\reflection.simba}
{$i reflection\core\RefPaint.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Active := True;
Nick := '';
Pin := '';
end;
end;

procedure SetupScript;
begin
Smart_Server := 121;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
ActivateClient;
SetupSRL;
SetupReflection;
DeclarePlayers;
LoginPlayer;
Wait (410+random(770));
end;

procedure R_DebugInv;
var
InvLoopNumber,i:integer;
ItemSlot:TInvenItem;
begin
InvLoopNumber := 1;
for i := 1 to 28 do
begin
ItemSlot := GetInven(i);
SMART_DrawTextEx(False, (ItemSlot.CenterPoint.x) - 5, (ItemSlot.CenterPoint.y) - 5, 'UpChars', IntToStr(GetItemIDAt(i)), clYellow);
Inc(InvLoopNumber);
Continue;
end;
end;

begin
SetupScript;
EnableSmartCanvas;
R_DebugInv;
end.
Have items in your inventory.

-Boom

**BANNED The Man

2011-02-07 18:15:19

Will fork and request pull tomorrow if it isn't committed by then.
Also, would just like to say a thank you to grats for testing while my simba was bugging :)

-Boom

mormonman

2011-02-07 18:47:15

Why not make it so that when you mouse over an inventory slot, it shows all the info for that item? Draw a box to show where they should mouse.

**BANNED The Man

2011-02-07 18:56:01

Well what other info would people want..?

grats

2011-02-07 18:59:41

Did you want to change the y axis 5 to a 25 like we did?






edit:

From: Dynamite
Most updated == main post


Oh, my bad.. rarely look at first post because all the new stuff happens at the end xD

**BANNED The Man

2011-02-07 19:03:38

Most updated == main post

mormonman

2011-02-07 21:04:13

From: Dynamite
Well what other info would people want..?


Every piece of information that a TInvItemholds.