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.

Script Help Please

Help for those learning Tcl or writing their own scripts.
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Script Help Please

Post by whittinghamj »

Could someone help me find out why this not working please.

Code: Select all

bind pub o !ftptest ftp:test
proc ftp:test {n u h c a} { 
set port [lindex $text 2]
 if {[catch {set ftp_test [socket -async $a $port]} sockerr]} { 
   putserv "privmsg $c :$a is 4OffLine" 
   } else { 
   putserv "privmsg $c :$a is 9OnLine" 
 } 
 close $ftp_test 
}
I am trying to have the dcript do the following

!ftptest host port
<bot> host is online

or

host is offline.

Could someone help me out on this one please :D

Cheers
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

try this:

Code: Select all

bind pub o !ftptest ftp:test
proc ftp:test {n u h c a} {
 if {[catch {set ftp_test [socket -async $a]} sockerr]} {
   putserv "privmsg $c :$a is 4OffLine"
   } else {
   putserv "privmsg $c :$a is 9OnLine"
 }
 close $ftp_test
}
should work for things like:
!ftptest ftp.some.host.net 6969
C
Cletus
Voice
Posts: 19
Joined: Sun Aug 06, 2006 6:01 pm

Post by Cletus »

This is better suited to the scripting help board isn't it? Oh well. :)
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

hey drag,

That just returns offline all the time, there is no where to give the arg for the port eg !ftptest host port or !ftptest host:port

both return offline even tho I know that ftp is online.

any suggestions? cheers
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Cletus wrote:This is better suited to the scripting help board isn't it? Oh well. :)
After 67 posts you'd think the person posting would know.

Moved to: Scripting Help
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply