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
➜ General
➜ Adding triggers through a script into a group?
Adding triggers through a script into a group?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Clanat
(2 posts) Bio
|
Date
| Fri 19 Oct 2007 05:03 AM (UTC) |
Message
| I'm interested in making a script that can be placed on a blank MUSHClient and work correctly, adding the necessary triggers into the proper groups. I looked through the AddTrigger and AddTriggerEx methods, and there doesn't seem to be any way to specify a group for the triggers to go in. Is there any way to do this without having to edit the triggers manually? | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 19 Oct 2007 08:37 AM (UTC) |
Message
| |
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Fri 19 Oct 2007 08:38 AM (UTC) |
Message
| |
Posted by
| Clanat
(2 posts) Bio
|
Date
| Reply #3 on Fri 19 Oct 2007 05:32 PM (UTC) |
Message
| Thanks, sorry I didn't read the FAQ closely enough. | Top |
|
Posted by
| Yanwuhuan
(15 posts) Bio
|
Date
| Reply #4 on Tue 28 Oct 2008 06:30 AM (UTC) |
Message
|
Oh, seems the 'name' is necessary for all the actions.
So this is not I want.
I want a no-name but with-group way to add triggers/alias/timers.
So I can dumping my entries into a script, make my world clean.
Then in my init script, I can:
1. deletegroups('a-group-name')
2. one by one, create a no-name trigger with group 'a-group-name'.
3. disable or enable the group for init state.
Now I lost the handler for created trigger after invoke AddTrigger.
If I didn't define each trigger name, it's hard to locate them, since it is not impossible to read them back and check it's 'match' field :(
Now I must use a replacement way to do that, define each name as 'a-group-name'..dummy_count. It's easy to check the 'name' field.
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #5 on Tue 28 Oct 2008 07:23 AM (UTC) |
Message
| |
Posted by
| Yanwuhuan
(15 posts) Bio
|
Date
| Reply #6 on Wed 29 Oct 2008 08:15 AM (UTC) |
Message
| Thank you, I know the internal name like *triggerNNN.
What I mean is like zmud class. It doesn't care each trigger's name, just care of group.
The scene is:
1. delete the special group
2. create many temporary trigger/alias/timer via a table(maybe), and add to the group.
So it's easy to share between different char on same world, or share to other mudders. Just require the .lua is ok, like plug-in.
To do step 2, now the only way is create it firstly, then get its info using addxml, then change its group.
Now the name is the quick way to get it back, otherwise we need get list, and compare each 'match' field.
BTW, thank Nick for the wonderful and powerful mud client:) | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #7 on Wed 29 Oct 2008 10:11 PM (UTC) |
Message
| I'm not quite sure what you are trying to do here.
The logical way of sharing a whole group of triggers, between worlds, or between users, is to simply put them in a plugin. Then you just install that plugin where required. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Yanwuhuan
(15 posts) Bio
|
Date
| Reply #8 on Thu 30 Oct 2008 06:08 AM (UTC) |
Message
|
The trouble is my friends is not good at programming...
So I need to make a simplest way to add their own match text they want. A string table is simple way for it, so I can make the script to read the string, then auto-create the triggers.
Just now I saw another post "Trigger from a dynamic list?", seems 'addxml.trigger' can do 'AddTrigger' behavior, like:
addxml.trigger {
enabled = 'y',
regexp = 'y',
['repeat'] = 'y',
custom_colour = '17',
sequence = '100',
other_text_colour = 'red',
match = '\\\\b(' .. table.concat (names, '|') .. ')\\\\b',
name = 'pkillers',
}
It's enough for me:)
Thank you. | 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.
23,843 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top