Mushclient Questions

by Esano

Back to Mechanic's Corner.

Esano2009-12-26 01:32:49
Because that's not the way Mushclient does its triggering/gagging.

You could always use the DeleteLine function.
Unknown2009-12-28 00:22:17
QUOTE (Kialkarkea @ Dec 25 2009, 06:59 PM) <{POST_SNAPBACK}>
Why won't Mush let me Gag a multi line trigger? sad.gif


The more detailed answer is because MUSHclient displays the lines as they arrive. It also doesn't assume that your trigger matches on a fixed number of lines (could've matched two lines, even if it's setup for three), and so it can't be sure how many lines it needs to delete.
Dynami2010-01-06 01:26:36
QUOTE
ColourNote("white", "purple", "*****string.upper("%1") .. " HAS A PROTECTION FIELD UP!*****")


QUOTE
Compile error
World: Treant
Immediate execution
:1: ')' expected near 'Leronia'

I have tried every possible combination to make this work, but I always get that error back unsure.gif
Rael2010-01-06 01:33:17
Have you thought about just getting a support contract Dynami?
Dynami2010-01-06 01:39:54
QUOTE (Rael @ Jan 5 2010, 08:33 PM) <{POST_SNAPBACK}>
Have you thought about just getting a support contract Dynami?

I am pretty sure those only apply to the Treant system tongue.gif
Unknown2010-01-06 01:55:25
CODE
ColourNote("white", "purple", "*****" .. string.upper("%1") .. " HAS A PROTECTION FIELD UP!*****")


That will be $1 good sir.
Unknown2010-01-06 03:58:41
QUOTE (Dynami @ Jan 5 2010, 08:26 PM) <{POST_SNAPBACK}>
I have tried every possible combination to make this work, but I always get that error back unsure.gif

You might have to do it like this:

CODE
ColourNote ("white", "purple", "*****", "white", "purple", string.upper("%1"), "white", "purple", " HAS A PROTECTION FIELD UP!*****")


... because I'm not sure if MUSHclient will accept concatenation in ColourNotes.
Esano2010-01-06 04:20:35
It does. It's just that, as has been pointed out and corrected, they made mistakes in their concatenation.
Unknown2010-01-06 06:21:49
QUOTE (Ried @ Jan 6 2010, 03:58 AM) <{POST_SNAPBACK}>
You might have to do it like this:

CODE
ColourNote ("white", "purple", "*****", "white", "purple", string.upper("%1"), "white", "purple", " HAS A PROTECTION FIELD UP!*****")


... because I'm not sure if MUSHclient will accept concatenation in ColourNotes.


Mine works fine. Put my code in an alias ^wow (.*)$ and do wow estarra.
Lorina2010-01-06 22:00:36
So, let's pretend I don't know anything about Lua... What would I need to do to allow me to discern people before I psyvamp and stuff? I don't like using egoscan because it takes up a possible good spot.
What I am getting at is what do I need to do to make Discernment tell me the percent a person is at when it catches their ego?
Ilyarin2010-01-06 22:55:38
CODE

     enabled="y"
   keep_evaluating="y"
   match="^(\\w+)\\'s ego is at (\\d+)\\/(\\d+)\\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  local cur, max = tonumber("%2"), tonumber("%3")

per = (cur * 100) / max

Note("%1's ego is at " .. math.ceil(per) .. "%")

  


This works, although it's not lovely. It rounds up to nearest 1%. Copy/Paste that into the triggers tab.
Lorina2010-01-06 23:34:49
<3 Ilyarin wub.gif
Unknown2010-01-08 18:39:22
How would I make an alias to buff?

For example I would like to use my abilities foo, bar, and baz, but each requires equilibrium or balance and I need to pause briefly in between commands.

Shaddus2010-01-08 18:45:42
QUOTE (vinc456 @ Jan 8 2010, 01:39 PM) <{POST_SNAPBACK}>
How would I make an alias to buff?

For example I would like to use my abilities foo, bar, and baz, but each requires equilibrium or balance and I need to pause briefly in between commands.

If you're using Vbscript, you can make an alias that does this:

World.send "food"
world.doafter 5, "bar"
world.doafter 10, "baz"
Make sure you set it to send to script.

I'm not sure how quick your equi/balance is, but you can change the numbers to suit you. This is basic, but it works.
Unknown2010-01-08 18:52:36
QUOTE (Shaddus Mes'ard @ Jan 8 2010, 11:45 AM) <{POST_SNAPBACK}>
If you're using Vbscript, you can make an alias that does this:

World.send "food"
world.doafter 5, "bar"
world.doafter 10, "baz"
Make sure you set it to send to script.

I'm not sure how quick your equi/balance is, but you can change the numbers to suit you. This is basic, but it works.


I'm trying to use Lua but I'm sure it will be very similar. Thanks!
Unknown2010-01-08 19:04:01
The most efficient way to do it is to setup a queue of actions and execute the next one when you regain equilibrium/balance from the last. Timers are easy, but they're only good to a point, especially temporary timers like DoAfter.
Ilyarin2010-01-09 20:29:08
I'm fiddling with I/O in Lua MUSHClient and have hit a snag.

I'm using this in the immediate code execution bit.

CODE
io.output(io.open("my.txt","w"))
io.write('print("blah")')
io.close()

io.input(io.open("my.txt","r"))
assert(loadstring(io.read("*all"))) ()
io.close(io.input())


Now after running that, I track down the my.txt file that's been created, and I can't delete it because it's still open by MUSHClient. How do I close it properly? I can delete the file after closing MUSHClient, but I want to sever all ties immediately. This is the first time I've used I/O in Lua, so please don't say "OMG you're an idiot." sad.gif
Unknown2010-01-09 22:20:29
You're mixing functions that aren't meant to be used this way. You use either open or input/output, not both.

CODE
io.input("my.txt")  -- Opens file for reading
v = io.read("*all") -- Reads entire file into variable
io.close()             -- Closes your file
Ilyarin2010-01-09 23:25:45
Oh... Ha. Thanks. smile.gif
Ilyarin2010-01-09 23:51:43
Mm...I'm doing this, now.

CODE
io.output(io.open("my2.txt","w"))
io.write('blah blah blah')
io.close()

io.input("my2.txt")
local v = io.read("*all")
print(v)
io.close()


And it gives me this (the error caused by the last line, io.close())

CODE
blah blah blah
Run-time error
World: Midkemia
Immediate execution
:8: attempt to use a closed file
stack traceback:
        : in function 'close'
        :8: in main chunk