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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Hotspots only in plugins?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Hotspots only in plugins?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 27 Dec 2009 02:41 AM (UTC)  quote  ]

Amended on Sun 27 Dec 2009 04:42 AM (UTC) by Nick Gammon

Message
In the interests of keeping this thread to only two pages, this feature has been added to version 4.46.

Please note that a restriction has been added in this version (not directly related to this problem, but found when testing it). The restriction is that miniwindows may not have an empty string as a name any more. This is because in various places in the code an empty miniwindow name is take to mean "no active miniwindow".

In particular, this will affect you if you are testing miniwindows outside plugins, and do this:


win = GetPluginID ()  -- get a unique name
WindowCreate (win, 0, 0, 200, 200, 4, 0, ColourNameToRGB("white"))  -- create window


In this case GetPluginID will return an empty string, which will now not be acceptable as a window name. Thus this code would fail outside a plugin, but work inside one.

To work around that, make sure that miniwindow names are not just the plugin ID, if you are testing outside plugins. eg.


win = GetPluginID () .. ":1" -- get a unique name


- Nick Gammon

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

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Fri 25 Dec 2009 01:41 AM (UTC)  quote  ]
Message
It doesn't appear to be added by now either. Any reason in particular this was scrapped?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sat 21 Mar 2009 07:44 PM (UTC)  quote  ]
Message
Quote:

Did it get added?


I forgot, sorry.

- Nick Gammon

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

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Sat 21 Mar 2009 12:46 AM (UTC)  quote  ]
Message
In my case I would never have a script file, just simply plugins, as I prefer modular programming. I also usually set up methods to communicate between the plugins when necessary. Usually aliases that are sent from one plugin to another with no command history added to them. So I can also test the sent data easily by simply typing in a test set as well.

-Onoitsu2
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Sat 21 Mar 2009 12:09 AM (UTC)  quote  ]
Message
Looking at the version history, it doesn't seem like this change has been made just yet.
[Go to top] top

Posted by Katie Love   (19 posts)  [Biography] bio
Date Fri 20 Mar 2009 11:24 PM (UTC)  quote  ]
Message
I just installed the latest version, and I'm still having this problem. Did it get added? I'd hate to go on a wild goose chance tracking down an error that doesn't exist.

Thanks!
[Go to top] top

Posted by Yergo   Poland  (20 posts)  [Biography] bio
Date Wed 03 Dec 2008 08:21 PM (UTC)  quote  ]
Message
Thank you in advance, Nick. Looking forward to new version :)

I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua)
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Wed 03 Dec 2008 07:38 PM (UTC)  quote  ]
Message
Thank you, thank you, thank you, thank you!!

In return, I'm slowly but surely converting everyone I know (and several people I don't) over to MUSHclient. Everyone's very impressed with your work (and mine, too, of course)!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 03 Dec 2008 07:27 PM (UTC)  quote  ]
Message
OK I see that if it is holding back development of miniwindows, that restriction can be removed.

The next version should come out in the next week or so.

- Nick Gammon

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

Posted by Yergo   Poland  (20 posts)  [Biography] bio
Date Wed 03 Dec 2008 05:05 PM (UTC)  quote  ]
Message
I'm a fan of scriptfile tuning and I'm not very happy when I must make a plugin. In my opinion hotspot option should be available as all other from the script file. When I'm writing scripts only for me it's much more esier to learn and edit/repair/improve.

Check this out: I'm playing now with sort of scripts that makes few simple functions available to user, eg. creating simple, preconfigured miniwindow at choosen place and size. And so, if somebody want to create with this plugin at start of world his set of miniwindows, it is impossible from scriptfile (when doing it in scriptfile is most intuitive), because he is limited to use $world->CallPlugin function instead of classic callbacks (plugin functions are hidden for scriptfile - why? I can use them from alias/macro/etc, but from scriptfile no? ), and he is forced to use a plugin, because hotposts don't work instead. Mess.

After all - yeah I used to make plugins from my scripts. But with plugin generator, with all triggers, macros, aliases and variables preseted. With all script tested and debugged. It's just easier to play with code and create required aliases/etc with a click instead of fighting with XML and crushings of client after plugin file updates.
----
After a bit of hours I'm just angry with this. So I'm making calmly a requesting for unblock the Hotspot feature to use it with scriptfile... Please?

Nick: Anyway, when are youg going to publish the new version?

I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua)
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Sun 21 Sep 2008 02:19 AM (UTC)  quote  ]
Message
I've tried the functions provided for communicating with various plugins and world files. It always ended in disaster when things just started getting too complicated for me to know what was going where any more. I'll worry about the distribution of my scripts, providing enough functionality and documentation to make them relatively seamless with existing world settings, but I'm not going through the rigmarole of getting my modular plugin design to work.

If the only reason for the hotspot limitation is to keep me from mucking with my world file, I'd like to be the judge of that and design my own scripts, for better or worse. I'm not about to get into fudging things with plugins to work around a hotspot limitation.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 21 Sep 2008 01:30 AM (UTC)  quote  ]
Message
First, here is a "reload the plugin I am working on" alias:


<aliases>
  <alias
   match="rl"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

if ReloadPlugin ("97d89d35e4b6d88747267240") == error_code.eNoSuchPlugin then
  check (LoadPlugin ("/program files/mushclient/worlds/plugins/some_plugin.xml"))
end
Note "plugin reloaded"

</send>
  </alias>
</aliases>


I use a variant of that (you need to change the plugin ID and the filename) so that if the plugin is loaded, it reloads it, and if not loaded (eg. because of a syntax error) it loads it from scratch. Then to test I just type "rl" and start testing.

Then I have the plugin open in Crimson Editor, so I can just Alt+Tab back and forth and effortlessly change things as required. To add more triggers/aliases/timers, just enter them in the main GUI, then use the Copy button to get them on the clipboard, then delete them from the main world file. Then, just paste them into the plugin where required.

You should be able to get them to communicate with each other with BroadcastPlugin or CallPlugin, combined possibly with GetPluginVariable or GetPluginVariableList.

The approach of putting everything in the world file, first misses out on some of the plugin-specific callbacks, and also makes it hard to distribute your ideas to players who may already have their own scripts in their world file. The whole idea of plugins was that you could selectively add them, regardless of whatever they already might be using.

I suppose hotspot callbacks could be called in the main script file, but I am reluctant to do that. Effectively it would encourage non-modular distributions. If you were desperate, you could fudge around it by making a small plugin whose job was simply to add hotspots to miniwindows, and when the callback was called, generate some alias that communicates with the main script.

- Nick Gammon

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

Posted by Larkin   (278 posts)  [Biography] bio
Date Sat 20 Sep 2008 12:05 PM (UTC)  quote  ]
Message
I don't like the modal dialogs, either, and I've been wanting the world settings one at least to be made modeless.

I try to build scripts that are very modular and will work for a variety of different characters. With plugins, I have a very difficult time making them communicate and share with one another, so I end up just putting it all in the world and my install/configure functions just load it and set it up for the user.
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sat 20 Sep 2008 11:58 AM (UTC)  quote  ]
Message
I never really had an issue with that. It's pretty trivial to make a 'reload this plugin' script accelerator.

Then again, I -always- have a text editor open. I by far prefer it, even. I don't like modal dialogs while I'm mudding either, so it actually allows me to do more at once.

That is not to say that I can't sympathize with your comment about transfering values, since I consider it somewhat of a pain as well. But in my eyes, any script is written decently from the ground up, so with the proper things encapsulated in the right plugins. It just saves me tons of work in the long run.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Sat 20 Sep 2008 11:37 AM (UTC)  quote  ]
Message
I use plugins very sparingly because I want my scripts to share the same memory space, basically. I don't want to have to deal with event notification, variable passing, or any of the issues that arise from making things too compartmentalized.

I understand that plugins can make it easier to distribute things to others. When I'm coding and debugging, however, they are more trouble to reload and test. You can't just open a dialog, tweak a trigger's properties, and try it again. You have to edit the plugin in a text editor and then reinstall it.
[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.


6,483 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]