ID:170312
 
mob/verb/say(T as text)
if(findtext("WHO","who"))
var/mob/M
usr << "<b>Players</b>:"
for(M)
if(M.client)
usr <<"[M]"
return
world<<"<small><b>[usr]</b></font> Yells [T]"


Problem #1: What i want this to do is if it finds the phrase who it outputs how many players there are and not display what the player said to the world. However it displays it anyway and i don't know how to stop it. So how would i stop it?

[Edit]
Problem #2: it also is displaying Players: Jiskuha every time i say something instead of if i say who.


~>Jiskuha
Your telling findtext() to find "who" in "WHO", which it always will

You want findtext(T,"who").

One thing to note, this will trigger even if someone happens to say something like "I wonder who did it..."
In response to Nick231
Thanks,That helped with problem #2 :).

~>Jiskuha
In response to Nick231
Nick231 wrote:
Your telling findtext() to find "who" in "WHO", which it always will

You want findtext(T,"who").

One thing to note, this will trigger even if someone happens to say something like "I wonder who did it..."

Which is why he can take the IRC approach of using keywords infront of the word.
EX: "*who", ":who", etc...
In response to Teh Governator
Yeah, I was aware of that. I'm just using that snippet i whipped up right there for testing.

P.S. If anyone could help me with Problem #1 that's posted up there still that'd be greeeeeeeaaaat!


~>Jiskuha
In response to Jiskuha
if(findtext(T,"Who"))
//blah
else
world << "[src]:[T]"



I think that would do it >.>
In response to N1ghtW1ng
That is what i thought as well however it does not work.

~>Jiskuha
In response to Jiskuha
Jiskuha wrote:
That is what i thought as well however it does not work.

~>Jiskuha

if(findtext(T,"Who"))
return 0
world<<T
In response to Teh Governator
Code Problem:Two different outputs.

Channels/proc
Say(T as text)
if(!T)return
if(findtext(T,"!Join"))
usr.Join()
return 0

mob/verb
Join(Channels/r in Channelss)
if(r==null)
src <<"No Channels Registered."
else
if(usr.CChannels != null)
usr.CChannels.Leave(usr)
r.Join(usr)
usr.CChannels = r


Channels are there and they show when i hit the verb. However, when i type !Join it says No Channels Registered.

~>Jiskuha
In response to Jiskuha
I think it has something to do with the way you are calling it. Maybe it is because you are not giving usr.Join() an arguement when it is expecting one in the verb...I might be wrong =P.
In response to N1ghtW1ng
I tried usr.Join(Channels/r in Channelss) No luck.
Does anyone know how i should be calling this?

~>Jiskuha
In response to Jiskuha
Can anyone help me,All i need help on is how i should call this verb. Sorry if i was not clear on that.

~>Jiskuha
In response to Jiskuha
How to call it, eh?
Well, as you can see:
Join(Channels/r in Channelss) has some args, so you would have to do something like:
var/q=rand(1,Channelss.len)
usr.Join(Channels[q])
In response to Hell Ramen
Would you mind explaining that a little as i don't understand it.

~>Jiskuha
In response to Jiskuha
Jiskuha wrote:
Would you mind explaining that a little as i don't understand it.

~>Jiskuha

I dunno' if it worked or not, but, here it goes:
var/q=rand(1,Channelss.len) = Picking a random channel from 1 to Channelss max length
usr.Join(Channelss[q]) = Picking a channel from Channels with the length of q.

The point here, is, well, you're looking to see if "" is in there, and it's not. You need to find something that would find the text that you need. (EX: findtext "!Join Jiskuha's Lair" or something)

In response to Hell Ramen
I want it to have the same function as the verb Join. It shows all of the channels in the list however this does not list the names and forces the player to know the others names. How can i get it to have the same function as the verb?

~>Jiskuha