Esano2009-01-04 02:01:36
To save Zarquan's Treant thread, here's a thread for all your mushclient questions unrelated to Treant. Ask away.
Unknown2009-01-04 20:51:41
You might want to look at other topics before you start your own.
http://forums.lusternia.com/index.php?showtopic=16734 or http://forums.lusternia.com/index.php?showtopic=16754, for example.
http://forums.lusternia.com/index.php?showtopic=16734 or http://forums.lusternia.com/index.php?showtopic=16754, for example.
Qival2009-01-06 13:03:01
I have a mushclient question, well more about a hang up question. I made a small script to colour citizens and city enemies as preperation to making auto enemy and ally sequence on demesne entries.
Now this worked very well for the first week but yesterday and today mushclient started to crash on the colouring triggers. Any idea why (I think it might have to do with an endless loop on the repeat but I do not know why)
Script and triggers:
    enabled="y"
  lines_to_match="2"
  match="^Enemies of (.*?)\\:\\n(.*?)$"
  multi_line="y"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Âallegiancerecon_enemyconvert("%2")
 Â
    enabled="y"
  lines_to_match="2"
  match="^The following are ACTIVE citizens (.*?)\\:\\n(.*?).$"
  multi_line="y"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Âallegiancerecon_allyconvert("%2")
 Â
    custom_colour="4"
  enabled="y"
  expand_variables="y"
  group="allegiancerecon2"
  keep_evaluating="y"
  match="\\b(?:@!Allegiancerecon_orgallies)\\b"
  regexp="y"
  repeat="y"
  sequence="100"
  >
 Â
    custom_colour="7"
  enabled="y"
  expand_variables="y"
  group="allegiancerecon2"
  keep_evaluating="y"
  match="\\b(?:@!Allegiancerecon_orgenemies)\\b"
  regexp="y"
  repeat="y"
  sequence="100"
  >
 Â
script stuff:
if not allegiancerecon then
  allegiancerecon = {}
end
function allegiancerecon_allyconvert(arg)
    allegiancerecon_allylist = string.gsub(arg, ", ", "|")
    SetVariable ("Allegiancerecon_orgallies", allegiancerecon_allylist)
end
function allegiancerecon_enemyconvert(arg)
    allegiancerecon_enemylist = string.gsub(arg, ", ", "|")
    SetVariable ("Allegiancerecon_orgenemies", allegiancerecon_enemylist)
end
Now this worked very well for the first week but yesterday and today mushclient started to crash on the colouring triggers. Any idea why (I think it might have to do with an endless loop on the repeat but I do not know why)
Script and triggers:
CODE
 Â
  lines_to_match="2"
  match="^Enemies of (.*?)\\:\\n(.*?)$"
  multi_line="y"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
 Â
 Â
  lines_to_match="2"
  match="^The following are ACTIVE citizens (.*?)\\:\\n(.*?).$"
  multi_line="y"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
 Â
 Â
  enabled="y"
  expand_variables="y"
  group="allegiancerecon2"
  keep_evaluating="y"
  match="\\b(?:@!Allegiancerecon_orgallies)\\b"
  regexp="y"
  repeat="y"
  sequence="100"
  >
 Â
 Â
  enabled="y"
  expand_variables="y"
  group="allegiancerecon2"
  keep_evaluating="y"
  match="\\b(?:@!Allegiancerecon_orgenemies)\\b"
  regexp="y"
  repeat="y"
  sequence="100"
  >
 Â
script stuff:
if not allegiancerecon then
  allegiancerecon = {}
end
function allegiancerecon_allyconvert(arg)
    allegiancerecon_allylist = string.gsub(arg, ", ", "|")
    SetVariable ("Allegiancerecon_orgallies", allegiancerecon_allylist)
end
function allegiancerecon_enemyconvert(arg)
    allegiancerecon_enemylist = string.gsub(arg, ", ", "|")
    SetVariable ("Allegiancerecon_orgenemies", allegiancerecon_enemylist)
end
Unknown2009-01-06 16:19:46
How many characters are in each of those variables? There is a limit to the length of a regex wildcard, and this is certainly one place where you can run into this problem.
Qival2009-01-06 17:11:16
The citizen one has 4675 characters
The enemy one has 4469 characters
None of the problems occur when the repeat option is not selected. (So I assumed the regex part was fine)
(And right now it is working again)
The enemy one has 4469 characters
None of the problems occur when the repeat option is not selected. (So I assumed the regex part was fine)
(And right now it is working again)
Unknown2009-01-06 23:00:22
Weird! I wonder if Nick could shed any light on it then.
Saran2009-01-07 11:35:52
I'm having a dumb moment.
I'm writing some astro scripts in vbscript (I'm just that bored at work and considering an alt) and wondering how I'd echo results? Oooh or is there a way to create secondary windows outside the main screen. (gods stop me before I download vb express and think about a sep... though for astrology a nice little app that can get data from mush might be nice)
I'm writing some astro scripts in vbscript (I'm just that bored at work and considering an alt) and wondering how I'd echo results? Oooh or is there a way to create secondary windows outside the main screen. (gods stop me before I download vb express and think about a sep... though for astrology a nice little app that can get data from mush might be nice)
Esano2009-01-07 12:35:54
QUOTE (Saran @ Jan 7 2009, 10:35 PM) <{POST_SNAPBACK}>
I'm having a dumb moment.
I'm writing some astro scripts in vbscript (I'm just that bored at work and considering an alt) and wondering how I'd echo results?
I'm writing some astro scripts in vbscript (I'm just that bored at work and considering an alt) and wondering how I'd echo results?
Note or ColourNote (or AnsiNote) for full lines.
Tell and ColourTell work fairly similarly - they just don't have a newline at the end (so you can stack ColourTell to vary colours in a single line).
QUOTE (Saran @ Jan 7 2009, 10:35 PM) <{POST_SNAPBACK}>
Oooh or is there a way to create secondary windows outside the main screen. (gods stop me before I download vb express and think about a sep... though for astrology a nice little app that can get data from mush might be nice)
Have a look at miniwindows, or you can use a dummy world.
Unknown2009-01-07 20:23:40
Actually I thought that the newline in ColourNote wasn't added until the end, so:
CODE
ColourNote("red", " ", "TEST", "blue", " ", "TEST")
should have a red TEST followed by a blue TEST on the same line.Esano2009-01-07 20:52:26
QUOTE (Enigma @ Jan 8 2009, 07:23 AM) <{POST_SNAPBACK}>
Actually I thought that the newline in ColourNote wasn't added until the end, so:
CODE
ColourNote("red", " ", "TEST", "blue", " ", "TEST")
should have a red TEST followed by a blue TEST on the same line.That only works when using Lua, as far as I'm aware.
Isuka2009-01-08 19:33:48
What are good options for logging? I'd like to be able to log in HTML (basically for the color and ability to post online easily), but I'm a bit miffed by the formatting in the basic pre/postamble. I use wrapwidth 0, and as a result the log has the start of lines indented way to the right, and the wrapped line all the way to the left of the screen. From what I can see, this is an issue with using the pre-formatted tag "
".
I could play with it myself, but it occured to me that someone has probably already set up something that works well. Any suggestions?
Unknown2009-01-08 20:01:23
QUOTE (Esano @ Jan 7 2009, 03:52 PM) <{POST_SNAPBACK}>
That only works when using Lua, as far as I'm aware.
Ah, perhaps I should read more before answering
Unknown2009-01-08 20:07:47
QUOTE (Isuka @ Jan 8 2009, 02:33 PM) <{POST_SNAPBACK}>
What are good options for logging? I'd like to be able to log in HTML (basically for the color and ability to post online easily), but I'm a bit miffed by the formatting in the basic pre/postamble. I use wrapwidth 0, and as a result the log has the start of lines indented way to the right, and the wrapped line all the way to the left of the screen. From what I can see, this is an issue with using the pre-formatted tag "
".
I could play with it myself, but it occured to me that someone has probably already set up something that works well. Any suggestions?
The
tag does prevent your browser from wrapping the lines. Try removing that and see if you like the results. I log with the default pre/post-amble because I don't mind the longer lines. I just wish MUSHclient wouldn't randomly skip logging some commands (and maybe some other lines, but I haven't noticed anything important missing yet).
Isuka2009-01-08 21:39:30
QUOTE (Zarquan @ Jan 8 2009, 12:07 PM) <{POST_SNAPBACK}>
The
tag does prevent your browser from wrapping the lines. Try removing that and see if you like the results. I log with the default pre/post-amble because I don't mind the longer lines. I just wish MUSHclient wouldn't randomly skip logging some commands (and maybe some other lines, but I haven't noticed anything important missing yet).
Well, I -almost- have a solution to this that suits my needs. I want a timestamp to the left of the line, so I encased each line with a pre/post amble to create a table, timestamp in one cell, mud output in another. This works great... except for the fact that the
tags are dropping a newline into each cell, which destroys the formatting.
So at the moment I either have horrible text spacing issues, or double-spaced logs... anyone know of a way to maintain formatting but be able to drop newlines in HTML?
Only other option I can think of is to use ###### functions to trim, and use pre/postamble to drop in the scripting for each entry...
Edit: ...... apperantly "java" + "script" = "######"
Unknown2009-01-09 01:46:47
Here's a question. Probably a stupid one too. Is there a way to 'pause' the trigger in any way? For example, I want a trigger to do some of its own actions, then switches to another trigger, and that's done, the first trigger continues from where it left off. I hope I make some sense, it's seriously late here.
Unknown2009-01-09 01:51:56
It depends on exactly what you're trying to do, but basically it requires a few calls to EnableTrigger to turn them on/off. (Yes, the EnableTrigger function also disables triggers.) Give them each a unique name and use that name when you call EnableTrigger. First trigger fires, disables itself and enables the second. Second trigger fires, disables itself and re-enables the first. If the second line isn't always guaranteed, do the re-enabling in a trigger that matches on the prompt instead.
Unknown2009-01-09 08:48:01
No need to go through that much details, I know some of the basics. In any case, I had no idea EnableTrigger could be used to 'pause' the triggers. Hrm... This raises one more question, though. Can I add a small delay between the commands, while sending to script? If I try doing it your way, MUSH will still execute the -whole- trigger immediately, likely messing up what the second trigger was supposed to do.
Unknown2009-01-09 12:07:12
You could use DoAfter or DoAfterSpecial to delay an action. You could also use a timer that you enable and disable. Or, if you're using Lua, you might want to look at Nick's wait.lua module, which allows waiting for a regular expression with an optional timeout value using coroutines.
Rika2009-01-09 21:38:31
Is there a command that bypasses aliases like #send in Cmud?
Unknown2009-01-09 22:01:30
QUOTE (rika @ Jan 9 2009, 04:38 PM) <{POST_SNAPBACK}>
Is there a command that bypasses aliases like #send in Cmud?
Yes, and surprisingly enough it's the Send function. The Execute function is the one that parses aliases.