]>
Commit | Line | Data |
---|---|---|
1 | #include "../control/control.h"\r | |
2 | #include "../nick/nick.h"\r | |
3 | #include "../channel/channel.h"\r | |
4 | \r | |
5 | int fa_facepalm(void *source, int cargc, char **cargv) {\r | |
6 | nick *sender=(nick *)source;\r | |
7 | nick *victim;\r | |
8 | channel *cp;\r | |
9 | \r | |
10 | if (cargc<1) {\r | |
11 | controlreply(sender,"Usage: facepalm <target>");\r | |
12 | return CMD_ERROR;\r | |
13 | }\r | |
14 | \r | |
15 | if ((victim=getnickbynick(cargv[0]))!=NULL) {\r | |
16 | controlreply(victim," .-'---`-.");\r | |
17 | controlreply(victim,",' `.");\r | |
18 | controlreply(victim,"| \\");\r | |
19 | controlreply(victim,"| \\");\r | |
20 | controlreply(victim,"\\ _ \\");\r | |
21 | controlreply(victim,",\\ _ ,'-,/-)\\");\r | |
22 | controlreply(victim,"( * \\ \\,' ,' ,'-)");\r | |
23 | controlreply(victim," `._,) -',-')");\r | |
24 | controlreply(victim," \\/ ''/");\r | |
25 | controlreply(victim," ) / /");\r | |
26 | controlreply(victim," / ,'-'");\r | |
27 | controlreply(sender,"Gave %s a facepalm.",victim->nick);\r | |
28 | } else if ((cp=findchannel(cargv[0]))!=NULL) {\r | |
29 | controlchanmsg(cp," .-'---`-.");\r | |
30 | controlchanmsg(cp,",' `.");\r | |
31 | controlchanmsg(cp,"| \\");\r | |
32 | controlchanmsg(cp,"| \\");\r | |
33 | controlchanmsg(cp,"\\ _ \\");\r | |
34 | controlchanmsg(cp,",\\ _ ,'-,/-)\\");\r | |
35 | controlchanmsg(cp,"( * \\ \\,' ,' ,'-)");\r | |
36 | controlchanmsg(cp," `._,) -',-')");\r | |
37 | controlchanmsg(cp," \\/ ''/");\r | |
38 | controlchanmsg(cp," ) / /");\r | |
39 | controlchanmsg(cp," / ,'-'");\r | |
40 | controlreply(sender,"Spammed facepalm in %s.",cp->index->name->content);\r | |
41 | } else {\r | |
42 | controlreply(sender,"Can't find %s.",cargv[0]);\r | |
43 | }\r | |
44 | \r | |
45 | return CMD_OK;\r | |
46 | }\r | |
47 | \r | |
48 | void _init() {\r | |
49 | registercontrolhelpcmd("facepalm",NO_OPERED,2,fa_facepalm,"Usage: facepalm <target>\nSpams a facepalm at target.");\r | |
50 | }\r | |
51 | \r | |
52 | void _fini() {\r | |
53 | deregistercontrolcmd("facepalm",fa_facepalm);\r | |
54 | }\r |