Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-14-2002, 06:47 AM
billybob53 billybob53 is offline
Banned
Join Date: Nov 2002
Location: Usually in wy own world but at the moment in England
Posts: 33
billybob53 is on a distinguished road
Send a message via AIM to billybob53 Send a message via Yahoo to billybob53
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?
Reply With Quote
  #2  
Old 12-14-2002, 07:19 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
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.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #3  
Old 12-14-2002, 08:33 AM
billybob53 billybob53 is offline
Banned
Join Date: Nov 2002
Location: Usually in wy own world but at the moment in England
Posts: 33
billybob53 is on a distinguished road
Send a message via AIM to billybob53 Send a message via Yahoo to billybob53
hmm.... it wouldn't be insertstring? what would it be?
Reply With Quote
  #4  
Old 12-14-2002, 07:25 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
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.
__________________
Former Global Scripting Team Member


Reply With Quote
  #5  
Old 12-14-2002, 07:39 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
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*
Reply With Quote
  #6  
Old 12-14-2002, 07:46 PM
billybob53 billybob53 is offline
Banned
Join Date: Nov 2002
Location: Usually in wy own world but at the moment in England
Posts: 33
billybob53 is on a distinguished road
Send a message via AIM to billybob53 Send a message via Yahoo to billybob53
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,...
Reply With Quote
  #7  
Old 12-15-2002, 02:21 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
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* =(
__________________
Former Global Scripting Team Member


Reply With Quote
  #8  
Old 12-15-2002, 02:24 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally posted by Ningnong
and Loriel that hurt *holds head* =(
Tsss.
*puts fresh paint over the scratches on the server*
Reply With Quote
  #9  
Old 12-15-2002, 03:02 AM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
New methods of flamming,

-Flamming is evolving, are you?
__________________
--Spark911
Reply With Quote
  #10  
Old 12-15-2002, 09:12 AM
SaitoHajime SaitoHajime is offline
Registered User
Join Date: May 2002
Location: California
Posts: 396
SaitoHajime is on a distinguished road
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.
__________________
Current Staff Jobs:
*Co-Manager of G2k1


Last edited by SaitoHajime; 12-15-2002 at 09:53 AM..
Reply With Quote
  #11  
Old 12-17-2002, 02:15 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
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?
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:58 AM.


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