Advertisement
makimaki

socketbot

Jun 22nd, 2010
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.77 KB | None | 0 0
  1. alias swrite { sockwrite -tn nth $1- }
  2. alias sock { if ($$1 == START) {  if ($sock(nth)) { sockclose nth } | .timer -m 1 10 .sockopen nth three.irc.sparkpea.net 6667 } |  elseif ($$1 == MSG) { swrite privmsg # $2- | halt } | elseif ($$1 == MODE) { swrite MODE # $2- | halt } | elseif ($$1 == JOIN) { swrite JOIN $active | halt } | elseif ($$1 == PART) { swrite PART $active | halt } |  elseif ($$1 == AUTH) { if (%sep == $null) { set %sep $$?="Email & Pass:" } | swrite NickServ IDENTIFY %sep } }
  3. on *:sockopen:nth: { sockwrite -tn nth NICK SocketBot |   echo -st Logging in to $network $+ ...  | sock auth  }
  4. on *:sockread:nth:{
  5.   var %fd | sockread %fd | if (!%fd) { halt }
  6.   tokenize 32 %fd
  7.   window -m @sock | echo @sock $1-
  8.   if ($1 == PING) { swrite nth PONG $2- }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement