Mushclient Questions

by Esano

Back to Mechanic's Corner.

Unknown2010-05-15 00:42:04
QUOTE (Sylphas @ May 14 2010, 12:43 AM) <{POST_SNAPBACK}>
The most helpful thing you can do is learn to use regular expressions. Google it, there's plenty of resources all over that will show you how it's done. That's like half of programming here. The rest can be taught easily enough if you sit down and want to learn it. I'd be more than willing to give a basic programming class in relation to MUDs if people want, over IRC or something.



I would.. LOVE that. I'm honestly the type of person that can't miss a single step. You can't assume I know certain things.

Think of it like this, if LUA format was like a sandwhich... I'd need to know
1. Get the peanut butter from the pantry.
2. Remove cap from the peanut butter jar
3. Get a knife to spread the peanut butter... etc

Every single little step. I get lost so easy T_T
(seriously couldn't figure how to tie my own shoes till I was twelve. Stupid bunny loop around the tree and under the hole trick didn't help. )
Felicia2010-05-15 22:14:52
I'm switching from CMUD to MUSHClient. Thanks to Nick Gammon's video tutorials and a bit of reading, I now know how to do everything I could do in CMUD in MUSHClient, and more. (I can't do complex scripting yet, but I couldn't do that in CMUD, either).

I have only one problem: MiniWindows. CMUD has its own very user-friendly (compared to MUSHClient, that is) version of MiniWindows, which I've become addicted to. Aether channels, tells, the client-side map, and several other game elements that I frequently refer to are all in their own sized-to-fit, scrolling windows on my CMUD.

MUSHClient's MiniWindows require a much more sophisticated knowledge of scripting. I've watched Nick Gammon's 18-minute video tutorial on it and followed along as best I could, and I'm also reading up on the individual elements and the basics of Lua, but I think it will take a while before I can write a MiniWindow myself.

Does anyone have (or can you point me to) a basic template that would work for Lusternia if I plug in the font, positioning of the window, trigger information for capturing and ending the loop, things like that? I think I know enough to know where to put that information, I just can't write them myself yet from scratch (but I will... uh, eventually. Hopefully sooner than later).
Unknown2010-05-15 22:40:19
QUOTE (Felicia @ May 15 2010, 10:14 PM) <{POST_SNAPBACK}>
Does anyone have (or can you point me to) a basic template that would work for Lusternia if I plug in the font, positioning of the window, trigger information for capturing and ending the loop, things like that? I think I know enough to know where to put that information, I just can't write them myself yet from scratch (but I will... uh, eventually. Hopefully sooner than later).


I wouldn't know how to recode it, but when I tried Aardwolf, it gave me such similar things. I had downloaded the version they recommend for people who don't have any triggers and such, it can be found on the website. I wouldn't know how to switch it around to make it work for Lusternia though.
Felicia2010-05-15 22:56:34
QUOTE (TheSponge @ May 15 2010, 06:40 PM) <{POST_SNAPBACK}>
I wouldn't know how to recode it, but when I tried Aardwolf, it gave me such similar things. I had downloaded the version they recommend for people who don't have any triggers and such, it can be found on the website. I wouldn't know how to switch it around to make it work for Lusternia though.


Yeah. If no one has a blank template of sorts, I'll attempt to "Frankenstein-ize" something from another source (possibly the tutorial video itself), and see what needs to be changed to make it work for what I want in Lusternia.

I pretty much just want to complete my switch from CMUD to MUSHClient ASAP, then once I've made the switch, increase my knowledge of MUSHClient and Lua from there. Right now, only MiniWindows are standing in the way of that.
Felicia2010-05-16 07:03:33
Heh. What CMUD actually allows, is simply to capture lines (based on various criteria) from the main output window, then send those lines to one or more dummy worlds. One can gag the lines from the main output at the same time, which essentially grants my auto-map and chat channels their own free-floating, configurable, re-sizable windows.

The same thing is possible in MUSHclient. The technique for doing it in MUSHclient is more complex than in CMUD, but orders of magnitude less complicated than messing with MiniWindows. MiniWindows are far more robust, of course, but it's really not feasible for me to learn Lua before I switch clients.

