Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-15-2013, 06:15 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Swear Filter toggle

I'm just wondering, what's the best way to make a swear filter to turn it on and off?

I don't want a loop to run through each players chat - any suggestions?
__________________
Reply With Quote
  #2  
Old 05-15-2013, 06:21 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Clientside and onRemotePlayerChats()?
Reply With Quote
  #3  
Old 05-15-2013, 06:24 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
That doesn't work if players already have said something while you're not in the level
__________________
Reply With Quote
  #4  
Old 05-15-2013, 06:28 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by xAndrewx View Post
That doesn't work if players already have said something while you're not in the level
Then you'd only need to loop through players when the option is changed. Or just ignore this little quirk as players won't be changing the option that often.
Reply With Quote
  #5  
Old 05-15-2013, 06:30 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
not really a very good idea imo

thanks
__________________
Reply With Quote
  #6  
Old 05-15-2013, 08:09 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xAndrewx View Post
not really a very good idea imo
Uh, why not? Seems like the most reasonable solution to me. Just filter everybody's chat when you enter a new level or the option is toggled.
__________________
Reply With Quote
  #7  
Old 05-15-2013, 08:27 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by cbk1994 View Post
filter everybody's chat when you enter a new level
Which isn't even needed because onRemotePlayerChats() is called when the player is loaded into render view as well.
Reply With Quote
  #8  
Old 05-16-2013, 02:17 AM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
u can store the filtered chat in an attr and show that instead on player entry if u want to be retarded and not do what dusty said
Reply With Quote
  #9  
Old 05-16-2013, 06:16 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Hezzy002 View Post
u can store the filtered chat in an attr and show that instead on player entry if u want to be retarded and not do what dusty said


You guys are missing my point, I didn't want a loop.
__________________

Last edited by Darlene159; 05-17-2013 at 01:13 AM.. Reason: No need to call names
Reply With Quote
  #10  
Old 05-16-2013, 06:26 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by DustyPorViva View Post
Or just ignore this little quirk as players won't be changing the option that often.
best solution, would be best to leave it enabled by default and then don't even bother checking people's chat when they toggle it.

if they're going to get offended by someone saying **** don't even give them the opportunity to complain it. no one else is going to complain because you didn't un-filter people saying **** either.
__________________
Quote:

Last edited by fowlplay4; 05-16-2013 at 02:53 PM..
Reply With Quote
  #11  
Old 05-16-2013, 07:31 AM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
i dont want a loop, boo hoo. who the **** gives a **** , if you dont want a loop use a shitty solution that wastes bandwidth instead of processing power.

if you cant afford a single loop when you change levels then you should evaluate how you're scripting your *** server

Last edited by Darlene159; 05-17-2013 at 01:14 AM.. Reason: No need to call names
Reply With Quote
  #12  
Old 05-16-2013, 11:31 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xAndrewx View Post
You guys are missing my point, I didn't want a loop.
So you want to filter each player's chat, but you don't want to loop through the players...? What's wrong with you?

Is this better?

PHP Code:
function onPlayerEnters() {
  if (
players.size() >= 1) {
    
filterChat(players[0]);
  }
  
  if (
players.size() >= 2) {
    
filterChat(players[1]);
  }
  
  if (
players.size() >= 3) {
    
filterChat(players[2]);
  }
  
  if (
players.size() >= 4) {
    
filterChat(players[3]);
  }
  
  if (
players.size() >= 5) {
    
filterChat(players[4]);
  }
  
  if (
players.size() >= 6) {
    
filterChat(players[5]);
  }
  
  if (
players.size() >= 7) {
    
filterChat(players[6]);
  }
  
  if (
players.size() >= 8) {
    
filterChat(players[7]);
  }
  
  if (
players.size() >= 9) {
    
filterChat(players[8]);
  }
  
  if (
players.size() >= 10) {
    
filterChat(players[9]);
  }
  
  if (
players.size() >= 11) {
    
filterChat(players[10]);
  }
  
  if (
players.size() >= 12) {
    
filterChat(players[11]);
  }
  
  if (
players.size() >= 13) {
    
filterChat(players[12]);
  }
  
  if (
players.size() >= 14) {
    
filterChat(players[13]);
  }
  
  if (
players.size() >= 15) {
    
filterChat(players[14]);
  }
  
  if (
players.size() >= 16) {
    
filterChat(players[15]);
  }
  
  if (
players.size() >= 17) {
    
filterChat(players[16]);
  }
  
  if (
players.size() >= 18) {
    
filterChat(players[17]);
  }
  
  if (
players.size() >= 19) {
    
filterChat(players[18]);
  }
  
  if (
players.size() >= 20) {
    
filterChat(players[19]);
  }
  
  if (
players.size() >= 21) {
    
filterChat(players[20]);
  }
  
  if (
players.size() >= 22) {
    
filterChat(players[21]);
  }
  
  if (
players.size() >= 23) {
    
filterChat(players[22]);
  }
  
  if (
players.size() >= 24) {
    
filterChat(players[23]);
  }
  
  if (
players.size() >= 25) {
    
filterChat(players[24]);
  }
  
  if (
players.size() >= 26) {
    
filterChat(players[25]);
  }
  
  if (
players.size() >= 27) {
    
filterChat(players[26]);
  }
  
  if (
players.size() >= 28) {
    
filterChat(players[27]);
  }
  
  if (
players.size() >= 29) {
    
filterChat(players[28]);
  }
  
  if (
players.size() >= 30) {
    
filterChat(players[29]);
  }
  
  if (
players.size() >= 31) {
    
filterChat(players[30]);
  }
  
  if (
players.size() >= 32) {
    
filterChat(players[31]);
  }
  
  if (
players.size() >= 33) {
    
filterChat(players[32]);
  }
  
  if (
players.size() >= 34) {
    
filterChat(players[33]);
  }
  
  if (
players.size() >= 35) {
    
filterChat(players[34]);
  }
  
  if (
players.size() >= 36) {
    
filterChat(players[35]);
  }
  
  if (
players.size() >= 37) {
    
filterChat(players[36]);
  }
  
  if (
players.size() >= 38) {
    
filterChat(players[37]);
  }
  
  if (
players.size() >= 39) {
    
filterChat(players[38]);
  }
  
  if (
players.size() >= 40) {
    
filterChat(players[39]);
  }
  
  if (
players.size() >= 41) {
    
filterChat(players[40]);
  }
  
  if (
players.size() >= 42) {
    
filterChat(players[41]);
  }
  
  if (
players.size() >= 43) {
    
filterChat(players[42]);
  }
  
  if (
players.size() >= 44) {
    
filterChat(players[43]);
  }
  
  if (
players.size() >= 45) {
    
filterChat(players[44]);
  }
  
  if (
players.size() >= 46) {
    
filterChat(players[45]);
  }
  
  if (
players.size() >= 47) {
    
filterChat(players[46]);
  }
  
  if (
players.size() >= 48) {
    
filterChat(players[47]);
  }
  
  if (
players.size() >= 49) {
    
filterChat(players[48]);
  }
  
  if (
players.size() >= 50) {
    
filterChat(players[49]);
  }
  
  if (
players.size() >= 51) {
    
filterChat(players[50]);
  }
  
  if (
players.size() >= 52) {
    
filterChat(players[51]);
  }
  
  if (
players.size() >= 53) {
    
filterChat(players[52]);
  }
  
  if (
players.size() >= 54) {
    
filterChat(players[53]);
  }
  
  if (
players.size() >= 55) {
    
filterChat(players[54]);
  }
  
  if (
players.size() >= 56) {
    
filterChat(players[55]);
  }
  
  if (
players.size() >= 57) {
    
filterChat(players[56]);
  }
  
  if (
players.size() >= 58) {
    
filterChat(players[57]);
  }
  
  if (
players.size() >= 59) {
    
filterChat(players[58]);
  }
  
  if (
players.size() >= 60) {
    
filterChat(players[59]);
  }
  
  if (
players.size() >= 61) {
    
filterChat(players[60]);
  }
  
  if (
players.size() >= 62) {
    
filterChat(players[61]);
  }
  
  if (
players.size() >= 63) {
    
filterChat(players[62]);
  }
  
  if (
players.size() >= 64) {
    
filterChat(players[63]);
  }
  
  if (
players.size() >= 65) {
    
filterChat(players[64]);
  }
  
  if (
players.size() >= 66) {
    
filterChat(players[65]);
  }
  
  if (
players.size() >= 67) {
    
filterChat(players[66]);
  }
  
  if (
players.size() >= 68) {
    
filterChat(players[67]);
  }
  
  if (
players.size() >= 69) {
    
filterChat(players[68]);
  }
  
  if (
players.size() >= 70) {
    
filterChat(players[69]);
  }
  
  if (
players.size() >= 71) {
    
filterChat(players[70]);
  }
  
  if (
players.size() >= 72) {
    
filterChat(players[71]);
  }
  
  if (
players.size() >= 73) {
    
filterChat(players[72]);
  }
  
  if (
players.size() >= 74) {
    
filterChat(players[73]);
  }
  
  if (
players.size() >= 75) {
    
filterChat(players[74]);
  }
  
  if (
players.size() >= 76) {
    
filterChat(players[75]);
  }
  
  if (
players.size() >= 77) {
    
filterChat(players[76]);
  }
  
  if (
players.size() >= 78) {
    
filterChat(players[77]);
  }
  
  if (
players.size() >= 79) {
    
filterChat(players[78]);
  }
  
  if (
players.size() >= 80) {
    
filterChat(players[79]);
  }
  
  if (
players.size() >= 81) {
    
filterChat(players[80]);
  }
  
  if (
players.size() >= 82) {
    
filterChat(players[81]);
  }
  
  if (
players.size() >= 83) {
    
filterChat(players[82]);
  }
  
  if (
players.size() >= 84) {
    
filterChat(players[83]);
  }
  
  if (
players.size() >= 85) {
    
filterChat(players[84]);
  }
  
  if (
players.size() >= 86) {
    
filterChat(players[85]);
  }
  
  if (
players.size() >= 87) {
    
filterChat(players[86]);
  }
  
  if (
players.size() >= 88) {
    
filterChat(players[87]);
  }
  
  if (
players.size() >= 89) {
    
filterChat(players[88]);
  }
  
  if (
players.size() >= 90) {
    
filterChat(players[89]);
  }
  
  if (
players.size() >= 91) {
    
filterChat(players[90]);
  }
  
  if (
players.size() >= 92) {
    
filterChat(players[91]);
  }
  
  if (
players.size() >= 93) {
    
filterChat(players[92]);
  }
  
  if (
players.size() >= 94) {
    
filterChat(players[93]);
  }
  
  if (
players.size() >= 95) {
    
filterChat(players[94]);
  }
  
  if (
players.size() >= 96) {
    
filterChat(players[95]);
  }
  
  if (
players.size() >= 97) {
    
filterChat(players[96]);
  }
  
  if (
players.size() >= 98) {
    
filterChat(players[97]);
  }
  
  if (
players.size() >= 99) {
    
filterChat(players[98]);
  }
  
  if (
players.size() >= 100) {
    
filterChat(players[99]);
  }
  
  
// etc

Completely agree with Hezzy, if you can't use a loop here then you're doing it wrong.
__________________

Last edited by Darlene159; 05-17-2013 at 01:15 AM.. Reason: Removed deleted part of quoted post
Reply With Quote
  #13  
Old 05-16-2013, 12:06 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Someone is completely missing the whole point of a loop...
Mind you the execution time will be fairly fast @andrew, we are talking about milliseconds depending on your filtering method.

It wouldn't be infinite x-x
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #14  
Old 05-16-2013, 12:50 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
**** swear filters!!
__________________
Reply With Quote
  #15  
Old 05-16-2013, 01:26 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Crono View Post
**** swear filters!!
**** yeah!
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
Reply


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 02:03 AM.


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