All pastes #975277 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-04-07 13:17 UTC
rendered paste body
on *:Invite:#: { 
  /join $chan 
  /timer 1 1 /msg $chan 14[7FB14] Invited by:7 $nick .14 Thanks for using 7ForceBot ! 14Bot-admin: 7Deforcer 14- 7#ForceBot.
} 
ON *:TEXT:*!part ForceBot*:#: { 
  msg $chan $+ , 14Thanks for using 7 $me .14 /invite 7ForceBot14 $chan if you want 7 $me 14 back.  
  part $chan 
}



on $*:TEXT:/^[@!.](con)?grat[zs](ulation[zs])?/Si:#: { if ($2 isnum 2-99) { msg $chan 7 @@@@@ 14Woo0oo0t! Congratulations 7 $nick 14with:7 $$2-! 7 @@@@@  } 
  else { notice $nick Error Bad Syntax, Example: !grats 99 def } 
}



on *:TEXT:!chanstats:#: { 
  if (% [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $nick ] ] == $null) { set %lines. $+ $chan $+ . $+ $server $+ . $+ $nick 0 } 
  if (% [ $+ joins. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %joins. $+ $chan $+ . $+ $server 0 }
  if (% [ $+ lastline. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %lastline. $+ $chan $+ . $+ $server Nobody } 
  if (% [ $+ statsdate. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %statsdate. $+ $chan $+ . $+ $server $date }
  if (% [ $+ linestot. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %linestot. $+ $chan $+ . $+ $server 0 }
  if (%waitstats == $null) { 
    notice $nick Statistics for channel $+(,$chan,:,) 
    notice $nick Recorded since: % [ $+ statsdate. $+ [ $chan ] $+ . $+ [ $server ] ]
    notice $nick Total number of lines spoken: % [ $+ linestot. $+ [ $chan ] $+ . $+ [ $server ] ]
    notice $nick There are currently $nick($chan,0) user(s) in this channel.
    notice $nick $+(,% [ $+ lastline. $+ [ $chan ] $+ . $+ [ $server ] ],) was the last person to speak.
    notice $nick You have currently spoken % [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $nick ] ] line(s) $nick
    notice $nick $+(,% [ $+ joins. $+ [ $chan ] $+ . $+ [ $server ] ],) people have joined the channel.
    notice $nick Random Line: $read(randomline. $+ $server $+ . $+ $chan $+ .txt)
    set -u5 %waitstats 1
  } 
}

on *:TEXT:!reset chanstats:#: {  
  set %statsdate. $+ $chan $+ . $+ $server $date 
  set %linestot. $+ $chan $+ . $+ $server 0 
  set %lastline. $+ $chan $+ . $+ $server Nobody 
  unset %lines.* 
  write -c randomline. $+ $server $+ . $+ $chan $+ .txt 
  notice $nick Statistics for $chan has been reset. 
}  

on *:TEXT:!lines*:#: {
  if (% [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $2 ] ] == $null) { notice $nick $2 hasn't said anything in this channel yet. } 
  else { notice $nick $2 has currently spoken % [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $2 ] ] in $chan on $network $+ . }
}

on *:TEXT:*:#: { 
  if ($1- == !chanstats) ($1- == !reset chanstats) { Halt } 
  if (% [ $+ statsdate. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %statsdate. $+ $chan $+ . $+ $server $date } 
  else if ($len($1-) >= 30) { write randomline. $+ $server $+ . $+ $chan $+ .txt $$1- $+([,By: $nick,]) } 
  set %lastline. $+ $chan $+ . $+ $server $nick 
  inc %linestot. $+ $chan $+ . $+ $server 1 
  inc %lines. $+ $chan $+ . $+ $server $+ . $+ $nick 1 
}

on *:JOIN:#deforcer: { inc %joins. $+ $chan $+ . $+ $server 1 }







on *:TEXT:*youtube.*/watch?v=*:#:{ 
  var %name $wildtok($1-, *youtube.*/watch?v=*, 1, 32) 
  var %link $gettok(%name,2-,61) 
  var %x $ticks 
  while ($sock(YoutubeL. $+ %x)) { inc %c } 
  sockopen $+(YoutubeL.,%x) www.youtube.com 80 
  sockmark $+(YoutubeL.,%x) $+(%link,~,msg $chan,~,$nick,~,$chan) 
} 
on *:SOCKOPEN:YoutubeL.*:{ 
  sockwrite -nt $sockname GET $+(/watch?v=,$gettok($sock($sockname).mark,1,126)) 
  sockwrite -nt $sockname HOST www.youtube.com 
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:YoutubeL.*:{ 
  if ($sockerr) { 
    notice $gettok($sock($sockname).mark,3,126) $colors($gettok($sock($sockname).mark,3,126),Youtube) $c2($gettok($sock($sockname).mark,3,126),Socket $+(error,$chr(44))) $c1($gettok($sock($sockname).mark,3,126),please try again) 
    sockclose $sockname 
  } 
  else { 
    var %read 
    sockread %read 
    if ($regex(%read,/BASE_YT_URL/)) && (!$hget($sockname, Duration)) { 
      var %a $gettok($htmlfree(%read),0,32) 
      while (%a) { 
        if ($remove($gettok($htmlfree(%read),%a,32),$chr(44),$chr(32)) isnum) { hadd -m $sockname Duration $duration($remove($gettok($htmlfree(%read),%a,32),$chr(44),$chr(32))) } 
        dec %a 
      } 
      if (!$hget($sockname, Duration)) { hadd -m $sockname duration Uknown } 
    } 
    if ($regex(%read,/<title>(.*)<\/title>/)) { 
      hadd -m $sockname Title $regml(1) 
    } 
    if ($regex(%read,/<span class="viewCount">(.*)<\/span>/)) { 
      hadd -m $sockname Viewcount $regml(1) 
    } 
    if ($regex(%read,/<span class="lightLabel">Comments:<\/span> <a href="(.*)">(.*)<\/a>/)) { 
      var %commentcount $regml(2) 
      var %name $gettok($sock($sockname).mark,3,126) 
      var %return $colors(%name,Youtube) $iif($hget($sockname, Title),$c2(%name,Title:) $c1(%name,$hget($sockname, Title))) $iif(%commentcount,$c2(%name,| Comments:) $c1(%name,%commentcount)) $& 
        $iif($hget($sockname, Viewcount),$c2(%name,| Views:) $c1(%name,$hget($sockname, Viewcount))) $iif($hget($sockname, Duration),$c2(%name,| Duration:) $c1(%name,$hget($sockname, Duration))) 
      $gettok($sock($sockname).mark,2,126) $iif(c isincs $chan($gettok($sock($sockname).mark,4,126)).mode,$strip(%return),%return) 
      hfree $sockname 
      sockclose $sockname 
    } 
  } 
} 
alias colors { 
  var %c1 $iif($2 || $2 == 0,$iif($hget(c1, $address($1,2)),$v1,07),07) 
  var %c2 $iif($2 || $2 == 0,$iif($hget(c2, $address($1,2)),$v1,14),14) 
  return $+($chr(3),%c1,$chr(2),$chr(40),$chr(2),$chr(3),%c2,$upper($strip($iif($2 || $2 == 0,$2-,$1-))),$chr(2),$chr(3),%c1,$chr(41),$chr(2)) 
} 
alias c1 { 
  var %x = $iif($2 || $2 == 0,$iif($hget(c1, $address($1,2)),$v1,07),07) 
  var %f = $iif($2 || $2 == 0,$2-,$1-) 
  return $+($chr(3),%x,$strip(%f)) 
} 
alias c2 { 
  var %x = $iif($2 || $2 == 0,$iif($hget(c2, $address($1,2)),$v1,14),14) 
  var %f = $iif($2 || $2 == 0,$2-,$1-) 
  return $+($chr(3),%x,$strip(%f)) 
} 









on $*:TEXT:/^[!@.]cmb-calc/Si:#: { 
  if ($2 == $null) || ($3 == $null) || ($4 == $null) || ($5 == $null) || ($6 == $null) || ($7 == $null) || ($8 == $null) || ($9 == $null) { 
    notice $nick Syntax: !cmb-calc A S D H R P M SU 
  } 
  else { 
    set %dispp $iif($left($1,1) == @, msg $chan, notice $nick) 
    Var %Def $calc($4 * 100) 
    Var %Hits $calc($5 * 100) 
    Var %Pray $calc($7 * 50) 
    var %summon $calc($9 * 50) 
    Var %hit.def.pray.summon $calc((%Def + %hits + %Pray + %summon) / 400) 
    Var %hit.def.pray $calc((%Def + %hits + %Pray) / 400) 
    Var %Att $calc($2 * 130) 
    Var %str $calc($3 * 130) 
    if (!$and($6,1)) { Var %range $calc((($6 - 1) + ($6 * 2)) * 65) } 
    Else var %Range $calc($6 * 195) 
    if (!$and($8,1)) { Var %mage $calc((($8 - 1) + ($8 * 2)) * 65) } 
    Else var %Mage $calc($8 * 195) 
    Var %Melee $calc((%att + %str) /400), %Ranger $calc(%range / 400), %mager $calc(%mage / 400) 
    If (%ranger > %melee) && (%ranger > %Mager) { 
      set %return $calc(%hit.def.pray.summon + %ranger) 
      set %f2p $calc(%hit.def.pray + %ranger) 
      set %based Ranged 
    } 
    elseIf (%mager > %melee) && (%mager > %ranger) { 
      set %return $calc(%hit.def.pray.summon + %mager) 
      set %f2p $calc(%hit.def.pray + %mager) 
      set %based magic 
    } 
    elseIf (%Melee > %mager) && (%melee > %ranger) { 
      set %return $calc(%Hit.def.pray.summon + %melee) 
      set %f2p $calc(%Hit.def.pray + %melee) 
      set %based Melee 
    } 
    %dispp 7*** (14COMBAT7) 14with:   7Attack:14 $2 7Strength:14 $3 7Defence:14 $4 7Hitpoints:14 $5 7Ranged:14 $6 7Prayer:14 $7 7Magic:14 $8 7Summon:14 $9 7[14P2P:7 %Return $+ 7] 7[14F2P:7 %f2p $+ 7] 
    unset %based 
    unset %return 
  } 





on $*:text:/^[@!.]sp(ell(check)?)?/Si:#:{ 
  set %data.method $iif(@ isin $1,msg #,notice $nick) 
  if ($2) { 
    spellcheck $2 
  } 
  else { 
    %data.method 7 $+($nick,$chr(44)) 14enter a word to spellcheck! 
    unset %data.method 
  } 
} 

alias spellcheck { 
  if ($1) { 
    sockopen Spellsock rs.facepwn.com 80 
    sockmark Spellsock $1 
  } 
  else echo -atc info * /spellcheck: missing parameters 
} 

on *:SOCKOPEN:Spellsock: { 
  sockwrite -nt $sockname GET /Parsers/wordspell.php?word= $+ $sock($sockname).mark HTTP/1.1 
  sockwrite -nt $sockname Host: rs.facepwn.com 
  sockwrite -nt $sockname $crlf 
} 

on *:SOCKREAD:Spellsock: { 
  var %c $iif(%data.method,$v1,echo -atc info2) 
  if ($sockerr) { %c 14There was an error with the socket. } 
  else { 
    var %sockread, %a $sock($sockname).mark 
    sockread %sockread 
    if (*properly* iswm %sockread) { 
      %c 7 $qt(%a) 14is spelled correctly! 
      set %temp true 
    } 
    elseif (*suggestion* iswm %sockread) { 
      %c 7 $qt(%a) 14is misspelled. 
      %c %sockread 
      set %temp true 
    } 
    if (%temp) { 
      unset %data.method %temp 
      sockclose $sockname 
    } 
  } 
}






on *:TEXT:!greet*:#: { 
  set %greet [ $+ [ $nick ] ] $2- | notice $nick 7[14Greet7]7 Your greet message has been set to:14 $2- 
} 

