Mushclient Questions

by Esano

Back to Mechanic's Corner.

Unknown2009-02-25 00:46:00
You can open it in any text editor and fix it or at least copy and paste your settings into a working world file.
Isuka2009-02-25 00:47:45
QUOTE (SerenGuard Gero @ Feb 24 2009, 03:29 PM) <{POST_SNAPBACK}>
So last night being sleepy I did something to mess up my mush save, so now when I try to open it it says that File does not have a valid MUSHclient XML signature. After that shows up and I hit ok I get hit with Unexpected file format. Is there any way to save my file, I don't want to have to enter all those aliases and triggers back in.

open your world file with notepad and make sure the top of the file looks similar to this:
CODE








Also: if all else fails, you can copy and paste the contents of the file to a new world, and save your triggers/aliases and so forth that way.
Unknown2009-02-28 02:18:56
How would I highlight a word that matches a cerain variable out a bunch of text?

Another question, can I customize the color of the DoAfter() Function? If so how would I do that?
I've tried many times and failed...
Unknown2009-02-28 04:06:15
QUOTE (Vecanamu @ Feb 27 2009, 09:18 PM) <{POST_SNAPBACK}>
How would I highlight a word that matches a cerain variable out a bunch of text?

Another question, can I customize the color of the DoAfter() Function? If so how would I do that?
I've tried many times and failed...


For the first one, can you give a little more details on what exactly you're doing? Maybe an example?

For the second one, I'm not sure how you "color a function," so it might help to explain what you're doing with your DoAfter call...
Unknown2009-02-28 04:36:15
The first one, I'm trying to hightlight the name of my target.

The second one, I'm using DoAfter() to tell me about when my phantom illusion wears off. I wanted to change the color of the output so it may be more noticable.
Esano2009-02-28 05:09:33
QUOTE (Vecanamu @ Feb 28 2009, 03:36 PM) <{POST_SNAPBACK}>
The first one, I'm trying to hightlight the name of my target.

The second one, I'm using DoAfter() to tell me about when my phantom illusion wears off. I wanted to change the color of the output so it may be more noticable.

Erm, DoAfter just sends to the mud. What you're actually using is either NoteAfter or DoAfterSpecial....

For the latter, here's an example of making it colourful:

DoAfterSpecial(5,'ColourNote("red","white","Phantom wore off!")',12)
Unknown2009-02-28 05:49:40
That's exactly what I was looking for, thank you.


I still need help on the first thing though. I want to highlight my target variable everytime it goes across the screen. For example, target=vecanamu so everytime vecanamu shows up I want it to be a different color.

This is what I've been doing that doesn't seem to work.

Trigger: ^@target.*$

Unknown2009-02-28 10:36:39
CODE

     custom_colour="17"
   enabled="y"
   expand_variables="y"
   ignore_case="y"
   keep_evaluating="y"
   match="(@!target)"
   regexp="y"
   repeat="y"
   sequence="1"
   other_text_colour="red"
  >
  

Copy the whole thing, paste it in triggers. Change colour to your own liking.
Esano2009-02-28 11:22:01
QUOTE (Vecanamu @ Feb 28 2009, 04:49 PM) <{POST_SNAPBACK}>
That's exactly what I was looking for, thank you.


I still need help on the first thing though. I want to highlight my target variable everytime it goes across the screen. For example, target=vecanamu so everytime vecanamu shows up I want it to be a different color.

This is what I've been doing that doesn't seem to work.

Trigger: ^@target.*$

What Caerulo gave you will work, but I'll explain what you're doing wrong.

First off, I'm going to assume that you're telling it it's regex. That's fine. But let's deconstruct your pattern.

^@target.*$

^ matches at the start of the line. Directly following this is your @target - so it will only match if your target occurs at the very start of the line. After this you're using . and * so it matches any number of any character until the end. The highlight affects the entire matched pattern, so even if it worked it would turn the entire line red, not just their name.

You also (although you didn't say if you had) have to enable the 'expand variables' option. 'Ignore case' is also good, so it doesn't matter if you type target Esano, target esano, target eSAno, etc. it'll still match.
Unknown2009-02-28 13:56:33
Okay, I understand that. I was using the 'Ignore case' but I still didn't have it set up right. Thank you, Caerulo and Esano
Unknown2009-03-02 08:26:32
How do you add newlines to variables via the SetVariable command?
Unknown2009-03-02 12:28:31
QUOTE (Caerulo @ Mar 2 2009, 03:26 AM) <{POST_SNAPBACK}>
How do you add newlines to variables via the SetVariable command?


\\n (assuming regex in whatever pattern is using the variable)

Why are you putting newlines into variables, though, one must wonder?
Unknown2009-03-02 12:39:43
QUOTE (Zarquan @ Mar 2 2009, 08:28 PM) <{POST_SNAPBACK}>
\\n (assuming regex in whatever pattern is using the variable)

Why are you putting newlines into variables, though, one must wonder?

To make a temporary ct/gt catcher until I understand how tables work. I've tried using \\n, even \\0A, but I always get this error
Compile error
World: Lusternia
Immediate execution
:1: unfinished string near '"'

My alias to test it:

match="test"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
SetVariable ("test", GetVariable("test") .. "\\nTesting")
Note ("test")




I've tried SetVariable ("test", GetVariable("test") .. \\n .. "Testing"), SetVariable ("test", GetVariable("test") .. "\\n" .. "Testing"), SetVariable ("test", GetVariable("test") .. "\\n Testing"). All gave the same error.
Unknown2009-03-02 13:16:03
QUOTE (Caerulo @ Mar 2 2009, 07:39 AM) <{POST_SNAPBACK}>
To make a temporary ct/gt catcher until I understand how tables work. I've tried using \\n, even \\0A, but I always get this error
Compile error
World: Lusternia
Immediate execution
:1: unfinished string near '"'

My alias to test it:

match="test"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
SetVariable ("test", GetVariable("test") .. "\\nTesting")
Note ("test")




I've tried SetVariable ("test", GetVariable("test") .. \\n .. "Testing"), SetVariable ("test", GetVariable("test") .. "\\n" .. "Testing"), SetVariable ("test", GetVariable("test") .. "\\n Testing"). All gave the same error.


I just did SetVariable("aaa", "Line1\\nLine2") and it didn't give me any errors. I believe your issue is that GetVariable("test") is returning nil.

I'm not sure why you'd need tables (or newlines) just to catch CT/GT. Assuming you're using wrapwidth 0, which you really should be at this point, you can easily catch tells with a simple trigger.
Unknown2009-03-02 13:52:54
This is strange. I copied exactly as you did:

match="aaa"
enabled="y"
send_to="12"
sequence="100"
>
SetVariable ("aaa", "Line1\\nLine2")
Note (GetVariable("aaa"))



I made sure I had a variable called 'aaa'.

I still get this error:

Compile error
World: Lusternia
Immediate execution
:1: unfinished string near '"Line1'


Basically, what I'm trying to do is to is to trigger the CT, then 'paste' it into the variable that stores it. So what I'm trying to do is to set the variable to as it was, plus the new CT in a newline. I'm still not very good with Lua yet, and I tried to replicate what you did with the crits and kills stuff, but didn't work.
Unknown2009-03-02 20:03:10
QUOTE (Caerulo @ Mar 2 2009, 08:52 AM) <{POST_SNAPBACK}>
This is strange. I copied exactly as you did:

match="aaa"
enabled="y"
send_to="12"
sequence="100"
>
SetVariable ("aaa", "Line1\\nLine2")
Note (GetVariable("aaa"))



I made sure I had a variable called 'aaa'.

I still get this error:

Compile error
World: Lusternia
Immediate execution
:1: unfinished string near '"Line1'


Basically, what I'm trying to do is to is to trigger the CT, then 'paste' it into the variable that stores it. So what I'm trying to do is to set the variable to as it was, plus the new CT in a newline. I'm still not very good with Lua yet, and I tried to replicate what you did with the crits and kills stuff, but didn't work.


Putting it in an alias you need to escape the backslash or it gets expanded in the alias before it executes. So, it should be "Line1\\\\nLine2" then.

You might want to try using table.insert(t, "Line from CT") instead. Here's a snippet of Lua code that should give you an idea or two:
CODE
t = t or {} -- Make sure the table is valid first
table.insert(t, "Line 1 from CT")
table.insert(t, "Line 2 from CT")
for k,v in ipairs(t) do
  print(k,v)
end


Obviously, the table.insert is what you'll want to do each time you capture a line, and put the t = t or {} before it to be sure your table is initialized, if you like.

When you want to walk through the lines you've captured, you use a for loop like the one in the example.
Unknown2009-03-03 05:17:10
Thank you so much! I'll be trying to figure out the table thing.
Oli2009-03-03 06:12:30
So, for whatever reason, my computer seems to be lagging a helluva lot lately. Without mushclient up I'm fine, but with it up I'm havin real issues with webpages taking a long time loading, and Lusty has been really laggy for me the past 2-3 days. I know my computer can handle more than this. Back when I played WoW, I could sit in the busiest spot in the game while downloading stuff and I'd be fine.

Thing is my Treant is kinda old. 1.12 And I was wondering if it could be slowing me down. Also using Mushclient 4.37, but I dunno if there's a new update.

So far I've done everything I can think of but its still sluggish. Any ideas?


Found out what it was, so nevermind
Unknown2009-03-03 12:04:40
I'm curious to know what it was now. Heh.

Also, you really should upgrade as new versions of Treant are released. There's really no reason not to!
Oli2009-03-03 18:22:06
My mom was downloading a grand total of about 10gig worth of media. Also, I checked the link in your sig and couldn't find any specifics on how to upgrade. Did I miss anything? Or is it just an automatic update after I DL it?