Graal Forums

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

billybob53 12-14-2002 06:47 AM

keys
 
jsut wondering....

is this the right format for if the player pressis a specified key? cause i want to make a text field for passwords and login and stuff....

so i got a few questions:

1.) is this the format i should use?

if (keypressed){
if (keydown2(keycode(a),true){addstring this.passfield,a;}
" " " " " "
and so on?

2.) will keydown2 work offline?

3.) Should i use "if (this.passfield=<password>){//stuff} at the end?

osrs 12-14-2002 07:19 AM

Re: keys
 
Quote:

Originally posted by billybob53
jsut wondering....

is this the right format for if the player pressis a specified key? cause i want to make a text field for passwords and login and stuff....

so i got a few questions:

1.) is this the format i should use?

if (keypressed){
if (keydown2(keycode(a),true){addstring this.passfield,a;}
" " " " " "
and so on?

2.) will keydown2 work offline?

3.) Should i use "if (this.passfield=<password>){//stuff} at the end?

1-I dont think it's right.
2-Yes,at least works for me.
3-'if (strequals(<password>,#s(this.passfield))){//stuff;} would be better.

billybob53 12-14-2002 08:33 AM

hmm.... it wouldn't be insertstring? what would it be?

Ningnong 12-14-2002 07:25 PM

I never use if (keypressed) { etc } when using keydown2, I simply use:

if (keydown2(keycode(key),true)){
//do all this stuff;
}

May i remind you that keydown2 doesn't work in a timeout loop.
eg:

//#CLIENTSIDE
if (keydown2(keycode(x),true)){
say2 Mo0;
}

that works. No timeout needed :P

And if you want to make a password field, i suggest using showpoly, you can make a nice looking password field (yes a box) with showpoly.

Loriel 12-14-2002 07:39 PM

Quote:

Originally posted by Ningnong
I never use if (keypressed) { etc } when using keydown2, I simply use:

if (keydown2(keycode(key),true)){
//do all this stuff;
}

May i remind you that keydown2 doesn't work in a timeout loop.
eg:

//#CLIENTSIDE
if (keydown2(keycode(x),true)){
say2 Mo0;
}

that works. No timeout needed :P

And if you want to make a password field, i suggest using showpoly, you can make a nice looking password field (yes a box) with showpoly.

*bangs your head against the NPC Server repeatly*

billybob53 12-14-2002 07:46 PM

but, i cant make a flag that's if (this.passfield=blah).

I used addstring to make it show the letters but it's always like:
x,x,x,x,x,...

Ningnong 12-15-2002 02:21 AM

jez no need to take my head off. I wasn't thinking, what i meant was you dont need a timeout 'with' if (keypressed) because thats an action x.x

and Loriel that hurt *holds head* =(

Loriel 12-15-2002 02:24 AM

Quote:

Originally posted by Ningnong
and Loriel that hurt *holds head* =(
Tsss.
*puts fresh paint over the scratches on the server*

Spark910 12-15-2002 03:02 AM

New methods of flamming,

-Flamming is evolving, are you?

SaitoHajime 12-15-2002 09:12 AM

Re: keys
 
Instead of using addstring, use something like this:

setstring this.passfield,#s(this.passfield)a;

That way it will put the letter a after it. :)

HoudiniMan 12-17-2002 02:15 AM

Quote:

Originally posted by SaitoHajime
Instead of using addstring, use something like this:

setstring this.passfield,#s(this.passfield)a;

That way it will put the letter a after it. :)

Clever girl

Quote:

Originally posted by Loriel

Tsss.
*puts fresh paint over the scratches on the server*

Did you make sure that's coffee retardant paint Loriel? :D


All times are GMT +2. The time now is 04:45 AM.

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