|
Pauley Beginner
Joined: 17 May 2024 Posts: 17
|
Posted: Fri Jul 05, 2024 9:54 am
Button to enable/disable a trigger |
I have a trigger for my healer which will do a "party check" command for each "new round" of combat
so that I can know who to heal and not.
However, this "party check" command is spammy when I'm not playing my healer, and thus I want to create a button which turns this trigger on and off.
Trigger *** NEW ROUND *** TODO party status percent
This trigger has ID 32, can i use this in my button to toggle it on and off? Or maybe I'm forced to create/destroy the trigger with the button?
Any examples of how this could be implemented would be greatly appreciated |
|
|
|
Pauley Beginner
Joined: 17 May 2024 Posts: 17
|
Posted: Fri Jul 05, 2024 2:38 pm Re: Button to enable/disable a trigger |
Pauley wrote: |
I have a trigger for my healer which will do a "party check" command for each "new round" of combat
so that I can know who to heal and not.
However, this "party check" command is spammy when I'm not playing my healer, and thus I want to create a button which turns this trigger on and off.
Trigger *** NEW ROUND *** TODO party status percent
This trigger has ID 32, can i use this in my button to toggle it on and off? Or maybe I'm forced to create/destroy the trigger with the button?
Any examples of how this could be implemented would be greatly appreciated |
Somewhat of a workaround, but it works - just make the same trigger for both button toggles, just that one state does something and the other state still triggers but does nothing. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sun Jul 07, 2024 11:35 pm |
You can do that.
You need to give the trigger an ID of "PartyChecker"
then your button will do the following:
Code: |
#SWITCH (%trigger(PartyChecker))
(0) {#T+ PartyChecker}
(1) {#T- PartyChecker} |
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Pauley Beginner
Joined: 17 May 2024 Posts: 17
|
Posted: Mon Jul 08, 2024 9:51 am |
shalimar wrote: |
You can do that.
You need to give the trigger an ID of "PartyChecker"
then your button will do the following:
Code: |
#SWITCH (%trigger(PartyChecker))
(0) {#T+ PartyChecker}
(1) {#T- PartyChecker} |
|
Ah yes, I read about this way of switching. I found the trigger ID in the xml part in the GUI, how would I go about giving it its own ID ? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Jul 08, 2024 10:18 am |
You can either edit the xml directly, id="PartyChecker"
Or you can click the 'More' button at the bottom of the package editor window and just fill in the panel labeled ID. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Pauley Beginner
Joined: 17 May 2024 Posts: 17
|
Posted: Sun Aug 04, 2024 10:52 am |
shalimar wrote: |
You can either edit the xml directly, id="PartyChecker"
Or you can click the 'More' button at the bottom of the package editor window and just fill in the panel labeled ID. |
I cannot get this button to work. I make a simple push button and put the code into the script text field.
for testing purposes i changed the command to #ECHO commands to give me a visible output.
pushing the button does exactly nothing.
Code: |
#SWITCH (%trigger(475))
(0) {#ECHO test}
(1) {#ECHO TESTING} |
when i disable the trigger this should output "test" and when i enable the trigger it should output "TESTING" (when pushing the button)
The client is behaving as if the code in that button doesn't exist
(it was the same with the original quoted code, it didn't turn the trigger on or off)
screenshot:
https://i.ibb.co/Xz0yszp/Untitled.png |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Aug 05, 2024 12:06 pm |
The ID needs to start with a letter is the issue here, fully numeric IDs are not supported.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Pauley Beginner
Joined: 17 May 2024 Posts: 17
|
Posted: Sun Aug 11, 2024 4:03 pm |
shalimar wrote: |
The ID needs to start with a letter is the issue here, fully numeric IDs are not supported. |
Aaah, that makes sense - i was using the default ID assigned by cmud upon creating the trigger |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sat Aug 31, 2024 11:20 am |
The numeric ID is actually the priority in which settings execute, should any given thing cause several settings to go off simultaneously. (lower goes first)
I have no idea why it isn't labeled as such in the XML. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|