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 08-28-2007, 05:07 PM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Space remove function?

Out of curiosity, is there a function that removes all the spaces within a sentence? I couldn't find one looking through the wiki. o.o
__________________
Stan.
Reply With Quote
  #2  
Old 08-28-2007, 05:10 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Nope.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 08-28-2007, 05:20 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
make one yourself?
__________________
Reply With Quote
  #4  
Old 08-28-2007, 05:31 PM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Too bad, guess I'll have to make one as Chompy said. :P
__________________
Stan.
Reply With Quote
  #5  
Old 08-29-2007, 03:10 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
I'm Going To Assume You Want To Automatically Remove The Spaces From The Player's Chat:

PHP Code:

function onPlayerChats(){
 
tokens player.chat.tokenize();
 
player.chat tokens[1tokens[2tokens[3tokens[4tokens[5tokens[6tokens[7tokens[8tokens[9tokens[10];

Not Tested, But Should Work :P
__________________
Trying to be nice now...
Reply With Quote
  #6  
Old 08-29-2007, 03:17 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by bscharff View Post
I'm Going To Assume You Want To Automatically Remove The Spaces From The Player's Chat:

PHP Code:

function onPlayerChats(){
 
tokens player.chat.tokenize();
 
player.chat tokens[1tokens[2tokens[3tokens[4tokens[5tokens[6tokens[7tokens[8tokens[9tokens[10];

Not Tested, But Should Work :P
I believe you need this

PHP Code:
function onPlayerChats(){
 
tokens player.chat.tokenize();
 
player.chat tokens[1] @ tokens[2] @ tokens[3]...;

__________________
Deep into the Darkness peering...
Reply With Quote
  #7  
Old 08-29-2007, 03:24 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by bscharff View Post
I'm Going To Assume You Want To Automatically Remove The Spaces From The Player's Chat:

PHP Code:

function onPlayerChats(){
 
tokens player.chat.tokenize();
 
player.chat tokens[1tokens[2tokens[3tokens[4tokens[5tokens[6tokens[7tokens[8tokens[9tokens[10];

Not Tested, But Should Work :P
I don't need to seperate the players chat. o.o And you didn't properly declare that variablep properly. Besides I was hoping there was a general function for removing the spaces from any line of text.
__________________
Stan.
Reply With Quote
  #8  
Old 08-29-2007, 06:08 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
PHP Code:
temp.txt "I love f'ing rock'n'roll!";
for (
temp.footemp.txt.tokenize()) temp.txt2 = (temp.txt2 == NULL temp.foo temp.txt2 temp.foo);
player.chat temp.txt2
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 08-30-2007, 06:50 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 xXziroXx View Post
PHP Code:
temp.txt "I love f'ing rock'n'roll!";
for (
temp.footemp.txt.tokenize()) temp.txt2 = (temp.txt2 == NULL temp.foo temp.txt2 temp.foo);
player.chat temp.txt2
PHP Code:
temp.txt2 = (temp.txt2 == NULL temp.foo temp.txt2 temp.foo); 
Is the same thing as just:

PHP Code:
temp.txt2 @= temp.foo
You should always initialize the variable prior to the for loop so you don't accidentally use the variable beforehand and not even realize it.
__________________
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 12:31 AM.


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