Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Something that should be added. (https://forums.graalonline.com/forums/showthread.php?t=43425)

Ghost Pirate 03-13-2003 04:05 AM

Something that should be added.
 
A automatic internet type translator

so all those single letter "words" are made into the real words, I get so annoyed when I see this bullcrap. I pretty much want to kill the person(s) who came up with this crap.

Kaiser2 03-13-2003 04:31 AM

Graal Bomy Moon made something like that, where curse words are replaced, and for example, plz becomes please, etc.

--Chris-- 03-13-2003 05:09 AM

I don't think it could be done with things such as "u" cause if someone were to say a word with the letter "u" in it, it would translate the individual letter into the word "you."

Example: Mush = Myoush

Unless of course they do something like (I suck at scripting but you get the idea)


string = 1 character
if input = "u"
print "you"

or a much longer versian if that's not possible like
if input = "u" then
print "you"
else
input = "mush"
print "mush"

*Repeat with every word that has the letter "u" in it*

G_yoshi 03-13-2003 05:33 AM

Quote:

Originally posted by --Chris--
I don't think it could be done with things such as "u" cause if someone were to say a word with the letter "u" in it, it would translate the individual letter into the word "you."

Example: Mush = Myoush

Unless of course they do something like (I suck at scripting but you get the idea)


string = 1 character
if input = "u"
print "you"

or a much longer versian if that's not possible like
if input = "u" then
print "you"
else
input = "mush"
print "mush"

*Repeat with every word that has the letter "u" in it*

tokenize works :p

By the way, GScript isn't BASIC or whatever variant you are using :p

NPC Code:

if (timeout) {
if (playerchats) {
tokenize #c;
this.wordcount = tokenscount;
for (this.i=0; this.i<tokenscount; this.i++) {
setstring chat#v(this.i),#t(this.i);
if (strequals(#s(chat#v(this.i)),u)) {
setstring chat#v(this.i),you;
}
}
setplayerprop #c,#s(chat0) #s(chat1) #s(chat2) ...; //this is the best way I can think of reconstructing the original text.
}
timeout = 0.1;
}



That should replace the 'u' with you. Although my method to reconstruct the original chat text could be better. I'm just not sure how to.

Kaimetsu 03-13-2003 05:42 AM

G_Yoshi, your method is horrible. Better version (untested but still way better):

NPC Code:

if (playerchats) {
tokenize #c;
for (i=0;i<tokenscount;i++) {
if (strequals(#t(i),u)) setstring local.chat,#s(local.chat)you ;
else setstring local.chat,#s(local.chat)#t(i) ;
}
setplayerprop #c,#s(local.chat);
setstring local.chat,;
}



Nesting event blocks is stupidstupidstupid.

Jeff 03-13-2003 06:27 PM

Or better, " u " (note the spaces) in the censor with its replacement listed as " you "

*adds*



EDIT: Well, at least on newmain or any other server with a censor.



ANOTHER EDIT: Ah, I need to add a tokenize thing because strequals didn't take my thoughts right.


ONE LAST EDIT: Kai, I took advantage of your code, but with one modification. The spaces should be #K(160) or they won't show up in the output

G_yoshi 03-13-2003 11:10 PM

Quote:

Originally posted by Kaimetsu
G_Yoshi, your method is horrible. Better version (untested but still way better):

NPC Code:

if (playerchats) {
tokenize #c;
for (i=0;i<tokenscount;i++) {
if (strequals(#t(i),u)) setstring local.chat,#s(local.chat)you ;
else setstring local.chat,#s(local.chat)#t(i) ;
}
setplayerprop #c,#s(local.chat);
setstring local.chat,;
}



Nesting event blocks is stupidstupidstupid.

Sorry. I figured it was, but I at least gave it a shot :)

Kaimetsu 03-14-2003 12:16 AM

If I were to make a real version then I'd include the ability to check for words in words. It'd take a list of word replacements with a boolean parameter for each which specified whether or not to respond to it if the string is part of another word. For 'u' we wouldn't do anything, but for 'spoon' (use your imagination) we would.

Tyhm 03-19-2003 10:30 PM

Tokenize = cleaner than " u ":
u sawk - tokenizes to You suck
u sawk - " u " not found
If you wanna do the indexof( u ,#c), better to make it the indexof( u , #c ) with spaces on either end.

Kaimetsu 03-20-2003 04:27 AM

Quote:

Originally posted by Tyhm
Tokenize = cleaner than " u ":
u sawk - tokenizes to You suck
u sawk - " u " not found
If you wanna do the indexof( u ,#c), better to make it the indexof( u , #c ) with spaces on either end.

Actually, I'd just do indexof(u,#c) and then use #e to check the characters on either side. If they're spaces, it's a separate word. If not, it isn't.

magicbud3344 04-14-2003 05:03 PM

it would take forever becuase people would just make up new ones x_x
P1Z ples plez p1ez ect.
;x

Jeff 04-14-2003 05:19 PM

Badbadgeno.


But that aside, the tokenizing system didn't work because it removed all quotation marks. But I am able to remove things like the corruptions of "please" that look like "pulls."

Xeph0ria 04-16-2003 05:35 PM

I have an easier solution.
BAN THE *****S WHO ARE TOO DAMN LAZY TO TYPE THE TWO EXTRA LETTERS.
:D

adam 04-16-2003 06:15 PM

u suxors m@n w3 n33d to t@lk like dis. It @in't u prob.

Ok ok, just kidding.


A script to convert known "words" to the appropriate word can be made. One to keep up with new "words" on it's own... Unlikely. Since there are so many varients to each words it might not do much good to make one.


All times are GMT +2. The time now is 08:42 PM.

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