Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddonInfo <- {
- "Name":"bot command package"
- "Summary":"bot commands"
- "Version":"0.01"
- "Author":"NovaSquirrel"
- };
- function BotCommand(Type, OldParams, Context) {
- local Params = api.DecodeJSON(OldParams);
- local Nick = Params.Nick;
- local Arg = Params.Arg;
- local ArgSplit = api.TextParamSplit(Arg);
- local Command = Params.Cmd;
- local ReplyWith = Params.Say;
- local Temp;
- function Say(Text) {
- api.Command(ReplyWith, Text, Context);
- }
- switch(Command) {
- case "echo":
- Say(Arg);
- return EventReturn.DELETE;
- case "allcaps":
- Say(Arg.toupper());
- return EventReturn.DELETE;
- case "nocaps":
- Say(Arg.tolower());
- return EventReturn.DELETE;
- case "eval":
- if(Nick == "NovaSquirrel")
- compilestring(Arg)();
- else
- Say("no");;
- return EventReturn.DELETE;
- }
- return EventReturn.NORMAL;
- }
- api.AddEventHook("bot command", BotCommand, Priority.NORMAL, 0, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement