ID:268809
 
mob/verb/say(T as text)
set hidden = 1
var/list/mobs = list()
if(mutelist.Find(src.key))
src << "You're muted, therefore you can't talk."
else
if(T)
if(findtext(T,"\n"))
src << "Please refrain from spamming."
src.spam++
else
for(var/mob/M in view(src))
if(M)
if(M.client)
src.spam++
mobs+=M
mobs-=src
mobs << "\icon[src]([src] says:) [html_encode(T)]"
src << "\icon[src](<font color = #CCCCCC>[src]</font> says:) [html_encode(T)]"
mobs=null
if(src.spam>=3)
mutelist.Add(src.key)
world << "<B>[src] has auto-muted by the Spam Protector, he will be unmuted within 10 minutes.</B>"
src.spam = 0
sleep(100*600)
if(mutelist.Find(src.key))
mutelist.Remove(src.key)
world << "<B>[src] has been auto-unmuted by the Spam Protector."
sleep(10)
src.spam--

:|
It says it can't remove from the list(durring runtime).
I R TEH MIND-BOGLGED.
*cough*cheapbump*cough*
What list, mobs or mutelist? I can suggest one thing though, that you spawn() instead of sleep(). Change this part:

sleep(100*600)
if(mutelist.Find(src.key))
mutelist.Remove(src.key)
world << "<B>[src] has been auto-unmuted by the Spam Protector."


To this:

spawn(100*600)
if(src && mutelist.Find(src.key))
mutelist.Remove(src.key)
world << "<B>[src] has been auto-unmuted by the Spam Protector."


With that modification, the proc will exit and you may avoid some complications.


/Gazoot
In response to Gazoot
Thanks, Gaz... the error...
<font color = red>
runtime error: undefined proc or verb /mob/Remove().

proc name: say (/mob/verb/say)
source file: Verbs.dm,27
usr: Hell Ramen (/mob)
src: Hell Ramen (/mob)
call stack:
Hell Ramen (/mob): say("test")</Font>

And the mobs.Remove(src) is the error. :9
In response to Hell Ramen
Looks to me like mutelist isn't actually a list. Did you accidently assign it to a mob instead of adding a mob to it?
In response to YMIHere
        GMmute(T as text)
set desc = "Who's key do you wish to mute?"
set category = "Admin"
mutelist+=T
world << "<b>[src] has muted the key \"[T]\"."

GMban(T as text)
set desc = "Who's key do you want to ban?"
set category = "Admin"
banlist+=T
world << "<b>[src] has banned the key \"[T]\"."




GMunmute()
set category = "Admin"
if(mutelist.len)
var/unmute = input("Who do you wish to unmute?","Unmute") in mutelist
mutelist.Remove(unmute)
world << "<b>[src] has unmuted the key \"[unmute]\"."
else
src << "No one to unmute!"

I add them to it. :o
Whoa! What exactly are you trying to do? There's a lot of stuff inside that for() loop that shouldn't be there. For one, the mobs list is completely useless how you have it setup. For every mob in view() you're adding a mob to the list, then sending them a message, then making the list null. Is this some type of indentation error that happened when transporting this to the forums?
In response to Hell Ramen
Rule of thumb, close html and use

tags
In response to Hell Ramen
Well Im confused, I would just put this code to not let muted people talk.

mob/var/mute = 0
mob/verb/Say(t as text)
if(usr.mute == 1)
usr<<"You are muted j00 f00l."
..()
else
view()<<"[usr]: [t]"


Thats as simple is it gets... efficant and simple.
In response to YMIHere
Ungh, I'll just use the basic say verb model...
I'm not good with this advanced crud. :9
In response to N1ghtW1ng
N1ghtW1ng wrote:
Rule of thumb, close html and use

tags

I actually fixed my code before you posted that. :O
In response to Hell Ramen
Actually you still didn't close your HTML. use:

After the sent. with bold in it.
In response to N1ghtW1ng
Whoops, one of my first tags I forgot to close. >_>
Thanks Night.
In response to Hell Ramen
No Problemo.
How about we just start by taking out the loop. =) Since you don't seem to need an individual reference to each mob in view, we can just output the message to oview(). I will also take out the mobs list, which was used to display the message.

While taking that out, we'll get rid of if(M) and if(M.client) as they really aren't needed. Of course, we'll have to take Gazoot's advice and change those sleep()s to spawn()s. =)

mob/verb/say(T as text)
set hidden = 1
if(mutelist.Find(src.key))
src << "You're muted, therefore you can't talk."
else
if(T)
if(findtext(T,"\n"))
src << "Please refrain from spamming."
src.spam++
else
src.spam++
oview(src) << "\icon[src]([src] says:) [html_encode(T)]"
src << "\icon[src](<font color = #CCCCCC>[src]</font> says:) [html_encode(T)]"
if(src.spam>=3)
mutelist.Add(src.key)
world << "<B>[src]</B>" // Message shortened
src.spam = 0
spawn(100*600)
if(mutelist.Find(src.key))
mutelist.Remove(src.key)
world << "<B>[src] has been auto-unmuted by the Spam Protector."
spawn(10)
src.spam--


That should be better, but I don't see what was causing your error.

*Edit
I meant to mention that I shortened the auto-mute message to prevent horizontal scrolling on the forums. The comment was there, but if you missed it you may have had to track this post down to find the original message again. =)
In response to YMIHere
YMI here, you are teh life saver.
I think I'm thinking of a "Worldsay" type verb...
Anyways, thanks!
In response to Hell Ramen
My previous post seems kind of rude reading it now, I didn't intend for it to come out that way. Sorry. =(

Anyway, if you don't try advanced stuff from time to time, how will you ever advance? =)
In response to YMIHere
_>
I still shouldn't of tried it early on.
And it wasn't that rude. :o
*misses Garthor*