ID:159055
 
Okay, I'm making a hacking sim/RPG and I'm putting an IRC in the game. I don't know if some of this stuff works or not because I get zero errors and warnings, but when I test it I get this message:

"unrecognized or inaccessible verb: irc_chat"

This is all my IRC code I have so far:
mob
var
oncomp=0
list/irc=list()
verb
comp(c as command_text)
set hidden=1
if(!oncomp)
usr << "<i><u>You're not on a computer...</i></u>"
else
if(c=="irc")
winset(usr, "irc", "is-visible=true")
irc+=usr.alias

irc_chat(t as text)
set hidden=1
irc << output("[world.time] :: [usr.alias] > [t]","irc.output2")


I have the irc.input3 set to the default verb: "irc_chat" but when I type in it and hit enter, I get the error I stated above. Any help?

Thanks!
irc-chat "
Thats how you type the verb, not irc_chat "
In response to AJX
I know a "-" is a space but I named the verb irc_chat ... can you not use underscores?
In response to Hi1
In node (path) names, underscores turn into spaces. Note that if you create a mob type named "/mob/Big_Joe", his name defaults to "Big Joe". Additionally, a verb declared by verb/Kill_Stuff() will be shown as "Kill Stuff" in an info control.
And in turn, as you've said, in verb commands, spaces turn into dashes.
So yes, a verb declared with verb/the_space() will be used by the command "the-space" only. You may be able to override a verb's name with the name setting to work with underscores, though (maybe even spaces, but unlikely), if you really want.
In response to Kaioken
Okay, I have it mostly working, but the output doesn't work, so I have a question:
Can you output to a list? This is how I'm doing it:

mob
var
list/irc=list()

verb
ircchat(t as text)
set hidden=1
irc << output("[world.time] :: [usr.alias] > [t]","irc.output2")


Would that work?
In response to Hi1
Nope. You'd have to do a for() loop to everything in the list and output to whatever you found.

for(var/mob/m in irc) m<<t
In response to Mysame
I just implemented that but it has the same effect as my posted code, no output...
*BUMP*

;)
In response to Hi1
Hmm, I tried this out by just changing a few things and it appeared to work but of course your skin controls might be messed up a little. I'd check your skin controls before using this since searching through all mobs can sometimes bring about a bit of lag.

mob
var
oncomp = 0
inIRC = 0
verb
comp(c as text)
set hidden=1
if(!oncomp)
usr << "<i><u>You're not on a computer...</i></u>"
else
if(c=="irc")
winset(usr, "irc", "is-visible=true")
usr.inIRC = 1
irc_chat(t as text)
set hidden=1
for(var/mob/M in world)
if(!inIRC)
continue
else
M<< output("[world.time")] :: [usr.alias] > [t]","irc.output2")
In response to THESINKING
Thanks, it works now. :)
In response to Hi1
No problem, but a quick suggestion on the time I'd use time2text if I were you it shows up better.
In response to THESINKING
Okay, thanks.
In response to Mysame
Uh. The reference seems to imply something different.
A << B: "A may be a mob, the whole world, or any list containing mobs."
In response to Schnitzelnagler
Yes, he is incorrect. The left-hand side argument (destination) of the << output operator can be either a mob, client, or a list (containing either).
It is preferred to just output to the list when needed instead of looping, as then the looping is done internally which is of course faster.
In response to Kaioken
Oh, I never knew. Just figured as his didn't work out. Thanks for correcting.