I've been trying to wrap my head around MiniWindows for about three hours now, with far less luck than I thought I'd have. Basically, you have to actually understand Lua to utilize them properly; otherwise, it's like trying to figure out how to cook a pie from a cookbook written in a foreign language. Fortunately, the dummy windows should work. Only ??? more hours of work to go. Good thing it's a weekend!

EDIT: Finally got it all working properly! I could have used Treant's basic map as a baseline, but I don't think Treant includes a separate chat channels window, and now I've learned something. (What that something is, I'll not repeat in polite company.)
Ardmore2010-05-17 02:43:19
Okay! So... Hey.

Making a spectacles announcer, and it all works fine, but now I'm trying to modify it to interact with the Treant mapper system.

My issue is, sometimes I get lazy and I don't feel like loading the map, or the current area isn't mapped, all kinds of stuff like that.

So, for those cases (at least, this is what I thought the code did) I have: local area = mapper.current_area.name or nil
If there is no current_area.name, then... default to nil.

Run-time error
World: Treant
Immediate execution
:477: attempt to index field 'current_area' (a nil value)
stack traceback:
:477: in function 'announce'
:1: in main chunk

Is there a way to reference a table that may or may not be populated?
Sylphas2010-05-17 02:49:59
local area
if mapper.current_area then
area = mapper.current_area.name
end

Of the top of my head, though, so take it with a grain of salt.
Ardmore2010-05-17 03:28:54
Fixed it.
Sylphas2010-05-19 22:31:09
Why is this not working? (@!fae)\\#(\\d+) matches my leprechaun fine, since he's the first in line. It refuses to match the rest, even with "Repeat on Same line" checked. (\\w+)\\#(\\d+) does the same thing, as does \\#(\\d+) and (@!fae). They'll match one thing, at most, then be done. Really don't feel like having thirteen triggers when one should work. sad.gif
Unknown2010-05-20 00:11:39
Repeat on same line only works for coloring things. I've looked at that piece of code in the MUSHclient source several times, and it is technically possible for Nick to allow any regex to match multiple times in a single line, though I'm sure he has reasons for not doing it.

So, generally, you'll want to match the whole line and parse it yourself in script.
Sylphas2010-05-20 00:39:49
QUOTE (Zarquan @ May 19 2010, 08:11 PM) <{POST_SNAPBACK}>
Repeat on same line only works for coloring things. I've looked at that piece of code in the MUSHclient source several times, and it is technically possible for Nick to allow any regex to match multiple times in a single line, though I'm sure he has reasons for not doing it.

So, generally, you'll want to match the whole line and parse it yourself in script.


Ah, ok, so I'm not doing it wrong, it just doesn't work. That makes me feel less stupid.
Ardmore2010-05-20 00:40:42
I'm confused, though, since it seems he's doing NOTHING different than your name highlight trigger, and you don't have that in a script.
So... no, you shouldn't need to script that.
Unknown2010-05-20 02:29:33
Ardmore, re-read what I wrote and let it sink in... biggrin.gif
Ardmore2010-05-20 02:41:14
QUOTE (Zarquan @ May 19 2010, 10:29 PM) <{POST_SNAPBACK}>
Ardmore, re-read what I wrote and let it sink in... biggrin.gif

I read what you said, it just doesn't make sense... If it triggers to colour something why won't it trigger to run a script or add a variable or something?

sad.gif
Sylphas2010-05-20 02:42:30
QUOTE (Ardmore @ May 19 2010, 10:41 PM) <{POST_SNAPBACK}>
I read what you said, it just doesn't make sense... If it triggers to colour something why won't it trigger to run a script or add a variable or something?

sad.gif


Because MUSHclient is purposely coded like that.
Ardmore2010-05-20 02:44:09
Makes no sense.
Unknown2010-05-20 04:03:24
QUOTE (Ardmore @ May 20 2010, 02:44 AM) <{POST_SNAPBACK}>
Makes no sense.

http://i229.photobucket.com/albums/ee165/Znike/sense.jpg
Mirami2010-05-21 23:38:52
How do you reload a lua file after you've got your world running (completely reset it)?
Sylphas2010-05-22 00:14:46
I dunno if there's an elegant way to do it. Disabling and reenabling scripting might work. Editing your main script file with gibberish, deleting it, then saving should trigger MUSH to ask you to reevaluate as well.
Unknown2010-05-22 02:52:39
Shift+Ctrl+R reloads your main script file and anything else it includes. There's a button on the toolbar for it, too.