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.

Ping Script

Old posts that have not been replied to for several years.
Locked
D
DigitalXXL

Ping Script

Post by DigitalXXL »

Hi Guys!

I´ve just started learning TCL about a week ago. Now I´m at my second script and I´m stuck. I wanted to create a script that´s pinging a server and shows the result in an irc channel. The script should run on an eggdrop.

So far my code:

Code: Select all

bind pub - .ping ping
proc ping { nick uhost hand chan arg } {
    catch {exec ping $hostname} result
    putserv "PRIVMSG $chan : PING $result"
}
After typing .ping in my channel my bot answers with:
PING couldn't duplicate input handle: bad file number

I don´t know what this means and how I could fix it. Could anyone help me please?
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

this script is one of the biggest securety holes ever...

an exec with a parameter every user (bind -) can use....that system is allready doomed :D

better try working with open than with exit because it doesnt block your bot
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

error

Post by devilsoulblack »

<Maloso-n> .ping
<DeVilSoulBlacK> PING can't read "hostname": no such variable
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

you didnt define $hostname anywhere in the script, so how could it be read by the exec ?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Even, ifyoud efine hostname script isnt working...I puted my btos ip there and i typed .ping on chan and bot returned PING and nofthing more..
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

]Kami[ wrote:Even, ifyoud efine hostname script isnt working...I puted my btos ip there and i typed .ping on chan and bot returned PING and nofthing more..
how should it...
a) the ping command works different on unix and windows, if you use this exec on unix you bot will freeze (because ping <host> wont quick after 4 trys like windows ping does).
b) the catch output is multiple lines long, thats why you have to split the text @ \n

as said befor, dont you exec but try it with "open"...
Locked