MUSHClient

by Unknown

Back to Mechanic's Corner.

Unknown2005-02-07 08:34:49
Okay, I am a former/current zMUD user, and I just want to try out MUSHClient. Here's a few general questions, of which most zMUD-turned-MUSHClient users would probably ask:

1. What's the equivalent of zMUD's #SHOW/#ECHO/#SAY?

2. If I want to execute some scripting, whether it be basic or complex, within something such as a trigger or alias; do I need to call a script file (e.g. VBScript), or can I do scripting within the XML-like code or something else which MUSHClient uses?
Unknown2005-02-07 09:05:12
I'm a zMUD user who's now trying out MUSHclient. For writing to the Output screen as a simple echo message, look at the world functions ColourTell, ColourNote, and Note. You can use the Info functions to put text in the status window, though I don't use that too much yet.

You can write script code directly inside of an alias without having to call any code in a file. Just make sure you send the output to Script or use your script line prefix (default is /) before each script line. When you write a plug-in, you can include script code inside the "script" XML tag. The "plugin" tag will define the language used, so each plugin can have a different language.
Unknown2005-02-07 09:11:03
Thanks.

Bleh. Is there any way to "test" scripts while offline? When I try to do:

World.note "This monster is worth avoiding!"

it asks to reconnect.

Maybe I just have to create a new world which connects to something local....
Unknown2005-02-07 09:19:43
Using world.Note should not ask you to reconnect. Make sure you setup your scripting properly and that you're using the syntax for the language you specified. When you try to actually send a command to the MUD, it automatically tries to connect you. It's a bit annoying, especially for someone used to testing everything on zMUD. To test your triggers in MUSHclient, use the "Test Trigger..." option on the Game menu.

As for testing scripts offline, I use Python and I edit and test all my scripts inside Pythonwin. Once I have the basic principle of how my class methods interact, I switch from Pythonwin print statements to actual world calls. I've made a base class that provides an interface for my classes and then when I create things, I specify either a Pythonwin version or a MUSHclient version. The main difference between the two being the commands they execute (i.e., instead of sending commands to the world, the Pythonwin version simply prints them to the interactive window).
Unknown2005-02-07 10:50:45
To test things offline I normally use the simple echo server called Phantom from www.magnumsworld.com . I just run that, change the address to 'localhost' in Mushclient and the port to 23 in Phantom, and connect. It's also a great way to run "crashtests", sending long combat logs to see if your system can handle 20k lines of afflictions and attacks coming at it at once.
Unknown2005-02-08 05:04:23
Okay, 2 things:

1. How can I create status bars?

2. Can someone post an example of a VBScript trigger, or something similar (Python, whatever). Thanks.
Unknown2005-02-08 05:08:53
And also, how can I create an alias-like thing, using "/" as its prefix, like commands. This is what I want to do:

CODE


    match="/clr"
  enabled="y"
  send_to="12"
  ignore_case="y"
  sequence="100"
 >
 world.DeleteOutput
 



But it comes up with a code error message box, because it thinks it is an actual command but it can't find it.
Unknown2005-02-08 07:08:34
As for the alias, the "/" conflicts with the default script prefix character. If you absolutely need "/" for your aliases then you should change the script prefix to something else. Bring up the Scripting dialogue (Shift-Ctrl-6) and change the Script Prefix (bottom right corner) to something like "~" or maybe "#", or whatever.

Mushclient has an "info bar", which is a grey strip right bellow the command window. There are callbacks (most have "info" in their name) that can be used to change the font, and back and fore colours. There are also some callbacks to manipulate the application's status bar, but it can't create additional bars. Personally I've never used the status bar, but there are some plugins that do. For example the "Status_Bar_Prompt" plugin by Nick Gammon, which ships with Mushclient.

What do you mean by a "trigger in Vbscript"? Triggers and aliases (and almost everything else) is saved in XML format, they can use scripting and one of the ways to do that you just used in your alias. Another way is to put a function or sub name in the Script field field of the trigger/alias edit dialogue. The function/sub must be declared in a script attached to whatever entity (world file or plugin) the alias/trigger is declared in.
Unknown2005-02-08 08:08:48
QUOTE(Avator @ Feb 8 2005, 08:08 PM)
As for the alias, the "/" conflicts with the default script prefix character. If you absolutely need "/" for your aliases then you should change the script prefix to something else. Bring up the Scripting dialogue (Shift-Ctrl-6) and change the Script Prefix (bottom right corner) to something like "~" or maybe "#", or whatever.

Mushclient has an "info bar", which is a grey strip right bellow the command window. There are callbacks (most have "info" in their name) that can be used to change the font, and back and fore colours. There are also some callbacks to manipulate the application's status bar, but it can't create additional bars. Personally I've never used the status bar, but there are some plugins that do. For example the "Status_Bar_Prompt" plugin by Nick Gammon, which ships with Mushclient.

What do you mean by a "trigger in Vbscript"? Triggers and aliases (and almost everything else) is saved in XML format, they can use scripting and one of the ways to do that you just used in your alias. Another way is to put a function or sub name in the Script field field of the trigger/alias edit dialogue. The function/sub must be declared in a script attached to whatever entity (world file or plugin) the alias/trigger is declared in.
44709


I'll just leave the "/" alias, then.

Okay, I was looking at the "Health_Bar" plugin by Nick Gammon, and it's kind of nifty how it uses a Wingdings box-like symbol to display them. I want to modify this for Lusternia, but I'm not sure how to incorporate a trigger for the max values of scores in it.

blush.gif Heheh... I just saw another post where someone said that they have changed their system to "all VBScript", so I just assumed... yeah. Sorry. tongue.gif
Unknown2005-02-08 08:20:10
Oh, I think I've got the idea of the Health_Bar plugin thing, I just got confused by the entity thing.

(Sample plugin which helped me.)
Ethelon2005-02-08 16:47:08
Here's an autohealer you can use. It's best to CONFIG PROMPT ADD NEWLINE so it heals on the first prompt capture instead of waiting. I found this works far better than the Plugin from the Gammon Forums, which I used for awhile also until I got sick of double sipping.

CODE



    custom_colour="14"
  enabled="y"
  group="Alerts"
  match="(You may use another health, mana, or bromide potion, or medicine bag.|You may drink another health, mana, or bromide potion.)"
  name="trigger_health"
  regexp="y"
  send_to="12"
  sequence="100"
 >
 world.enabletrigger "HealReflex", "1"send>
 
    custom_colour="5"
  enabled="y"
  group="Reflex"
  match="^  Ego    \\: (.*?)\\/(.*?) (.*?)"
  regexp="y"
  send_to="10"
  sequence="100"
 >
 maxe%2
 
    custom_colour="8"
  enabled="y"
  group="Reflex"
  match="^  Health \\: (.*?)\\/(.*?) (.*?)"
  regexp="y"
  send_to="10"
  sequence="100"
 >
 maxh%2
 
    custom_colour="8"
  enabled="y"
  group="Reflex"
  match="^  Mana   \\: (.*?)\\/(.*?) (.*?)"
  regexp="y"
  send_to="10"
  sequence="100"
 >
 maxm%2
 
    custom_colour="3"
  enabled="y"
  expand_variables="y"
  group="*Reflex"
  keep_evaluating="y"
  match="^(.*?)h\\, (.*?)m\\, (.*?)e\\, (.*?)p (.*?)\\-"
  name="HealReflex"
  regexp="y"
  repeat="y"
  send_to="12"
  sequence="100"
 >
 if (%1 <= @maxhealth*.85) then
send "drink health"
enabletrigger "HealReflex", "0"
end if
if (%2 <= @maxmana*.85) then
if (%1 >= @maxhealth*.86) then
send "drink mana"
enabletrigger "HealReflex", "0"
end if
end if
if (%2 >= @maxmana*.86) then
if (%1 >= @maxhealth*.86) then
if (%3 <= @maxego*.85) then
send "drink bromide"
enabletrigger "HealReflex", "0"
end if
end if
end if


 


Unknown2005-02-08 19:35:37
I'm not sure what the 10 value does for the send_to. I know that 12 is script. My question, really, is what does the "maxe%2" and similar values do in this little script?
Unknown2005-02-08 21:12:20
It looks incomplete. Value 10 for send_to means "Execute", aka the world.Execute callback, which acts like typing the text in the command window - it is parsed through aliases. But Ethelon probably forgot to post the "max*" aliases. Which brings up the question - why not set the "maxmana", "maxhealth", "maxego" variables directly, instead of doing it through aliases?
Ethelon2005-02-09 02:28:49
I do alot of testing and had those set as aliases, which yes, I forgot to add. I'll repost the autohealer, sorry. This is how it should be set and should work now




custom_colour="14"
enabled="y"
group="Alerts"
match="(You may use another health, mana, or bromide potion, or medicine bag.|You may drink another health, mana, or bromide potion.)"
name="trigger_health"
regexp="y"
send_to="12"
sequence="100"
>
world.enabletrigger "HealReflex", "1"send>

custom_colour="5"
enabled="y"
group="Reflex"
match="^ Ego \\: (.*?)\\/(.*?) (.*?)"
regexp="y"
send_to="12"
sequence="100"
>
world.setvariable "maxego", "%2"

custom_colour="8"
enabled="y"
group="Reflex"
match="^ Health \\: (.*?)\\/(.*?) (.*?)"
regexp="y"
send_to="12"
sequence="100"
>
world.setvariable "maxhealth", "%2"

custom_colour="8"
enabled="y"
group="Reflex"
match="^ Mana \\: (.*?)\\/(.*?) (.*?)"
regexp="y"
send_to="12"
sequence="100"
>
world.setvariable "maxmana", "%2"

custom_colour="3"
enabled="y"
expand_variables="y"
group="*Reflex"
keep_evaluating="y"
match="^(.*?)h\\, (.*?)m\\, (.*?)e\\, (.*?)p (.*?)\\-"
name="HealReflex"
regexp="y"
repeat="y"
send_to="12"
sequence="100"
>
if (%1 <= @maxhealth*.85) then
send "drink health"
enabletrigger "HealReflex", "0"
end if
if (%2 <= @maxmana*.85) then
if (%1 >= @maxhealth*.86) then
send "drink mana"
enabletrigger "HealReflex", "0"
end if
end if
if (%2 >= @maxmana*.86) then
if (%1 >= @maxhealth*.86) then
if (%3 <= @maxego*.85) then
send "drink bromide"
enabletrigger "HealReflex", "0"
end if
end if
end if





Unknown2005-02-09 08:51:23
Ethelon, on your MUSHClient code in the "Afflictions" topic in the "Combat Guide" forums, some code off the end of each post is eaten, I think.
Ethelon2005-02-09 19:23:40
If needed I can send you a Zip file with the system from that topic, it seems there was some errors in how I posted it, making it hard for people to DL, so I've just been sending them the files
Unknown2005-02-10 18:28:18
Okay, if possible, could you please send me that Zip file. My email is afreeth@gmail.com.

Thanks.
Rauros2005-02-17 22:18:00
Question about MUSHclient. I downloaded version 3.65. I get this startup screen that has you click on a number. Does that happen every time I use it? And is this version free to use for as long as I want?
Ethelon2005-02-18 01:03:17
yes, that will happen everytime, it's a load screen. If you register that screen doesn't pop up anymore. It's only like what, 10 seconds though? Not that bad for something free
Unknown2005-02-18 02:45:20
Why did Gammon make it so you have to select the correct number? To make it more of a hassle?