mIRC Home    About    Download    Register    News    Help

Print Thread
#130232 14/09/05 01:52 PM
Joined: Jul 2005
Posts: 56
W
whoami Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Jul 2005
Posts: 56
Hello,
I'm working on pictures windows games and i want to solve a problem which it..

I want to trigger something when [curserdown] is already pressed.
What i meant is if i press [cruserup] alone it will trigger something.
but if i pressed [curserleft] and the [cruserup] is already pressed i trigger the thing i want to.
So this may helps me to shoot at diffrent angels..
If u couldnt unserstand anything check this

http://users.cjb.net/blink2k/blinks%20game.avi

Sorry for my english

#130233 14/09/05 02:22 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I think your best bet is to use variables.
Code:
on *:keydown:@window:cursorup key number: {
  set %cursorup 1
}

on *:keyup:@window:cursorup key number: {
  unset %cursorup
}

Then, in your game, use a while or if statement to say that if %cursorup = 1 and %cursorleft = 1, do the command for up/left. And so on. There is $keyrpt, but I don't think that will really do what is needed.

The other option is to simply use the numpad.


Invision Support
#Invision on irc.irchighway.net
#130234 27/10/05 10:57 AM
Joined: Nov 2004
Posts: 148
D
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2004
Posts: 148
One bug in your script.

If a key is pressed and then he switches to another window, and then stop pressing the key, then it will not unset the variable.


I thought of making the same thing, but then I realized that it is not good.

#130235 27/10/05 01:09 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Well, the likelihood of switching windows while playing a game is low, but yes, there are problems. You can always throw in a timer that checks to see if the window is active, and if it isn't, it will unset the variable.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard