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.

Web ignore/ban list

Old posts that have not been replied to for several years.
Locked
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Web ignore/ban list

Post by Aron »

I downloaded a script called webbanlist.tcl or something and its working ok, but now i want to convert this to an online ignore list.
I already searched for something like this, but i couldnt find it.
My guess is, that it could be easily converted by changing certain vars (banlist, etc) to others, but i tried, and its not working.

Here is the code of the webbanlist.tcl:

Code: Select all

##################################
### WebBanList.tcl             ###
### Version 1.1                ###
### By Wcc                     ###
### wcc@techmonkeys.org        ###
### http://www.dawgtcl.com:81/ ###
### EFnet #|DAWG|Tcl           ###
##################################

############################################################################
### Copyright © 2000 - 2002 |DAWG| Scripting Group. All rights reserved. ###
############################################################################

##############################################################################
## This script generates a web page listing all global and channel bans in  ##
## the bot's banlist.                                                       ##
##############################################################################

##########################################################
## Just load the script, edit the settings, and rehash. ##
##########################################################

######################################################################
# Set here the path to the DAWG template file you would like to use. #
# You can obtain templates by visiting http://dawg.oc255.net:81/ and #
# clicking the templates link.                                       #
######################################################################

set webbanlist_setting(tpl) "/home/asoaron/jabot/scripts/wban/WebBanList_OGGBO.tpl"

##########################################
# Set the filename of the web page here. #
##########################################

set webbanlist_setting(page) "/home/asoaron/html/bot/banlist.html"

####################
# Code begins here #
####################

if {![string match 1.6.* $version]} { putlog "\002WEBBANLIST:\002 \002WARNING:\002 This script is intended to run on eggdrop 1.6.x or later." }
if {[info tclversion] < 8.2} { putlog "\002WEBBANLIST:\002 \002WARNING:\002 This script is intended to run on Tcl Version 8.2 or later." }

bind time - "*0 * * * *" webbanlist_createhtml
bind time - "*5 * * * *" webbanlist_createhtml

set webbanlist_setting(version) "1.1"
set webbanlist_notpl 0

