[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Frequently Asked Questions (FAQ) about MUSHclient

Frequently Asked Questions (FAQ) about MUSHclient

This subject is now closed.     [Refresh] Refresh page


Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Thu 12 Apr 2007 11:58 PM (UTC)

Amended on Sat 27 Jan 2018 11:47 PM (UTC) by Nick Gammon

Message
1. What is a quick way to reach this page?

This page can be quickly reached from the link: http://www.gammon.com.au/faq





2. What is the fastest way to get help?

The fastest way is to search the forum. No matter the time of day or night, it is a big reference site waiting to help you.

Please try searching this forum.


Also, check out the Plugins page:



A lot of things that are asked for frequently are available as plugins.



3. I have lost my registration code

MUSHclient is now FreeWare. Download any version from 4.00 onwards and you do not need a registration code:





4. What is the latest version?

The latest version is always announced here:



Sometimes the "downloads" page lags a bit behind, in case we find bugs in the very latest version.



5. What changes were made recently?

See the release notes:





6. I am having a problem, and got an error message

It is very hard to help with vague descriptions and "I got an error".

Please post a query to the General section of the forum, including the following:


  • A exact copy of the trigger / alias etc. that is causing the problem.

    Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


  • A copy of the exact error message (copy and paste).

  • If a script is involved, a copy of the (relevant part of the) script.

    Template:codetag To make your code more readable please use [code] tags as described here.


  • A summary of what your settings are.

    Template:bug

    Please provide a summary of your world configuration:

    • Either use the scripting Immediate window (Ctrl+I) to execute: Debug ("summary")

      or

    • Install the Summary plugin (see "Summary" feature) and type "summary"

    Then copy the resulting information from the output window, and paste into a Forum message.

    You need version 4.55 onwards of MUSHclient to do this.







7. How do I use a suggested trigger or alias? It seems to have XML stuff like <trigger> or <alias> in it.

The XML format is designed to allow you to easily copy from the forum, and paste into MUSHclient, without lengthy instructions like "click on the regular expression check box".

See this post for copying an entire trigger / alias / timer from the forum and pasting it into MUSHclient in a single operation:





8. Do I need to use scripting? If so, how?

Scripting is entirely optional, however by doing it you can do fancier things, like checking if health is low.

Template:scripting Scripting tutorial

There is extensive information about scripting in MUSHclient at http://mushclient.com/scripting. This includes screen shots and examples.





9. What script language should I use?

We strongly recommend Lua these days. It is powerful and easy to use, and comes ready installed (supplied with MUSHclient). Some script languages (like Python, Perl, PHP) need you to download and install the script engine first.



10. Where is the documentation for script functions?

Online, everything is documented here:



A list of functions available in scripting is here:



However exactly the same information is in the MUSHclient help file - it is generated from the same database.


You can use Help menu -> Functions List to get a sorted list of all script functions, and narrow down the selection by entering something (eg. "trigger") in the filter box.



11. I made a trigger to fire on my prompt line, but it fires one line too late.

This topic has been heavily covered in the forum.

Please try searching this forum for the phrase "prompt newline".


The brief answer is that triggers fire when a "newline" (end-of-line) character is received, and some prompts do not have that. Various things you can do are:


  • Configure MUSHclient to convert an IAC EOR/GA to a newline. See world configuration -> Appearance -> Output section. This may not work for all MUDs.

  • Configure your MUD to add a newline to prompts.

  • Make a plugin that detects prompts using OnPluginPacketReceived, and adds a newline. One forum posting about that is here:



  • Make a plugin that detects partial lines using OnPluginPartialLine. One forum posting about that is here:






12. What are plugins?

Plugins are separate files that add functionality to the client. Some are supplied with it, some are available on this site from the plugins page, and some are written independently.

The plugins page:



Some plugins are released on the forum:





13. Can I get the MUD text read out to me?

There have been some posts about speech readers. Here is one:



There is a plugin that will speak incoming text from the MUD:



(Right-click and "save file as" to make a copy of the sapi.xml file, then install as a plugin).

More recently a Lua version has been released. For detailed installation instructions see:





14. What are regular expressions?

Triggers and aliases can either match on "simple" text (like "You are hungry") or with wildcards (like "You gain * experience").

However for more complex matching you can check the "regular expression" box and do things like searching for 5 digits followed by 3 letters. There is documentation about using regular expressions in the file docs/RegularExpressions.txt that comes with MUSHclient, and also the help topic "Regular Expressions". This forum post gives quite a few examples:

Template:regexp Regular expressions
  • Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
  • Also see how Lua string matching patterns work, as documented on the Lua string.find page.


Also see this page:



The full documentation for MUSHclient (PCRE) regular expressions is here:





15. Can I use MUSHclient under Linux?

We have had quite a bit of success running MUSHclient under Wine. See this forum section for details:



Also see this post for how MUSHclient can be easily installed under Ubuntu Linux:



You are advised to run MUSHclient with the /wine command-line option, or it may crash as it attempts to do some Windows-specific things. For example:


$ wine mushclient.exe /wine




16. Can I use MUSHclient under Mac OS/X?

I have been using 'Boot Camp' and 'Parallels' successfully on an Intel-based Mac. With Windows XP installed, MUSHclient runs like any other Windows application.

More recently I have used VMWare Fusion with great success.

http://vmware.com/products/fusion/

Of course, you need a copy of Windows to install under Boot Camp, Parallels or VMware. However since Windows has such a wide installed base, you should be able to find a (legitimate) copy somewhere.

For a while I had it running under Virtual PC as well, on a PowerPC Mac.

Another approach on a Mac is to install Wine and then run MUSHclient under that (this doesn't require you to have a copy of Windows):





17. How do I make a Macro key (like F4) call a script?

Macros are sent to the "command processor" - so make an alias that the macro can call. For example, an alias called some long name like "this_macro_calls_a_script". Then make F4 send "this_macro_calls_a_script".

Also see question 39 on this page.



18. How do I write a stat roller for my MUD?

Please try searching this forum for the phrase "stat roller".


There are lots of examples, and you should be able to base yours off one of them.



19. I can't connect to my MUD!

First read this: http://www.mushclient.com/forum/?id=8369

That post discusses the various error messages you might get and what they mean.

You could try another client - the problem is probably not MUSHclient itself. For example, "telnet" comes with Windows. Use Start Menu -> Run and type "telnet" and hit <enter>. If you get the GUI-based telnet application, there is a menu item to connect. If you see something like:


Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet>


You can now type: o <address> <port>

If that also fails you probably have a firewall between you and the MUD, or it might simply be down for some reason.

Please try searching this forum for the phrase "connect firewall".




20. I need to use SSH (secure sockets) to connect.

See this page:





21. How do I make a targetting alias?

A simple example is this:


<aliases>
  <alias
   match="target *"
   enabled="y"
   variable="target"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Now you can type: target kobold

You can make fancier ones that notify you when you change targets (with a bit of scripting).

There is a YouTube video showing the process of making a targetting alias:





22. How do I use a variable in a trigger or an alias?

If you check "expand variables" in a trigger, then MUSHclient variables are expanded, in both the match text and the sent text. Here is an example:


<triggers>
  <trigger
   custom_colour="7"
   enabled="y"
   expand_variables="y"
   match="@target hits you!"
   sequence="100"
  >
  <send>punch @target</send>
  </trigger>
</triggers>


In the above example whenever the "target" mob hits you, you automatically punch it back.

Another example is to make an alias that attacks whatever the current target is (from FAQ item 21 above):


<aliases>
  <alias
   match="k"
   enabled="y"
   expand_variables="y"
   sequence="100"
  >
  <send>kick @target</send>
  </alias>
</aliases>


In the above example, whenever you type "k" you will kick the current target.

Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


As well as using the targetting alias described in FAQ item 21, you can also manually set up variables by using the world configuration -> Scripting -> Variables tab. Simply click on the Add button, type "target" as the target variable name, and the name of the target as the contents. If the target variable already exists, simply double-click it to edit it.



23. How can I log chats etc. to another window?

The simple way is to make a trigger which "appends to notepad", like this:


<triggers>
  <trigger
   enabled="y"
   match="&lt;chat&gt; *"
   name="chats"
   send_to="5"
   sequence="100"
  >
  <send>%1</send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


The above trigger sends anything matching '<chat> *' to a notepad window called "chats".

For more control you could use the AppendToNotepad function (eg. to put a timestamp on each line).

Template:function=AppendToNotepad AppendToNotepad

The documentation for the AppendToNotepad script function is available online. It is also in the MUSHclient help file.



The problem with the notepad is it is in a single colour. Also, it will eventually slow down when it gets very big. To preserve the original colours in output from the MUD, you can send text to another "dummy" world, which will preserve colours. To do this you need to create (and open) a new world, and give it an IP address of '0.0.0.0'. This tells MUSHclient to not try to actually connect to it, so it stays closed. However you can still script text to go into its window.

Here is an example that sends chats to a world called "chats". For this to work you need to have Lua as your scripting language.


<triggers>
  <trigger
   enabled="y"
   match="&lt;chat&gt; *"
   send_to="14"
   sequence="100"
  >
  <send>
  
local w = GetWorld ("chats")  -- get "chat" world

if w then  -- if present
  for _, v in ipairs (TriggerStyleRuns) do
    w:NoteStyle (v.style)  -- change bold/italic/underline as required
    w:ColourTell (RGBColourToName (v.textcolour), 
                  RGBColourToName (v.backcolour), 
                  v.text)  
  end -- for each style run
  w:Note ("")  -- wrap up line

end -- world found

</send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


What this is doing is using the special variable TriggerStyleRuns which is set up when you send to "script (after omit)". It sends each style run (colour run) separately, and then terminates with a Note to end the line.

Also see this forum thread for examples of turning the above idea into a plugin, and also modifying it to handle multi-line chat messages:





24. How does the chat system work?

MUSHclient supports the MudMaster and zChat chat formats. You can use a GUI interface, a chat plugin, or totally script it yourself. See this page for more details:






25. How do I pause a script, or delay an action?

Scripts cannot literally pause (wait) because that would hang the entire client. One simple method of doing things with pauses, is to use the DoAfter script function which lets you do things after a delay. Note that timers must be active for this to work.

Here is an example of doing that:


<aliases>
  <alias
   match="eat"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
Send "open bag"
DoAfter (1, "get food bag")
DoAfter (3, "eat food")
DoAfter (4, "close bag")
</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


The DoAfter specifies how long to wait before doing the action, in seconds (you can use fractions). Note that each time interval is from now, so it would actually open the bag, wait 1 second, get the food, wait 2 seconds, eat the food, wait 1 second, and close the bag.

An alternative approach, which is more flexible (that is, it lets you script in decisions in the middle of the pauses) is to use Lua coroutines, as described in this post:



The same "eat" example could be coded like this, using that technique:


<aliases>
  <alias
   match="eat"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
require "wait"
wait.make (function ()

  Send ("open bag")

  wait.time (1)
  Send ("get food bag")

  wait.time (2)
  Send ("eat food")

  wait.time (1)
  Send ("close bag")

end) 
</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


In the above example, we now code the actual delays (1 second, 2 seconds, 1 second) rather than the delay from the very start.

You can also use the "wait" library to wait on text (eg. wait for some words to arrive from the MUD). You can even test for some text or a timeout. In other words, look for "Exits: *" but time out after 10 seconds if it doesn't arrive.



26. Can I access a database?

You can access a MySQL database from Lua using the techniques described here:



You can also use an ODBC database, see this post:



Version 4.38 of MUSHclient onwards also has support for the SQLite imbedded into the code for Lua scripting:



And from version 4.40 onwards you can use SQLite databases from all script languages:



Documentation about SQL is here:





27. Can I make COM objects?

From Lua, you can use LuaCOM to do that:



MUSHclient version 4.60 onwards has LuaCOM built in, so you just need to "require" it to use it. See the examples in the link above.

From other languages (like VBscript) you can use things like CreateObject to make COM objects.



28. Can I make a graphical status bar (for HP etc.)?

This thread describes how you can use miniwindows to make a bar that shows health, mana, etc. from information in your prompt.





29. I want to add triggers from the command line, like I could in my old client.

If you used to do something like this:


#action {you are hungry} {eat food}


... you can make a general alias that matches on that pattern ("#action {*} {*}") and make a trigger on-the-fly, without needing to use the GUI interface. Here is an example:


<aliases>
  <alias
   match="#action {*} {*}"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
ChangeDir (GetInfo (66))  -- make sure we are in MUSHclient executable directory


require "addxml"  -- addxml extension

-- add the trigger 

addxml.trigger {  
  match = "%1", 
  send = "%2",
  sequence = 100,
  enabled = true,
               }

ColourNote ("white", "green", "Added trigger to match on '%1', sending '%2'")
</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.




30. How come world.note doesn't work in my script?

Some script languages, including Lua, are case-sensitive. You must use the exact capitalization shown in the documentation. For example:


note "hi there" --> error: attempt to call global 'note' (a nil value)

Note "hi there" --> 'hi there' displayed


There are various things in the client to help get the spelling and capitalization right. For example, when editing a script in the "send to script" window you can click on the "Complete" button to finish a half-typed function name, including the correct capitalization.



31. How do I do arithmetic in a script?

You can use either MUSHclient variables, or simply the variables available in your script language.

The posting about scripting discusses this in some length:



Basically:


  • MUSHclient variables are remembered (saved to disk) from one session to another; but
  • Script language variables are easier to use


Here is a simple trigger that counts the rats you kill (using Lua scripting):


<triggers>
  <trigger
   enabled="y"
   match="A rat dies!"
   send_to="12"
   sequence="100"
  >
  <send>
rats = (rats or 0) + 1
Note ("You have now killed ", rats, " rats")
</send>
  </trigger>
</triggers>


The idiom "(rats or 0)" is used to ensure that the number zero is used initially, otherwise you get an error message "attempt to perform arithmetic on global 'rats' (a nil value)".

This example below shows using a MUSHclient variable to track total xp gained:


<triggers>
  <trigger
   enabled="y"
   match="You go up a level and gain * xp!"
   send_to="12"
   sequence="100"
  >
  <send>
xp = tonumber (GetVariable ("xp")) or 0

xp = xp + %1

SetVariable ("xp", xp)

Note ("Total xp gained is ", xp)</send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


In this case we grab the "xp" variable (by calling GetVariable), so we can work with it. We then add the new amount, and save the new amount back (by calling SetVariable).



32. How do I compare a wildcard in a trigger?

A common mistake is to take a "string" value (like a name) and try to compare it inside a trigger without quoting it. For example:


(bad example)

<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="* hits you!"
   send_to="12"
   sequence="100"
  >
  <send>
if %1 == "kobold" then
  Send ("kill %1")
else
  Send ("flee")
end -- if</send>
  </trigger>
</triggers>


The problem with this example is that when the wildcard is substituted by MUSHclient for %1, it will end up reading:


if kobold == "kobold" then


Unfortunately, the first kobold is treated as a variable name (which will probably contain nothing) rather than the string "kobold". To correct it, you have to quote the wildcard, like this:

(good example)

<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="* hits you!"
   send_to="12"
   sequence="100"
  >
  <send>
if "%1" == "kobold" then
  Send ("kill %1")
else
  Send ("flee")
end -- if</send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Note the quotes in the 'if' statement.




33. How can I match the colour of a word in a trigger?

If the colour is for the very first matching character, then you can use the trigger dialog box to specify that colour.

Otherwise you need to call a script, and have that script check the "style runs" of the matching line. When MUSHclient stores text in the output window, it starts a new "style run" for each change in colour/style (eg. red text to white text, or bold to italic).

If your trigger calls a Lua script function, it gets passed a fourth argument (the first 3 being trigger name, matching line, and wildcards table). The fourth argument is a table of the style runs in the matching line.

Each entry has a sub table for:


  • text - the actual text
  • length - the length of this style run
  • textcolour - the RGB colour of the text in this style (number)
  • backcolour - the RGB colour of the background (number)
  • style - style bits (bold=1, underline=2, blink=4) or'ed together (eg. bold underline would be 6)


Thus by iterating over the style runs (in a 'for' loop) you can find what colour a particular part of the line is in.

There is a post about a Lua function that does exactly that:



You could do a similar thing in other script language by using GetLineInfo and GetStyleInfo.



34. How do I stop that annoying "script error" dialog box?

In the world configuration -> Scripting -> Scripts page, you can check "Note errors".

Now, instead of a dialog box appearing on a script error, it is written to the output window. This is less obtrusive in the middle of a battle, and then you can go back and review it later to see what went wrong.




35. How can I check inside an alias that I am connected to the MUD?

If you are using Lua, you can add this line (assuming you are sending to script):


assert (not (GetInfo (106) or GetInfo (107)), "Not connected to MUD")





36. How can I check I haven't turned timers or triggers off?

If you are using Lua, you can add these lines to a script:


assert (GetOption ("enable_timers") == 1, "Timers not enabled")
assert (GetOption ("enable_triggers") == 1, "Triggers not enabled")




37. How can I capture multiple lines in a trigger, for example an inventory list?

There are a few ways of doing this. For a start there are multi-line triggers, which can work in some cases, if the multi-line group has a well-defined start and end point.

Multi-line triggers can be fiddly to get working, because you need to:


  • Anticipate the maximum number of lines you might get
  • Find a good starting point to identify the start of the sequence
  • Handle line-breaks inside the regular expression
  • Find a good ending point to identify the end of the sequence
  • Make sure it doesn't keep matching as the text scrolls up the output window


Another, probably more reliable, way is to use three different triggers. The example below illustrates this.

The first trigger matches the start of an inventory list (ie. "You are carrying:"). This one enables the remaining two triggers.

The second trigger matches anything (ie. "*") and adds whatever it finds to an "inventory table". This is for subsequent processing.

The third trigger detects the end of the inventory list. In this case we detect a prompt line (starting with "<") or just a blank line. For this to work properly you need to make sure that under File menu -> Global Preferences -> General you have checked "Regular expressions can match on an empty string".

Once the end of the inventory list is reached the second and third trigger are turned off again (as we are no longer getting inventory items). This is a good place to do some work on the inventory. For example, check you have sufficient supplies, copy to a notepad window, something like that. The example below simply sorts into alphabetic order, and displays each line.

These triggers are designed to work with Lua scripting, however the general technique could be used in all scripting languages.


<triggers>

<!-- trigger to match start of inventory -->

  <trigger
   enabled="y"
   match="You are carrying:"
   send_to="12"
   sequence="100"
  >
  <send>
inventory_table = {}
EnableTrigger ("inventory_line", true)
EnableTrigger ("inventory_stopper", true)
</send>
  </trigger>

<!-- trigger to match an inventory line -->

  <trigger
   match="*"
   name="inventory_line"
   send_to="12"
   sequence="50"
  >
  <send>
  table.insert (inventory_table, "%0")  -- add inventory item to our table
  </send>
  </trigger>

<!-- trigger to match end of inventory -->
  
  <trigger
   match="(^&lt;)|^$"
   name="inventory_stopper"
   regexp="y"
   send_to="12"
   sequence="40"
  >
  <send>
-- don't need to track inventories any more
EnableTrigger ("inventory_line", false)
EnableTrigger ("inventory_stopper", false)

-- in case no table yet
inventory_table = inventory_table or {}

table.sort (inventory_table)

print ("In your inventory is:")

for _, item in ipairs (inventory_table) do
  print (item)
end -- for

  </send>
  </trigger>
    
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


A third approach is to use the "wait" module in Lua, to make a script that pauses and waits for the various inventory lines to arrive. There is a forum posting about this, including links to a YouTube video that shows how you can set up such a script:

Template:post=9965 Please see the forum thread: http://gammon.com.au/forum/?id=9965.





38. How do I call an alias from a script (or an alias from another alias or trigger)?

If you are doing some scripting, and want to send some commands to be re-evaluated for aliases, speed-walks etc. then you can use the world.Execute function.

In an alias or trigger, simply use "send to: Execute".

Text sent to the Execute function is re-evaluated by the MUSHclient command processor, and thus can contain other aliases, speed-walks, scripting prefixes, etc.

There are more details in this forum post:





39. How can I make a keystroke like Ctrl+K do something?

The quick way is to script an Accelerator command like this:


/ Accelerator ("ctrl+K", "kick")


This assumes you have Lua scripting turned on and "/" as the scripting prefix. However such changes only persist for the current session.

This small plugin below could be used to add as many extra keystrokes as you want, just copy and paste into Accelerators.xml file, and install as a plugin. You can edit the "Accelerator" lines near the bottom to add new ones, or change the ones there (part in bold below).

If you want to do something fancier than simply sending something to the MUD, make the accelerator send a word that matches an alias, for example:


Accelerator ("ctrl+H", "check_health")


Now if you make a "check_health" alias, you can do whatever you want inside it.

Another method is to use AcceleratorTo which lets you send the text to somewhere you nominate (eg. the scripting engine). For example:


AcceleratorTo ("Shift+Ctrl+H", [[

   -- script goes here
   ColourNote ('white', 'blue', 'Hello, world!') 

    ]], sendto.script)


Template:saveplugin=Accelerators To save and install the Accelerators plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Accelerators.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Accelerators.xml (which you just saved in step 3) as a plugin
  7. Click "Close"



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
   name="Accelerators"
   author="Nick Gammon"
   id="bcd4c85623b51c11ec643123"
   language="Lua"
   purpose="Add custom keystrokes"
   date_written="2007-04-17 16:16:25"
   requires="3.80"
   version="1.0"
   >
</plugin>
<script>
<![CDATA[
function OnPluginInstall ()

  Accelerator ("ctrl+E", "eat food")
  Accelerator ("ctrl+K", "kick")

  -- add more here ...

  -- list them
  for _, v in ipairs (AcceleratorList ()) do Note (v) end

end -- function OnPluginInstall
]]>
</script>
</muclient>





40. The help file doesn't work under Windows Vista!

It seems Microsoft in their wisdom are not releasing the WinHlp32.exe program that used to ship with Windows. You can do a few things to work around this:


  • Grab a copy of WinHlp32.exe (8 Kb) from an existing earlier version of Windows

  • See this forum post:



    The help files are now released as individual HTML files, which you can open in your web browser.

  • The material in the help file is online at:



    This is the identical information that is in the help file - it is generated from the same database.

  • Go to the Microsoft "Help and Support" site. This article describes why they are not supporting WinHlp32.exe:

    http://support.microsoft.com/kb/917607

    They offer to let you download a copy:

    http://go.microsoft.com/fwlink/?LinkID=82148





41. How do I add a trigger / alias / timer with an option that is not supported by AddTrigger / AddAlias / AddTimer?

You can easily add triggers/aliases/timers by setting all the options in a Lua table, and then using addxml.trigger, addxml.alias or addxml.timer which are now part of the "addxml.lua" file that ships with MUSHclient. See:



If you are not using Lua, you can use ImportXML instead:

Template:function=ImportXML ImportXML

The documentation for the ImportXML script function is available online. It is also in the MUSHclient help file.





42. I get an error (Error -2147221005) when enabling scripting

A message like that that appears immediately after enabling scripting indicates that the script engine is not installed (or not fully installed). This particularly appears to happen with Python, PHP and Perl.

Various script engines are supplied independently of MUSHclient by the various organizations that supply them. The exceptions are:


  • Lua ships with MUSHclient and is thus always available

  • VBscript and Jscript are usually installed as part of a Windows installation, as a lot of web pages use VBscript and Java script.


For other engines (eg. Python, PHP, Perl), you will need to go to their web site and download the script engine.

After doing that you may also need to "register" the script engine with Windows. There is a "Register DLL" button in the scripting configuration dialog, that works with some script engines.

In the case of Python you may also need to run the Python script "pyscript.py". Read the Python documentation, or search this forum, for more details.

Important! Make sure you download the 32-bit version of script engines like Python or Perl. MUSHclient is a 32-bit application (not 64-bit). Attempts to interface with 64-bit script engines will fail.



43. I am having problems running under Microsoft Vista - no data seems to arrive from the MUD

A user has reported that taking these steps can help:


  • Install MUSHclient in a path other than C:\Program Files. (eg. C:\ or "My Documents")

  • Before running MUSHclient, make a shortcut to the MUSHclient.exe program in the installation directory. Then right-click on the shortcut icon, and go to Properties -> Compatibility, and tell it to:


    • Run with Administrator privileges; and
    • Run in Windows XP compatibility mode.


  • It may also help to open a command window (Start Menu -> Run -> "cmd") and then type:


    netsh int tcp set global autotuninglevel=disable


    You need to do this when logged in with Administrator privileges.


Also see point 40 (above) about problems using Help - you may need to download WinHlp32.exe from the Microsoft site.



44. Most or all of the client window went gray when I dragged the Info bar



This is a known bug in the way one of the internal libraries works.

To fix it, go to the View menu and select "Reset Toolbar Locations".



If you are not using the Info bar you could uncheck "Info Bar" (see above) so you don't accidentally do that again.



45. Can I have a non-English version of MUSHclient?

MUSHclient versions 4.10 onwards have had Internationalization code put in them. This make it comparatively easy for people who speak other languages to make a localized version. This forum post describes the process in some detail:

http://mushclient.com/forum/?id=7953

If anyone wants to contribute to the localization process they are very welcome to make a post in the International part of the forum.



46. Pressing Ctrl+C does not copy text from my output window

If possible, upgrade MUSHclient to version 4.42 or above. That fixes the problem.

Otherwise ... this is because you have the Global Option set "All typing goes to command window". Because of this the Ctrl+C is directed to the command window, not the output window.

You can uncheck that option (File menu -> Global Options -> General -> All typing goes to command window).

Or, you can install this plugin (RH-click to download it):



Once downloaded (you need to "save as file", not simply open in your web browser) - you can use the File menu -> Plugins to install it.



47. How can I repeat a command x times, like: #3 punch

See this forum thread: http://www.mushclient.com/forum/?id=8473

There is a plugin you can install that lets you repeat a command, you can download it by RH-clicking this link:



Once downloaded (you need to "save as file", not simply open in your web browser) - you can use the File menu -> Plugins to install it.

Alternatively, to "manually" repeat things, just type Ctrl+R to repeat the last thing you sent.



48. How can I make the MUSHclient window semi-transparent?

There is no GUI interface for doing this, you must enter a line of scripting, like this:


Transparency (GetSysColor (12), 255)


The above example makes the gray "frame" colour fully transparent, so that you can see the desktop where there are no world windows.

For some example screen shots, see:



Alternatively, this makes the whole MUSHclient window 50% transparent:


Transparency (-1, 127)


The second number should be in the range 0 to 255 - with 0 being completely transparent (so you can't see anything) and 255 being fully opaque (like normal). Don't use a low number like 0 as you won't be able to see the client window and thus won't be able to enter any commands or use the menus.

As there is no GUI interface to change this, if you want it to happen automatically you could put the above line at the very end of the Lua "sandbox" if you are using Lua scripting. (File menu -> Global Preferences -> Lua).

For other languages you could make a simple trigger that does the transparency command as part of the login sequence - just detect some line that normally appears as part of the MUD "greeting", like this:


<triggers>
  <trigger
   enabled="y"
   match="Original DikuMUD code by:"
   send_to="12"
   sequence="100"
  >
  <send>
  
Transparency (GetSysColor (12), 255)

</send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


There is more documentation here:

Template:function=Transparency Transparency

The documentation for the Transparency script function is available online. It is also in the MUSHclient help file.



Note that the Transparency function only works under Windows XP and Vista, not under Windows 95/98/ME/NT etc.



49. How can I enter speedwalks without a special prefix?

See this forum posting:



That describes an alias that will recogize speedwalks sequences automatically and expand them for you.



50. How can I make an alias take an optional wildcard?

For example, if I type "heal" I want to "cast healing touch" but if I type "heal Nick" I want to "cast healing touch Nick".

The simple approach is to simply leave out the space between the word ("heal" in this case) and the wildcard, like this:


<aliases>
  <alias
   match="heal*"
   enabled="y"
   sequence="100"
  >
  <send>cast healing touch%1</send>
  </alias>
</aliases>


The above alias will match on simply "heal" and therefore will work as described. However the problem is, it will also match on other words starting with "heal" (eg. "health", where it would send "cast healing touchth", which you probably don't want.

A better approach is to use a regular expression, like this:


<aliases>
  <alias
   match="^heal( .*){0,1}$"
   enabled="y"
   regexp="y"
   sequence="100"
  >
  <send>cast healing touch%1</send>
  </alias>
</aliases>


Now this one only matches on "heal" on its own, or "heal" followed by a space, and then something else, so it won't match "health".

If you need to make a different action occur based on whether the optional wildcard is present, you can test for that in a script, like this:


<aliases>
  <alias
   match="^heal( {1,}(.*)){0,1}$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
if "%2" == "" then
  Send ("cast healing touch self")
else
  Send ("cast healing touch %2")
end -- if
</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


This example uses a second set of brackets to create wildcard 2, which is the target of the heal, if any. It also allows for multiple spaces after "heal". By testing if %2 (wildcard 2) is an empty string or not, you can script different behaviour.



51. I did a Note (or ColourNote) in a trigger script, but the note does not appear!

This will happen if you do "send to script" and, in your script, use Note (or a variant, like ColourNote, ColourTell, AnsiNote and so on) and have the trigger doing "omit from output".

The reason is that MUSHclient omits from the start of the triggered line(s) to the end of the output buffer, which also deletes any notes you may have done.

Version 4.54 of MUSHclient no longer does this. Upgrade to version 4.54 or higher to avoid this issue.

Other than upgrading, there are two work-arounds for this:


  1. Use a script file, and call a function in the script file (by putting the function name in the Script box in the trigger). Script functions are not called until after the omitting is done, and thus any notes you do are not omitted.

    - or -

  2. Instead of "Send to: Script" in the trigger, use "Send to: Script (after omit)". This calls the script after the omitting is done, and also allows you to do notes inside the script.




52. What is the purpose of all those xxx.lua files in the "lua" subdirectory of MUSHclient?

These provide additional helpful "Lua modules" for your use, if you script in Lua. For more information about each one see this forum posting:






53. When I type my character name and password it always gets rejected the first time.

Try disabling the configuration option "Negotiate About Window Size" in the Output configuration. This causes the bytes FF FB 1F in hex (IAC WILL NAWS) to be sent to the MUD. Some MUDs don't recognise that sequence.




54. Where is the MUSHclient source code?

The source code is published on GitHub here:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 13 Apr 2007 12:46 AM (UTC)

Amended on Fri 13 Apr 2007 12:53 AM (UTC) by Nick Gammon

Message
This thread has been closed, so that postings cannot be made to it. If a question is asked frequently enough it will be added to the main post above.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 17 Apr 2007 03:17 AM (UTC)

Amended on Wed 19 Aug 2009 06:19 AM (UTC) by Nick Gammon

Message
The FAQ items have been numbered now, so if you want to refer someone to a particular answer, you can say something like:


For queries about triggers not firing on a prompt line, see http://mushclient.com/faq, item 11.


More simply (from August 2009), you can do this in a forum posting:

[faq=11]

This will appear as:

Template:faq=11 Please read the MUSHclient FAQ - point 11.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


124,405 views.

This subject is now closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]