Pluginator Updates (and requests)
Re: Pluginator Updates (and requests)
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?
Does Lua not have a Table.update method?
Proud owner of the ten thousandth post.
Re: Pluginator Updates (and requests)
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
...etc. The 'tonumber(v)' converts it to a number if possible.lua game.pluginator
{
armor_level = 0,
balance = 0,
disguised = 0,
encumbrance = 1,
energy_current = 500,
- OldNoctere
- Posts: 8
- Joined: Mon Oct 30, 2023 7:15 pm
Re: Pluginator Updates (and requests)
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.
Re: Pluginator Updates (and requests)
Sorry. It probably feels like we're jumping down your throat. We're just trying to make sure that other people do it properly.
Proud owner of the ten thousandth post.
- OldNoctere
- Posts: 8
- Joined: Mon Oct 30, 2023 7:15 pm
Re: Pluginator Updates (and requests)
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"
Re: Pluginator Updates (and requests) !IMPORTANT FOR PACKAGE MAINTAINERS!
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?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.
Re: Pluginator Updates (and requests)
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.
I'll make sure that the initial "pluginator on" send is always nice and accurate.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?
<Rias> PUT ON PANTS
<Fellborn> NO
<Fellborn> NO
Re: Pluginator Updates (and requests)
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.
Proud owner of the ten thousandth post.
Re: Pluginator Updates (and requests)
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.
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.
Re: Pluginator Updates (and requests)
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
<Fellborn> NO