Pluginator Updates (and requests)

Discussion of MUD clients, plugins, the website, and other technical stuff.
Gorth
Posts: 581
Joined: Sat Nov 13, 2021 11:53 am
Location: Michigan

Re: Pluginator Updates (and requests)

Post by Gorth »

If your code is operating in the general order that you've lain out blocks, then your scripts would be constantly jumping between zeros and the real numbers once this update goes live.

Does Lua not have a Table.update method?
:undm_scales_key: :shagerd:
Proud owner of the ten thousandth post.
Serity
Posts: 129
Joined: Wed Feb 16, 2022 2:59 pm

Re: Pluginator Updates (and requests)

Post by Serity »

Gorth wrote: Tue Nov 28, 2023 4:32 pm If your code is operating in the general order that you've lain out blocks, then your scripts would be constantly jumping between zeros and the real numbers once this update goes live.

Does Lua not have a Table.update method?
I mean, the way I do it (on live server) with Lua/Mudlet is just:

Code: Select all

-- trigger regex: ^\<\<\<(?<full>PLUGINATOR)\!\>\>\>(?<plugins>.+)\<\<\<\/PLUGINATOR!\>\>\>$
local p = matches.plugins
for k,v in p:gmatch("'(.-)': ([%d%.%-]+)") do
  game.pluginator[k] = tonumber(v) or v
end
lua game.pluginator
{
armor_level = 0,
balance = 0,
disguised = 0,
encumbrance = 1,
energy_current = 500,
...etc. The 'tonumber(v)' converts it to a number if possible.
User avatar
OldNoctere
Posts: 8
Joined: Mon Oct 30, 2023 7:15 pm

Re: Pluginator Updates (and requests)

Post by OldNoctere »

Gorth, you are correct in that you should clear the variables BEFORE you check them. I am sorry if the order I posted them gave that impression. It was just, that was order my thought processes worked and the zero-ing out was an after thought.
Gorth
Posts: 581
Joined: Sat Nov 13, 2021 11:53 am
Location: Michigan

Re: Pluginator Updates (and requests)

Post by Gorth »

Sorry. It probably feels like we're jumping down your throat. We're just trying to make sure that other people do it properly. :)
:undm_scales_key: :shagerd:
Proud owner of the ten thousandth post.
User avatar
OldNoctere
Posts: 8
Joined: Mon Oct 30, 2023 7:15 pm

Re: Pluginator Updates (and requests)

Post by OldNoctere »

Please also note, that what I mentioned is "one way" to do things. I never said it was the only way. There are many schools of thought of iterating over something versus verbose spelling out something with pro and cons for each but as a wise man once told me, "there are many paths to the top of the mountain"
User avatar
nobody
Posts: 501
Joined: Wed Jun 17, 2020 7:43 am
Contact:

Re: Pluginator Updates (and requests) !IMPORTANT FOR PACKAGE MAINTAINERS!

Post by nobody »

Rias wrote: Tue Nov 28, 2023 8:13 am It will also send the entirety of information once upon character login, and there will probably be a command to manually send all information if people need it for some reason (maybe to "refresh" all character data in their plugin or something) though the command would be rate-limited so it doesn't just get called constantly to try and replicate the old behavior.
I believe the current pluginator doesn't refresh data until it changes, so the first full set may be wrong if any meaningful gameplay has occurred with pluginator off. With this change, would it be possible to have it refresh all the values to their current true value and then send the full line rather than sending the full line with some possibly stale data?
User avatar
Rias
DEV
Posts: 2024
Joined: Sun Sep 03, 2017 4:06 pm
Location: Wandering Temicotli

Re: Pluginator Updates (and requests)

Post by Rias »

adresin wrote: Tue Nov 28, 2023 4:07 pm Will each change be separate then? Or if more than one thing changes in a tick, or whatever increment you're using, would the line still potentially include more than one item?
It sends each update individually the instant it occurs. I could have a version that only sends once every second with the most recent changes if people prefer that, but I thought it could get frustrating to have some updates lagging a bit.
nobody wrote: Tue Nov 28, 2023 4:44 pm I believe the current pluginator doesn't refresh data until it changes, so the first full set may be wrong if any meaningful gameplay has occurred with pluginator off. With this change, would it be possible to have it refresh all the values to their current true value and then send the full line rather than sending the full line with some possibly stale data?
I'll make sure that the initial "pluginator on" send is always nice and accurate.
<Rias> PUT ON PANTS
<Fellborn> NO
Gorth
Posts: 581
Joined: Sat Nov 13, 2021 11:53 am
Location: Michigan

Re: Pluginator Updates (and requests)

Post by Gorth »

Rias wrote: Tue Nov 28, 2023 4:51 pm It sends each update individually the instant it occurs. I could have a version that only sends once every second with the most recent changes if people prefer that, but I thought it could get frustrating to have some updates lagging a bit.
The latter would probably be more packet-size conscious, as well as less triggering in general for those older clients who struggle with that sort of thing. There are situations where a small bit of time might have changed something, but I posit that those situations should not be expected to be changed by scripts.
:undm_scales_key: :shagerd:
Proud owner of the ten thousandth post.
adresin
Posts: 30
Joined: Thu Sep 07, 2023 3:02 pm

Re: Pluginator Updates (and requests)

Post by adresin »

I'm definitely in favor of no lag, for sure. But depending on the reason for the change you're making in the first place, not sure if that would be helpful or not.

Basically I can work with either. I just need to know if the plugin itself should be set to handle updates with multiple items in one line beyond the initial full one, or if it should expect every change to contain a single item. I know, it would be smart to account for both just in case, but this is coming from someone who until recently hadn't used mush or lua for literally years. The pluginator is an amazingly useful feature, i"m just trying to catch up to make the parsing plugin just as useful. :)
User avatar
Rias
DEV
Posts: 2024
Joined: Sun Sep 03, 2017 4:06 pm
Location: Wandering Temicotli

Re: Pluginator Updates (and requests)

Post by Rias »

There may occasionally be times when the pluginator sends multiple pieces of information at once, so you'll want your code to be able to account for that. Ideally I'll find more opportunities to have it do so and cut down on the number of sends. This is just the first step toward greater efficiency: Not sending the entirety of all plugin information every single time it's called.
<Rias> PUT ON PANTS
<Fellborn> NO
Post Reply