All pastes #629830 Raw Edit

NotForYou2

public text v1 · immutable
·published 2007-07-22 18:28 UTC
rendered paste body
alias status {
  var %a = 0
  while (%a < $chan(0)) {
    inc %a
    if ($me isop $chan(%a)) {
      inc %b
      inc %power $nick($chan(%a),0)
      inc %chan $nick($chan(%a),0)
    }
    if ($me ishop $chan(%a)) {
      inc %c
      inc %power $nick($chan(%a),0)
      inc %chan $nick($chan(%a),0)
    }
    if ($me isvoice $chan(%a)) {
      inc %d
      inc %chan $nick($chan(%a),0)
    }
    if ($me isreg $chan(%a)) {
      inc %e
      inc %chan $nick($chan(%a),0)
    }
  }
  msg $iif($chan,$chan,$active) 14I am in a total of [4 $+ $chan(0) $+ ]14 channels. I'm 4op14 in [4 $+ $iif(%b,%b,0) $+ ]14 channels, 7halfop14 in [4 $+ $iif(%c,%c,0) $+ ]14 channels, 2voice14 in [4 $+ $iif(%d,%d,0) $+ ]14 channels, and 10regular14 in [4 $+ $iif(%e,%e,0) $+ ]14 channels. I have power over [4 $+ %power $+ / $+ %chan $+ ] (4 $+ $int($calc(%power * 100 / %chan)) $+ % $+ )14 users.
  unset %b
  unset %c
  unset %d
  unset %e
  unset %power
  unset %chan
}

on *:INPUT:*: {
  if ($1 == .inv) {
    invite $2 $chan
  }
  if ($1 == .v) {
    mode $chan +v $2
  }
  if ($1 == .k) {
    kick $chan $2-
  }
  if ($1 == .op) {
    mode $chan +o $2
  }
  if ($1 == .kb) {
    mode $chan +b $address($2,2)
    kick $chan $2 $read(kick.txt)
  }
  if ($1 == .unban) {
    mode $chan -b $2
    mode $chan -b $address($2,2)
    /ban -r $chan $2
  }
  if ($1 == .ban) {
    mode $chan +b $address($2,2)
  }
  if ($1 == .deop) {
    mode $chan -o $2
  }
  if ($1 == .topic) {
    msg $chan The topic is: $chan($chan).topic
  }
}

alias stats { 
  var %x $chan(0),%o 0,%h 0,%v 0,%p 0,%t 0 
  while (%x) { 
    if (($me isop $chan(%x)) || ($me ishop $chan(%x))) { 
      inc $+(%,$iif($me isop $chan(%x),o,h)) 1 
      inc %p $nick($chan(%x),0) 
    } 
    elseif ($me isvoice $chan(%x)) { inc %v 1 } 
    inc %t $nick($chan(%x),0) 
    dec %x 1 
  } 
  msg $active 14I am currently on  $chan(0) channels. Of those, I am 7opped 14on^  $+(%o,$chr(44)) $+  7halfopped 14on^  $+(%h,$chr(44)) $+  and 7voiced 14 on^  $+ $+(%v,.) $+ 7I have power over^  $+(%p,/,%t) Guys.
}

ON *:TEXT:!tb*:#rsisland:{ 
  if ($me isvoice $chan || $me isreg $chan) { notice $nick ERROR: Sorry I need halfop+ To do that. | halt } 
  if ($2 == $null) { Notice $nick ERROR: !tb <nick> <time> <reason> | halt } 
  if ($3 == $null) { Notice $nick ERROR: !tb $2 <time> <reason> | halt  } 
  if ($nick ishop $chan && $2 ishop $chan) {  notice $nick ERROR: $2 is a half-op in $chan $+ , so I wont kick him. | halt  } 
  if ($nick ishop $chan && $2 isop $chan) {  notice $nick ERROR: $2 is a op in $chan $+ , so I wont kick him. | halt  } 
  if ($nick isreg $chan || $nick isvoice $chan) { notice $nick ERROR: You must be Halfop+ for this script to work.  | halt } 
  if ($nick ishop $chan || $nick isop $chan) { 
    inc %kicked 
    /ban -ku $+ $calc( $3 * 60 ) $chan $2 ¤ $3 Min Ban ¤ Reason: $4- ¤ Noobs Pwnt: %kicked ¤ 
  } 
} 

