Mushclient Questions

by Esano

Back to Mechanic's Corner.

Vhaas2009-05-01 07:36:25
Helpful, but I am not sure what you are saying in the last part.
Kelly2009-05-08 18:20:38
Hey y'all. This probably doesn't really belong here, but I didn't think it was new thread worthy. As a disclaimer, I don't know -that- much about coding outside of my basic C++ programming class and basic attempts at Java, so pardon if I'm misusing the jargon or am pretty much clueless.

Anyway, I've been running on Nexus ever since I had to operate via laptop (college), and silly Macs don't support MUSH. I found this MudWalker client (which I haven't tried, anyone know about it?) which scripts in Lua, which I believe is also compatible with MUSH.

So, my question is, would you be able to, say, take scripts as written for MUSH and use them in another client compatible with Lua? Would anything in the code have to be changed for compatibility? Help would be appreciated!
Unknown2009-05-08 18:39:11
Lua integration will vary slightly from one client to the next, meaning that you cannot simply take (most) scripts from one client and use them on another.

In theory (as I'm no Mac person myself), you could get MUSHclient running on MacOS X with Wine.
Kelly2009-05-08 18:49:06
(googles Wine) Ah, I didn't know about that. I was considering buying a copy of Windows (for some other things) but this looks like it's worth investigating. Thanks for the tip!

On that note, has anyone tried the Wine/MUSH setup?
Isuka2009-05-08 21:42:34
QUOTE (Kelly @ May 8 2009, 11:49 AM) <{POST_SNAPBACK}>
(googles Wine) Ah, I didn't know about that. I was considering buying a copy of Windows (for some other things) but this looks like it's worth investigating. Thanks for the tip!

On that note, has anyone tried the Wine/MUSH setup?

I've heard quite a few people have had success with it. I'm partitioning a section off to re-install openSUSE now that I've finished my MCSE stuff, and I'll be trying to get mush working there. I'll let you know.

One thing you have to think about is the client calls, though. For example, GetVariable() is something you'll use frequently in MUSH, but may not (probably won't) exist in other clients, because it's a MUSH specific function. These keep a direct port from one client to another from happening smoothly.
Kelly2009-05-08 21:56:47
So I went ahead and tried Wine (rather haphazardly) and I did get it to run MUSH quite nicely. Then, for giggles, I tried to set up the Treant system on it, but encountered the same problem as here: http://forums.lusternia.com/index.php?show...20&start=20

Was that problem ever resolved, or any ideas how to fix?
Unknown2009-05-08 21:58:12
Is there an easy way to port cMUD to MUSH triggers/aliases/variables and vice versa between the two clients?
Unknown2009-05-08 22:25:14
QUOTE (Jozan @ May 8 2009, 05:58 PM) <{POST_SNAPBACK}>
Is there an easy way to port cMUD to MUSH triggers/aliases/variables and vice versa between the two clients?


Nope! If you wanted to just convert the patterns, you could use XSLT and something like XML Cooktop to translate from one format to another, but the scripting between the two is very different and that's the real issue with porting things like this.
Unknown2009-05-08 22:27:42
QUOTE (Kelly @ May 8 2009, 05:56 PM) <{POST_SNAPBACK}>
So I went ahead and tried Wine (rather haphazardly) and I did get it to run MUSH quite nicely. Then, for giggles, I tried to set up the Treant system on it, but encountered the same problem as here: http://forums.lusternia.com/index.php?show...20&start=20

Was that problem ever resolved, or any ideas how to fix?


I don't think it was ever resolved, and I'm not a Wine user myself (nor do I wish to mess with it and start supporting it). If you're using the template world and script, try skipping that and just make your own world from scratch?
Unknown2009-05-17 16:41:53
How do you add a timer to MUSH? I figured it out for zMUD with help a long while ago, but now I want to do it for mush.

383h, 402m, 378e, 0p ex-

Would be great.

Thank you for your help ahead of time.
Isuka2009-05-17 16:55:14
From my main system file:
CODE
if not bushido then
    bushido = {
        mil = GetInfo(232),
        lastmil
    }
end

function bushido:getTime()
    local tm = os.date("*t")
    local td = string.format("%s:%s:%s",tm.hour,tm.min,tm.sec)
    self.lastmil = self.mil
    self.mil = GetInfo(232)
    local diff = self.mil - self.lastmil
    diff = string.format("%.3f",diff)
    return { = td, = diff}
end

Then, on my prompt script (where i gag and then reprint the prompt):
CODE
local tm = bushido:getTime()
ColourTell("steelblue",""," <<"..tm.. " +"..tm..">>")

Which looks like this:
<<9:54:49 +22.685>>
Unknown2009-05-17 16:56:10
QUOTE (Isuka @ May 17 2009, 12:55 PM) <{POST_SNAPBACK}>
From my main system file:
CODE
if not bushido then
    bushido = {
        mil = GetInfo(232),
        lastmil
    }
end

function bushido:getTime()
    local tm = os.date("*t")
    local td = string.format("%s:%s:%s",tm.hour,tm.min,tm.sec)
    self.lastmil = self.mil
    self.mil = GetInfo(232)
    local diff = self.mil - self.lastmil
    diff = string.format("%.3f",diff)
    return { = td, = diff}
end

Then, on my prompt script (where i gag and then reprint the prompt):
CODE
local tm = bushido:getTime()
ColourTell("steelblue",""," <<"..tm.. " +"..tm..">>")

Which looks like this:
<<9:54:49 +22.685>>


Thank you!
Isuka2009-05-17 16:57:58
You could make that it's own object by changing "bushido" to "time", and as such having your own individual time object, actually.
Furien2009-05-17 20:54:15
Got it working, thanks!
Fern2009-05-21 00:21:03
ohgods, what did I do?

Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Send-to-script cannot execute because scripting is not enabled.
Unknown2009-05-21 09:11:21
Ya open Configure or Configuration, then you clicks on Scripting, then you check 'enable script'. You can pick your scripting language ..VBScript, Phyton, Lua..
Unknown2009-05-21 10:47:28
If you load a script that has some egregious error in it, it will disable the script engine to protect your settings. You'd have to correct the error and reload the script (Shift+Ctrl+R), if that is the case.
Unknown2009-05-28 17:43:10
New question. Me being stupid again. Sue me.

So, I'm trying to make an alias to apply mending to a bodypart manually for hunting without actually having to go through 'apply mending to '. I had it working earlier and then my computer crashed without saving Treant changes. I've entered it back in identically (I think) and it sends 'apply mending to' now.

The script is

match="mnd"
enabled="y"
expand_variables="y"
regexp="y"
sequence="100"
>
apply mending to %1



So what am I doing wrong?
Unknown2009-05-28 20:57:44
Change your match to "^mnd\\s+(\\w+)$" and have it Send to Execute. The Send to Execute is so that Treant can track the salve balance correctly when you do this manually.

If you want to uncheck regex instead, you can use "mnd *" as your pattern.