Hi. Can write TCL script in command: !time ot !ntp bot telling time directly from a specific NTP server.
for example:
User: !ntp
Bot: NTP pool.ntp.org time: 09:45:63 GMT+2
Code: Select all
# Author: tomekk
# e-mail: tomekk/@/tomekk/./org
# home page: http://tomekk.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
set server "pool.ntp.org"
###########################################################
bind pub - !ntp gimme_time
package require time
proc gimme_time { nick uhost hand chan arg } {
global server
set tok [time::getsntp $server]
time::wait $tok
if {[time::status $tok] eq "ok"} {
set t [time::unixtime $tok]
putquick "PRIVMSG $chan :NTP $server time: [clock format $t -format "%H:%M:%S"]"
} else {
putquick "PRIVMSG $chan :NTP [time::error $tok]"
}
time::cleanup $tok
}
putlog "ntp.tcl ver 0.1 by tomekk loaded"
Code: Select all
can't find package time
while executing
"package require time"
(file "scripts/ntp.tcl" line 12)
invoked from within
"source scripts/ntp.tcl"
(file "eggdrop.conf" line 1396)
* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)