PDA

View Full Version : NPCServer updates: wordFilterText()


Admins
04-22-2009, 12:07 AM
This has already been added some months ago but has not been mentioned yet:

wordfiltertext(text, type) - returns integer - filters text with the rules defined in wordfilter/rules.txt, second parameter is the text type (chat, pm, toall or nick), result is a combination of 1 (log) + 2 (tell admins) + 4 (replace) + 8 (warn) + 16 (jail) + 32 (ban); use getWordFilterNewText(), getWordFilterMessage() and getWordFilterMatches() for more information about the filtered text

getwordfiltermatches(int) - returns object - returns an array of words which matched the word filter after calling wordFilterText(), parameter is the maximum number of matches you want

getwordfiltermessage() - returns string - returns the warn message after calling wordFilterText()

getwordfilternewtext() - returns string - returns the new text generated by the word filter after calling wordFilterText()

Usage example:


temp.filteresult = wordFilterText(player.chat, "chat");

if ((temp.filteresult & 1)!=0)
savelog2("cursinglog.txt", player.account @ " used rude words: " @ getWordFilterMatches(3));

if ((temp.filteresult & (8 + 16 + 32))!=0)
player.chat = getWordFilterMessage();
else if ((temp.filteresult & 4)!=0)
player.chat = getWordFilterNewText()

fragman85
04-22-2009, 01:28 PM
This has already been added some months ago but has not been mentioned yet:



wow...

Crow
04-22-2009, 05:41 PM
Awesome. I still think you should have at least a .txt file somewhere which includes all the changes you make to the NPC Server and the GServer.

Deas_Voice
04-22-2009, 05:43 PM
I still think you should have at least a .txt file somewhere which includes all the changes you make to the NPC Server and the GServer.

so do i.

Admins
04-22-2009, 05:59 PM
Or someone could add a wiki page for it and copy the forum announcements may be :)

Crow
04-22-2009, 06:03 PM
Or someone could add a wiki page for it and copy the forum announcements may be :)

Won't work out, you are not even announcing everything >.<

fragman85
04-22-2009, 10:30 PM
Won't work out, you are not even announcing everything >.<

Or a little late, rofl.
I even heard from *WhiteDragon that there's a function called "import()" :o

fowlplay4
04-23-2009, 12:18 AM
It'd be nice to get the rest of the file I/O commands like..

copyfile(originalfile, newfile)
renamefile(originalfile, newfile) unless requestfilerename handles this, haven't tested.

and preferably a number of how many files the script can save in a set time before it sets off the flood alert, which seems to like to take down GS2 File I/O until the npcserver's restarted.

cbk1994
04-23-2009, 12:32 AM
What exactly do the ban and jail options do? I assume jail just warps the player to the jail level or something, and ban causes the gserver to ban them?

napo_p2p
04-23-2009, 12:50 AM
What exactly do the ban and jail options do? I assume jail just warps the player to the jail level or something, and ban causes the gserver to ban them?

Probably like what happens when a cheating tool is detected.

fowlplay4
04-23-2009, 12:52 AM
If that is the case, I think it would be quite funny filtering some common words and watching bans roll in.

Inverness
04-23-2009, 12:55 AM
If that is the case, I think it would be quite funny filtering some common words and watching bans roll in.Until the PWA log in and ask you what the **** you're doing.

Soala
04-23-2009, 01:13 AM
until the pwa log in and ask you what the **** you're doing.

xd !

Geno
04-23-2009, 02:00 AM
[email protected]

fowlplay4
04-23-2009, 02:12 AM
Until the PWA log in and ask you what the **** you're doing.

It's always nice when the PWA visit tbh.

Tig just logged on right now!

fragman85
04-23-2009, 07:40 AM
It's always nice when the PWA visit tbh.

Tig just logged on right now!

and asked you what the **** you're doing?
xD

fowlplay4
04-24-2009, 02:25 AM
and asked you what the **** you're doing?
xD

No he was investigating a ticket for a ban made an hour earlier for some one who cross server traded.

Good response time tbh.

Admins
05-01-2009, 07:00 PM
The ban and jail options were there for future expansion. People are not automatically banned or jailed, scripts could eventually jail if someone is breaking the word filter rules several times.