The questions continue... :-)

Posted by RasmusKL on Tue 19 Dec 2006 11:36 PM — 7 posts, 30,477 views.

#0
More questions pop in, as I investigate the fuller potential of Mush.. :-) But atleast I finally made my browser work out with the cookies of the registration thingy, I'm licenced, woo! :-)

- The infobar can be undocked and moved.. or so the helpfile says, how? :-) I'd like to dock it above the textbox where you enter commands :-)

- I havn't found any way to make a trigger (with AddTrigger or AddTriggerEx or SetTriggerOption) that makes my text use styles (bold, italic, underline) ... ? One option might be to use the functionality to load from xml?

- I'm currently investigating the use of plugins, but so far, I've been quite happy just using lua packages (using 3.83), since I've implemented an event system (which I plan on making available to more people once it's more mature)... So I have atleast a wee bit dependency between some of the plugins. I was thinking either of two models.
Anyways, the model isn't so important, but the only real way I could see this work is by either hooking into the reciever function for Broadcasts or doing multiple PluginCalls, and both options seem to be a lot of string parsing, which may not be efficient in the long run. Also I've had problems finding how it'd be possible for a plugin to communicate with the script file for the current world (excluding polling done by the script file - which is not realistic).

I know the last bit is kind of long and ... well, but it'd be nice to have a comment or Nick's thoughts on it? :-)

- Rasmus.
Australia Forum Administrator #1
Quote:

The infobar can be undocked and moved.. or so the helpfile says, how?


If you double-click on the infobar, quite close to the left-hand side, it becomes a moveable toolbar. Then you can drag it around, however I recommend holding down the Ctrl key while you do this, or you are likely to get the "big grey screen" effect (you will know it when you see it). If this happens I think there is not much alternative but to go the View menu and select "Reset Toolbar Locations".

However you can't really position it over the input box, as it will hide the most recent output line. You can put it elsewhere, like outside the main MUSHclient frame.

Quote:

I havn't found any way to make a trigger (with AddTrigger or AddTriggerEx or SetTriggerOption) that makes my text use styles (bold, italic, underline)


Do you mean match on those things? Or draw in the output window in different ways?

Quote:

I'm currently investigating the use of plugins ...


This is a good idea for modularity, and for distribution of your scripts. I would try to keep things in one plugin if possible, but if not BroadcastPlugin is probably a good way to go. To pass a lot of data around you may need to either do lots of broadcasts, or have some sort of comma or tab-delimited string, and then re-parse that in the other plugin. It sounds slow, but really the Lua regular expression matcher is very fast.

http://www.gammon.com.au/scripts/doc.php?function=BroadcastPlugin

To communicate with the main script file, you could do world.Execute, and then send something that an alias in the main world could pick up.

eg.


Plugin sends: world.Execute ("blah <params>")

Main world has alias: blah *
#2
Ah, I thought it might be possible to dock it between the command line and the output window, but I'll try to get used to having it below the command line then ;-)

---

I wanted to make my trigger alter the styles, like I can use the custom colours to change the text. But I found no option for doing eg. custom color 14 + bold or the likes... :-) I know I can do it manually in the trigger box, but I usually build most of my triggers from code.. Weird me :-)

---

About the plugins, as I'm not going to distribute most of my scripts (think I'm like the only user on Deeper Trouble that uses mush anyways) I feel that doing lua modules work as well as doing plugins, without getting additional interface problems.. :-) But that's just preference I guess, maybe I'll convert to plugins one of these days.

---

Btw, a small suggestion, it'd be really neat if there was an option to make selection in the output window automatically copy it (or atleast if you paste in the command bar), I usually never select anything in the output window if I am not going to paste it somewhere :-)


Thanks,
- Rasmus.






Australia Forum Administrator #3
Quote:

I wanted to make my trigger alter the styles ...


You can use the ImportXML function to add a trigger, in which case all trigger options are available. You can copy a sample trigger to the clipboard from the GUI interface to get the names of the options, or see this post:

http://www.gammon.com.au/forum/bbshowpost.php?id=7123
Amended on Fri 22 Dec 2006 03:20 AM by Nick Gammon
Australia Forum Administrator #4
Quote:

it'd be really neat if there was an option to make selection in the output window automatically copy it


There is an option under Commands -> Keyboard Preferences, that double-click pastes a word. Thus if you see something (like a player or mob name) you can double-click it to put it into the command window.
#5
Thanks.

I've fiddled a bit more with it. I've come to terms with the infobar - and I've seen the infamous gray screen effect.. :-)

Is it possible to do resizing of the infobar? It's really nice that you can dock it at the bottom and top, but when it has the shape it has, it's very very ineffective to dock it at the sides.. (gray screen effect :-P)..

I was thinking something in the lines of:

http://www.rasmuskl.dk/pics/mushsugg.png

Where the notepad would be my resized infobar and I could do multiple lines :-)

I know it's possible to do in the existing system with a notepad, but they're not very nice to work with from the scripts (also resize issues etc, would be nice to use the infobar instead, since it's meant for this exact thing).

Thanks,
- Rasmus.
Australia Forum Administrator #6
There isn't really a way of resizing it. Its behaviour is really built in to the MFC library.

As an alternative you may want to look at this post:

http://www.gammon.com.au/forum/bbshowpost.php?id=4951

Using that technique you would have total control over the size, appearance, and location of extra information you want to display.