Jump to content
chain

Stats Socket

Recommended Posts

  • Administrators
alias opens {
  set %nick chain
  set %chan #coders-irc-lounge
  set %root D:/Abs/www
  sockopen LOG1 cs1.coders-irc.net  10001
}
on *:SOCKOPEN:LOG*:{
  sockwrite -n $sockname NICK %nick
  sockwrite -n $sockname USER project . . Socket
  sockwrite -n $sockname USERHOST $sockname
  .timer 1 3 /sockwrite -n $sockname JOIN %chan
}
on *:SOCKCLOSE:LOG*:{ .timer 1 5 /opens }
on *:SOCKREAD:LOG*:{
  sockread %temp
  tokenize 32 $gettok(%temp,1-,32)

  var %file = %root $+ $gettok($3,1,58) $+ .txt
  var %file2 = %root $+ $gettok($3,1,58) $+ .txt

  if ($1 == PING) { sockwrite -n $sockname PONG $2 | return }
  if ($gettok($4,1,58) == VERSION) { sockwrite -n $sockname NOTICE $gettok($gettok($1,1,58),1,33) : $+ $chr(1) $+ VERSION mIRC Socket by codelibary.com $+ $chr(1) | return }
  if ($2 == PRIVMSG) {
    if ($left($3,1) == $chr(35)) {
      if ($gettok($gettok($gettok($1-,4,32),1,58),1,1) == ACTION) { write %file $timestamp * $gettok($gettok($1,1-,58),1,33) $gettok($5-,1,1) }
      else { write %file $timestamp < $+ $gettok($gettok($1,1,58),1,33) $+ > $gettok($4-,1-,58) }
    }
    else {
      if ($gettok($gettok($gettok($1-,4,32),1,58),1,1) == ACTION) { write %file2 $timestamp * $gettok($gettok($1,1-,58),1,33) $gettok($5-,1,1) }
      else { write %file2 $timestamp < $+ $gettok($gettok($1,1,58),1,33) $+ > $gettok($4-,1-,58) }
    }
  }
  if ($2 == 332) { write %file $timestamp * Topic is ' $+ $gettok($4-,2,58) $+ ' }
  if ($2 == 333) { write %file $timestamp * Set by $5 on $date(1113566259) @ $time(1113566259) }
  if ($2 == JOIN) {
    if ($gettok($gettok($1,1,58),1,33) == %nick) { write %file $timestamp * Now talking in $gettok($3,1,58) }
    else { write %file $timestamp * $gettok($gettok($1,1,58),1,33) ( $+ $gettok($gettok($1,1,58),2,33) $+ ) has joined $gettok($3,1,58) }
  }
  if ($2 == PART) { write %file $timestamp * $gettok($gettok($1,1,58),1,33) ( $+ $gettok($gettok($1,1,58),2,33) $+ ) has left $gettok($3,1,58) }
  if ($2 == NOTICE && $left($3,1) == $chr(35)) { write %file $timestamp - $+ $gettok($gettok($1,1,58),1,33) $+ : $+ $gettok($3,1,58) $gettok($4-,1,58) }
  if ($2 == NOTICE && $left($3,1) != $chr(35)) { write %file $timestamp - $+ $gettok($gettok($1,1,58),1,33) $+ - $gettok($4-,1,58) }
  if ($2 == TOPIC) { write %file $timestamp * $gettok($gettok($1,1,58),1,33) changes topic to ' $+ $gettok($4,1,58) $+ ' }
  if ($2 == KICK) {
    if ($4 == %nick) {
      write %file $timestamp * You were kicked by $gettok($gettok($1,1,58),1,33) ( $+ $gettok($5-,1,58) $+ )
      write %file $timestamp * Attempting to rejoin channel $3
      sockwrite -n $sockname join $3
    }
    else { write %file $timestamp * $4 was kicked by $gettok($gettok($1,1,58),1,33) ( $+ $gettok($5-,1,58) $+ ) }
  }
  if ($2 == MODE) { write %file $timestamp * $gettok($gettok($1,1,58),1,33) sets mode $4 $5 }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...