Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Multi Keys (https://forums.graalonline.com/forums/showthread.php?t=43673)

Ethic_Sern 03-23-2003 07:04 AM

Multi Keys
 
Ok this is getting no where. I have tired everything to get multi keys to work fr simple &&'s to setting var's when a key is held down to deleting it when the key is released.. Anyone wanna clue me in to this?

screen_name 03-23-2003 08:01 AM

Like if you are holding the V key and N key at the same time or something.

Kai, you said he might be a better scripter than me? (laughs) Anyways, you can simply run a for loop and have an array (length 26 for just the regular alphabet). Then if it's pressed, then make it 1, if not, 0. Then just do your testing.

Ethic_Sern 03-23-2003 06:16 PM

Quote:

Originally posted by screen_name
Like if you are holding the V key and N key at the same time or something.

Kai, you said he might be a better scripter than me? (laughs) Anyways, you can simply run a for loop and have an array (length 26 for just the regular alphabet). Then if it's pressed, then make it 1, if not, 0. Then just do your testing.

Yea def still don't work >.<

osrs 03-23-2003 07:00 PM

I don't know what you mean with 'multi keys',is that like press ctrl+d?so...

NPC Code:

timeout=0.05;
if(keydown2(17,true)){
if(keydown2(keycode(d),true)){
say2 You pressed:ctrl+d;
}
}


tlf288 03-23-2003 07:48 PM

NPC Code:

timeout = .05;
if (timeout) {
this.key = -1;
if (keydown2(17,true))
this.key += 2;
if( keydown2(keycode(d),true))
this.key += 2;
if (this.key % 3 == 0)
say2 You pressed "ctl+d" good for you!;
timeout = .05;
}


Ethic_Sern 03-23-2003 07:52 PM

Quote:

Originally posted by osrs
I don't know what you mean with 'multi keys',is that like press ctrl+d?so...

NPC Code:

timeout=0.05;
if(keydown2(17,true)){
if(keydown2(keycode(d),true)){
say2 You pressed:ctrl+d;
}
}


thats what i was doing wrong for if(keydown2(17,true)){ i was useing keycodes

screen_name 03-24-2003 05:20 AM

The way I stated was not to find a specific combination of keys. I thought hemeant just getting any keys pressed. Oh nevermind.

HoudiniMan 03-25-2003 02:30 AM

Quote:

Originally posted by screen_name
The way I stated was not to find a specific combination of keys. I thought hemeant just getting any keys pressed. Oh nevermind.
hooked on fonicks?

screen_name 03-25-2003 06:30 AM

Quote:

Originally posted by HoudiniMan


hooked on fonicks?

=/ Spelling class?

Anyways, it was 4am, what more could you expect?

HoudiniMan 03-25-2003 09:04 AM

Quote:

Originally posted by screen_name


=/ Spelling class?

Anyways, it was 4am, what more could you expect?

*shrugs* it was a joke :\


All times are GMT +2. The time now is 01:33 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.