ircN for mIRC — File Browser

ircNformIRCv6.0 / ircNformIRCv6.0 / ircn / SYSTEM / Chat.mrc

Chat.mrc — 10.2 KB — Download this file

;%%%%%%%%%%%%%%%%%%%%%%%%
;script iChat
;version 2.01
;author icN, Chutzpah
;email chutzpah@ircn.com
;url http://www.ircN.com
;%%%%%%%%%%%%%%%%%%%%%%%%
on 1:CHATOPEN {
  if ($nick == $me) halt
  if (%cmotd == on) .play =$nick $td(cmotd.txt) 0
  writeini $sys(ircndata.ini) $rb($nick) joined $remove($time,$right(3,$time))
}
on 1:CHAT:* {
  if (($nick == %en) || ($nick == %i2.me.n)) halt
  elseif ($1 == .part) {
    if (%partyline == on) {
      writeini $sys(ircndata.ini) $rb($nick) partyline no
      msg =$nick Leaving the partyline...
      pl $nick *** $pn($nick) has left the partyline.
    }
    else msg =$nick Partyline was not active.
  }
  elseif ($1 == .partyline) {
    if ($nick == $me) {
      iecho You cannot join your own partyline.
      iecho You can talk in your partyline by typing /partychat then using the window that comes up.
      halt
    }
    msg =$nick Now entering the party line...
    msg =$nick  
    msg =$nick Commands start with '.' (like '.quit' or '.help')
    msg =$nick Everything else goes out to the party line.
    msg =$nick  
    writeini $sys(ircndata.ini) $rb($nick) partyline yes
    writeini $sys(ircndata.ini) $rb($nick) away no
    writeini $sys(ircndata.ini) $rb($nick) channel 0
    pl $nick *** $pn($nick) joined the party line.
  }
  elseif ($1 == .chat) {
    if ($2 == $null) && ($readini $sys(ircndata.ini) $rb($nick) channel != 0) {
      pl $nick x!x $pn($nick) has left the channel.
      writeini $sys(ircndata.ini) $rb($nick) channel 0
      writeini $sys(ircndata.ini) $rb($nick) partyline yes
      msg =$nick Entering the party line...
      pl $nick *** $pn($nick) joined the party line.
      halt
    }
    if ($2 == 0) {
      if ($readini $sys(ircndata.ini) $rb($nick) channel == 0) {
        msg =$nick You're already on the party line!
        halt
      }
      writeini $sys(ircndata.ini) $rb($nick) channel 0
      writeini $sys(ircndata.ini) $rb($nick) partyline yes
      msg =$nick Entering the party line...
      pl $nick *** $pn($nick) joined the party line.
      halt
    }
    if ($2 == $readini $sys(ircndata.ini) $rb($nick) channel) {
      msg =$nick You're already on channel $2 $+ !
      halt
    }
    if ($readini $sys(ircndata.ini) $rb($nick) channel == 0) pl $nick *** $pn($nick) has left the party line.
    if ($readini $sys(ircndata.ini) $rb($nick) channel != 0) pl $nick x!x $pn($nick) has left the channel.
    writeini $sys(ircndata.ini) $rb($nick) channel $2
    msg =$nick Joining channel ' $+ $2 $+ '...
    pl $nick x!x $pn($nick) joined the channel.
    writeini $sys(ircndata.ini) $rb($nick) partyline yes
  }
  elseif ($1 == .away) {
    if ($2 == $null) {
      if ($readini $sys(ircndata.ini) $rb($nick) away == no) || ($readini $sys(ircndata.ini) $rb($nick) away == $null) {
        msg =$nick You weren't away!
        halt
      }
      writeini $sys(ircndata.ini) $rb($nick) away no
      msg =$nick You're not away any more.
      halt
    }
    writeini $sys(ircndata.ini) $rb($nick) away yes
    pl $nick x!x $pn($nick) is now away: $2-
    if (($readini $sys(ircndata.ini) $rb($nick) partyline == no) || ($readini $sys(ircndata.ini) $nick echo == off)) msg =$nick *** $nick is now away: $2-
  }
  elseif ($1 == .whom) {
    set %w 0 | set %numchat $chat(0)
    msg =$nick Area   Nick, Host, Status
    msg =$nick ----   -------------------------------------------------------------
    :start
    inc %w
    set %dcnick $rb($chat(%w))
    if (%w > %numchat) {
      msg =$nick --------------------------------------------------------------------
      msg =$nick Legend: (p = partyline) (u = unconnected)
      halt
    }
    if ($readini $sys(ircndata.ini) %dcnick away == yes) set %dcaway AWAY
    else set %dcaway idle
    if ($readini $sys(ircndata.ini) %dcnick partyline == yes) {
      msg =$nick  (p)   $pn(%dcnick) $remove($address(%dcnick,1),*!*) ( $+ %dcaway $+ )
      goto start
    }
    msg =$nick (u) $pn(%dcnick) $remove($address(%dcnick,1),*!*) ( $+ %dcaway $+ )
    goto start
  }
  elseif ($1 == .whois) {
    if ($readini $sys(ircndata.ini) $rb($2) hostmask == $null) {
      msg =$nick Can't find anyone matching that.
      halt
    }
    if ($readini $sys(ircndata.ini) $rb($2) password) set %wpass yes
    else set %wpass no
    if ($readini $sys(ircndata.ini) $rb($2) signoff) set %wso $readini $sys(ircndata.ini) $rb($2) signoff
    else set %wso n/a
    :begin
    set %i 1
    set %host $readini $sys(ircndata.ini) $rb($2) hostmask
    msg =$nick HANDLE        PASS    LAST
    msg =$nick $fix(13,$2) $fix(6,%wpass) %wso
    :start
    inc %i
    if ($token(%i,33,%host) == $null) goto end
    if ($right($token(%i,33,%host),1) == $chr(42)) {
      msg =$nick         *! $+ $remove($token(%i,33,%host),$right($token(%i,33,%host),1))
      goto start
    }
    msg =$nick         *! $+ $token(%i,33,%host)
    goto start
    :end
  }
  elseif ($1 == .me) {
    if ($readini $sys(ircndata.ini) $rb($nick) partyline == yes) {
      pl $nick $chr(42) $pn($nick) $2-
      halt
    }
    msg =$nick You aren't connected to the party line! Type .partyline to join...
  }
  elseif ($1 == .nick) {
    pl $nick x!x $pn($nick) is now known as $left($2,15)
    writeini $sys(ircndata.ini) $rb($nick) pnick $left($2,15)
  }
  elseif ($1 == .echo) {
    if ($2 == on) {
      writeini $sys(ircndata.ini) $rb($nick) echo on
      msg =$nick Echo turned on.
      halt
    }
    if ($2 == off) {
      writeini $sys(ircndata.ini) $rb($nick) echo off
      msg =$nick Echo turned off.
      halt
    }
    msg =$nick Usage: .echo <on/off>
  }
  elseif ($1 == .help) {
    if ($2 == $null) {
      msg =$nick DCC COMMANDS for $me $+ , %script $+ :
      .play -tchelp =$nick $td(util.txt) 0
      halt
    }
    if ($2 isin $readini $td(util.txt) commands help) {
      .play -t $+ $2 =$nick $td(util.txt) 0
      halt
    }
    msg =$nick No help available on that.
  }
  elseif ($1 == .timestamp) {
    if ($2 == on) {
      writeini $sys(ircndata.ini) $rb($nick) timestamp on
      msg =$nick Timestamp turned on.
      halt
    }
    if ($2 == off) {
      writeini $sys(ircndata.ini) $rb($nick) timestamp off
      msg =$nick Timestamp turned off.
      halt
    }
    msg =$nick Usage: .timestamp <on/off>
  }
  elseif ($1 == .quit) {
    if ($readini $sys(ircndata.ini) $rb($nick) partyline == yes) pl $nick *** $pn($nick) has left the party line.
    writeini $sys(ircndata.ini) $rb($nick) signoff $replace($remove($adate,$right($adate,3)),/,-)
    msg =$nick *** Ja mata!
    .timer 1 5 close -c $nick
  }
  elseif ($left($1,1) == .) { msg =$nick What?  Try '.help' }
  elseif ($readini $sys(ircndata.ini) $rb($nick) partyline == yes) {
    pl $nick < $+ $pn($nick) $+ > $1-
  }
}
on 1:INPUT {
  if (($active == @PartyLine) && ($left($1,1) != /)) {
    if ($1 == .whom) {
      set %w 0 | set %numchat $chat(0)
      echo @PartyLine Area   Nick, Host, Status
      echo @PartyLine ----   -------------------------------------------------------------
      :start
      inc %w
      set %dcnick $rb($chat(%w))
      if (%w > %numchat) {
        echo @PartyLine --------------------------------------------------------------------
        echo @PartyLine Legend: (p = partyline) (u = unconnected)
        halt
      }
    }
    elseif ($1 == .whois) {
      if ($readini $sys(ircndata.ini) $rb($2) hostmask == $null) {
        echo @PartyLine Can't find anyone matching that.
        halt
      }
      if ($readini $sys(ircndata.ini) $rb($2) password) set %wpass yes
      else set %wpass no
      if ($readini $sys(ircndata.ini) $rb($2) signoff) set %wso $readini $sys(ircndata.ini) $rb($2) signoff
      else set %wso n/a
      :begin
      set %i 1
      set %host $readini $sys(ircndata.ini) $rb($2) hostmask
      echo @PartyLine HANDLE        PASS    LAST
      echo @PartyLine $fix(13,$2) $fix(6,%wpass) %wso
      :start
      inc %i
      if ($token(%i,33,%host) == $null) goto end
      if ($right($token(%i,33,%host),1) == $chr(42)) {
        echo @PartyLine         *! $+ $remove($token(%i,33,%host),$right($token(%i,33,%host),1))
        goto start
      }
      echo @PartyLine         *! $+ $token(%i,33,%host)
      goto start
      :end
    }
    elseif ($1 == .away) {
      if ($2 == $null) pt *** $me is no longer away.
      else pt *** $me is now away: $2-
    }
    elseif ($1 == .me) {
      pt $chr(42) $me $2-
    }
    else pt < $+ $me $+ > $1-
  }
}
on 1:CHATCLOSE {
  if ($nick == %en) halt
  if ($readini $sys(ircndata.ini) $rb($nick) partyline == yes) pl $nick *** $nick lost dcc link.
  writeini $sys(ircndata.ini) $rb($nick) signoff $replace($remove($adate,$right($adate,3)),/,-)
}
alias pl {
  set %i 0
  if ($window(@Partyline)) echo @PartyLine $2-
  :start
  inc %i
  set %dcnick $rb($chat(%i))
  if (%i > $chat(0)) goto end
  if (($1 == %dcnick) && ($readini $sys(ircndata.ini) %dcnick echo == off)) goto start
  if (($readini $sys(ircndata.ini) %dcnick partyline == yes) && ($readini $sys(ircndata.ini) %dcnick channel == $readini $sys(ircndata.ini) $rb($1) channel) && ($readini $sys(ircndata.ini) %dcnick timestamp == on)) { msg = $+ %dcnick $timestamp $2- | goto start }
  if (($readini $sys(ircndata.ini) %dcnick partyline == yes) && ($readini $sys(ircndata.ini) %dcnick channel == $readini $sys(ircndata.ini) $rb($1) channel)) msg = $+ %dcnick $2-
  goto start
  :end
}
alias pt {
  set %i 0
  if ($window(@Partyline)) echo @PartyLine $1-
  :start
  inc %i
  set %dcnick $rb($chat(%i))
  if (%i > $chat(0)) halt
  if (($readini $sys(ircndata.ini) %dcnick partyline == yes) && ($readini $sys(ircndata.ini) %dcnick timestamp == on)) {
    msg = $+ %dcnick $timestamp $1-
    goto start
  }
  if ($readini $sys(ircndata.ini) %dcnick partyline == yes) msg = $+ %dcnick $1-
  goto start
}
alias pn {
  if ($readini -n $sys(ircndata.ini) $rb($1) pnick) return $readini -n $sys(ircndata.ini) $rb($1) pnick
  else return $1
}
alias partychat {
  window -aed @PartyLine %pcloc @PartyLine Courier New 411
  pt *** $me joined the party line.
}
menu @PartyLine {
  exit { set %pcloc $swlc(@PartyLine) | window -c @PartyLine | pt *** $me left the partyline. }
  off { partyline off }
}