ON *:TEXT:!av on*:#:{ if ($nick ishop $chan || $nick isop $chan) { 
    set %av $+ $chan ON 
    msg $chan 14Auto Voice is now on!14 
  } 
} 
ON *:JOIN:#:{ if (%av [ $+ [ $chan ] ] == ON) { /mode $chan +v $nick } 
} 
ON *:TEXT:!av off*:#:{ if ($nick ishop $chan || $nick isop $chan) { 
    unset %av $+ $chan 
    msg $chan 14Auto Voice is now off =(14 
  } 
} 

on *:text:mute:#:{
  if ($nick isop $chan || $nick ishop $chan) { 
    if ($me isop $chan || $me ishop $chan) { /mode $chan +m } 
} } 

ON *:TEXT:!noobcheck*:#:{ msg $chan Scanning $chan for noobs... 
  /timer5 1 3 { msg $chan Noob Found: $nick($chan,$r(1,$nick($chan,0))) } 
} 



on *:TEXT:!unmute:#:{ 
  if ($nick isop $chan || $nick ishop $chan) { 
    if ($me isop $chan || $me ishop $chan) { /mode $chan -m } 
} } 

on *:text:!av *:#:{ 
  if ($nick = Arri`) || ($nick isop #) || ($nick ishop #) { 
    mode $chan +v $2
    writeini autovoice.ini $chan $2 $2
    msg $chan $2 Added to the autovoice list! 
  } 
} 

on *:TEXT:!poll*:#pokéisl:{ 
  if ($2 isnum) { 
    msg $chan $nick has started a poll: $3- for $2 minutes. 
    msg $chan Type !vote yes, or !vote no to count your vote. 
    set %yes 0 | set %no 0 
    /timerVOTE 1 $calc($2 * 60) signal -n results $chan 
  } 
  else { 
    msg $chan $nick has started a poll: $3- for 2 minutes. 
    msg $chan Type !vote yes, or !vote no to count your vote. 
    set %yes 0 | set %no 0 
    /timerVOTE 1 120 signal -n results $chan 
  } 
} 
on *:text:!yes:#pokéisl:{ 
  .notice $nick Thank you for your vote, Yes has been counted! 
  inc %yes 1 
} 
on *:text:!no:#pokéisl:{ 
  .notice $nick Thank you for your vote, Yes has been counted! 
  inc %no 1 
} 

on *:TEXT:!endpoll:#pokéisl:{ 
  if (($timer(VOTE)) && ($nick isop $chan)) { 
    msg $chan The poll has been ended by $nick $+ .  The answer is $iif($(%yes,2) > $(%no,2),yes,$iif($(%yes,2) == $(%no,2),tie/no votes,no)) $+ 
    msg $chan Results: Yes: %yes $ceil($calc((%yes) /(%yes + %no) * 100)) $+ % 
    msg $chan No: %no $ceil($calc((%no) /(%yes + %no) * 100)) $+ % 
    timerVOTE off 
  } 
} 
on *:SIGNAL:results: { 
  /msg $1 The poll has ended. The answer is $iif($(%yes,2) > $(%no,2),yes,$iif($(%yes,2) == $(%no,2),tie/no votes,no)) $+ 
  Results: Yes: %yes $ceil($calc((%yes) /(%yes + %no) * 100)) $+ % 
  No: %no $ceil($calc((%no) /(%yes + %no) * 100)) $+ % 
  unset %yes | unset %no