#GATEWAY 2.0 #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 "/u1/tonioli/public_html/data.html" # Filename to send user information HTML code to set ufilename "/u1/tonioli/public_html/userdata.html" # 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 "#IRC-Rio 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 "#IRC-Rio 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 #IRC-Rio IRC Viewer is not currently running.

" puts $fd "Please try later.
" close $fd putdcc $idx "#IRC-Rio 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 "#IRC-Rio 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 filename linecount set text [lindex $args 0] set fd [open $filename a] puts $fd "\<$nick> $text
" incr linecount boogerfind close $fd } # Check for change of nickname proc change {nick host handle chan newnick} { 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 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 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 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 QUIT proc hung_up {nick host handle chan reason} { global filename linecount set fd [open $filename a] puts $fd "*** $nick has QUIT IRC ($reason)
" close $fd incr linecount get_userlist boogerfind } proc topic {nick host handle chan topc} { 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 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 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 "#IRC-Rio 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 >20 } { cleanhouse } } proc get_userlist {args} { global ufilename set fd [open $ufilename w] puts $fd "" puts $fd "" puts $fd "" puts $fd "" puts $fd "" set chan "#IRC-Rio" set chanusers [chanlist $chan] foreach user $chanusers { if {[isop $user $chan]} {set q "@"} {set q ""} if {[isvoice $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"