# GATEWAY 3.0 # made this work for multi-channel bots, now only shows data from the chosen channel # added support for modes, actions and fixed the nicklist to display properly # Thanks to djsmoke for the help with the actions. =] it prolly woulda never worked without him # to the best of my knowledge this is the only tcl of its kind to display actions now # thanks to all those who had a hand in this before me, it was a great tcl to begin with, just needed tweaking =] # any questions or comments email me at wwarlock@hitmen.net or goto undernet #wildfire #inspired by Gateway-TCL v1.31 (c) Zor (klemm@nbnet.nb.ca) #but programmed with new colors, and; #now show when the topic is changed and; #single changes on original script #topic routine was got of wwwlive script #all credits to me, Zor and roots(ia174@gm.fh-koeln.de) #tks for Zor and roots # How does it work? Pretty simple actually. All public # chat, joins, parts, kicks, quits and topic are sent to an HTML document # User List Has been re-implemented, you can load this page in frames # that can be read from a web browser such as Netscape. # quits have been implemented in this version # but autostart flag was removed. # i'm not like the autostart work, and remove # i'm looking for a new autostart # i'm search too, how implemet actions # If you have any suggestions on how to get them to work, let me know. #Felipe Tonioli (tonioli@mtec.com.br) # .GATEWAY is the command in the DCC Chat Window # This option is available to anyonw with a +m flag bind dcc m gateway sendgate #Get User List From Channel bind join * * get_userlist # Filename to send all channel HTML tags/code to set filename "/home/immortal/public_html/wwwlive.html" # Filename to send user information HTML code to set ufilename "/home/immortal/public_html/nick.html" # Channel to view set www_channel "#wildfire" # Variable to show gateway's current mode set gatemode "INACTIVE" # Set the amount of linecount (to count the amount of lines in # the scrollback buffer) set linecount 0 # Procedure to set up or destroy current gateway proc sendgate {hand idx mode} { global filename gatemode linecount # Insert header HTML code into $filename # This header information MUST be included in the # HTML document if you want it to automatically reload # itself. The "content" value can be set to whatever # amount of seconds you want it to reload if {$mode == "on" && $gatemode == "INACTIVE"} { set fd [open $filename w] puts $fd "" puts $fd "" puts $fd "#wildfire Live " puts $fd "" # Anything after the tag is merely for personal appearance. # Any extra tags for colors, graphics, etc can all be added at this # point. puts $fd "" puts $fd "" close $fd putdcc $idx "#wildfire IRC/WWW Gateway active on $filename " loadbind get_userlist set gatemode "ACTIVE" } # Create a manual Reset command if {$mode == "reset"} { cleanhouse } # Disable IRC/WWW Gateway if {$mode == "off"} { unloadbind set fd [open $filename w] # This code can be changed to fit whatever you want # your gatway to indicate when it has been disabled. # This will ONLY occur if you MANUALLY disable it with # the .gateway off. puts $fd "Out Of Service" puts $fd "

Gateway Not Available


" puts $fd "

The #wildfire IRC Viewer is not currently running.

" puts $fd "Please try later.
" close $fd putdcc $idx "#wildfire IRC/WWW Gateway Disabled" set gatemode "INACTIVE" set linecount 0 get_userlistout close $fd } # Show current status of IRC/WWW gateway if {$mode == "status"} { putdcc $idx "#wildfire IRC/WWW Gateway is currently $gatemode" if {$gatemode == "ACTIVE"} { putdcc $idx " Location: $filename" putdcc $idx " Line Count: $linecount" } } # .GATEWAY Command Help if {$mode == ""} { putdcc $idx "Usage: .gateway " } } # Manual Logger, sends all public messages to $filename # The logfile command could not be used because of # the conflict between HTML standards and IRC. proc output {nick uhost hand chan args} { global www_channel if { $chan == $www_channel} { global filename linecount set text [lindex $args 0] set fd [open $filename a] puts $fd "\<$nick> $text
" incr linecount boogerfind close $fd } } # Check for ACTION proc pubact {nick uhost hand chan keyword args} { global www_channel if { $chan == $www_channel} { global filename linecount set text "[string trim [string trim [lrange $args 0 end] \}] \{]" set fd [open $filename a] puts $fd "* $nick $text
" incr linecount boogerfind close $fd } } # Check for change of NICK proc change {nick host handle chan newnick} { global www_channel if { $chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "*** $nick is now known as $newnick
" close $fd incr linecount get_userlist boogerfind } } # Check for a JOIN proc enter {nick host handle chan} { global www_channel if { $chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "*** $nick ($host) has joined $chan
" close $fd incr linecount get_userlist boogerfind } } # Check for a PART proc leave {nick host handle chan} { global www_channel if { $chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "*** $nick ($host) has left $chan
" close $fd incr linecount get_userlist boogerfind } } # Check for a KICK proc shove {nick host handle chan kickeduser reason} { global www_channel if { $chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "$kickeduser was kicked by $nick ($reason)
" close $fd incr linecount get_userlist boogerfind } } # Check for a MODE change proc oplevel {nick host handle chan mc} { global www_channel if {$chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "*** Mode change $mc on $chan by $nick
" close $fd incr linecount get_userlist boogerfind } } # Check for a QUIT proc hung_up {nick host handle chan reason} { global www_channel if { $chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "*** $nick has QUIT IRC ($reason)
" close $fd incr linecount get_userlist boogerfind } } # Check for TOPIC proc topic {nick host handle chan topc} { global www_channel if { $chan == $www_channel} { global filename linecount set fd [open $filename a] puts $fd "*** $nick changes topic to: $topc
" close $fd incr linecount } } # Load all bindings proc loadbind {args} { bind pubm * * output bind ctcp * "ACTION" pubact bind mode * * oplevel bind part * * leave bind join * * enter bind kick * * shove bind nick * * change bind sign * * hung_up bind topc * * topic } # Unload all bindings proc unloadbind {args} { unbind pubm * * output unbind ctcp * "ACTION" pubact unbind mode * * oplevel unbind part * * leave unbind join * * enter unbind kick * * shove unbind nick * * change unbind sign * * hung_up unbind topc * * topic } # Used to erase the $filename on a regular basis. # This is so the HTML file does not become excessively long # and annoying. proc cleanhouse {args} { global filename linecount putlog "Cleaning House..." set fd [open $filename w] puts $fd "" puts $fd "" puts $fd "#wildfire Live " puts $fd "" puts $fd "" puts $fd "" close $fd set linecount 0 } # Find out if the line count of HTML tags has exceeded # the preferred amount (one screenful) proc boogerfind {} { global linecount if {$linecount > 30 } { cleanhouse } } proc get_userlist {args} { global ufilename set fd [open $ufilename w] puts $fd "" puts $fd "" puts $fd "" puts $fd "" puts $fd "" set chan "#wildfire" set chanusers [chanlist $chan] foreach user $chanusers { set q "" if {[isvoice $user $chan]} {set q "+"} if {[isop $user $chan]} {set q "@"} puts $fd "$q$user
" } close $fd } proc get_userlistout {args} { global ufilename set fd [open $ufilename w] puts $fd "" puts $fd "" puts $fd "" puts $fd "

Out
" puts $fd "Of
" puts $fd "Service

" close $fd } putlog "`o_o` IRC/WWW Gateway 2 LOADED"