Mushclient Questions

by Esano

Back to Mechanic's Corner.

Everiine2009-02-11 17:36:27
I'm actually having trouble writing something in MUSH... What I want is for some things to look like this:
CODE
--------------------------------------------------------------------------------
  SEREN BRAVE (COL)                                                      <><><>
--------------------------------------------------------------------------------

But they keep coming out like this:
CODE
-------------------------------------------------------------------------
  SEREN BRAVE (COL) <><><>
                                                                        
-------------------------------------------------------------------------


I used to use this sort of writing theme all the time (for example, it is formatted properly in GHELP RANKS, which I wrote a long time ago), but now it refuses to make it the way it is supposed to look.
Isuka2009-02-11 17:54:22
QUOTE (Everiine @ Feb 11 2009, 09:36 AM) <{POST_SNAPBACK}>
I'm actually having trouble writing something in MUSH... What I want is for some things to look like this:
CODE
--------------------------------------------------------------------------------
  SEREN BRAVE (COL)                                                      <><><>
--------------------------------------------------------------------------------

But they keep coming out like this:
CODE
-------------------------------------------------------------------------
  SEREN BRAVE (COL) <><><>
                                                                        
-------------------------------------------------------------------------


I used to use this sort of writing theme all the time (for example, it is formatted properly in GHELP RANKS, which I wrote a long time ago), but now it refuses to make it the way it is supposed to look.

if you're using lua:
CODE
ColourTell(color, "", string.format("%-30s", "Seren Brave (COL)"))
ColourTell(color, "", "<><><>")
Note("")

the -30s tells the formater how many spaces this section will take, and the - part tells it to print at the front rather than the back.
Everiine2009-02-11 18:28:18
QUOTE (Isuka @ Feb 11 2009, 12:54 PM) <{POST_SNAPBACK}>
if you're using lua:
CODE
ColourTell(color, "", string.format("%-30s", "Seren Brave (COL)"))
ColourTell(color, "", "<><><>")
Note("")

the -30s tells the formater how many spaces this section will take, and the - part tells it to print at the front rather than the back.


I'm not sure what that is or how it relates to writing CLHELP scrolls.
Unknown2009-02-11 18:34:25
Isuka thought you wanted pretty output and missed that you're editing scrolls. You need to figure out what it is that's stripping the extra spaces and deal with it harshly. I haven't edited scrolls for a long time, but I'd give the Send File option on the Input menu a try (Shift+Ctrl+O).
Everiine2009-02-11 18:43:57
I think it has something to do with the "<>". I think it's trying to convert them into something. It's the same reason why I can't put any more "*" into the help scrolls, because in the MUSHclient editor all of the commands begin with * and it was trying to convert some of my stuff into commands. I'll look into that Send File stuff.

EDIT: Nope, still getting the same results with "Send File". Mush is just eliminating spaces everywhere. A little more information:

CODE
PRIVILEGES
----------
  -Use of the GNT aether, which is only for Serenguard

RESTRICTIONS
------------
  (same as previous)

TASKS
-----
-You must spend at least 5 Lusternian days at this rank. There are no
exceptions.

-Take the Centaur Vision Quest (GHELP VISIONS). When you have taken this
quest, you will be advanced 5 LUsternian days. Upon graduation from
Novicehood you will be given the title of Unblooded.


You can see that those items listed under Privileges and Restrictions are indented two spaces like they should be. But under Tasks, they are not. The only difference I can see here is one is being affected by Word Wrapping and the other isn't. Lusternia's Word Wrap width is set to zero, MUSHclient is what is wrapping the lines at 80.
Everiine2009-02-11 19:05:20
CODE
-----------------------------------------------------------------------
BASIC RANKS                                                     <><><>
-----------------------------------------------------------------------

BRAVE:

Those who have just joined the Serenguard. Must spend 20 Lusternian
days in the Ancestral Glade as a Wayfarer and another 10 days as a
novice Brave (unless completing tasks shortens time).
    
UNBLOODED:

Those who have graduated novicehood and have a mentor, but have not
taken the Serenguard Oath or passed the First Tier test. Cannot earn
favours or hold offices or appointments.
     Requirements: graduated novicehood and have a mentor


This is taken from GHELP RANKS. I last edited it less than two weeks ago, judging by the date. The title bar looks perfect, and the other lines are all spaced and indented correctly. The only thing I can think of is that the wrap width is causing some problem. If I recall, none of the lines are being automatically wrapped, but are instead manually line broken and indented.

I'm going to try a few more experiments and see what happens.
Enero2009-02-11 19:08:03
Umm... server and client side wrapping is only for text output. I think the actual in game editor is set to 80 and you can't change that. A thing that I hate even more than in game editor is the AD system which has completely different wrap width.

Just a stab in the dark but have you tried disabling parsing, triggers and everything else that could get in the way?
Everiine2009-02-11 19:17:26
QUOTE (Enero @ Feb 11 2009, 02:08 PM) <{POST_SNAPBACK}>
Umm... server and client side wrapping is only for text output. I think the actual in game editor is set to 80 and you can't change that. A thing that I hate even more than in game editor is the AD system which has completely different wrap width.

Just a stab in the dark but have you tried disabling parsing, triggers and everything else that could get in the way?


No, but I did solve the problem. I don't know why, but it had something to do with my text wrapping and length of the lines. I went and edited the scroll in Notepad, shortening the title bars to the length of the ones I know worked and I went and physically added line breaks where they all belong. I don't know why this is the only way I've found to make it work, but at least the scroll looks like it is supposed to.
Chade2009-02-11 19:24:33
name="squintingmacros_"
match="^squinting$"
enabled="y"
group="Chade_Macros"
regexp="y"
send_to="12"
sequence="100"
>
Accelerator ("alt+Numpad1", "squint sw")
Accelerator ("alt+Numpad2", "squint s")
Accelerator ("alt+Numpad3", "squint se")
Accelerator ("alt+Numpad4", "squint w")
Accelerator ("alt+Numpad5", "observe")
Accelerator ("alt+Numpad6", "squint e")
Accelerator ("alt+Numpad7", "squint nw")
Accelerator ("alt+Numpad8", "squint n")
Accelerator ("alt+Numpad9", "squint ne")
Accelerator ("alt+Numpad0", "squint in")
Accelerator ("alt+add", "squint down")
Accelerator ("alt+subtract", "squint up")
Accelerator ("alt+decimal", "squint out")


name="walkingmacros_"
match="^walking$"
enabled="y"
group="Chade_Macros"
regexp="y"
send_to="12"
sequence="100"
>
Accelerator ("Numpad1", "sw")
Accelerator ("Numpad2", "s")
Accelerator ("Numpad3", "se")
Accelerator ("Numpad4", "w")
Accelerator ("Numpad5", "ql")
Accelerator ("Numpad6", "e")
Accelerator ("Numpad7", "nw")
Accelerator ("Numpad8", "n")
Accelerator ("Numpad9", "ne")
Accelerator ("Numpad0", "in")
Accelerator ("add", "down")
Accelerator ("subtract", "up")
Accelerator ("decimal", "out")
Accelerator ("divide", "bashon")
Accelerator ("multiply", "gg")


name="aethercraftmovementmacros_"
match="^ships$"
enabled="y"
group="Chade_Macros"
regexp="y"
send_to="12"
sequence="100"
>
Accelerator ("Numpad1", "pilot steer sw")
Accelerator ("Numpad2", "pilot steer s")
Accelerator ("Numpad3", "pilot steer se")
Accelerator ("Numpad4", "pilot steer w")
Accelerator ("Numpad5", "ship look")
Accelerator ("Numpad6", "pilot steer e")
Accelerator ("Numpad7", "pilot steer nw")
Accelerator ("Numpad8", "pilot steer n")
Accelerator ("Numpad9", "pilot steer ne")
Accelerator ("divide", "pilot launch")
Accelerator ("multiply", "pilot dock")



Modify as required. MUSH doesn't seem to like you using ctrl+keypad or shift+keypad keys but I bet it can be done. The commands in the Accelerator keys for divide and multiply are aliases - if you want your keypad to call funky attack scripts etc you'll need to put them in an alias first then put the alias into the Accelerator. You also need to execute the alias to assign accelerators every time you open your world, they won't work until you do, haven't figured out a way of saving them yet.
Unknown2009-02-11 20:35:22
1. I use Ctrl+Numpad keys just fine!
2. Put the Accelerator calls in your main Lua script, so that they execute when your file is parsed, and you have no need of the aliases then unless you want to remap the keys.

CODE
-- Setup macros for squinting
Accelerator("Ctrl+Subtract", "sq u")
Accelerator("Ctrl+Add", "sq d")
Accelerator("Ctrl+Decimal", "sq out")
Accelerator("Ctrl+Numpad0", "sq in")
Accelerator("Ctrl+Numpad1", "sq sw")
Accelerator("Ctrl+Numpad2", "sq s")
Accelerator("Ctrl+Numpad3", "sq se")
Accelerator("Ctrl+Numpad4", "sq w")
--Accelerator("Ctrl+Numpad5", "")
Accelerator("Ctrl+Numpad6", "sq e")
Accelerator("Ctrl+Numpad7", "sq nw")
Accelerator("Ctrl+Numpad8", "sq n")
Accelerator("Ctrl+Numpad9", "sq ne")

-- Setup macros for sprinting
Accelerator("Alt+Subtract", "sprint u")
Accelerator("Alt+Add", "sprint d")
Accelerator("Alt+Decimal", "sprint out")
Accelerator("Alt+Numpad0", "sprint in")
Accelerator("Alt+Numpad1", "sprint sw")
Accelerator("Alt+Numpad2", "sprint s")
Accelerator("Alt+Numpad3", "sprint se")
Accelerator("Alt+Numpad4", "sprint w")
--Accelerator("Alt+Numpad5", "")
Accelerator("Alt+Numpad6", "sprint e")
Accelerator("Alt+Numpad7", "sprint nw")
Accelerator("Alt+Numpad8", "sprint n")
Accelerator("Alt+Numpad9", "sprint ne")

-- Setup macros for fighting
Accelerator("Ctrl+Alt+Numpad1", "smash left")
Accelerator("Ctrl+Alt+Numpad2", "smite up")
Accelerator("Ctrl+Alt+Numpad3", "smash right")
Accelerator("Ctrl+Alt+Numpad4", "pound left")
--Accelerator("Ctrl+Alt+Numpad5", "")
Accelerator("Ctrl+Alt+Numpad6", "pound right")
Accelerator("Ctrl+Alt+Numpad7", "bash left")
Accelerator("Ctrl+Alt+Numpad8", "smite down")
Accelerator("Ctrl+Alt+Numpad9", "bash right")
Isuka2009-02-11 21:17:45
Awesome, thanks for the information on the accelerators.

New question:

I'm having a problem with a trigger to capture items in the rift. Essentially I want it to capture the numerical value and name of the item, parse it into an array within lua, and set a variable in mush to help with persistence. This is the trigger i am using:
CODE

     custom_colour="11"
   enabled="y"
   group="rift_capture"
   keep_evaluating="y"
   match="\\ (\\w+)"
   regexp="y"
   repeat="y"
   send_to="12"
   sequence="100"
  >
  gear:rift("%2","%1")
  

Here is the problem: it's only calling the function for the first element caught in a line, even though it is properly coloring every element in the line. I've confirmed this by using a Note in the function itself every time it's called.

I have keep evaluating and repeat on same line checked, so I'm not sure what the problem is.


Edit: here's some sample output of what I'm getting.
CODE
Glancing into the Rift, you see:
   arnica             calamus             chervil
Caught--: arnica
   coal               coltsfoot           earwort
Caught--: coal
   faeleaf             galingale           gold
Caught--: faeleaf
   horehound           iron               kafe
Caught--: horehound
   kombu               leather             marjoram
Caught--: kombu
   merbloom           mercury             myrtle
Caught--: merbloom
   pennyroyal         platinum           reishi
Caught--: pennyroyal
   rope               ruby               silver
Caught--: rope
   sparkleberry       spices             steel
Caught--: sparkleberry
   wood               wormwood           yarrow
Caught--: wood

Kuroi2009-02-11 22:09:13
QUOTE (Isuka @ Feb 11 2009, 09:17 PM) <{POST_SNAPBACK}>
Awesome, thanks for the information on the accelerators.

New question:

I'm having a problem with a trigger to capture items in the rift. Essentially I want it to capture the numerical value and name of the item, parse it into an array within lua, and set a variable in mush to help with persistence. This is the trigger i am using:
CODE

     custom_colour="11"
   enabled="y"
   group="rift_capture"
   keep_evaluating="y"
   match="\\ (\\w+)"
   regexp="y"
   repeat="y"
   send_to="12"
   sequence="100"
  >
  gear:rift("%2","%1")
  

Here is the problem: it's only calling the function for the first element caught in a line, even though it is properly coloring every element in the line. I've confirmed this by using a Note in the function itself every time it's called.

I have keep evaluating and repeat on same line checked, so I'm not sure what the problem is.


I tried it and can't get yours to work but here's the one I use which does work:

CODE
enabled="y"
group="aPickle"
keep_evaluating="y"
match="(\\s+\\ (+))(\\s+\\ (+))?(\\s+\\ (+))?"
regexp="y"
repeat="y"
send_to="12"
sequence="100"
>
Note("%2", "%3","%5", "%6","%8", "%9")

Isuka2009-02-11 22:13:06
QUOTE (Kuroi @ Feb 11 2009, 02:09 PM) <{POST_SNAPBACK}>
I tried it and can't get yours to work but here's the one I use which does work:

CODE
enabled="y"
group="aPickle"
keep_evaluating="y"
match="(\\s+\\ (+))(\\s+\\ (+))?(\\s+\\ (+))?"
regexp="y"
repeat="y"
send_to="12"
sequence="100"
>
Note("%2", "%3","%5", "%6","%8", "%9")


Indeed, I can certainly just make it optional, but I'd like to know why this doesn't work so I don't run into the same problem later on.

What's funny to me is that the trigger does catch, I know it does because I've run several tests on it. The script just doesn't execute.
Kuroi2009-02-11 22:20:21
QUOTE (Isuka @ Feb 11 2009, 10:13 PM) <{POST_SNAPBACK}>
Indeed, I can certainly just make it optional, but I'd like to know why this doesn't work so I don't run into the same problem later on.

What's funny to me is that the trigger does catch, I know it does because I've run several tests on it. The script just doesn't execute.


yes it's true! When using the code you used, I can Note("%1","%2") but only the first of each line gets 'noted', as you demonstrated, however if you tell it to omit from output it omits the whole rift. I wonder if there's a different way of addressing wildcards from a trigger which repeats on the same line which I'm just not familiar with.
Isuka2009-02-11 22:41:27
QUOTE (Kuroi @ Feb 11 2009, 02:20 PM) <{POST_SNAPBACK}>
yes it's true! When using the code you used, I can Note("%1","%2") but only the first of each line gets 'noted', as you demonstrated, however if you tell it to omit from output it omits the whole rift. I wonder if there's a different way of addressing wildcards from a trigger which repeats on the same line which I'm just not familiar with.


Maybe, though the way i understand it each trigger would re-initialize the wildcards, meaning that each time that trigger captured, be it on the same line or not, %1 would be the correct value.
Chade2009-02-12 00:36:27
Just seen what Gregori has done with his defs layout in this log: http://daytoncowles.200gigs.com/the_gank_squad.html

I like it, anyone have any idea how to replicate it?
Isuka2009-02-12 02:19:47
QUOTE (Chade @ Feb 11 2009, 04:36 PM) <{POST_SNAPBACK}>
Just seen what Gregori has done with his defs layout in this log: http://daytoncowles.200gigs.com/the_gank_squad.html

I like it, anyone have any idea how to replicate it?


Mine is very similar, though rather than the yellow X, i change the color of the entire word. mediumspringgreen for on, crimson for off.

I hadn't seen how treant displayed it before, though. I like the colors he uses.
Chade2009-02-12 03:18:19
That's not a standard Treant display, he's using the display.Info function to print the text which shows » and it looks like he's taken code from the AUTOS print out in Treant too - it's just a nice clean set up that shows all his possible defs and which ones he has up at any given moment - I'm going to rip the idea off completely when I get back to playing Lust properly again biggrin.gif
Unknown2009-02-12 04:00:15
QUOTE (Chade @ Feb 12 2009, 08:36 AM) <{POST_SNAPBACK}>
Just seen what Gregori has done with his defs layout in this log: http://daytoncowles.200gigs.com/the_gank_squad.html

I like it, anyone have any idea how to replicate it?

Actually, it is in the Treant system.

Go to the template notepad in the treant folder, and you'll see this:

CODE
-- Setup your defenses for the DEFS display, making it much prettier and more useful
my_defs = {
   = { "boosting", "breathing", "consciousness", "constitution", "immunity", "regeneration", "resistance", "strength", "sturdiness", "surging", "vitality", "weathering" },
   = { "stance" },
   = { "aethersight", "deathsense", "lipreading", "nightsight", "powermask", "thirdeye" },
   = { "insomnia", "metawake", "selfishness" },
   = { "attitude", "drunkard", "performance", "role", "sober", "wounded" },
   = { "beauty", "deathsight", "kingdom", "levitating", "mercy", "perfection", "protection", "waterwalking" },
   = { "attuned" },
   = { "charismaticaura" },
   = { "combatstyle", "gripping" },
   = { "autumn", "blue", "orange", "red", "serpent", "yellow" },
   = { "mounted" },
   = { "bolting", "greenman", "lightning", "ringwalk", "stagform", "staghide", "swiftstripes", "trueheart" },
   = { "kafe", "fire", "frost", "speed" }
}


Paste it into your script file before the 'require "treant"', edit it to include whatever defs you want, do a TCONFIG SKILLS in-game and it will look just like Gregori's.
Chade2009-02-12 04:25:35
Woah. I r noob sad.gif