Mushclient Questions

by Esano

Back to Mechanic's Corner.

Kante2010-07-27 19:51:08
Tried that already, as well as switching around the quote types.

Run-time error
World: Treant
Immediate execution
:1: bad argument #3 to 'ColourNote' (string expected, got no value)
stack traceback:
: in function 'ColourNote'
:1: in main chunk

That's what happens when I remove the quotes around the ColourNote itself.
Calixa2010-07-27 20:02:26
You're missing a third argument, as the error says:

world.DoAfter (30, "world.ColourNote ('red', '176 Seconds Till Song Ends')", something here missing)

If nothing needs to be there only the , after the double quote should do the trick hopefully.
Razenth2010-07-27 20:02:55
Edit.
Kante2010-07-27 20:08:01
QUOTE (Calixa @ Jul 27 2010, 04:02 PM) <{POST_SNAPBACK}>
You're missing a third argument, as the error says:

world.DoAfter (30, "world.ColourNote ('red', '176 Seconds Till Song Ends')", something here missing)

If nothing needs to be there only the , after the double quote should do the trick hopefully.

That still only succeeds in printing it as a raw string.
Razenth2010-07-27 20:10:27
Try removing the quotes, and inserting the third argument for the ColourNote in the right place.
Unknown2010-07-27 20:13:02
You need foreground, background, and message parameters. ColourNote("red", "", "Blah.") will print red text with the default background color.

You also want to use DoAfterSpecial and use 12 or 14 as your last parameter to send to script.
Kante2010-07-27 20:30:27
I finally got it. Thank you, everyone!
Unknown2010-07-29 03:06:17
This may be a really really really -really- stupid question and probably easily answered if I bother to read through this entire thread(I won't, patience is a valuable commodity for me atm and I don't have much of it).

How can I get this bloody trigger to work?

CODE

     enabled="y"
   match="Meleris, Keeper of the Pool of Stars bows to you - the lesson in Discernment is"
   sequence="100"
  >
  learn 15 discernment from meleris
  

All I wants to do is read my help files while I learn. Can't be bothered to continually type in "learn blah blah blah" every 10-15 seconds. sad.gif


EDIT: I'm much more used to Mudlet and Zmud. MUSH is too... I don't know, weird. Yeah, sure it uses Lua like Mudlet, but it ain't user friendly!
Esano2010-07-29 04:59:33
Hm. Open up the trigger and click the "convert to regex" button - it might be treating one of those characters (probably the -) as a control character. If that doesn't work, talk to me ingame.

Or you can use this, but it'll probably need wrapwidth 0.

CODE

     enabled="y"
   match="^(\\w+)(\\, .*)? bows to you \\- the lesson in (\\w+) is over\\.$"
   regexp="y"
   sequence="100"
  >
  learn 15 %3 from %1
  
Unknown2010-07-29 05:10:33
QUOTE (Esano @ Jul 28 2010, 09:59 PM) <{POST_SNAPBACK}>
Hm. Open up the trigger and click the "convert to regex" button - it might be treating one of those characters (probably the -) as a control character. If that doesn't work, talk to me ingame.

Or you can use this, but it'll probably need wrapwidth 0.

CODE

     enabled="y"
   match="^(\\w+)(\\, .*)? bows to you \\- the lesson in (\\w+) is over\\.$"
   regexp="y"
   sequence="100"
  >
  learn 15 %3 from %1
  

This works perfectly. Thank you!
Thendis2010-07-29 16:37:27
I want an alias to put up multiple defenses that each need equilibrium. Usually, I would do a DoAfter and just try and time it right, but sometimes one is off and this feels a little odd. Is there a way to make DoAfter set a variable? Any other ideas on how I could do this?
Razenth2010-07-29 16:38:52
Make a queue and have Mush execute the next command on the queue whenever you regain balance.
Thendis2010-07-29 16:46:19
QUOTE (Razenth @ Jul 29 2010, 11:38 AM) <{POST_SNAPBACK}>
Make a queue and have Mush execute the next command on the queue whenever you regain balance.


That sounds like multiple forms of awesome.
Never heard of that, know where I can find more information?

If it's lua, I might be able to manage, but I'm not very good and need a few examples.
Unknown2010-07-29 17:13:55
My Treant combat system has that already built into it. Of course, it also has a separate defup mechanism that works with multiple balances in parallel...
Xavius2010-07-29 17:45:09
QUOTE (Kante @ Jul 27 2010, 02:42 PM) <{POST_SNAPBACK}>
Can someone tell me what I'm doing wrong?


enabled="y"
match=""Thy time within the Basin has come to a close." you sing, playing a rousing march on a forestal violin decorated with chimes."
send_to="12"
sequence="100"
>
world.DoAfter (30, "world.ColourNote ('red', '176 Seconds Till Song Ends')")




The DoAfter function is working, but it keeps printing the ColourNote as a raw string.

It's printing that as a raw string because you're passing it as a raw string. Whenever you put quotes around something, you're calling it a string.

The problem is that your ColourNote is written incorrectly. I believe that you need to specify both foreground and background colors (but someone who doesn't hate scripting in MUSH could probably tell you for sure). If you paste into your client /world.ColourNote ('red', '176 Seconds Till Song Ends'), you'll get the same error message.
Unknown2010-07-29 18:27:30
Assuming Lua, this should work better:
CODE
DoAfterSpecial(30, "ColourNote('red', '', '176 Seconds \\'Til Song Ends')", 12)
Unknown2010-07-30 04:31:30
EDIT: Ignore this.
Unknown2010-08-02 19:38:32
There a way to put clan chats in a different box or something? Hard when your bashing stuff and have to scroll up to see what is said.
Unknown2010-08-02 19:39:54
Felicia described not too long ago how to use a dummy world to separate out your channels. There are a couple of plugins to do chat stuff in a miniwindow, but they're a bit more advanced.
Unknown2010-08-02 23:22:27
I tried it, and I got this

Syntax error
Line in error:
local w = GetWorld ("chat") -- get "chat" world

What is happeninggg, I can't talk anymore.