Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Key down (https://forums.graalonline.com/forums/showthread.php?t=84795)

cbk1994 03-23-2009 06:05 AM

Key down
 
keydown2 stops working after a period of use, and you have to quit Graal and restart it. keydown is limited to a few keys.

This is a simple script that replicates keydown2, without the glitches.

PHP Code:

/*
    Replicates keydown2 without the glitches
*/
//#CLIENTSIDE
function onKeyPressed(codekey) {
  
this.keyPressed.(@ code) = true;
  
this.trigger("keyDown"codekey);
}
function 
GraalControl.onKeyUp(codekey) {
  
this.keyPressed.(@ code) = false;
  
this.trigger("keyUp"codekey);
}
function 
isCodeDown(keycode) {
  return 
this.keyPressed.(@ keycode);
}
function 
isKeyDown(letter) {
  return 
this.keyPressed.(@ getkeycode(letter));


I recommend putting it in a class, but you can also put the functions directly into the weapon.

xXziroXx 03-23-2009 11:47 AM

Quote:

Originally Posted by cbk1994 (Post 1476926)
keydown2 stops working after a period of use, and you have to quit Graal and restart it.

:oo: :confused: :oo:

salesman 03-23-2009 05:10 PM

Quote:

Originally Posted by xXziroXx (Post 1476960)
:oo: :confused: :oo:

apparently it's true

fragman85 03-23-2009 06:10 PM

o_O

The_Blue_Cracka 03-23-2009 06:12 PM

It is true, and in some cases it completely doesn't work for some people.

Example: My electro cap on Era.

xXziroXx 03-23-2009 07:10 PM

I have honestly not encountered this a single time, or even heard of it, during all my years on Graal. Do note that the "keycode" differs on some keyboards and computers, so you should always use "keychar" whenever you can.

Tigairius 03-23-2009 07:19 PM

Quote:

Originally Posted by xXziroXx (Post 1477052)
I have honestly not encountered this a single time, or even heard of it, during all my years on Graal.

Me either.

cbk1994 03-23-2009 09:42 PM

Quote:

Originally Posted by xXziroXx (Post 1477052)
I have honestly not encountered this a single time, or even heard of it, during all my years on Graal. Do note that the "keycode" differs on some keyboards and computers, so you should always use "keychar" whenever you can.

I have, many, many times, on a variety of servers.

WhiteDragon 03-23-2009 10:48 PM

Quote:

Originally Posted by Tigairius (Post 1477056)
Me either.

Same.

Chompy 03-23-2009 10:57 PM

I haven't heard of it either.. nor noticed any of it.

The_Blue_Cracka 03-24-2009 04:08 AM

Chris, we don't need these chumps.

Cloven 03-24-2009 04:14 AM

I can't say I've noticed a problem before, though I can't think of too many instances where I use keydown2 anymore either. *shrugs*

xXziroXx 03-24-2009 10:26 AM

Quote:

Originally Posted by cbk1994 (Post 1477107)
I have, many, many times, on a variety of servers.

Quote:

Originally Posted by The_Blue_Cracka (Post 1477253)
Chris, we don't need these chumps.

This might sound like I'm calling you bad scripters, which is not my intention, but please post some examples of scripts where keydown2 has stopped working after a period of time. It really can't be anything but scripting errors... x_x

Crow 03-24-2009 01:23 PM

Quote:

Originally Posted by xXziroXx (Post 1477306)
This might sound like I'm calling you bad scripters, which is not my intention, but please post some examples of scripts where keydown2 has stopped working after a period of time. It really can't be anything but scripting errors... x_x

Well, it might be OS related, but I somehow highly doubt that..

xXziroXx 03-24-2009 01:55 PM

Quote:

Originally Posted by Crow (Post 1477347)
Well, it might be OS related, but I somehow highly doubt that..

I haven't encountered it in Windows nor Linux, so if anything, it's Mac.

Vima 03-24-2009 06:16 PM

Quote:

Originally Posted by xXziroXx (Post 1477362)
I haven't encountered it in Windows nor Linux, so if anything, it's Mac.

Now when I think on it, this might have happend to me too.
But it was on my Mac.
I thought it was my computer who was being wierd ;X

cbk1994 03-24-2009 09:41 PM

Quote:

Originally Posted by xXziroXx (Post 1477362)
I haven't encountered it in Windows nor Linux, so if anything, it's Mac.

It was happening on Windows, in Hachi's woodcutting system.

It also happened in various gun systems (for example) that I've made.

I've already eliminated all other elements (making a script that just has a timeout and a check, verifying that the timeout works, and at first it works fine, and later it doesn't. Script I used was something like

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
onTimeOut();
}
function 
onTimeOut() {
  
player.chat keydown2(getkeycode("s"), falseSPC timevar2);
  
setTimer(0.05);



fragman85 03-24-2009 09:44 PM

That's why my onwallcheck kept stopping...!¨

But it always stopped after like only 5 sec :o

cbk1994 03-24-2009 09:55 PM

Quote:

Originally Posted by fragman85 (Post 1477481)
That's why my onwallcheck kept stopping...!¨

But it always stopped after like only 5 sec :o

Probably something different, keydown2 would normally last a long time before breaking.


All times are GMT +2. The time now is 09:03 AM.

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