if {![info exists webbanlist_setting(tpl)] || [catch {source $webbanlist_setting(tpl)}]} {
	putlog "\002WEBBANLIST:\002 The template file could not be opened; using default."
	set webbanlist_notpl 1
}
foreach {s v} [list Page_CC #000000 Page_HC #000000 Page_LinkC #0000FF Page_TTextC #000000 Page_TextC #000000 Page_BGC \
	#FFFFFF Page_TCC_2 #E0E0E0 Page_TCC_1 #C0C0C0 Page_THC_2 #8080E0 Page_THC_1 #8080C0 Page_TCS 4 Page_THS 5 Page_TitleS 6 \
	Page_Title {Ban List} Page_TitleTag {Ban List} Page_Img {}] {
	if {$webbanlist_notpl || ![info exists webbanlist_setting($s)]} { set webbanlist_setting($s) $v  }
}
proc webbanlist_format_td {type line center text} {
	switch -- $type {
		"title" { return "<font face=tahoma size=\"$::webbanlist_setting(Page_THS)\" color=\"$::webbanlist_setting(Page_TextC)\">[expr ($center)?{<center>}:{}]$text[expr ($center)?{</center>}:{}]</font>" }
		"header" { return "<td align=\"left\" bgcolor=\"$::webbanlist_setting(Page_THC_${line})\"><font size=\"$::webbanlist_setting(Page_THS)\" color=\"$::webbanlist_setting(Page_HC)\">[expr ($center)?{<center>}:{}]$text[expr ($center)?{</center>}:{}]</font></td>" }
		"cell" { return "<td align=\"left\" bgcolor=\"$::webbanlist_setting(Page_TCC_${line})\"><font size=\"$::webbanlist_setting(Page_TCS)\" color=\"$::webbanlist_setting(Page_CC)\">[expr ($center)?{<center>}:{}]$text[expr ($center)?{</center>}:{}]</font></td>" }
	}
}
proc webbanlist_timedate {unixtime} {
	if {$unixtime == 0} { return "Never" }
	return [clock format $unixtime -format {%I:%M %p %D}]
}
proc webbanlist_createhtml {args} {
	set dt [clock format [clock seconds] -format {%I:%M %p %D}]
	set page [open $::webbanlist_setting(page) w]
	puts $page "<html>\n  <head>\n    <title>$::webbanlist_setting(Page_TitleTag)</title>\n    <META NAME=\"description\" CONTENT=\"Ban List\">\n    <META NAME=\"keywords\" CONTENT=\"bans, irc, eggdrop, tcl, link\">\n  </head>\n\n  <body bgcolor=\"$::webbanlist_setting(Page_BGC)\" link=\"$::webbanlist_setting(Page_LinkC)\" alink=\"$::webbanlist_setting(Page_LinkC)\" vlink=\"$::webbanlist_setting(Page_LinkC)\">"
	if {[string compare $::webbanlist_setting(Page_Img) ""] != 0} { puts $page "    <center><img src=\"$::webbanlist_setting(Page_Img)\"></img></center>" }
	puts $page "    <center><font face=tahoma size=\"$::webbanlist_setting(Page_TitleS)\" color=\"$::webbanlist_setting(Page_TTextC)\">$::webbanlist_setting(Page_Title)</font></center>\n    <br>"
	puts $page "    <br>\n    <br>\n    [webbanlist_format_td title 0 1 {Global Bans}]\n    <br>\n    <table align=\"center\">\n      <tr>"
	foreach {a b} [list 1 Number 2 Ban 1 Comment 2 Expires 1 Added 2 {Last Used} 1 Creator] { puts $page "        [webbanlist_format_td header $a 1 $b]" }
	puts $page "      </tr>"
	if {[string compare [banlist] ""] == 0} {
		puts $page "      <tr>"
		foreach {a b} [list 1 - 2 - 1 - 2 - 1 - 2 - 1 -] { puts $page "        [webbanlist_format_td cell $a 1 $b]" }
		puts $page "      </tr>"
	} {
		set bnum 0
		foreach b [banlist] {
			incr bnum
			puts $page "      <tr>"
			foreach {a b} [list 1 $bnum 2 [lindex $b 0] 1 [lindex $b 1] 2 [webbanlist_timedate [lindex $b 2]] 1 [webbanlist_timedate [lindex $b 3]] 2 [webbanlist_timedate [lindex $b 4]] 1 [lindex $b 5]] { puts $page "        [webbanlist_format_td cell $a 1 $b]" }
			puts $page "      </tr>"
		}
	}
	puts $page "    </table>\n    <br>\n    <br>"
	foreach chan [channels] {
		if {[string compare [banlist $chan] ""] == 0} { continue } 
		set servernum 0
		puts $page "    [webbanlist_format_td title 0 1 "$chan Bans"]\n    <br>\n    <table align=\"center\">\n      <tr>"
		foreach {a b} [list 1 Number 2 Ban 1 Comment 2 Expires 1 Added 2 {Last Used} 1 Creator] { puts $page "        [webbanlist_format_td header $a 1 $b]" }
		puts $page "      </tr>"
		set bnum 0
		foreach b [banlist $chan] {
			incr bnum
			puts $page "      <tr>"
			foreach {a b} [list 1 $bnum 2 [lindex $b 0] 1 [lindex $b 1] 2 [webbanlist_timedate [lindex $b 2]] 1 [webbanlist_timedate [lindex $b 3]] 2 [webbanlist_timedate [lindex $b 4]] 1 [lindex $b 5]] { puts $page "        [webbanlist_format_td cell $a 1 $b]" }
			puts $page "      </tr>"
		}
		puts $page "    </table>\n    <br>\n    <br>"
	}
	puts $page "    <center><font face=tahoma color=\"$::webbanlist_setting(Page_TextC)\">Last Updated: $dt</font></center>\n    <center><font color=\"$::webbanlist_setting(Page_TextC)\">Generated By: $::botnick</font></center>\n  </body>\n</html>\n<!--<DAWGID>WebBanList $::webbanlist_setting(version)</DAWGID>-->"
	close $page
}

putlog "\002WEBBANLIST:\002 WebBanList Version $webbanlist_setting(version) by Wcc is loaded."
Any help would be greatly appreciated.

Thanks in advance
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Post by Aron »

* bump *
The best way to start learning is to start helping.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Can you post a copy of what you have tried, and we can help point out your mistakes.

It would be wise to upload it to some space, and post a link, and masses of test waste server resources.
Locked