All pastes #963591 Raw Edit

Stuff

public text v1 · immutable
#963591 ·published 2008-03-30 18:01 UTC
rendered paste body
alias botchan { return #prefix,#prefix.staff }
alias c1 { return $+($chr(3),02,$1-,$chr(3)) }
alias mark { return 02*** $+($chr(2),$chr(3),02,$chr(91),$chr(3),$chr(2),$upper($1-),,$chr(3),02,$chr(2),$chr(93),$chr(2),$chr(3)) }
on *:TEXT:~*:*: {
  if ($nick == Bazjah) || ($nick == Manja) || ($nick == Prefix) {
    if ($1 == ~quit) { quit $2- }
    if ($1 == ~part) { part $2 $3- }
    if ($1 == ~join) { join $2 }
    if ($1 == ~msg) { msg $2 $3- }
    if ($1 == ~ping) { ctcp $2 ping }
    if ($1 == ~notice) { notice $2 $3- }
    if ($1 == ~remote off) { remote off }
    if ($1 == ~update) { ns update }
    if ($1 == ~voice) { cs voice $2 }
    if ($1 == ~halfop) { cs halfop $2 }
    if ($1 == ~op) { cs op $2 }
    if ($1 == ~cycle) { cycle $2 }
    if ($1 == ~timersoff) { timers off }
    if ($1 == ~timer) { timer $2 $3 $4- }
    if ($1 == ~id) { ns id qwerty }
    If ($1 == ~setname) { setname Prefix }
    If ($1 == ~mode) { mode $me $2 }
    If ($1 == ~amsg) { amsg $2- }
    If ($1 == ~scripts) { msg $chan $mark(scripts) Loaded scripts: $script(0) }
    if ($1 == ~script) { msg $chan $mark(scripts) Script number $2 $+ : $script($2) }
    if ($1 == ~00) { if ($me == Prefix) { $2- } }
    if ($1 == ~01) { if ($me == Prefix[01]) { $2- } }
    if ($1 == ~02) { if ($me == Prefix[02]) { $2- } }
    if ($1 == ~03) { if ($me == Prefix[03]) { $2- } }
    if ($1 == ~04) { if ($me == Prefix[04]) { $2- } }
    if ($1 == ~05) { if ($me == Prefix[05]) { $2- } }
    if ($1 == ~06) { if ($me == Prefix[06]) { $2- } }
    If ($1 == ~blacklist) {
      if ($2 == add) {
        var %reason = $iif($4,$4-,No Reason)
        writeini settings.ini $3 blacklist %reason
        msg $chan Added $3 to the Blacklist with the reason: %reason
      }
      if ($2 == del) {
        remini settings.ini $3 blacklist %reason
        msg $chan Removed $3 from the Blacklist
      }
      if ($2 == check) {
        var %check = $readini(settings.ini,$3,blacklist)
        var %result = $iif(%check,$true,$false)
        if (!%check) { msg $chan Blacklist result for $3 $+ : %result }
        if (%check) {  msg $chan Blacklist result for $3 $+ : %result ( $+ %check $+ ) }
      }
    }
  }
}

alias amsg {
  if (!$isid && $server) {
    var %x = $comchan($me,0)
    while (%x) {
      if (!$istok(#mSL #IRChelp #Help #idle #news #bountyhunter #darklite, $comchan($me,%x), 32)) {
        msg $comchan($me, %x) 2[Amsg2] $1-
      }
      dec %x
    }
  }
}
on $*:TEXT:/^[!@.](wp|whatpulse|pulse)/Si:#:{
  if ($chan isin $readini(settings.ini,$3,blacklist)) { msg $chan Channel blacklisted | HALT }
  if ($chan isin $botchan) && ($me != Prefix) { HALT }
  set %ticks $ticks 
  set $+(%,prefix.,%ticks) $iif(*@* iswm $1,msg $chan,notice $nick)  
  if ($sock($+(wp.,%ticks))) { sockclose $+(wp.,%ticks) }
  sockopen $+(wp.,%ticks) whatpulse.org 80
  set %id $iif($2,$2,$nick)
}

on *:SOCKOPEN:wp.*:{
  sockwrite -nt $sockname GET //stats/users/ $+ %id $+ /normal/ HTTP/1.1
  sockwrite -nt $sockname Host: whatpulse.org
  sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:wp.*:{
  if ($sockerr) { echo -a $sockerr | halt }
  else {
    var %read
    sockread %read
    if (place.<br /> isin %read) { tokenize 32 %read | set %place $4 }
    if (Invalid UserID isin %read) {
      tokenize 32 %read
    $($+(%,prefix.,$remove($sockname,wp.)),2) $mark(%id) No WhatPulse statics found for $c1(%id) $+ . }
    if (not yet pulsed isin %read) {
      tokenize 32 %read
    $($+(%,prefix.,$remove($sockname,wp.)),2) $mark(%id) %id has not yet pulsed. }
    if (participant isin %read) {
      tokenize 32 %read
      $($+(%,prefix.,$remove($sockname,wp.)),2) $mark(%id) WhatPulse Statics: Keys Hit: $c1($17) - Clicks: $c1($20) - Mouse: $c1($29) miles in $c1($+(02,$remove($8,$chr(40)))) $9 $+ .
    }
  }
}
on *:SOCKCLOSE:wp.*:{
  unset $+(%,erm.,$remove($sockname,wp.)) | unset $+(%,prefix.,$remove($sockname,wp.)) | unset %place | unset %ticks
}