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 04-30-2007, 03:06 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
More gui trouble. -.-

Ok, I could never do this. ><
When you press a button, if a certain text in the gui says like "password" then something happens....
I have tried alot of stuff, so, can someone help me? x.x

HTML Code:
//#CLIENTSIDE
function onCreated(){
passwin.destroy();
}
function onWeaponFired(){
new GuiWindowCtrl("passwin") {
  profile = GuiBlueWindowProfile;
  x = 10;
  y = 10;
  canclose=true;
  canmove=true;
  canminimize=false;
  canmaximize=false;
  canresize=false;
  destroyonhide=true;
  width = 160;
  height = 120;
  text = "";
  
  new GuiMLTextCtrl("passs") {
  profile = GuiBlueMLTextProfile;
  x = 10;
  y = 30;
  width = 140;
  height = 10;
  text = "<center>Password:</center>";
}
  
  new GuiTextEditCtrl("password12") {
  profile = GuiBlueTextEditProfile;
  x = 10;
  y = 50;
  width = 140;
  height = 20;
  text = "";
}

 new GuiButtonCtrl("button1") {
   profile = GuiBlueButtonProfile;
   x = 30;
   y = 80;
   width = 100;
   height = 20;
   text = "Submit";
 }
  
}
}

function button1.onAction(){
if (thiso.password12 == "password"){
player.chat = "!";
}
}
Reply With Quote
  #2  
Old 04-30-2007, 03:10 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
What? I don't understand what you're trying to say.
Reply With Quote
  #3  
Old 04-30-2007, 03:12 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Ok, you put "password" in the text space, click submit, and something happens.
In this case, the player says !.
Reply With Quote
  #4  
Old 04-30-2007, 03:14 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Why are you doing thiso.password12?
password12 is an object of it self. It does not belong to the npc o_o
You should just do password12 and you might see more of what you are looking for (what ever that is? )
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 04-30-2007, 03:14 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by oo_jazz_oo View Post
Ok, you put "password" in the text space, click submit, and something happens.
In this case, the player says !.
PHP Code:
function button1.onAction() {
 if (
password12.text == "password") {
  
player.chat "!";
 }

__________________
Reply With Quote
  #6  
Old 04-30-2007, 03:15 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
PHP Code:

//#CLIENTSIDE
function onCreated(){
passwin.destroy();
}
function 
onWeaponFired(){
new 
GuiWindowCtrl("passwin") {
  
profile GuiBlueWindowProfile;
  
10;
  
10;
  
canclose=true;
  
canmove=true;
  
canminimize=false;
  
canmaximize=false;
  
canresize=false;
  
destroyonhide=true;
  
width 160;
  
height 120;
  
text "";
  
  new 
GuiMLTextCtrl("passs") {
  
profile GuiBlueMLTextProfile;
  
10;
  
30;
  
width 140;
  
height 10;
  
text "<center>Password:</center>";
}
  
  new 
GuiTextEditCtrl("password12") {
  
profile GuiBlueTextEditProfile;
  
10;
  
50;
  
width 140;
  
height 20;
  
text "";
}

 new 
GuiButtonCtrl("button1") {
   
profile GuiBlueButtonProfile;
   
30;
   
80;
   
width 100;
   
height 20;
   
text "Submit";
 }
  
}
}

function 
button1.onAction(){
if (
password12.text == "password"){
player.chat "!";
}

That should work, but heres another way you can "catch" the onAction

PHP Code:

//#CLIENTSIDE
function onCreated(){
passwin.destroy();
}
function 
onWeaponFired(){
new 
GuiWindowCtrl("passwin") {
  
profile GuiBlueWindowProfile;
  
10;
  
10;
  
canclose=true;
  
canmove=true;
  
canminimize=false;
  
canmaximize=false;
  
canresize=false;
  
destroyonhide=true;
  
width 160;
  
height 120;
  
text "";
  
  new 
GuiMLTextCtrl("passs") {
  
profile GuiBlueMLTextProfile;
  
10;
  
30;
  
width 140;
  
height 10;
  
text "<center>Password:</center>";
}
  
  new 
GuiTextEditCtrl("password12") {
  
profile GuiBlueTextEditProfile;
  
10;
  
50;
  
width 140;
  
height 20;
  
text "";
}

 new 
GuiButtonCtrl("button1") {
   
profile GuiBlueButtonProfile;
   
30;
   
80;
   
width 100;
   
height 20;
   
text "Submit";
   
thiso.catchevent(this"onAction""CheckPassword");
 }
  
}
}

function 
CheckPassword()
{
  if (
password12.text == "password")
    
player.chat "!";

Reply With Quote
  #7  
Old 04-30-2007, 03:19 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Quote:
Originally Posted by zokemon View Post
Why are you doing thiso.password12?
password12 is an object of it self. It does not belong to the npc o_o
You should just do password12 and you might see more of what you are looking for (what ever that is? )
Because I was just trying everything I could, and I didnt change it when I posted it.

Thanks andy and rapid. :P
Reply With Quote
  #8  
Old 04-30-2007, 07:32 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by oo_jazz_oo View Post
Because I was just trying everything I could, and I didnt change it when I posted it.

Thanks andy and rapid. :P
I don't get thanks? I solved 50% of your problem
You just needed to change thiso.password12 to password12.text
__________________
Do it with a DON!
Reply With Quote
  #9  
Old 04-30-2007, 07:45 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by zokemon View Post
I don't get thanks? I solved 50% of your problem
You just needed to change thiso.password12 to password12.text
By reading your solution he would have tried

if (password12 == "password") which wouldnt have worked.

Quote:
You should just do password12 and you might see more of what you are looking for (what ever that is? )
__________________
Reply With Quote
  #10  
Old 04-30-2007, 12:15 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Andy0687 View Post
By reading your solution he would have tried

if (password12 == "password") which wouldnt have worked.
Still 50% of the answer like I said
I just didn't get what he was asking :o
__________________
Do it with a DON!
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:11 PM.


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