Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Mouse and keyboard commands/variables (https://forums.graalonline.com/forums/showthread.php?t=31328)

Shorty2Dope 06-10-2002 09:15 PM

Mouse and keyboard commands/variables
 
Can anyone post a simple script on how to use them. I read the newfeatures and I tried it out but it would not work. helpsie :(

(if you could put as many comments about it explaining how it works, I am trying to learn graal scripting)

If you don't want people stealing the script just PM me it please.

Projectshifter 06-10-2002 09:26 PM

They are not too hard of scripts. There are several mouse ones, but the most common would probably be:
actionleftmouse
and
actionrightmouse
those are only activated if the NPC is clicked w/ that mouse button. I don't exactly remember off the top of my head for the new keyboard ones, I should know though b/c I do it enough ,lol. I think it is like:
if (keydown2){
if (#p1(letter)){action;}
}
try that. If not keydown2, try keypress. Just copy and paste from the new features and you should be able to play w/ it a bit.
---Shifter

Shorty2Dope 06-10-2002 09:48 PM

Quote:

Originally posted by Projectshifter
They are not too hard of scripts. There are several mouse ones, but the most common would probably be:
actionleftmouse
and
actionrightmouse
those are only activated if the NPC is clicked w/ that mouse button. I don't exactly remember off the top of my head for the new keyboard ones, I should know though b/c I do it enough ,lol. I think it is like:
if (keydown2){
if (#p1(letter)){action;}
}
try that. If not keydown2, try keypress. Just copy and paste from the new features and you should be able to play w/ it a bit.
---Shifter

The key one don't work, thats the one I mostly had a problem with. Also how do you make it tell if the key is being held down or not?

[EDIT]Ok I figured it out, what you gave me helped enough. Then I went back into the newfeatures and played with the variables/commands. yey![/EDIT]

adam 06-11-2002 12:23 AM

NPC Code:

if (keypressed){
if (keydown2(keycode(letter),true){
do this;
}
}



I believe that's how keydown2 works.

I forget how the mouse worked.

Just look at the newfeatures text file.
It explains it rather well.

Projectshifter 06-11-2002 01:10 AM

:P Beat ya m8, he he. Yeah, I am @ a school compy, so I can't really pull up my home comp and look, heh. Glad I could be of some help.
---Shifter
P.S. Some other mouse commands: leftmousebutton; rightmousebutton;
---Shifter


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

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