Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-02-2003, 03:11 AM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
Replacing Words

I'm trying to make a script where, if your chat text contains a certain word, it changes only that word and leaves the rest of the text alone
Any advice on how I am to accomplish this?
I am not asking for a script, but nor do I want to my post own as it is rather...bad.
Reply With Quote
  #2  
Old 03-02-2003, 03:25 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
Tokenize what playerchats, then use a loop to check the tokens for the text. Then replace the word if its found.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #3  
Old 03-02-2003, 03:35 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Quote:
Originally posted by Knuckles
Tokenize what playerchats, then use a loop to check the tokens for the text. Then replace the word if its found.

I'd suggest using #e.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- [email protected] N- !o ?K w(w--) !O [email protected] !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #4  
Old 03-02-2003, 03:43 AM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
how exactly am i to replace the word though?
Reply With Quote
  #5  
Old 03-02-2003, 04:05 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
Well, using #e would find theCURSEwithin other words. No? So, using tokens would be easier..

Hmm...
In a for loop, where its checking for the text inside the tokense;
Use a string, like client.chat and output the token to it.

If it DOESNT FIND the text, then add the token onto the string.
Else IF it FINDS the text that your looking for inside the token, then instead of adding the token into the string, add '*'s, or somthing.

When the forloops over, output the string as #c. If it made any sense to you at all XD.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #6  
Old 03-02-2003, 04:30 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
id use indexof, strlen, and #e
Reply With Quote
  #7  
Old 03-02-2003, 04:35 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
O_o, I see watcha sayin' he'ya. XD
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #8  
Old 03-02-2003, 05:16 PM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
well I got it working, but it's cheasy and I would like to try a different way =X
I'm not really familiar with indexof =/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:28 AM.


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