on *:TEXT:!deletegreet*:#: { 
  unset %greet [ $+ [ $nick ] ] | notice $nick 7[14Greet7]7 Your greet has been deleted.

} 

on *:JOIN:#: { 
  if (%greet [ $+ [ $nick ] ]) msg $chan 14-7[ForceBot]14-7[ $+ 7 $nick  $+ ]: %greet [ $+ [ $nick ] ] 
  else notice $nick To set a greet type !greet -text goes here!- 
} 

on *:text:!changegreet *:#: { 
  if ($nick == NICK1) || ($nick == NICK2) { 
set %greet [ $+ [ $2 ] ] $3- } } 
on *:text:!deletegreet *:#: { 
  if ($nick == NICK1) || ($nick == NICK2) { 
  alias delgreet { unset %greet [ $+ [ $2 ] ]  } }







on *:TEXT:!info*:#: {  
  var %a = 1, %op, %hop, %voice, %reg 
  while (%a <= $chan(0)) { 
    inc $iif($me isop $chan(%a), $(%op,0), $iif($me ishop $chan(%a), $(%hop,0), $iif($me isvoice $chan(%a), $(%voice,0), $(%reg,0)))) 
    inc %a 
  } 
  if ($2 == op) { //var %c 1,%ops | while ($comchan($me,%c)) { if ($me isop $v1) var %ops %ops $v2 | inc %c } | notice $nick 14[7 Info - Op14]: 7--- I am op in these %op channels: %ops } 
  if ($2 == hop) { //var %c 1,%hops | while ($comchan($me,%c)) { if ($me ishop $v1) var %hops %hops $v2 | inc %c } | notice $nick 14[7 Info - Hop14]: 7--- I am hop in these %hop channels: %hops } 
  if ($2 == voice) { //var %c 1,%voices | while ($comchan($me,%c)) { if ($me isvoice $v1) var %voices %voices $v2 | inc %c } | notice $nick 14[7 Info - Voice14]: 7--- I am voice in these %voice channels: %voices } 
  if ($2 == ranks) { /notice $nick 14[7 Info - Ranks14]: --- I am 4Op5 in %op Channels, 7Hop5 in %hop Channels, 2Voice5 in %voice Channels, and I got no rank in %reg Channels | notice $nick 14Type "7!info op14" To see what channels I am op in - Type "7!info hop14" To see what channels I am hop in - Type "7!info voice14" To see what channels I am voice in } 
  if ($2 == $null) { /notice $nick ERROR: "7!info help14" for help } 
  if ($2 == channels) { /notice $nick 14[7 Info - Channels14]: Currently am I in $chan(N) channels, and I have been in $lines(invchans2.txt) different channels } 
  if ($2 == invite) { /notice $nick 14[7 Info - Invite14]: I Have totaly been invited $iif(%invite, $v1, 0) times in $lines(invchans.txt) different channels. In This Channel I have been invited $iif(%invite2. [ $+ [ $chan ] ], $v1, 0) times } 
  if ($2 == other) { /notice $nick 14[7 Info - Other14]: I've been kicked $iif(%kick, $v1, 0) times, and I have been banned $iif(%ban, $v1, 0) times } 
  if ($2 == help) { 
    /notice $nick 14[7 Info - Help14]: Type "7!info ranks14" To see my channel ranks 
    /notice $nick 14[7 Info - Help14]: Type "7!info invite14" To see how many times I have been invited 
    /notice $nick 14[7 Info - Help14]: Type "7!info channels14" To see how many channels I am in 
    /notice $nick 14[7 Info - Help14]: Type "7!info other14" To see some other info 
  } 
} 

on *:INVITE:#:{ if ($isfile(invchans.txt)) { filter -fk invchans.txt $ $chan | if (!$filtered) { write invchans.txt $chan } } | else { write invchans.txt $chan } 
  inc %invite2. [ $+ [ $chan ] ] 
  inc %invite 
} 
on *:JOIN:#:{ if ($nick == $me) { 
    if ($isfile(invchans2.txt)) { filter -fk invchans2.txt $ $chan | if (!$filtered) { write invchans2.txt $chan } } | else { write invchans2.txt $chan } 
  } 
} 
on *:KICK:#:{ 
  if ($knick == $me) { 
    inc %kick 
  } 
} 
on *:BAN:#:{ 
  if ($bnick == $me) { 
    inc %ban 
  } 
} 
on *:TEXT:@info*:#: {    
  var %a = 1, %op, %hop, %voice, %reg 
  while (%a <= $chan(0)) { 
    inc $iif($me isop $chan(%a), $(%op,0), $iif($me ishop $chan(%a), $(%hop,0), $iif($me isvoice $chan(%a), $(%voice,0), $(%reg,0)))) 
    inc %a 
  } 
  if ($2 == op) { //var %c 1,%ops | while ($comchan($me,%c)) { if ($me isop $v1) var %ops %ops $v2 | inc %c } | notice $nick 14[7 Info - Op14]: 7--- I am op in these %op channels: %ops } 
  if ($2 == hop) { //var %c 1,%hops | while ($comchan($me,%c)) { if ($me ishop $v1) var %hops %hops $v2 | inc %c } | notice $nick 14[7 Info - Hop14]: 7--- I am hop in these %hop channels: %hops } 
  if ($2 == voice) { //var %c 1,%voices | while ($comchan($me,%c)) { if ($me isvoice $v1) var %voices %voices $v2 | inc %c } | notice $nick 14[7 Info - Voice14]: 7--- I am voice in these %voice channels: %voices } 
  if ($2 == ranks) { msg $chan 14[7 Info - Ranks14]: --- I am 4Op5 in %op Channels, 7Hop5 in %hop Channels, 2Voice5 in %voice Channels, and I got no rank in %reg Channels | notice $nick 14Type "7!info op14" To see what channels I am op in - Type "7!info hop14" To see what channels I am hop in - Type "7!info voice14" To see what channels I am voice in } 
  if ($2 == $null) { /notice $nick ERROR: "7!info help14" for help } 
  if ($2 == channels) { msg $chan 14[7 Info - Channels14]: Currently am I in $chan(N) channels, and I have been in $lines(invchans2.txt) different channels } 
  if ($2 == invite) { msg $chan 14[7 Info - Invite14]: I Have totaly been invited $iif(%invite, $v1, 0) times in $lines(invchans.txt) different channels. In This Channel I have been invited $iif(%invite2. [ $+ [ $chan ] ], $v1, 0) times } 
  if ($2 == other) { msg $chan 14[7 Info - Other14]: I've been kicked $iif(%kick, $v1, 0) times, and I have been banned $iif(%ban, $v1, 0) times } 
  if ($2 == help) { 
    /notice $nick 14[7 Info - Help14]: Type "7!info ranks14" To see my channel ranks 
    /notice $nick 14[7 Info - Help14]: Type "7!info invite14" To see how many times I have been invited 
    /notice $nick 14[7 Info - Help14]: Type "7!info channels14" To see how many channels I am in 
    /notice $nick 14[7 Info - Help14]: Type "7!info other14" To see some other info 
  } 
} 






on *:RAWMODE:#: { 
  if ($me !isop # && $me !ishop #) { return } 
  var %x 1,%t 1 
  while $mid($1,%x,1) { 
    if ($v1 isin +-) { 
      var %w $v1 
      inc %x 
      continue 
    } 
    if ($v1 !isincs $token($chanmodes,4,44)) { 
      inc %t 
      if (%w = + && $mid($1,%x,1) === b) { 
        var %a $(,$ $+ %t) 
        if ($regex(%a,/^(?:~[nq]:)?(.+)$/) && $regml(1) iswm $address($me,5)) { var %b %b %a } 
        elseif ($regex(%a,/^~r:\Q $+ $replace($fullname,$chr(32),_) $+ \E$/)) { var %b %b %a } 
        elseif ($regex(%a,/^~c:[^#]?(.+)$/) && $me ison $regml(1)) { var %b %b %a } 
      } 
    } 
    inc %x 
  } 
  if (%b) mode # - $+ $str(b,$modespl) %b 
}