# sitedb.v1.0.tcl 2004/04/14 @ GnuMatiC # # # CONTACT: # This is my first public release of a tcl that I have created. So please # feel free and contact me with suggestions and comments about this script # GnuMatiC on #efnet # # # DISCLAIMER: # - I TAKE NO RESPONSIBILTY IN WHAT THIS SCRIPT MAY OR MAY NOT DO TO YOUR # - SYSTEM, OR HOW YOU CHOOSE TO USE THIS SCRIPT. USE IT AT YOUR OWN RISK! # # # CHANGELOG: # v1.0 - initial release # # # DESCRIPTION: # This is a site database script to be ran with an eggdrop. It allows users of a channel # to add and remove sites from the database. It also allows users to update various # information to help keep track of sites. Almost every option allows the scripter to # fully customize which features they want to use. # This script ALSO can be used in multiple channels, allowing only one database to be used # but keeping that information private from the other channels, so each channel that the eggdrop # is running in with this script, can each have their own private lists of sites. # # # REQUIREMENTS: # -mysql # -mysqltcl # -eggdrop # # # NOTES: # If theres any problems with this script, first make sure you have tcl and mysql working together first. # Secondly, make sure none of the global variables or proc names conflict with any other running scripts. # # # INSTRUCTIONS: # -Define the below variables # -Run the included .sql file. mysql -u username -p password < sitedb.v1.0.sql # -Enable this script in eggdrop.conf ie: source scripts/sitedb.v1.0.tcl # -Rehash/Restart your eggdrop # -Enable one of the 3 options below, or define it to match your system. # # load /usr/local/lib/mysqltcl-2.12/libmysqltcl2.12.so # package require mysqltcl load /usr/lib/libmysqltcl2.50.so # # VARIABLES: # set cmdpre "!site" ;# Trigger you wish to use in channel set vers "Sitedb.v1.0" ;# Version number to help in debug mode set outprefix "\037Sitedb:\037" ;# Output prefix in channel to help layout set db(HOST) "localhost" ;# Hostname for mysql set db(USER) "user" ;# Username for mysql set db(PASS) "password" ;# Password for mysql set db(NAME) "sitesdb" ;# Database name for mysql set db(TABLE) "sites" ;# Table name for mysql ## set to 0 to Enable and 1 to Disable set disable(SNAME) 0 ;# Shortname - ie MSN set disable(LNAME) 0 ;# Longname - ie My Site Name set disable(LOCATION) 0 ;# Location - Canada set disable(SPEED) 0 ;# Speed - DSL set disable(SIZE) 0 ;# Size - 250gb set disable(STATUS) 0 ;# Status - Up/Down set disable(BNC) 0 ;# Bnc's - 1.1.1.1:1111 2.2.2.2:2222 set disable(RATING) 0 ;# Rating - 3.0 set disable(GADMIN) 0 ;# Gadmin - billgates set disable(SLOTS) 0 ;# Slots - 10/4 set disable(AVAILRATIO) 0 ;# Available Ratio Slots - 2 set disable(AVAILLEECH) 0 ;# Available Leech Slots - 0 set disable(SECTIONS) 0 ;# Sections - XXX MOREXXX EVENMOREXXX set disable(AFFILS) 0 ;# Affils - GROUP1 GROUP2 GROUP3 set disable(NOTES) 0 ;# Extra information - Site is closed on weekdays til 5pm! set disable(LASTUPDATE) 0 ;# Shows who and when site was lastupdated set disable(ADD) 0 ;# Allow new additions of sites? set disable(DEL) 0 ;# Allow deletion of sites? set disable(SELECT) 0 ;# Allow display of site information? set disable(SELECTALL) 0 ;# Allow display of all added sites? set disable(UPDATE) 0 ;# Allow ability to change site information? set disable(SEARCH) 0 ;# Allow ability to search the information? set disable(OPTIONS) 0 ;# Allow people to know which options you have enabled? set disable(VERS) 0 ;# Publically announce version? set disable(HELP) 0 ;# Allow the help menu system? set disable(DEBUG) 0 ;# Allow debug info to be logged? ############################################################################################## # Do not Edit BELOW! ############################################################################################## ## Get an array of enabled options set option "" if { $disable(SNAME) == 0 } { append option "sname " } if { $disable(LNAME) == 0 } { append option "lname " } if { $disable(LOCATION) == 0 } { append option "loc " } if { $disable(SPEED) == 0 } { append option "speed " } if { $disable(SIZE) == 0 } { append option "size " } if { $disable(STATUS) == 0 } { append option "status " } if { $disable(BNC) == 0 } { append option "bnc " } if { $disable(RATING) == 0 } { append option "rating " } if { $disable(GADMIN) == 0 } { append option "gadmin " } if { $disable(SLOTS) == 0 } { append option "slots " } if { $disable(AVAILRATIO) == 0 } { append option "availratio " } if { $disable(AVAILLEECH) == 0 } { append option "availleech " } if { $disable(SECTIONS) == 0 } { append option "sections " } if { $disable(AFFILS) == 0 } { append option "affils " } if { $disable(NOTES) == 0 } { append option "notes" } set option [string trimleft $option] set option [string trimright $option] ## Get an array of enabled abilities set ability "" if { $disable(ADD) == 0 } { append ability "add " } if { $disable(DEL) == 0 } { append ability "del " } set ability [string trimleft $ability] set ability [string trimright $ability] ############################################################################################## ## Begin Main Proc bind pub -|- [set cmdpre] sitedb proc sitedb { nick host handle channel arg } { global db cmdpre vers outprefix disable option ability ## Arguments equal to 0 if { [llength $arg] == 0 } { putserv "PRIVMSG $channel :Usage: [set cmdpre]