1 registered members (TipmyPip),
18,633
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
count the mouse click per second.
#412944
12/05/12 12:19
12/05/12 12:19
|
Joined: Oct 2012
Posts: 53
kenced
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2012
Posts: 53
|
hi!. I want to count the player clicks in a second. If 3 consecutive clicks done by the player it will do something, else the counter for clicks will return to 0. Is this possible?. Can anyone help me about this? thanks.
Last edited by kenced; 12/05/12 19:01.
|
|
|
Re: count the mouse click.
[Re: kenced]
#412980
12/05/12 19:33
12/05/12 19:33
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Here you go:
#include <acknex.h>
void on_mouse_left_event()
{
static fixed t0 = -16;
static fixed t1 = -16;
if (total_ticks <= t0 + 16)
{
beep(); // Do whatever you want to do here instead.
t0 = t1 = -16;
} else {
t0 = t1;
t1 = total_ticks;
}
}
Last edited by Uhrwerk; 12/06/12 04:01. Reason: Fixed a bug in the code
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: count the mouse click.
[Re: rayp]
#412985
12/05/12 19:47
12/05/12 19:47
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
But hes asking for 3 clicks in time if i understood him right. That is exactly what my sample does?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|