|
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
|
05-21-2007 23:00
I've been working on a device for some time now; Originally, I had six buttons on it that controlled up, down, left, right, and two option buttons. However, I've recently realized that by using llTakeControls, I can do all of these commands without using the prims. However, now the command returns a minimum of four times per press, simply because of the number of times it refreshes and gets the command again. Is it possible to do a simple command to limit it to a single control response, and not four to ten of them in a row? Having so many sent through makes controlling it much more difficult, and causes it to go careening out of control.
|
|
Simnelia Petrichor
Registered User
Join date: 10 Feb 2006
Posts: 35
|
05-22-2007 01:53
You should be able to do this by using the parameters on the control event - control(key id, integer held, integer change) { if (change & held & CONTROL_UP) { ... YOUR CODE } } This executes your code only if the event has been caused by a change in the status of the button, and the button is currently held down. Or in other words, you've just pressed the button.
|
|
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
|
05-22-2007 15:31
Thanks a ton; I fiddled with the code a little, used the info you gave me, and now it only sends a message when the button is pressed.
|