Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias quotebot {
- sockclose quotes
- socklisten quotes 113
- set %socketchan $active
- sockopen quotes_x $server 6667
- }
- on *:socklisten:quotes: {
- var %_rb = $r(1,500)
- sockaccept quotes_ [ $+ [ %_r ] ]
- sockclose quotes
- }
- on *:sockopen:quotes_x: {
- sockwrite -n quotes_x nick QuoteBot
- sockwrite -n quotes_x user SocketBot . . . SocketBot
- sockwrite -nt $sockname Join %socketchan
- noop $tip(FunBots ,Sockets,QuoteBot connected to $network)
- }
- on *:sockread:quotes*: {
- sockread %_quotes
- tokenize 32 %_quotes
- var %_ntoks2 = $numtok($1-,44)
- if (%_ntoks2 == 2 && $1,$3 isnum) {
- sockwrite -n $sockname $3 , $1 : USERID : UNIX : QuoteBot
- }
- if (:PING && $4 != :) { sockwrite -n $sockname PONG $2- }
- elseif (*!quote add* iswm %_quotes) {
- var %topic = $ini(quotes.ini,0) + 1
- writeini quotes.ini %topic quote $7-
- writeini quotes.ini %topic author $nick
- writeini quotes.ini %topic date $date
- writeini quotes.ini %topic time $time
- writeini quotes.ini %topic remove_author $nick
- sockwrite -nt $sockname PRIVMSG $3 :Quote $chr(35) $+ %topic $+ : $7- added by $nick $+ }
- 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! } }
- elseif (*!quote stats* iswm %_quotes) {
- 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 } }
- elseif (*!quote help* iswm %_quotes) { sockwrite -nt $sockname PRIVMSG $3 :Commands are, !quote add, !quote del, !quote stats }
- elseif (:* iswm $4 && $4 != :VERSION) { set %socket.version QuoteBot v1, By Aha2Y | .signal version $1- }
- elseif ($1 == PING && $2) { sockwrite -nt $sockname PONG $2- }
- }
- on *:SOCKCLOSE:quotes*: {
- sockclose quotes
- sockclose quotes_x
- noop $tip(FunBots,Sockets,QuoteBot disconnected from $network)
- }
- on *:signal:version: {
- tokenize 33 $1-
- set %string $remove($1-,$2)
- tokenize 32 $1-
- sockwrite -nt quotes_x NOTICE $remove(%string,:) $+($chr(1),VERSION) %socket.version
- unset %socket.version
- }
- alias -l nick { return $gettok($mid($1,2),1,33) }
- alias clearquotes {
- echo -at [QuoteBot] Removed all qoutes!
- remini quotes.ini
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement