Advertisement
Aha2Y

Untitled

Aug 1st, 2011
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.44 KB | None | 0 0
  1. alias quotebot {
  2.   sockclose quotes
  3.   socklisten quotes 113
  4.   set %socketchan $active
  5.   sockopen quotes_x $server 6667
  6. }
  7. on *:socklisten:quotes: {
  8.   var %_rb = $r(1,500)
  9.   sockaccept quotes_ [ $+ [ %_r ] ]
  10.   sockclose quotes
  11. }
  12.  
  13. on *:sockopen:quotes_x: {
  14.   sockwrite -n quotes_x nick QuoteBot
  15.   sockwrite -n quotes_x user SocketBot . . . SocketBot
  16.   sockwrite -nt $sockname Join %socketchan
  17.   noop $tip(FunBots ,Sockets,QuoteBot connected to $network)
  18. }
  19.  
  20. on *:sockread:quotes*: {
  21.   sockread %_quotes
  22.   tokenize 32 %_quotes
  23.   var %_ntoks2 = $numtok($1-,44)
  24.   if (%_ntoks2 == 2 && $1,$3 isnum) {
  25.     sockwrite -n $sockname $3 , $1 : USERID : UNIX : QuoteBot
  26.   }
  27.   if (:PING && $4 != :) { sockwrite -n $sockname PONG $2- }
  28.   elseif (*!quote add* iswm %_quotes) {
  29.     var %topic = $ini(quotes.ini,0) + 1
  30.     writeini quotes.ini %topic quote $7-
  31.     writeini quotes.ini %topic author $nick
  32.     writeini quotes.ini %topic date $date
  33.     writeini quotes.ini %topic time $time
  34.     writeini quotes.ini %topic remove_author $nick
  35.   sockwrite -nt $sockname PRIVMSG $3 :Quote $chr(35) $+ %topic $+ : $7- added by $nick $+ }
  36.   elseif (*!quote del* iswm %_quotes) { if ($readini(quotes.ini, $6, remove_author) == $nick) { sockwrite -nt $sockname PRIVMSG $3 :Quote removed by the Author. | decs %topic } | else { sockwrite -nt $sockname PRIVMSG $3 :You are not the Quote author! }     }
  37.   elseif (*!quote stats* iswm %_quotes) {
  38.   elseif ($ini(quotes.ini,0) > 1) { sockwrite -nt $sockname PRIVMSG $3 : $gettok($mid($1,2),1,33) $+ : There are currently $ini(quotes.ini,0) quotes } | else {  sockwrite -nt $sockname PRIVMSG $3 :There is currently $ini(quotes.ini,0) quote } }
  39.   elseif (*!quote help* iswm %_quotes) { sockwrite -nt $sockname PRIVMSG $3 :Commands are, !quote add, !quote del, !quote stats }
  40.   elseif (:* iswm $4 && $4 != :VERSION) { set %socket.version QuoteBot v1, By Aha2Y | .signal version $1- }
  41.   elseif ($1 == PING && $2) { sockwrite -nt $sockname PONG $2- }
  42. }
  43. on *:SOCKCLOSE:quotes*: {
  44.   sockclose quotes
  45.   sockclose quotes_x
  46.   noop $tip(FunBots,Sockets,QuoteBot disconnected from $network)
  47. }
  48. on *:signal:version: {
  49.   tokenize 33 $1-
  50.   set %string $remove($1-,$2)
  51.   tokenize 32 $1-
  52.   sockwrite -nt quotes_x NOTICE $remove(%string,:) $+($chr(1),VERSION) %socket.version
  53.   unset %socket.version
  54. }
  55. alias -l nick { return $gettok($mid($1,2),1,33) }
  56.  
  57. alias clearquotes {
  58.   echo -at [QuoteBot] Removed all qoutes!
  59.   remini quotes.ini
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement