Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias socket.trivbot {
- sockclose trivia
- set %trivia.server $server
- socklisten trivia $rand(100,500)
- sockopen trivia_x %trivia.server 6667
- }
- on *:socklisten:trivia: {
- var %_trivia = $r(1,500)
- sockaccept trivia_ [ $+ [ %_r ] ]
- sockclose trivia
- }
- on *:sockopen:trivia_x: {
- sockwrite -n trivia_x nick TrivBot
- sockwrite -n trivia_x user TrivBot . . . TrivBot
- }
- on *:sockread:trivia*: {
- sockread %_trivia
- tokenize 32 %trivia
- var %_ntoks3 = $numtok($1-,44)
- if (%_ntoks3 == 2 && $1 isnum && $3 isnum) {
- sockwrite -n $sockname $3 , $1 : USERID : UNIX : TrivBot
- }
- if ($1 == PING && $2) { sockwrite -nt $sockname PONG $2- }
- if (:* iswm $4 && $4 != :VERSION) { set %socket.version TrivBot v1, By Aha2Y | .signal version $1- }
- if ($1 == PING && $2) { sockwrite -nt $sockname PONG $2- }
- if ($2 == 376) { $tip(FunBots ,Sockets,TrivBot connected to $network) | sockwrite -nt $sockname Join #LunaQ }
- }
- on *:SOCKCLOSE:trivia*: {
- sockclose trivia
- sockclose trivia_x
- $tip(FunBots,Sockets,TrivBot disconnected from $network
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement