This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Return ping-events to channel

Old posts that have not been replied to for several years.
Locked
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Return ping-events to channel

Post by ProXy »

Hi there,

I wrote a little script that should run the command "ping" in the bash and print all lines back to my channel. I tried

Code: Select all

putserv "PRIVMSG $chan :[exec bash -c "ping -c3 $arg"]";
but this only responded the frist line. Does anyone know how to catch all?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I unix, you use a newline character, to make the display move to the next line.

This is how you are able to display text formatted accross multiple lines.

In IRC, the newline character, is the end of command singal for IRC servers.

As such, you need to spli the input, at the newline, and print each line, somthing like

Code: Select all

foreach a [exec ping blah blah] {
  puthelp "PRIVMSG $chan :$a"
}
Locked