Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Variables with default values, etc.

Variables with default values, etc.

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


Posted by Larkin   (278 posts)  Bio
Date Fri 11 Feb 2005 03:00 PM (UTC)
Message
Coming from zMUD after two years or so, I really like what I see now with MUSHclient. There are still some features that zMUD has that almost no other client has, and those I don't expect to see as core features here. However, I've found one or two simple features that I'd like to request:

1. Variables that can have default values. I know that it can be scripted to reset variables in the OnOpen or OnConnect events, but there may be people who do not wish to use scripting and writing a trigger to reset variables on connecting seems a bit strange. Plus, putting the default for your variable just something else you have to remember to do when you make a new variable.

2. Perhaps there could be an AddTimerEx script function that excepts more parameters. Specifically, I'm trying to setup timers that have a name and a send_to property, so that I can execute script code and still be able to remove the timer if something else happens first. (Hope that makes some sense.)

3. Some way to change colors in the status bar (not Info Bar) so that I could update it with green/red labels to indicate my balances or critical afflictions. zMUD does this, so I know that Windows is capable of doing it, though I don't know how easy it would be to make it scriptable. I've even written applications that had colored buttons in the status bar boxes.

4. I'd like an easier way to test my triggers, as hitting Ctrl-Shift-F12 and manually editing a block of text (especially with color codes) can be quite a hassle. One thing I really liked about scripting in zMUD was the ability to simply echo things to the output window and have the triggers and aliases all fire as though I were online. With MUSHclient, however, I get warnings about not being connected and so have resorted to testing my Python scripts in the Python IDE and my MUSHclient scripts using notes instead of actual commands.

I'll agree with what you said, Nick, on other threads about avoid bloatware by keeping most functionality in plugins, but these items I feel are part of the core functionality of the client. Thanks for the great work!
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Fri 11 Feb 2005 03:42 PM (UTC)
Message
For the fourth one, you can get phantom from http://www.magma.ca/~2k00lmag/muds/index.htm which allows you to connect to it, and do just that. Send text, and have it echo'd back. You're connected to a server, so you don't get yelled at.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #2 on Fri 11 Feb 2005 04:02 PM (UTC)
Message
I've used Phantom already, actually. I'm just afraid that it will interfere when I want to test multi-line triggers and my text is interleaved with the echo text. There ought to be a cleaner way to show "fake" output and test triggers.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #3 on Fri 11 Feb 2005 10:38 PM (UTC)
Message
On my site, poromenos.org, in the downloads section, there's a program called "Cat", you connect to it and you can have it echo textfiles to you (and even timestamped logs in real time). Maybe that will be useful to you, although I don't understand how it was doable in zMUD that is easier than in MC, could you explain that a bit more?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #4 on Fri 11 Feb 2005 11:28 PM (UTC)
Message
In zMUD, I would create aliases to echo back preset texts that I was using to test my triggers. I had one with a standard prompt, using zMUD's #SHOWPROMPT command and then I had a few that used #SHOW to echo text to my output window and fire my triggers while I was offline. I didn't need a server because it was all local output and the commands sent in response didn't give a warning about not being connected.

For the more rigorous tests, I always have to connect, but I like to see if I'm even anywhere close with my triggers and aliases before I connect and potentially hose my connection with loops. (One guy lagged out an entire city when his greeting alias got stuck in a loop. It even got others killed and they kicked him out of his guild, just to stop the spam and prevent more deaths!)
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #5 on Sat 12 Feb 2005 04:16 AM (UTC)

Amended on Sat 12 Feb 2005 04:39 AM (UTC) by Ked

Message
Quote:
I'm just afraid that it will interfere when I want to test multi-line triggers and my text is interleaved with the echo text.


I don't see how that could happen. Unless you explicitely build in some sort of delayes between the world.Send's that echo text, Mushclient will send it all in one go, from first send to the last one, and any of your responses to incoming echoes will be sent to Phantom _after_ it receives all the original echo text, sends it back, and Mushclient receives and starts processing it. Since the response leaves Mushclient after the original line had come back, I'd say that there's a _very_ slim chance of the response arriving back somewhere among the strings that left for the server long before it did. I've tested plenty of "trigger cascades" and straight multi-line triggers using Phantom and never had any problems with my response text cramming itself in between the echo lines.

I can see where having aliases that do #SHOW are useful for emulating MUD output generated by your responses to output received previously, but you can do the same thing with Mushclient aliases. Just set your triggers to send to Execute instead of World, and enable your "SHOW" aliases for testing, keeping them disabled on all other times. Though a better way would be to just make a plugin with an OnPluginSend hook, that substitutes your response text with actual MUD output before sending it off to Phantom. The only difference really is that Zmud does it on its own, and with Mushclient you need an echo server. But on the other hand, Zmud matches all your text through aliases, which allows both the simple way of testing triggers offline, and creates the furtile soil for the loops you described.

