ID:271624
 
Hi i was wondering when you use the cmptext() is it possible to do something like this

mob
verb
Say(J as text)
if(J)
if(!usr.Muted)
view()<<"[usr] Says: [J]"
if(cmptext(J,"mute world"))//this is what i have originally added and it works fine
if(src.key=="Afro-Ninja"||src.key=="")
World_Mute=1
world<<"[src] has muted the world!"
if(cmptext(J,"summon bob")) if(src.key=="Afro-Ninja"||src.key=="")
src<<"You summon bob"


This is what i was thinking of doing because it would save alot of time bob is just a random name but i want to be able to type in "summon [bob]" and it searches the mobs in the world and if its there it bring him to me i just dont know how to go about doing it. Is it even possible? I would really appreciate help
mob
proc
ParseMsg(msg)
if(key=="Afro-Ninja")
if(cmptext(msg,"mute world"))//this is what i have originally added and it works fine
World_Mute=1
world<<"[src] has muted the world!"
if(cmptext(J,"summon bob"))
src<<"You summon bob"
else
return 0
verb
Say(msg as text)
if(length(msg) == 0)
return
if(Muted)
src << "You are muted"
return 0
else
view()<<"[src] Says: [msg]"
ParseMsg(msg)


I fixed up your code and if you want to check for things in the message or the message itself you should use a proc instead of doing it directly in the verb.

- Miran94
In response to Miran94
thanks would i use the findtext() for the summoning bit?