[Mod] List Items [0.5] [listitems]

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

[Mod] List Items [0.5] [listitems]

by AntumDeluge » Sun Jul 09, 2017 07:25

listitems chat command

Description:

Chat Commands:
  • Single-word commands:
    • listitems
    • listentities
    • listnodes
    • listores
    • listtools
    • listmobs (requires mobs_redo)
    • Invocation: /<command> [-v] [string1] [string2] ...
      • command: Name of the command (e.g. listitems, listentities, etc.)
      • -v: Display description (if available) after object name (does not work with listores).
      • string[1,2] ...: String parameter(s) to filter output.
      • Without any string parameters, all objects registered in game are listed.
      • With string parameters, only objects matching any of the strings will be listed.
  • Generic list command.
    • Lists registered items or entities available in the game.
    • This command is disabled by default. To enable, set the config option listitems.enable_generic to true.
    • Invocation: /list type [-v] [string1] [string2] ...
      • type: List type (e.g. "items", "entities", etc.).
Global Functions:
  • listitems.list: Displays list of registered items or entities available in the game to player.
    • Invocation: listitems.list(player, l_type, switches, params, lower)
      • player: (string) Player name to whom the list is displayed.
      • l_type: (string) Which supported list to iterate ("items", "entities", etc.)
      • switches: (string) Options that affect output.
        • -v: Display description (if available) after object name.
      • params: (string) Item names to refine output list.
      • lower: (boolean) Make search case-insensitive (default: true).
Available Settings:
  • listitems.bullet_list (boolean) Displays items in a bulleted list (default: enabled).
  • listitems.enable_generic (boolean) Enables/Disables generic list chat command (default: disabled).
  • listitems.enable_mobs (boolean) Enables/Disables listmobs chat command (default: enabled if "mobs" available).

Image

Licensing:

Requirements:
  • Depends:
  • Privileges: none

Downloads:

Documentation:

TODO:
  • Add -d option to search within descriptions.
Last edited by AntumDeluge on Fri Aug 04, 2017 07:50, edited 15 times in total.
 

User avatar
DS-minetest
Member
 
Posts: 1022
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] List Items [0.1] [listitems]

by DS-minetest » Sun Jul 09, 2017 08:07

It would be nice if it would also count how many items were found.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
Chibi ghost
Member
 
Posts: 781
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] List Items [0.1] [listitems]

by Chibi ghost » Sun Jul 09, 2017 08:19

o0 I can only imagine how long my list would be
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.1] [listitems]

by AntumDeluge » Sun Jul 09, 2017 11:05

DS-minetest wrote:It would be nice if it would also count how many items were found.


You mean how many registered items, or how many of a specific item exists in world?
 

User avatar
DS-minetest
Member
 
Posts: 1022
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] List Items [0.1] [listitems]

by DS-minetest » Sun Jul 09, 2017 14:19

AntumDeluge wrote:
DS-minetest wrote:It would be nice if it would also count how many items were found.


You mean how many registered items, or how many of a specific item exists in world?

I mean how many item names are shown by the chatcommand with the given params.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.1] [listitems]

by AntumDeluge » Sun Jul 09, 2017 18:41

DS-minetest wrote:I mean how many item names are shown by the chatcommand with the given params.


Good idea.
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] List Items [0.1] [listitems]

by Wuzzy » Fri Jul 21, 2017 18:08

This mod is surprisingly useful. Thanks!
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.1] [listitems]

by AntumDeluge » Sun Jul 23, 2017 19:16

Wuzzy wrote:This mod is surprisingly useful. Thanks!

That makes me really happy to hear!
Last edited by AntumDeluge on Sun Jul 23, 2017 19:49, edited 1 time in total.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.1] [listitems]

by AntumDeluge » Sun Jul 23, 2017 19:17

I'm not very experienced with using regular expressions, but I think the mod could benefit from it quite a bit for refining searches.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.1] [listitems]

by AntumDeluge » Sun Jul 23, 2017 19:48

UPDATED!

Now displays number of items listed. Thank you DS-minetest for the suggestion.

listitems @ Git commit 7184a14

Note: I also changed it to display a bullet character (•) before each listed item, to try & make the output clearer & look nicer.

listitems @ Git commit 03e4c2c

Does anyone know of any instances where writing out the raw bullet character to the chat log might cause issues for the client or server? I believe that the bullet character is within the scope of the ANSI specification, & I believe that Minetest supports UTF-8. So I'm guessing that there wouldn't be any issue.
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] List Items [0.2] [listitems]

by Wuzzy » Sun Jul 23, 2017 20:19

The bullet point character displays for me.

I heard Russians often have problems with encodings in Minetest in general (I don't know if it affects your mod), you may want to talk to them.
But this may be a Minetest problem, I often heard Minetest does not have a working UTF-8 support yet (I hope it will get fixed someday).
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.2] [listitems]

by AntumDeluge » Sun Jul 23, 2017 20:21

Wuzzy wrote:I often heard Minetest does not have a working UTF-8 support yet


I may be mistaken then. I assumed it already fully supported UTF-8 as it seems to support multiple languages with the intllib mod.

--- Edit ---

That reminds me, I should probably add intllib support.
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] List Items [0.2] [listitems]

by Wuzzy » Mon Jul 24, 2017 01:15

Or maybe the UTF-8 bugs got already fixed. No idea, I haven't tracked this for a long time. You should talk to Minetest developers.

By the way: I think this mod is ready for release.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
Lone_Wolf
Member
 
Posts: 1979
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.4] [listitems]

by AntumDeluge » Mon Jul 24, 2017 09:24

Wuzzy wrote:Or maybe the UTF-8 bugs got already fixed. No idea, I haven't tracked this for a long time. You should talk to Minetest developers.

By the way: I think this mod is ready for release.


Added intllib support, in which the bullet character can be changed.

listitems @ Git commit 66d8a09

Also, requested topic move for mod release.

Lone_Wolf wrote:Great mod! Would love to see this as a CSM also.


I might think about doing this in the future.

--- Edit ---

Added config setting listitems.bullet_list to enable/disable displaying items in bulleted list (default: true).

listitems @ Git commit fe5718d
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] List Items [0.4] [listitems]

by Wuzzy » Mon Jul 24, 2017 12:38

Idea: Also add a “listentities” command. Same syntax as listitems, but lists all registered entities instead.

Idea: For items, also write the description in brackets (only if not nil, of course).

Maybe idea: For items, also search through the descriptions when using keywords (I'm not sure if this might cause problems).

Finally: Please rewrite the command help a bit. It is not clear what the parameters mean.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.4] [listitems]

by AntumDeluge » Mon Jul 24, 2017 18:36

Wuzzy wrote:Idea: Also add a “listentities” command. Same syntax as listitems, but lists all registered entities instead.


Funny, I was actually thinking about that last night.

Wuzzy wrote:Idea: For items, also write the description in brackets (only if not nil, of course).


Sounds good to me.

Wuzzy wrote:Maybe idea: For items, also search through the descriptions when using keywords (I'm not sure if this might cause problems).


This one might be a little more difficult for me, but I think it is a good idea. There should be parameters to search in item names &/or descriptions.

Wuzzy wrote:Finally: Please rewrite the command help a bit. It is not clear what the parameters mean.


Any suggestions? I was worried it was unclear when I wrote it. I'm not always the best at describing things or writing documentation.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.4] [listitems]

by AntumDeluge » Tue Aug 01, 2017 20:22

UPDATED!!! Use the -v option to display item descriptions.

listitems @ Git commit f3bf759


--- Edit ---

UPDATED!!! listentities command added.

  • Might be buggy.
  • Displaying descriptions doesn't seem to work.

listitems @ Git commit c0b9160
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] List Items [0.5] [listitems]

by Wuzzy » Wed Aug 02, 2017 00:33

de.txt:
## Help output description
List registered items = Registrierte Gegenstände anzeigen
List registered entities = Registrierte Entities anzeigen

## Help output parameters
options = Optionen
string1 = Text 1
string2 = Text 2

## Player used unrecognized switch
Unknown option: = Unbekannte Option:

## Search description
Searching in names ... = In Namen suchen …
Searching in names and descriptions ... = In Namen und Beschreibungen suchen …

## Number of items listed
Objects listed: = Aufgezählte Objekte:

## Bullet (change this if there are problems displaying the raw character "•")
• = •

Do what you want.

The commands themselves should NOT be translatable. This is asking for trouble. Mods and the Mesecons command block need to able to depend on the command name.
The -v option is missing in the command help. Hiding it in “options” is bad, because the user does not know which options are there. Better just show every possible option explicitly.



EDIT:
Oh, screenshot.png needs fixing. Required aspect ratio is 3:2 with a minimum size of 300×200 pixels.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.5] [listitems]

by AntumDeluge » Wed Aug 02, 2017 07:23

Thank you Wuzzy. I will make these changes & add your translation. I really appreciate the feedback.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.5] [listitems]

by AntumDeluge » Wed Aug 02, 2017 18:39

Wuzzy wrote:de.txt:

listitems @ Git commit 0ac4402

Wuzzy wrote:The commands themselves should NOT be translatable.

listitems @ Git commit 1748f06

Wuzzy wrote:The -v option is missing in the command help. Hiding it in “options” is bad, because the user does not know which options are there. Better just show every possible option explicitly.

listitems @ Git commit 5eed4cb

Wuzzy wrote:screenshot.png needs fixing. Required aspect ratio is 3:2 with a minimum size of 300×200 pixels.

listitems @ Git commit 499bc6f
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.4] [listitems]

by AntumDeluge » Wed Aug 02, 2017 19:39

AntumDeluge wrote:
  • Displaying descriptions doesn't seem to work.

I was wrong, it does work. It's just that there aren't many entities in my game that have descriptions.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.5] [listitems]

by AntumDeluge » Thu Aug 03, 2017 18:37

Added listores chat command:

listitems @ Git commit a25011e


--- Edit ---

Now commands can be invoked as /list items. Single-word commands (e.g. /listitems) are considered aliases:

/list items = /listitems
/list entities = /listentities
/list ores = /listores
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] List Items [0.5] [listitems]

by Wuzzy » Thu Aug 03, 2017 23:25

/list?

This sounds dangerous, it seems likely this word has already be used by some other mod or will be in the future because it is too freaking generic. I'd recommend to remove /list. It's pointless anyway because it's just longer than the real commands.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] List Items [0.5] [listitems]

by AntumDeluge » Thu Aug 03, 2017 23:40

You think so? I guess I kind of had the same feeling, but ignored it. You are probably right.

Can't registered chat commands be iterated? I could check first that it doesn't exist before registering it. I guess it's still not a great idea though. The core might one day like to make use of the list command.
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 10 guests