EDIT: Ack, it appears that OnPluginSend can't be used to replace the send text. The following function can however:


def OnPluginPacketReceived(strText):
    a = "\x0d\x0a"
    if strText == "testing"+a:
        return "tested okay!\n"


Since you aren't likely to send any colour codes or telnet commands from your triggers, simply appending a newline to the right side of the if test should be enough in most cases.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #6 on Sat 12 Feb 2005 06:19 AM (UTC)
Message
Or you can use the cat program poromenos has, which allows you to send things as you want, and does provide a server to throw commands at, guilt free.

Actually, it seems like an easy way of doing it would be to have a program that you can connect to two worlds with, one is your world, and the other could act as a 'server' which you could set up triggers to reply as expected from the server, to test your loops and other things. And you could also just switch worlds and send text directly.

You could even then use chat to send text from the 'server' so you never have to leave your own window.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #7 on Sat 12 Feb 2005 02:30 PM (UTC)
Message
Actually that would be extremely easy to make, like 10 minutes tops, but I'm not sure how useful it would be... If anyone wants, I might write it.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #8 on Sat 12 Feb 2005 03:54 PM (UTC)
Message
I find the cat server extremely useful. Thank you so much for writing it and making it freely available!

I'm not sure I understand the setup with the chat server, but it seems like you're suggesting a way to post more "live" data instead of catting it from log files. If that's what you're suggesting, I would be interested in this, also.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #9 on Sat 12 Feb 2005 05:41 PM (UTC)
Message
Flannel means that you could use one world to send data to another (from timers, triggers, etc), through a program that would connect the two worlds...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #10 on Sat 19 Feb 2005 11:22 PM (UTC)
Message
Quote:

1. Variables that can have default values. I know that it can be scripted to reset variables in the OnOpen or OnConnect events, but there may be people who do not wish to use scripting and writing a trigger to reset variables on connecting seems a bit strange. Plus, putting the default for your variable just something else you have to remember to do when you make a new variable.


I'm not sure what you mean by default values for variables. Variables don't exist until you create them, and in the creation process you assign a value. eg. in scripting:

a = 42 ' default value

or a MUSHclient variable:

SetVariable "myvar", "42"


Quote:

2. Perhaps there could be an AddTimerEx script function that excepts more parameters. Specifically, I'm trying to setup timers that have a name and a send_to property, so that I can execute script code and still be able to remove the timer if something else happens first. (Hope that makes some sense.)


You can use ImportXML, see:

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

This effectively lets you set up any parameters you like.


Quote:

3. Some way to change colors in the status bar (not Info Bar) so that I could update it with green/red labels to indicate my balances or critical afflictions. zMUD does this, so I know that Windows is capable of doing it, though I don't know how easy it would be to make it scriptable. I've even written applications that had colored buttons in the status bar boxes.


No, the standard status bar is just black on grey (or whatever your colour scheme is) however you can make other status bars, see:

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


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #11 on Sun 20 Feb 2005 12:28 AM (UTC)
Message
Thanks for your responses.

I have been working more with MUSHclient this past week and I have come to realize that it's simply different than what I am used to. Some of the features I felt were missing are not really missing or else not essential to what I'm doing.

For the variables with default variables, I was referring to the creation of a MUSHclient variable that has not only a current value, but also a "resettable" default that gets assigned to it on opening a world or when you reset the group it's in. (Of course, variables aren't in groups in MUSHclient. I'm referring to the #RESET command in zMUD, which can reset a class of aliases/macros/triggers/variables in one fell swoop.) I found a better way to do this, though, by just scripting the initialization of my variables to any default values I need and then saving the "saveable" values in MUSHclient variables.

I have also created a timer that will work for what I need. It wasn't clear to me from the documentation how to call a script function from a timer, but I received a tip on the forums here. I'm now able to make auto-resetting flags based on a combination of timers and triggers and that's exactly what I wanted.

I'll be writing a more detailed GUI application to communicate via UDP (COM is too messy and I'm not a VB fan), but I was just hoping that there was some simple way to color things in the status bar so that I could use it in the short term until I get the full application up and running.

Thanks again to Nick and everyone who helped answer my concerns about scripting in MUSHclient. I'm finding it to be very powerful and fun to use.
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.


34,659 views.

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

Go to topic:           Search the forum


[Go to top] top

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