Code: Select all
# irclivedata.tcl version 0.1.0
# code bodged by some guy @ http://ut2004.titaninternet.co.uk
# this script will log every channel the eggdrop bot is on
# it will update the nick list every minute
# if your running the eggdrop on a seperate server to the forum you will need to upload
# the logs to somewhere the forum can access it.
# i use weex and cron for this, http://weex.sourceforge.net
# you first need to make a folder called irclivedata in the eggdrop folder before
# running this script
# ie. /eggdrop/irclivedata
# the data files will then be crated in that folder
# don't edit anything below this line unless you know what your doing
#-----------------------------------------------------------------------
# create server files if they don't exist
foreach chan [channels] {
if {![file exists "./irclivedata/usershigh$chan"]} {
set fnameirc "./irclivedata/usershigh$chan"
set fpirc [open $fnameirc "w"]
puts $fpirc "0"
puts $fpirc "no date set"
close $fpirc
}}
bind time - * userlistrun ;# runs every minute
# this prcedure gets run every minute by the above bind
proc userlistrun {m h d mo y} {
# main loop to parse each channel
foreach chan [channels] {
# read in most users number and date
set userfiletag [open "./irclivedata/usershigh$chan" "r"]
set userlisttag [split [read -nonewline $userfiletag] \n]
close $userfiletag
# if current number of users in channel is bigger than on file then update data file
set currentnumberusers [llength [chanlist $chan]]
if {$currentnumberusers > [lindex $userlisttag 0]} {
set userfiletag [open "./irclivedata/usershigh$chan" "w"]
puts $userfiletag $currentnumberusers
puts $userfiletag [ctime [clock seconds]]
flush $userfiletag
close $userfiletag
set userfiletag [open "./irclivedata/usershigh$chan" "r"]
set userlisttag [split [read -nonewline $userfiletag] \n]
close $userfiletag
}
# make sure these list are clear
set currentusersop "" ; set currentusershalfop "" ; set currentusersvoice "" ; set currentusers ""
# split the users into ops, halfops, voiced and regular users
foreach userraw [chanlist $chan] {
if {[isop $userraw $chan]} {
append currentusersop "@$userraw, "
} elseif {[ishalfop $userraw $chan]} {
append currentusershalfop "%$userraw, "
} elseif {[isvoice $userraw $chan]} {
append currentusersvoice "+$userraw, "
} else {
append currentusers "$userraw, "
}}
# clear the list
set currentusersline " "
# add everyone together on one line
append currentusersline $currentusersop $currentusershalfop $currentusersvoice $currentusers
# write the current users, most users and nicks into the main file
set irclivedata [open "./irclivedata/irclive$chan.txt" "w"]
puts $irclivedata " Current users online $currentnumberusers"
puts $irclivedata " Most users [lindex $userlisttag 0] on [lindex $userlisttag 1]"
puts $irclivedata "[string range $currentusersline 0 end-2]"
close $irclivedata
}}
putlog "irclivedata v0.1.0 loaded"
intergrating that into a forum was done by someone else i have no idea how to do it.Current users online 51
Most users 73 on Sun Dec 10 17:18:00 2006
@SakuraBot, @`fluffy, @Xe|BNC|Fusion, @Q, @fnenu, @ne|Zofo, +MoonUnit, saka, Meow`, {Ez0}Dess[ApA], DR|Don-Research, Jonex, GsatNZ, [Ci]Rhizome, [InX]Dark_Lord, ]tla[|work, ]I[-Willow, TGS`A_Spec`, Bithir, [ST2]LSL^apero, Slainchild, Bitpull, Razz, xming, [CB]LooN, mi5|Iceman, `sunsh1ne-, topaz^bnc, Sergonium, Turo, Nic666_, reaper-work, ]I[Cruz, FC|diocrino, j-X|Ohm, Molgan, |FroG|MaLa3aR, drzizi`bnc, moose666, `reaper, Babelfish, EvenDarkerBOB, DR|Phirsty|32, Shambler[Bishop, `phat|cP|away, ]I[Static, Killer-Rabbit, Blue`off, Greyman, grep, fewmics
Code: Select all
# HTML2.Tcl -- a lot like ques3.tcl, but I wrote this one myself and to my
# likings PLUS improvemnets for eggdrop1.3.4!
#
# fixed - doesn't display chan voices twice..
#
# Original Version by kn0 <keith@cs.oswego.edu>
# Edited for Eggdrop1.3.x by Prime <Unkonwn>
# Set these....
# Do this for every channel you want
set web_chans(#mindirectory) minidirectory.txt
# What directory are your web pages in? Or what directory do you want this to
# be in?
set web_dir www.nashhosting.co.uk/bot/
# How often do you want the page to be updated? (In minutes)
set web_update 1
###### Do not edit anything beyond this point!!! ######
foreach i [timers] {
if {[lindex $i 1] == "web_write"} {
killtimer [lindex $i 2]
}
}
if ![info exists web_topic] {set web_topic(*) "*"}
foreach i [channels] {set web_topic($i) ""}
proc web_write {} {
global web_dir web_update botnick nick web_topic web_chans
foreach i [array names web_chans] {
set wpage $web_dir$web_chans($i)
set web_page $web_chans($i)
set web_chan $i
set a [open $wpage w]
if {$web_topic($i) == ""} {
set web_topic($i) "topic unknown"
}
puts $a "<META HTTP-EQUIV=\"refresh\" content=\"[expr $web_update * 60]\; url=$web_page\">"
puts $a "<TITLE>$web_chan IRC channel stats (Written at [time] [date])</TITLE>"
puts $a "<CENTER><FONT SIZE=\"6\">$nick's $web_chan stats</FONT><BR><I>(Topic: $web_topic($i))</I></CENTER>"
if {![onchan $botnick $web_chan]} {
puts $a "<FONT SIZE=5><B>I ($nick) am currently not on $web_chan, try again later</B></FONT>"
puts $a <P>
}
puts $a "<CENTER>"
puts $a "<TABLE BORDER=3>"
puts $a "<TR><TD COLSPAN=3><CENTER><FONT SIZE=5>$web_chan, [getchanmode $web_chan] ([llength [chanlist $web_chan]] users)</FONT></CENTER></TD></TR>"
puts $a "<TR><TD bgcolor=0000ff><FONT COLOR=FF0000><B>Nickname</B></td><td bgcolor=0000ff><FONT COLOR=ffff00><B>Status/info line</B></td><td bgcolor=0000ff><font color=ff0000><b>Address</B></td></tr>"
set chanlist [chanlist $web_chan]
set chanlist "$botnick [lsort [lrange $chanlist 1 end]]"
set oplist ""
set vlist ""
set noplist ""
set noplist2 ""
foreach i $chanlist {if [isop $i $web_chan] {lappend oplist $i} {lappend noplist $i}}
foreach i $noplist {
if [isvoice $i $web_chan] {
lappend vlist $i
} {
lappend noplist2 $i
}
}
set noplist $noplist2
foreach i "\{$oplist\} \{$noplist\} \{$vlist\}" {
foreach b $i {
set c ""
if {[isop $b $web_chan]} {set q "<FONT COLOR=ff00ff>@</FONT>"} {set q ""}
if {[isvoice $b $web_chan]} {set q "<FONT COLOR=ff00ff>+</FONT>"}
if {[matchattr [nick2hand $b $web_chan] b]} {append c ", (BOT)"}
if {$botnick == $b} {
puts $a "<TR><TD>$q$b</TD><TD><-- It's me!</TD></TR>"
}
if {$botnick != $b} {
set hand [nick2hand $b $web_chan]
puts $a "<TR><TD>$q$b</TD><TD>Idle [getchanidle $b $web_chan] min$c</TD><TD>[getchanhost $b $web_chan]</TD></TR>"
if {[getchaninfo $hand $web_chan] != "" && ![matchattr $b b] && $hand != "*"} {
puts $a "<TR><TD></TD><TD COLSPAN=2><I>Info: [getchaninfo [nick2hand $b $web_chan] $web_chan]</I></TD></TR>"
}
}
}
}
puts $a "</TABLE>"
if {[chanbans $web_chan] != ""} {
puts $a "<TABLE BORDER=3>"
puts $a "<TR><TD><CENTER><FONT SIZE=5>Bans:</FONT></CENTER></TD></TR>"
foreach c [chanbans $web_chan] {
puts $a "<TR><TD>$c</TD></TR>"
}
puts $a "</TABLE>"
}
puts $a "</CENTER>"
puts $a <HR>
puts $a "Click <A HREF=http://www.netscape.com>here</A> if you have a text-only browser.<BR>"
puts $a "This page is updated every $web_update minute(s)."
puts $a "<CENTER>-- <A HREF=ftp://ftp.sodre.net/pub/eggdrop/scripts1.3/html2.tcl>HTML2.Tcl</A> Eggdrop 1.3 script --</CENTER>"
close $a
}
timer $web_update web_write
}
bind topc - * web_topic
proc web_topic {nick uhost handle channel vars} {
global web_topic web_chans
if {[lsearch [array names web_chans] $channel] != "-1"} {
set web_topic($channel) $vars
}
}
web_write
putlog "\002HTML2\002 by \037Prime\037 - Writing: [array names web_chans] :stats files"
Code: Select all
[14:28] couldn't open "www.nashhosting.co.uk/bot/minidirectory.txt": no such file or directory
while executing
"open $wpage w"
(procedure "web_write" line 7)
invoked from within
"web_write"
(file "scripts/html2.tcl" line 108)
invoked from within
"source scripts/html2.tcl"
(file "eggdrop.conf" line 1349)
[14:28] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)