|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Fri Sep 11, 2009 4:35 am
Lua zs.trigger interface & xml |
1) start cmud, close sessions window
2) open PE, past following code into window
Code: |
<trigger priority="10" id="1">
<pattern>test</pattern>
<value> </value>
</trigger>
<alias name="test" language="Lua" id="2">
<value>trig = zs.gettrigger(1)
local tpat = trig.trigger
local tname = trig.name
local npat = "^"..tpat
local nname = string.sub(npat,1,64)
if (string.sub(tpat,1,64) ~= string.sub(tname,1,64)) then
--print("name&pattern NOT the same")
nname = tname
end
trig.name = nname
trig.trigger = npat
trig.endupdate</value>
</alias> |
3) right click on the alias, click execute script
4) click on the trigger, click xml tab, Notice name change, but same pattern
5) click script text tab, add a space to the script, save and click back on xml tab
6) notice no name tag, and pattern has been updated
Further testing reveals that the actual pattern HAS been updated, after executing the alias,
#say blehtest will not fire the trigger, but #say test will |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Sep 12, 2009 11:55 pm |
This is not actually a bug, but by design.
The name of trigger is taken from the 'fullname' property, the 'trigger' property. If you want the trigger name to be updated as well you need to set the 'fullname' property also.
fullname
Some settings have a short name and a long name. Use this to return the long name of a setting.
trigger
the same as the fullname property and used to store the full trigger pattern |
|
_________________ Asati di tempari! |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|