[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Editable "plugin preferences"
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Editable "plugin preferences"

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Cernunnos   Poland  (3 posts)  [Biography] bio
Date Thu 06 Jan 2005 02:30 PM (UTC)
Message
Hello everyone.
There is one thing I'd really like to have in MUSHclient - an ability to define my own "plugin preferences".
Now let me explain on an example.
I wrote a plugin which is logging current quests and displays its targets on infobar. This plugin checks if the character name said by the questmaster matches the name of my character (stored in a variable in a plugin) so that it won't catch some other guys quest. Now for every character I own I need different (but really the same) plugin with different charname in its variable. I know that I could create a variable in my character profile and refer to that but that's not very portable (I'm planning to release this plugin for other players of my mud). So an ability to change such things from the plugin preferences page would be nice. It could be some kind of flag added to certain variables in a plugin thet "marks" them as editable from plugin prefs. And additional it would be nice to have some simple boolean variables available as checkboxes to customise (a different flag, variables has to be '0' or '1' or truth of false or whatever).
And a button on plugin preferences displaying only for those plugins that have them (so maybe another flag on plugin details).
Now how about that? ;)
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Thu 06 Jan 2005 06:50 PM (UTC)
Message
Hmm, that IS useful, although I just use aliases, like Plugin:SetName <name>...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #2 on Thu 06 Jan 2005 07:53 PM (UTC)

Amended on Thu 06 Jan 2005 07:55 PM (UTC) by Flannel

Message
Or use entities. And then give a nice helpful note on install that tells them what they need to do to tweak the plugin to their own character.

Or, you could have a trigger that matches on whatever score screen if it contains their name, and set that to a variable.

Or if you knew their client was set to autoconnect, you could use GetInfo (or GetLoadedValue, or GetAlphaOption) and get their character name. You could even prompt them to ask if it was correct (or have them confirm/edit) by sending your alias (Plugin:SetName <namefound>) to the command line, so all they would have to do is hit enter. And if there was no name in the auto-connect, that would be their opportunity to enter it.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Cernunnos   Poland  (3 posts)  [Biography] bio
Date Reply #3 on Fri 07 Jan 2005 12:15 AM (UTC)
Message
Well, yes Flannels solution could work for me if mud was in english but I'm from Poland, mud is in polish and our language is not that simple. I don't know even how to explain that in english but my dictionary says it is called declension ;)
Basically it means that charname said by questmaster is little different from the one in autoconnect, so it will not work without users input.
[Go to top] top

Posted by Nick Gammon   Australia  (21,406 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Fri 07 Jan 2005 05:34 AM (UTC)
Message
Quote:

Now for every character I own I need different (but really the same) plugin with different charname in its variable.


The whole idea of plugins "saving state" is to handle that. The plugin saves data relevant to itself and the current world which is saved in a "state" file for that plugin/world combination. If you have multiple characters (presumably in multiple worlds) then each one will have its own state, and thus you can save the character name there.

All the plugin has to do is prompt the player to enter the name, which the plugin can catch as an alias. Something like this:


if GetVariable ("charname") == "" then
  Note ("Please enter: charname <your name>")
end -- if


Then make an alias "charname *" to accept the character name, and save it to a variable.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Cernunnos   Poland  (3 posts)  [Biography] bio
Date Reply #5 on Fri 07 Jan 2005 03:44 PM (UTC)
Message
Hmmm, good point. I guess I'll do it that way.
Thanks for help everyone.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,759 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]