ID:141223
 
Code:
obj
Kamehameha
icon='Objects.dmi'
icon_state="Box"
Click()
usr.Kamehameha()
return

DblClick()
usr<<output("<br><br>[src.name] set as Q.","window5.output1")
usr.SM=""
usr.SM2=""
usr.SM=src.name
usr.SM2=src.name
return


Problem description: I'm trying to set it so that if you click once, you would perform the verb Kamehameha but when you Double Click, I want to select the move.

My problem is that when I double click(even as fast as I could), It inputs both the single click and the double click. Is there a way to have like a tiny delay in between?

This seems more or less like a feature request to me :o

It would be nice they could add a new world var, something like click_delay. The default could be zero (0), meaning both Click() and DblClick() will be called upon a double click. Then you could raise the number for a longer interval click speed at which DblClick() will be registered after the first Click(). So if you set click_delay to 1, then click once, then click again before that 1 tick passes, DblClick() will be registered alone, and not both.
In response to Spunky_Girl
Spunky_Girl wrote:
This seems more or less like a feature request to me :o

It would be nice they could add a new world var, something like click_delay. The default could be zero (0), meaning both Click() and DblClick() will be called upon a double click. Then you could raise the number for a longer interval click speed at which DblClick() will be registered after the first Click(). So if you set click_delay to 1, then click once, then click again before that 1 tick passes, DblClick() will be registered alone, and not both.

Dangit. Oh well. Got any ideas on how I should separate using the move and selecting it? Obviously, I can't set it up how I have it now :/.
In response to Forerunnerz
Select - Left Mouse Click
Activate - Right Mouse Click

Advantages:
You'd only need to override one procedure and there is less of a chance to accidentally get the wrong one.
In response to Spunky_Girl
You could do that on your own with a client var and some sleep.
In response to Schnitzelnagler
EDIT: Thanks Kaioken, I took your advice and made my own little delay between the clicks.
In response to Forerunnerz
Forerunnerz wrote:
There is no right mouse click proc is there?

There's not a proc only for right click, but you can tell if somebody right clicked by checking the params in Click(), though I'm pretty sure you have to turn show_popup_menus off, which will disable all right click pop-up menus in the game.
In response to Forerunnerz
The event hook Click comes with params as third argument.

The params argument is text, and can be converted to a list using params2list(). It may contain left, middle, right.

Please note that client.show_popup_menus influences this behaviour.

Edit:
Damn, not even a minute too slow, but I included some useful links to the reference ;)
In response to Falacy
Falacy wrote:
Forerunnerz wrote:
There is no right mouse click proc is there?

There's not a proc only for right click, but you can tell if somebody right clicked by checking the params in Click(), though I'm pretty sure you have to turn show_popup_menus off, which will disable all right click pop-up menus in the game.

Nah, I'm good. I just set a delay between both Click() and DblClick().