It's not apparent from LuaPlayer that there is a way to get the last request slot, instead of guessing the last slot, or using the, I believe, undocumented limit of 1000 slots. Having it as a LuaControl for player and entity "would be nice".
It makes sense a character is required for request slots to mean anything. A long check would need there to be a player.character, but unless I am missing something, no character present could return 0 slots, and the people wanting to *set* slots already need to ensure there is something to set slots on. (I checked, it's an error, not false/nil, to set it without a target). It looks like another controller like editor doesn't enable request slots, so returning 0 for a character-less controller might not cause problems? If it does, then that would require the long method and no changes at present.
This is just a small thing I've come across a few times, wanting to know which requests slots of a player should be considered instead of 1000.
request_slot_count for LuaPlayer
request_slot_count for LuaPlayer
I have mods! I guess!
Link
Link
Re: request_slot_count for LuaPlayer
LuaEntity::request_slot_count gives the highest requested slot for the entity, including characters.
Don't forget, you're here forever.