Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-28-2007, 05:27 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
thanks. it works using attr's.
Reply With Quote
  #2  
Old 07-28-2007, 11:27 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Here's what I do

PHP Code:
if (player.chat.starts("sethat"))
  
player.attr[1] = player.chat.substring(7,-1); 
Reply With Quote
  #3  
Old 07-28-2007, 04:24 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Twinny View Post
Here's what I do

PHP Code:
if (player.chat.starts("sethat"))
  
player.attr[1] = player.chat.substring(7,-1); 
pshaw. Thats noob code.

PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

^-- That's where it's at.
__________________
Reply With Quote
  #4  
Old 07-28-2007, 04:42 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by cbkbud View Post
PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

ew o-o
Reply With Quote
  #5  
Old 07-28-2007, 05:26 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by cbkbud View Post
pshaw. Thats noob code.

PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

^-- That's where it's at.
That tokenize was seriously unnecessary... I didn't create a var (you also forgot to temp it) and I didn't need to tokenize it then access an index...
Reply With Quote
  #6  
Old 08-13-2007, 06:13 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 cbkbud View Post
pshaw. Thats noob code.

PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

^-- That's where it's at.
Using tokenize without parameters is real noob code.
__________________
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 04:08 PM.


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