![]() |
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:
|
Quote:
|
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.
|
Quote:
|
Or someone could add a wiki page for it and copy the forum announcements may be :)
|
Quote:
|
Quote:
I even heard from *WhiteDragon that there's a function called "import()" :o |
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. |
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?
|
Quote:
|
If that is the case, I think it would be quite funny filtering some common words and watching bans roll in.
|
Quote:
|
Quote:
|
lol@this
|
Quote:
Tig just logged on right now! |
Quote:
xD |
Quote:
Good response time tbh. |
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.
|
| All times are GMT +2. The time now is 12:02 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.