# Script : Channel Check v1.00 by David Proper (Dr. Nibble [DrN])
# Copyright 2001 Radical Computer Systems
# All Rights Reserved
#
# Testing
# Platforms : Linux 2.2.16 TCL v8.3
# Eggdrop v1.6.2
# And : SunOS 5.8 TCL v8.3
# Eggdrop v1.5.4
#
# Description : This was a requested TCL. It just let's you enter
# a comment and retrive when it was placed.
# Another bot lending servie script.
#
# Requested by : DragonMin@UnderNet
#
# History : 08/12/2001 - First Release
#
#
# Future Plans : Fix Bugs. :)
#
# NOTICE: Author contact will be changing within a month. We're moving and
# will be hooking up with cable modem. Chaotix.net might come back
# in limited form. Check the DALnet and UnderNet channels for
# current contact information
#
# Author Contact : Email - DAProper@earthlink.net
# Home Page - http://home.earthlink.net/~daproper
# IRC - Nick: DrN UnderNet/DALnet
# Support Channels - #RCS @ UnderNet
# #RCS @ DALnet
#
# Chaotix.Net is currentlly offline. Should return no later then Jan 1st, 2002
#
# Radical Computer Systems - http://www.chaotix.net/rcs/
# To subscribe to the RCS mailing list: mail majordomo@chaotix.net and in
# BODY of message, type subscribe rcs-list
#
# Feel free to Email me any suggestions/bug reports/etc.
#
# You are free to use this TCL/script as long as:
# 1) You don't remove or change author credit
# 2) You don't release it in modified form. (Only the original)
#
# If you have a "too cool" modification, send it to me and it'll be
# included in the official release. (With your credit)
#
# Commands Added:
# Where F CMD F CMD F CMD F CMD
# ------- - ---------- - ------------ - ----------- - ----------
# Public: o !chan-check o !last-check
# MSG: N/A
# DCC: N/A
#
# Public Matching: N/A
#
#\
# |##### NOTE: Anything on the Chaotix.Net domain is currently offline
# |##### until we move.
#/
##### TCL Request by DragonMin
# [DragonMin] could you help me with a tcl i need written?
# [msg(DragonMin)] depends on the complexity of it.
# [DragonMin] just need two commands
# [DragonMin] !chan-check
# [DragonMin] and !last-check
# [msg(DragonMin)] What would they do
# [DragonMin] the chan check needs to write to a files
# [DragonMin] like date and time of the check and the info on what they say
# [DragonMin] ie : !chan-check all good
# [DragonMin] last check just checks the last one of the chan-checks
set cmdchar_ "!"
set cc_ver "1.00"
set cc_file "~/chan-check.txt"
proc cmdchar { } {
global cmdchar_
return $cmdchar_
}
bind pub - [cmdchar]chan-check pub_chancheck
proc pub_chancheck {nick uhost hand channel rest} {
global cc_file
#if {([matchattr $hand o] == 0) && ([matchchanattr $hand o $channel] == 0)} {return 1}
if {([matchattr $hand v] == 0) && ([matchchanattr $hand v $channel] == 0)} {return 1}
set out [open $cc_file w]
set cc_time [unixtime]
puts $out $cc_time
puts $out $rest
puts $out $nick
puts $out $uhost
puts $out $channel
close $out
putserv "NOTICE $nick :Check Logged at [ctime $cc_time] for $channel ($rest)"
}
bind pub - [cmdchar]last-check pub_lastcheck
proc pub_lastcheck {nick uhost hand channel rest} {
global cc_file
#if {([matchattr $hand o] == 0) && ([matchchanattr $hand o $channel] == 0)} {return 1}
if {([matchattr $hand v] == 0) && ([matchchanattr $hand v $channel] == 0)} {return 1}
if {[file exists $cc_file]} {
set in [open $cc_file r]
set cc_time [gets $in]
set cc_msg [gets $in]
set cc_nick [gets $in]
set cc_uhost [gets $in]
set cc_channel [gets $in]
close $in
putserv "NOTICE $nick :Last Check Logged at [ctime $cc_time] for $cc_channel by $cc_nick \[$cc_uhost\] ($cc_msg)"
} {
putserv "NOTICE $nick :Sorry, no channel checks recorded yet."
}
}
return "Chan-Check $cc_ver by Dr. Nibble (DrN) -: Loaded :-"