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
➜ Bug reports
➜ MUSHclient crashing
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #15 on Tue 05 Jun 2007 10:09 PM (UTC) |
Message
|
Quote:
It was working before, I used it for about a week.
I presume the list got longer. :)
The breakeven point if until you get version 4.08 is around 800 names (4096 / 5).
As a work-around, use a number of triggers, where each one is limited to less than 800 names. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Thalir
(13 posts) Bio
|
Date
| Reply #16 on Fri 03 Aug 2007 09:45 AM (UTC) |
Message
|
Quote: You could look up a list of names in a Lua table very efficiently, as that would be a "keyed" lookup.
May I ask for an example, as to how a highlighting trigger can use the names in a lua table? | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #17 on Fri 03 Aug 2007 11:41 AM (UTC) |
Message
| Rather than trying to make a regexp match thousands of names, match a wildcard, and look it up, like this:
<triggers>
<trigger
enabled="y"
match="\b(\w+)\b"
regexp="y"
repeat="y"
send_to="12"
>
<send>
enemies = enemies or
{
nick = true,
david = true,
fred = true,
}
if enemies ["%1"] then
-- we found a match
Note ("matched on %1")
end -- if
</send>
</trigger>
</triggers>
This is a simple example, but it matches on any word, and inside the script you look up the word in a table ('enemies' in this case). Now this can't be used to colour the words individually, so if that is your intention, you might omit the whole line from output and then redraw it with recolouring.
This can get a bit fiddly, so if you merely want to colour the names of your enemies (all 800 of them?) then the original idea should be OK, since the later versions won't crash on the regular expression.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
58,445 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top