Hi all !
I've a simple question about triggering ...
I've a trigger they store in a 2 position array myStopWatch the values got by getStopWatchTime() the trigger responds to different output of the mud like:
"The sun starts to rise", "The sun is over your head", "The moon is rising" etc.
This events are not really fixed in specific times of the mud since the gods idea is to avoid player to have a really synchronized time ticket for their actions but still those outputs are at the end of a tick ...
At the end of trigger operation I need to issue:
send ( "TIME\n" )
and trigger the mud output in response of that command so i can get the mud time and store those in another 2 position array of time myTime so i can make some calculation like:
TicketLen = ( myStopWatch[2] - myStopWatch[1] ) / ( myTime[ 2 ] - myTime [ 1 ] )
This obviously adjusting the data in case of midnight is passed between the 2 series of data.
The trouble is that while both the triggers works fine each for each self (if I issue the TIME command manually) when the second should get the result of the send of the first the second doesn't fire.
Are there any way to trigger the output issued on the basis of another trigger ? Any suggestion ?
Thanks in advance !
Brutus
Triggering on Output of Trigger Action
Re: Triggering on Output of Trigger Action
I read it several times but don't quite understand which way do you mean this (there are several).The trouble is that while both the triggers works fine each for each self (if I issue the TIME command manually) when the second should get the result of the send of the first the second doesn't fire.
You shouldn't make triggers fire based on what other triggers fire - it's best to call functions or raise events.
Re: Triggering on Output of Trigger Action
As I understand it you have a mutiline OR trigger for:
"The sun starts to rise", "The sun is over your head", "The moon is rising" etc
This trigger stores the result of getStopWatchTime() into an array and sends "TIME" to as a command to the mud.
The second trigger responds to the output from the mud of the TIME command.
Unless you have the triggers nested or some other non-standard arrangement setup I can't see why this wouldn't work. Are you able to show screenshots of how the triggers are setup in your client? If I don't (I'm new) then Vadi might spot something like a checkbox ticked that shouldn't be, or nested triggered etc?
"The sun starts to rise", "The sun is over your head", "The moon is rising" etc
This trigger stores the result of getStopWatchTime() into an array and sends "TIME" to as a command to the mud.
The second trigger responds to the output from the mud of the TIME command.
Unless you have the triggers nested or some other non-standard arrangement setup I can't see why this wouldn't work. Are you able to show screenshots of how the triggers are setup in your client? If I don't (I'm new) then Vadi might spot something like a checkbox ticked that shouldn't be, or nested triggered etc?
Re: Triggering on Output of Trigger Action
Well I resolved ... and the trouble was only about the "timing" 
I mean since the last operation of the first trigger was to write the command TIME to the mud I was thinking that the other trigger was able to fire as soon as the output of the command was send back from the MUD, but I was wrong.
It seems that while a trigger is working, on my Mac OSX 10.8, other triggers can't fire ..
I solved using at the end of the first trigger:
tempTimer ( 3, [[send ("TIME\n")]]) instead of merely send ( "TIME\n" )
And now I've a really bullet ( and Gods ) proof way to adjust the length of time tick whatever the Gods change the hours times at which the sunrises or the moon sets (They say that this changes are due to he seasons, but for me it's only to avoid good triggering
)
If anyone is interested I could post both the triggers, the strings about the times of the day must be changed because of the language I'm on an italian language MUD

I mean since the last operation of the first trigger was to write the command TIME to the mud I was thinking that the other trigger was able to fire as soon as the output of the command was send back from the MUD, but I was wrong.
It seems that while a trigger is working, on my Mac OSX 10.8, other triggers can't fire ..
I solved using at the end of the first trigger:
tempTimer ( 3, [[send ("TIME\n")]]) instead of merely send ( "TIME\n" )
And now I've a really bullet ( and Gods ) proof way to adjust the length of time tick whatever the Gods change the hours times at which the sunrises or the moon sets (They say that this changes are due to he seasons, but for me it's only to avoid good triggering

If anyone is interested I could post both the triggers, the strings about the times of the day must be changed because of the language I'm on an italian language MUD

Re: Triggering on Output of Trigger Action
B.T.W.
During the development of the triggers I discovered another little trouble in the way lua works on OSX ..
The lua operator "-=" doesn't work well if I use it to test that an array in not "nil" it doesn't mater since I have changed the logic of the tests using the operator "==" but anyway this is a strange beaviour.
During the development of the triggers I discovered another little trouble in the way lua works on OSX ..
The lua operator "-=" doesn't work well if I use it to test that an array in not "nil" it doesn't mater since I have changed the logic of the tests using the operator "==" but anyway this is a strange beaviour.
Re: Triggering on Output of Trigger Action
To test for not nil, you can just do:
As for the operator you posted, I suspect you mean ~= rather than -=
Re: Triggering on Output of Trigger Action
Yes I should have mean ~= rather than -= ... but reading lua language manuals with a very little font I didn't have read well and I tried to use -= instead of ~= ... May be it's time to change my eyeglasses 
Btw for people that knows lua i've a little question: It seems to me (completely new to lua) that's a lot of the language is quite near to the 'C' language is that a good point to start to understand it or am I mislead from my experience on 'C' ?

Btw for people that knows lua i've a little question: It seems to me (completely new to lua) that's a lot of the language is quite near to the 'C' language is that a good point to start to understand it or am I mislead from my experience on 'C' ?
Re: Triggering on Output of Trigger Action
It's very C like in some regards, yes. That said, it's fundamentally different as it's an 'interpreted' language rather than a 'compiled' one.
It's also much, much easier to learn, heh.
It's also much, much easier to learn, heh.
Re: Triggering on Output of Trigger Action
The ~= operator on OSX does work correctly - I think you were misusing it. Could you show an example you were trying?