Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ How to keep the original color of the mud output that matched by the wait.regexp
How to keep the original color of the mud output that matched by the wait.regexp
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Killunix
(12 posts) Bio
|
Date
| Sun 05 Sep 2010 12:16 PM (UTC) Amended on Sun 05 Sep 2010 12:59 PM (UTC) by Killunix
|
Message
| How to keep the original color of the mud output that matched by the wait.regexp?
For example: the following image is the mud output that has the original color
http://lh3.ggpht.com/_t0oKqYjPmEo/TIOH9QkW9KI/AAAAAAAAAJY/QV7LXvzZrf0/Original%20Color.jpg"
I use the wait.regexp function to cap the mud output, then the color changed.like this:
http://lh5.ggpht.com/_t0oKqYjPmEo/TIOH9vPv_MI/AAAAAAAAAJc/fhdq4SV-xys/ChangebyRegexp.jpg
Thanks! | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #1 on Sun 05 Sep 2010 06:47 PM (UTC) |
Message
|
 |
Please help us by showing:
- A copy of the trigger, alias or timer you were using (see
Copying XML)
- The error message, if any, that you got
|
|
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #2 on Tue 07 Sep 2010 10:29 PM (UTC) Amended on Tue 26 Nov 2013 03:45 AM (UTC) by Nick Gammon
|
Message
| |
Posted by
| Killunix
(12 posts) Bio
|
Date
| Reply #3 on Thu 23 Sep 2010 07:59 AM (UTC) |
Message
| I have watched your video carefully,I still don't know how can modify the coder to keep the original styles.My code as follows:
function hyd_yzm()
local count=0
yzm={}
wait.make(function()
repeat
lines,wildchards=wait.regexp(".+")
table.insert(yzm,lines)
count=count+1
until count>=25
Execute("answer "..getyzm())
end)
end
| Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #4 on Thu 23 Sep 2010 10:21 AM (UTC) |
Message
| In my forum post that accompanied that video I had:
local line, wildcards, styles = wait.match ("*")
You don't have the styles do you? That is what has the colours in it. The style runs. The line is the plain text. The style runs has each style in its own colours. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Killunix
(12 posts) Bio
|
Date
| Reply #5 on Thu 23 Sep 2010 11:38 AM (UTC) Amended on Thu 23 Sep 2010 12:26 PM (UTC) by Killunix
|
Message
| Done!
Thanks you very much. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
17,476 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top