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.

socket tcl - HOW to make one?

Old posts that have not been replied to for several years.
Locked
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

socket tcl - HOW to make one?

Post by n00bster »

all i would like to know, is how to make tcl give socket information to users who type a certain trigger. like if someone types !serverstats - it should notice the user whether the a server is up/online or down/offline... my question is then, how do i make a tcl like that? whats the code?

thanks a lot in advance!
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Something like this should work

Code: Select all

set ip "127.0.0.1"
set port "21"

bind pub -|- !serverstats pub:serverstats

proc pub:serverstats {nick uhost hand chan text} {
global ip port
if {[catch {socket $ip $port} msg]} {
  putserv "PRIVMSG $chan :Server is offline. "  
} else {
  putserv "PRIVMSG $chan :Server is online. "  
  close $msg
}
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

oh... thanks! is it also possible to make it ping-check the server? like, when it gives the info that the server is on,it tells the ping for that server as well. where do i add that?

also,how do i make a partyline command for this function? (how to check if the server is on/off via partyline)

thanks a lot for the help, gb, and thanks again if you or/and someone else can help me with this!
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

help

Post by devilsoulblack »

how make one conection via sock in proxy ejp ip:port nick 1 join #canal and how make that ?
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

hmm....i would like my bot to display/notice the user 2, 3 or more server info (if the servers are on or off + ping),how do i make the script to display more than 1 server info/stats + ping at a time? like, here's the bot's respond when i type the trigger !serverstats: server 1 = online + ping, server 2 = offline + no ping and server 3 = online + ping.

how??

thank you A LOT in advance..... sry to be such a bother!! :(
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

so theres NO ONE that knows how to do this?? :( if there IS someone, please help me so i can stop bothering,which i dont like to do,thus im probably doing it right now,sorry... :(
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

alot of us know how to do this... but you can't just come in here and expect us to make the scripts for you.
If you'd bothered to learn a minimum of tcl you would know how to make it into a partyline command, but since you don't seem to wanna learn, I won't, and I doubt others will, make this script for you. Do an effort to learn and we will help you once/if you get stuck.
Elen sila lúmenn' omentielvo
Locked