minig Posted June 26, 2016 Share Posted June 26, 2016 hello, i have a script with a 1 parameter on / off (ks) - an two funtcion the first 1.GetParameter(ks) - it's okay ( 0 is off and 1 is on) the next mast reverse 2.GetParameter(ks) - ( 0 is on and 1 is off) how can i the ks value reverse? ( on send CC , off send Note) Quote Link to comment Share on other sites More sharing options...
minig Posted June 28, 2016 Author Share Posted June 28, 2016 okay i have the solution found a " ! " for GetParameter and the 0 is 1 and 1is 0 { if ( e instanceof Note) if ( e &&!GetParameter(ks)) } e.send(); Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted July 5, 2016 Share Posted July 5, 2016 Great, thanks for updating your own thread with your solution! Quote Link to comment Share on other sites More sharing options...
Unheardofski Posted September 28, 2016 Share Posted September 28, 2016 Semi-related note: A useful trick for making toggles when you do not always know the current state or do not want to check is to set the toggle like this: var toggle = -1; each time you need to "flick the switch" you go: toggle *= -1; now you have a toggle with states -1 (off) and 1 (on) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.