ID:270456
 
mob/var/list/IgnoreList = new()
client
verb
Ignore()
var/html="<html><head><title>Ignore</title></head>\
<body><table border=1 width=98% cols=2><tr><td align=center width=100%>Ignore who?</td></tr>"

for(var/mob/M in world)
html+="<tr><td align=center><a href='?src=\ref[M];action=ignore'>[M.name]\
</a></td>"

html+="</table></body></html>"

src<<browse(html,"window=join;size=200x300")


Topic(href,list[])
switch(list["action"])
if("ignore")
usr.IgnoreList += M
else ..()

Ok heres what i am trying to do i am wanting this topic/href to add the seleted mob in the ignore verb to the ignore list how would i go about doing so?
I would make it so it puts src=\ref[src];action=ignore;who=[M].


That way it actually gets called... I think.


-Doh
In response to XxDohxX
nope that does nothing.but leavw me with M undefined var.
In response to National Guardsmen
Try this:

mob/var/list/IgnoreList = new()
client
verb
Ignore()
var/html="<html><head><title>Ignore</title></head>\
<body><table border=1 width=98% cols=2><tr><td align=center width=100%>Ignore who?</td></tr>"

for(var/mob/M in world)
html+="<tr><td align=center><a href='?src=\ref[src];action=ignore;who=[M]'>[M.name]\
</a></td>"

html+="</table></body></html>"

src<<browse(html,"window=join;size=200x300")


Topic(href,list[])
switch(list["action"])
if("ignore")
mob.IgnoreList += list["who"]
else ..()


-Doh
In response to XxDohxX
mob/var/list/IgnoreList = new()
client
verb
Ignore()
var/html="<html><head><title>Ignore</title></head>\
<body><table border=1 width=98% cols=2><tr><td align=center width=100%>Ignore who?</td></tr>"

for(var/mob/M in world)
html+="<tr><td align=center><a href='?src=\ref[src];action=ignore;who=[M]'>[M.name]\
</a></td>"

html+="</table></body></html>"
src<<browse(html,"window=ignore;size=200x300")


Topic(href,list[])
switch(list["action"])
if("ignore")
mob.IgnoreList += list["who"]
mob<<browse(null,"window=ignore")
else ..()

client
verb
Say(T as text)
set category=null
set name=">"
if(!T)
return
var/list/ChannelS=Channels["[src.mob.Current.name]"]
for(var/mob/M in ChannelS)
if (M.IgnoreList.Find(usr))
return
M<<"[TimeStamp()][src.mob.name]: [T]"

Ok for some reason its not filtering out the ignored persons text i cant figure it out plese help
In response to National Guardsmen
It should be if (M.IgnoreList.Find(mob)) .


-Doh
In response to XxDohxX
Still not working i think its not adding to the list.
Just to be safe, use mob.Topic(). It comes with an extra argument and I forgot how it sorts it. It might just be a couple of conditional statements, but whatever. mob.Topic() is easier. You don't have to use locate() on the src reference. And, I only use client.Topic() for forms.

You problem is that you aren't dereferencing the mob at hand with locate(textref), in which case would be locate(src) (You placed M, I dunno why. usr is the person clicking the link and src is the object you reference through the link by the way.) Actually, I beleive you can use hsrc to add it as well. Or maybe just hsrc. (It has been a while)

mob.Topic() version
mob
var/list/IgnoreList=list()

Topic(href,list[])
switch(list["action"])
if("ignore") usr.IgnoreList+=src
else ..()

client/verb
Ignore()
var/html="<html><head><title>Ignore</title></head>\
<body><table border=1 width=98% cols=2><tr><td align=center width=100%>Ignore who?</td></tr>"

for(var/mob/M in world)
html+="<tr><td align=center><a href='?src=\ref[M];action=ignore'>[M.name]</a></td>"
html+="</table></body></html>"
src<<browse(html,"window=join;size=200x300")


client.Topic() version
mob
var/list/IgnoreList=list()

client/verb
Ignore()
var/html="<html><head><title>Ignore</title></head>\
<body><table border=1 width=98% cols=2><tr><td align=center width=100%>Ignore who?</td></tr>"

for(var/mob/M in world)
html+="<tr><td align=center><a href='?src=\ref[M];action=ignore'>[M.name]</a></td>"
html+="</table></body></html>"
src<<browse(html,"window=join;size=200x300")
Topic(href,list[],hsrc)
switch(list["action"])
if("ignore") usr.IgnoreList+=hsrc //or usr.IgnoreList+=locate(src)
else ..()


Try those out.

[Edit]
Actually, instead of adding the mob to list, ad it's ckey. =D



In response to XxDohxX
More like "if(mob in M.IgnoreList)".
In response to CaptFalcon33035
Try this.

mob
var/list/IgnoreList=list()

client/verb/ignore()
var/html
for(var/client/c)
html+="<a href=?action=ignore&ignored=\ref[c]>[c]</a>"
src<<html

client
Topic(href,h[])
switch(h["action"])
if("ignore")
var/ignored=locate(h["ignored"])
if(ignored)
mob.IgnoreList+=ignored