ON $*:text:/^[!@](rand(om)?)?fact/Si:#: { if (%hlchannel == off) { inc %r set $+(%,fact.return.,%r) $iif($left($1,1) == @, msg $chan, notice $nick) sockopen $+(fact.,%r) www.randomfunfacts.com 80 } } ON *:SOCKOPEN:fact.*: { sockwrite -nt $sockname GET / HTTP/1.1 sockwrite -nt $sockname Host: $+(www.randomfunfacts.com,$crlf,$crlf) } ON *:SOCKREAD:fact.*: { if ($sockerr) { $($+(%,fact.return.,%r),2) Socket Error: $sockerr } else { var %fact sockread %fact if (** iswm %fact) { $($+(%,fact.return.,%r),2) $htmlfree(%fact) unset %fact* sockclose $sockname } } } alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) return %x } on *:TEXT:!randoff:#: { if (%hlchannel == on) notice $nick 14 The !randomfact command has already been disabled. elseif ($address($nick,2) != $address($me,2)) && ($nick !isop $chan) notice $nick 14You are not Tkavil314 or an 4@op14 in $chan $+ . Please contact either to turn this off. elseif (%hlgame == on) notice $nick Unable to process command. else { set %hlhannel on amsg 7 $+ $me $+ 's 14 The !randomfact command is now disabled. } } on *:TEXT:!randon:#: { if (%hlchannel == off) notice $nick 14 The !randomfact comamnd is already enabled. elseif (($address($nick,2) != $address($me,2)) && ($nick !isop $chan)) notice $nick 14You are not 7Tkavil314 or an 4@op14 in $chan $+ . Please contact either to turn this off. else { set %hlchannel off amsg 7 $+ $me $+ 's 14 The !randomfact command has been re-enabled. } }