|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Fri Aug 12, 2011 2:48 pm
[3.34] BUG: #T+ is not working properly, when we use more than one window at... |
My session has 3 main windows: mud, logs: chat and quests.
If you read something in the window 2 or 3 will trigger the following alias to #t+ does not bring the desired rezultu and the results of %trigger is as follows:
Code: |
#t+ tr_checkaff
#echo tr_checkaff -> %trigger(tr_checkaff)
#t+ tr_checkaff2
#echo tr_checkaff2 -> %trigger(tr_checkaff2)
...
|
before: tr_checkaff -> -1
after: tr_checkaff -> -1
befor: tr_checkaff2 -> -1
after: tr_checkaff2 -> -1
when the focus is window 1:
before: tr_checkaff -> 0
after: tr_checkaff -> 1
befor: tr_checkaff2 -> 0
after: tr_checkaff2 -> 1
I performed a few simulations and came to the conclusion that #t+ and %trigger is not working properly when the active window is different than that in which the script (alias here) was called.
Would like to receive favorable consideration and/or identify an alternative solution/bypass the problem. Cancellation of additional windows is not an option. P
best regards |
|
Last edited by Araadan on Fri Aug 12, 2011 5:14 pm; edited 1 time in total |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Aug 12, 2011 3:58 pm |
Try putting the settings you want to share between windows in a separate module, or use the //window/class/.../setting syntax to tell CMUD exactly where to look for the setting. You might also want to change the title of your post, I assume by #T? you meant #T+ and #T-, but #T? is actually a different command in CMUD, so I was momentarily confused when the post itself had nothing to do with it.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Aug 12, 2011 4:08 pm |
Any setting that is inside a window cannot be seen by other settings outside that window. Is this the problem you're seeing?
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Aug 12, 2011 4:32 pm |
That's always been the case. If you're wanting to execute an alias from an alternative window, you'll need to do something like:
Code: |
#EXECWIN "Mainwindowname" {alias here} |
|
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Aug 12, 2011 5:21 pm |
Not true, Matt, you just have to use //window/class/... to reference it.
|
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Fri Aug 12, 2011 5:23 pm |
@Daern ofc #t+ / #t- / %trigger, my fault;]
@MattLofton exactly
@charneus the point is that for an alias, which operates in an X session for X session it should not matter which window I have just activated. Alias has to act in this window, which was called, unless it contains the user type # execwin: window_name: alias, etc.
most likely obstacle to mutual understanding is my knowledge of English;]
edit:
@charneus I do not want to play in multisessions, in my opinion,% trigger / # t + not working properly.
cmud performs alias in the first window, I read the logos in the second, and the alias is trying to # t + in the second instead of first. ;]
really do not know how it is easier to describe ... |
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Fri Aug 12, 2011 5:38 pm |
Code: |
#execwin %window {#t+ tr_checkaff} |
Oh! I managed to send a command to the proper window ... But I still think that way not that way. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Aug 12, 2011 9:47 pm |
As I said in my first post, you could just make a module, and put all settings that you want to share between all windows in that module, instead of tying them to one window. Then you shouldn't need the #execwin command to execute commands in a separate window, you can use those settings from any window.
|
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Sat Aug 13, 2011 9:40 am |
But why? I want to run an alias in the window in which it was called. So the first. Cmud should function properly regardless of how many windows and the sessions have also included.
I have no problem with the syntax, and an obvious error function "% trigger."
Please take a alias as in the example and call it by "# wait 3000; alias" and switch to another window. Alias will perform in the right window, but the% trigger and # t + will appeal to a window that is currently active / focus.
This is wrong! |
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Sat Aug 13, 2011 6:45 pm |
Maybe I'm not understanding the issue entirely but if you want to enable/disable triggers in another window why don't you just specifcy the full path to them?
Code: |
#t+ //Window/MyTriggerFolder/tr_checkaff
#t- //Window/MyTriggerFolder/tr_checkaff
|
|
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Sat Aug 13, 2011 10:37 pm |
Since # t + should work by default in the window, where it was called. No matter whether I am at the time of the script switches to another window and read the logs ...
@ orphean not an option because it would have for each session and each trigger separately define "/ / window / / myclass / /". As a temporary solution and at the same time effectively applied #execwin %window {#t+ tr_checkaff}
It remains my hope that someone will test this issue and confirm the bug, which causes the patch in a subsequent version cmuda ... |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sun Aug 14, 2011 1:09 am |
Araadan, I don't see the difference between adding //window/class to all your triggers, and adding #execwin %window to all your triggers. They'll both work in the long run anyway, but the former will be more efficient, so it's the recommended method of the two. I don't understand why you're so against using it. As for whether it's a bug, I don't think you decide that. It could really go either way, and I think at this point we need to wait for Zugg to comment. He's the only one who can decide if it's a bug or not.
|
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Tue Aug 16, 2011 9:39 am |
Araadan wrote: |
I performed a few simulations and came to the conclusion that #t+ and %trigger is not working properly when the active window is different than that in which the script (alias here) was called.
...
Please take a alias as in the example and call it by "# wait 3000; alias" and switch to another window. Alias will perform in the right window, but the% trigger and # t + will appeal to a window that is currently active / focus. |
Not quite so... You can paste the following code in the untitled session an go play with "testA" alias.
Code: |
<window name="A" id="1">
<uid>{AC5D136E-6DB8-496F-A95E-159D9BAB1781}</uid>
<packages>untitled</packages>
<alias name="testA" id="3">
<value>#T- testC
#SWITCH (%trigger(testC, alias))
(-1) {#SAY "testC doesn't exist"}
(0) {#SAY "testC disabled"}
(1) {#SAY "testC enabled"}
#SAY "TestA - before #WAIT - SWITCH TO ANOTHER WINDOW (you have 3 sec)"
#WAIT 3000
#SAY "TestA - after #WAIT"
a_command_to_MUD_sample
#SAY "Try to enable testC alias in the ""A"" window"
#T+ testC
#SAY %trigger(testC, alias)
#SWITCH (%trigger(testC, alias))
(-1) {#SAY "testC doesn't exist"}
(0) {#SAY "testC disabled"}
(1) {#SAY "testC enabled"}
</value>
</alias>
<alias name="testC" id="5"/>
</window>
<window name="B" id="2">
<uid>{E73C114E-E70B-41D4-9109-21D942E28B57}</uid>
<packages>untitled</packages>
</window> |
As you can see, #T+ works well even if you've switch to another window. And yes, after you've switch to another window you'll not see any output from the last #SWITCH command (that is the bug for me, CMUD should keep a kind of default window context to output to, or something like.)
So, #T+ works regardless of where is keyboard focus now and doesn't follow it, but there is a bug with text output.
Next, you use #WAIT in your sample, but #WAIT creates a new thread. You can open Debug window and see that threads counter value increase each time you run test alias. May be it somehow related with troubles you have. |
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Wed Aug 17, 2011 4:04 am |
@ Arde thank you for your support.
Analyzed my script for your comments and in fact, before each occurrence of an alias is used #wait.
On the other hand ... I think that pointed out the general direction and has made efforts to help identify the problem - the rest is a matter of programmers.
Fortunately, I found a temporary way to avoid this problem in the critical points.
ps. when I could write on the forum in Polish or German without googl translate? : P |
|
|
|
|
|