Skip to content

Instantly share code, notes, and snippets.

@dnet
Created June 23, 2011 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnet/1043241 to your computer and use it in GitHub Desktop.
Save dnet/1043241 to your computer and use it in GitHub Desktop.
1337 module for IRCnet #hspbp channel
-module(leet).
-export([ircmain/1, ircproc/1, reload/2]).
ircmain(Contact) ->
spawn(?MODULE, ircproc, [Contact]).
reload(Contact, Pid) ->
Pid ! reloaded,
ircproc(Contact).
ircproc(Contact) ->
case erlang:localtime() of
{_, {13, 37, _}} -> Contact ! {announce, "'1337"}, timer:sleep(60000);
_ -> nop
end,
receive
quit -> quit;
{ident, Pid} ->
Pid ! {ident, "leet"},
ircproc(Contact);
{reload, Pid} ->
?MODULE:reload(Contact, Pid);
_ -> ircproc(Contact)
after 10000 ->
ircproc(Contact)
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment