Mushclient Questions

by Esano

Back to Mechanic's Corner.

Vathael2009-07-10 14:39:02
Alright, so I've turned into the MUSH noob that has thousands of questions. How are Accelerators added in lua? Do they go into the script file?
Unknown2009-07-10 14:40:41
I put mine in the script file, but you could put them in an alias (with send to script) if you wanted to change sets of macros more dynamically.
Vathael2009-07-10 14:44:07
Alright, anyone have any idea how to use accelerators for expansion on the numpad. (i.e. CTRL+ALT+1 or CTRL+SHIFT+1)
Unknown2009-07-10 14:53:09
CODE
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")


You can find it in the MUSHclient documentation, too. tongue.gif
Unknown2009-07-10 14:53:10
QUOTE (Vathael @ Jul 10 2009, 10:39 AM) <{POST_SNAPBACK}>
Alright, so I've turned into the MUSH noob that has thousands of questions. How are Accelerators added in lua? Do they go into the script file?


Out of curiosity why the switch from zmud?
Vathael2009-07-10 14:57:31
QUOTE (Deschain @ Jul 10 2009, 09:53 AM) <{POST_SNAPBACK}>
Out of curiosity why the switch from zmud?


To try something different.
Vathael2009-07-10 17:49:08
Alright.. how can I make this:

Vathael has left the area.

Get sub'd to this:

+--+ Vathael

The left area being blue the outside bracket things being white and the name being white. I understand how to gag and such, just don't exactly know how to do the printing.
Unknown2009-07-10 18:22:31
Send to script (after omit).

ColourNote("blue", "", "+--+", "white", "", "%1")

(assuming you captured the name as the first wildcard)
Ardmore2009-07-11 08:22:04
I'm trying to make a priority-type target system like I had in zMUD - I'm giving tables a try. So when I login, I do target = php:Table() to initialize it. So in my Lua file I have:

target = "^\\"adorath\\\\d+\\"\\\\s+a slimy\\, amphibious adorath$"
target = "^\\"mantekarr\\\\d+\\"\\\\s+a mantis-like mantekarr$"
target = "^\\"cave-fisher\\\\d+\\"\\\\s+a hard-shelled\\, many-legged cave-fisher"
target = "^\\"basidion\\\\d+\\"\\\\s+a multi-stemmed fungoid basidion$"
target = "^\\"centipede\\\\d+\\"\\\\s+a giant centipede$"

I also have a trigger to match anything in INFO HERE (so far) and pass it to this function if a certain condition is met. All is good and well, but why isn't my for-loop in order (I have output that lists what my loop does), when I do INFO HERE it always goes...

centipede - ^"centipede\\d+"\\s+a giant centipede$
adorath - ^"adorath\\d+"\\s+a slimy, amphibious adorath$
mantekarr - ^"mantekarr\\d+"\\s+a mantis-like mantekarr$
fisher - ^"cave-fisher\\d+"\\s+a hard-shelled, many-legged cave-fisher

...before finially matching to the fisher.

Why is centipede first instead of last? Is there a way to fix it to keep my priority queues?

My function in case anyone was wondering:

CODE
function bash:AddTarget(line)
for k,v in pairs(target) do
Note(k .. " - " .. v)
re = rex.new(tostring(v))
local a, b = re:match(line)
if (a and cool.gif then
table.insert(room, tostring(k))
return
end
end
end


I know it's not complete, I just need help with the one problem I have now before I finish up.
Unknown2009-07-11 11:32:53
If you create target as a php:Table(), then you use target:pairs() for your loop iterator. That's the key to getting them in order.
Ardmore2009-07-11 21:39:57
I'm not entirely sure what you mean - I tried many different things of what I thought you meant but couldn't get anything working.
Unknown2009-07-11 22:54:21
How can I make things shorter, replacement...

"You point the tip of your athame at a green eyelash viper's heart and make a sudden stabbing motion. A glowing pentagram shoots from the tip of the athame and slams into his chest, making him gasp in pain."

For example and turn it into

Nicholo Nature Curses
Aerotan2009-07-12 02:02:34
Make a trigger to catch the triggering text, have it set to not output the triggering text, and then have it send your new text to output in the dropdown list.
Unknown2009-07-12 02:20:18
Lol Wut?

Simpler please?

Something sorta step by step?
Aerotan2009-07-12 02:53:34
Make a trigger to catch the text string. As the trigger, use the bit you want to make go away. There's a checkbox on the right side that says "Omit from output" Check that. Then, below the big white box, there's a dropdown box that says "Send To:" make sure it has Output selected. Finally, whatever you want it to say instead, put in the big white box.
Esano2009-07-12 02:55:16
Not sure if that'll work. You'll need to use Send to: Script (after omit), then use Note("Whatever you want it to say") in the send box (the big white box).
Yoruk2009-07-12 04:39:18
Quick question. I have an average understanding of regex but this problem has been bugging me for the past hour and is not working.

"Twisting in a circle, you plunge your right foot into Nebula's gut, driving the foot so hard that it snaps his spine."

This is what I'm trying to capture. My trigger statement is:

"Twisting in a circle, you plunge your (right|left) foot into /w+'s gut, driving the foot so hard that it snaps (his|her) spine."

I've checked it vigorously and the only problem it has is within the "/w+'s" part (As in it won't proc). I think it has something to do with the apostrophe but I'm not sure.

any ideas?
Razenth2009-07-12 04:48:27
It is. In fact, it's other stuff too. Since it's a regex, you need to put escapes before anything that's not a number or a letter. So the period, the comma, the apostrophe. The escape char is \\.
Esano2009-07-12 05:04:12
CODE
^Twisting in a circle\\, you plunge your (right|left) foot into \\w+'s gut\\, driving the foot so hard that it snaps (his|her) spine\\.$

Yoruk2009-07-12 05:12:11
yay! it works. It's just my eyes which were being weird. I got the escape character wrong and did the other slash. ugh

Thanks!