Graal Forums

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

Aethorpe 02-20-2005 11:18 PM

keydown?
 
Does anyone know the keycodes for keydown, and/or a better way to find them? :x

ApothiX 02-21-2005 01:28 AM

Quote:

Originally Posted by Aethorpe
Does anyone know the keycodes for keydown, and/or a better way to find them? :x

commands.rtf

Aethorpe 02-21-2005 01:47 AM

Quote:

Originally Posted by ApothiX
commands.rtf

I am talking about using any key from the keyboard, not just default commands, like A,S,D,Q,M,Tab, etc.

Spiker 02-21-2005 02:19 AM

well all you have to do is click in the space to the right of thing you want to have on hot key and type a letter, a letter should show up in the space to the right.

ApothiX 02-21-2005 05:28 AM

Quote:

Originally Posted by Aethorpe
I am talking about using any key from the keyboard, not just default commands, like A,S,D,Q,M,Tab, etc.

Then this thread should be named 'keydown2?'

PHP Code:

if(keypressed) {
  
setplayerprop #c,#p(0) pressed.;


or if you want ones that don't work with keypressed,

PHP Code:

if(timeout) {
  for(
i=0;i<255;i++) {
    if(
keydown2(ifalse)) {
      
setplayerprop #c,#v(i) pressed.;
    
}
  }



Aethorpe 02-21-2005 06:09 AM

Quote:

Originally Posted by Spiker
well all you have to do is click in the space to the right of thing you want to have on hot key and type a letter, a letter should show up in the space to the right.

Nice try, but I fear you have no idea what we are talking about here. >.>

Aethorpe 02-21-2005 06:12 AM

Quote:

Originally Posted by ApothiX
Then this thread should be named 'keydown2?'

PHP Code:

if(keypressed) {
  
setplayerprop #c,#p(0) pressed.;


or if you want ones that don't work with keypressed,

PHP Code:

if(timeout) {
  for(
i=0;i<255;i++) {
    if(
keydown2(ifalse)) {
      
setplayerprop #c,#v(i) pressed.;
    
}
  }



Well, I appreciate the help, or would be help, had I any idea how that actually works.

falco10291029 02-21-2005 06:12 AM

NPC Code:

if (keypressed&&strequals(#p(0),key you want)) {
//script
}


There.

Aethorpe 02-21-2005 06:21 AM

Quote:

Originally Posted by falco10291029
NPC Code:

if (keypressed&&strequals(#p(0),key you want)) {
//script
}


There.

Strangely, it's not working. >.>

NPC Code:
if (keypressed&&strequals(#p(0),k)) {

say2 working;

}



Is this correct? :x

Ajira 02-21-2005 06:26 AM

Quote:

Originally Posted by falco10291029
NPC Code:

if (keypressed&&strequals(#p(0),key you want)) {
//script
}


There.

=/
#p(0) is the actual keycode, whereas #p(1) is the actual character.

falco10291029 02-21-2005 07:22 AM

OH yes, Im used to my brother using the pointless
NPC Code:

if (keypressed&&keydown2(#p(0),)) {
//stuff
}


so you would need it to be:
NPC Code:

if (keypressed&&strequals(#p(1),k)) {

say2 working;

}


ApothiX 02-21-2005 02:32 PM

Quote:

Originally Posted by Aethorpe
Well, I appreciate the help, or would be help, had I any idea how that actually works.

Put that in a script, and begin pressing buttons on your keyboard..

Dach 02-21-2005 08:25 PM

Quote:

Originally Posted by my commands.rtf
Key Numbers
8 back
9 tab (does not work with keypressed)
13 return
16 shift (does not work with keypressed)
17 control (does not work with keypressed)
18 alt (does not work with keypressed)
33 page up (does not work with keypressed)
34 page down (does not work with keypressed)
35 end (does not work with keypressed)
36 home (does not work with keypressed)
42 print key (does not work with keypressed)
45 insert (does not work with keypressed)
46 delete (does not work with keypressed)
91 left windows key (does not work with keypressed)
92 right windows key (does not work with keypressed)
93 mouse popup key (does not work with keypressed)
112-123 F1-F12 (does not work with keypressed)
144 numlock (does not work with keypressed)
160 left shift (does not work with keypressed)
161 right shift (does not work with keypressed)
162 left control (does not work with keypressed)
163 right control (does not work with keypressed)
164 left alt/menu (does not work with keypressed)
165 right alt/menu (does not work with keypressed)

the shameless plug wasn't necessarily intentional

ApothiX 02-21-2005 10:23 PM

Quote:

Originally Posted by Dach
the shameless plug wasn't necessarily intentional

:spam:? I already directed him to commands.rtf in a previous post. Actually quoting commands.rtf was unnessisary.

Malinko 02-21-2005 10:35 PM

Don't forget your good friends of newfeatures.txt!

Lance 02-21-2005 11:29 PM

Quote:

Originally Posted by ApothiX
:spam:? I already directed him to commands.rtf in a previous post. Actually quoting commands.rtf was unnessisary.

As far as I know, they aren't contained in commands.rtf but in newfeatures200X.txt. His updated commands.rtf, however, does contain them.

Aethorpe 02-22-2005 12:16 AM

Quote:

Originally Posted by falco10291029
OH yes, Im used to my brother using the pointless
NPC Code:

if (keypressed&&keydown2(#p(0),)) {
//stuff
}


so you would need it to be:
NPC Code:

if (keypressed&&strequals(#p(1),k)) {

say2 working;

}



Thank you. :)

ApothiX 02-22-2005 03:06 AM

Quote:

Originally Posted by Lance
As far as I know, they aren't contained in commands.rtf but in newfeatures200X.txt. His updated commands.rtf, however, does contain them.

Ah, didn't realise, I thought they were there by default. I must've updated mine and forgot about it. Sorry for the misconceptions.


All times are GMT +2. The time now is 05:29 PM.

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