Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Announcements (https://forums.graalonline.com/forums/forumdisplay.php?f=240)
-   -   NPCServer updates: wordFilterText() (https://forums.graalonline.com/forums/showthread.php?t=85257)

Admins 04-21-2009 11:07 PM

NPCServer updates: wordFilterText()
 
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:

PHP Code:

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

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

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


fragman85 04-22-2009 12:28 PM

Quote:

Originally Posted by Stefan (Post 1485868)
This has already been added some months ago but has not been mentioned yet:

wow...

Crow 04-22-2009 04: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 04:43 PM

Quote:

Originally Posted by Crow (Post 1486048)
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 04:59 PM

Or someone could add a wiki page for it and copy the forum announcements may be :)

Crow 04-22-2009 05:03 PM

Quote:

Originally Posted by Stefan (Post 1486053)
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 09:30 PM

Quote:

Originally Posted by Crow (Post 1486055)
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-22-2009 11:18 PM

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-22-2009 11:32 PM

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-22-2009 11:50 PM

Quote:

Originally Posted by cbk1994 (Post 1486106)
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-22-2009 11:52 PM

If that is the case, I think it would be quite funny filtering some common words and watching bans roll in.

Inverness 04-22-2009 11:55 PM

Quote:

Originally Posted by fowlplay4 (Post 1486113)
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 12:13 AM

Quote:

Originally Posted by inverness (Post 1486114)
until the pwa log in and ask you what the **** you're doing.

xd !

Geno 04-23-2009 01:00 AM

lol@this

fowlplay4 04-23-2009 01:12 AM

Quote:

Originally Posted by Inverness (Post 1486114)
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!


All times are GMT +2. The time now is 10:03 AM.

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