Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Initialize()
- {
- BindEvent("OnMessage", OnMessageEvent); //Bind the message event
- }
- function ReInitialize(url)
- {
- ReloadBot(url); //Must be called to reload the script contents
- }
- function OnMessageEvent(data)
- {
- var username = data.username;
- var text = data.text;
- switch (username)
- {
- case "Asplosions":
- var chatargs = text.explode(" ", 2);
- switch (chatargs[0].toLowerCase())
- {
- case "hello":
- SendAMessage("Hi there!");
- break;
- case "!loadscript":
- if (chatargs[1] != "")
- {
- ReInitialize(chatargs[1]);
- }
- else
- {
- SendAMessage("Oops you forgot a url!");
- }
- break;
- default:
- //I don't understand you.
- }
- break;
- case "Mal1t1a":
- var chatargs = text.explode(" ", 2);
- switch (chatargs[0].toLowerCase())
- {
- case "beep":
- SendAMessage("boop");
- break;
- case "!loadscript":
- if (chatargs[1] != "")
- {
- ReInitialize(chatargs[1]);
- }
- else
- {
- SendAMessage("Oops you forgot a url!");
- }
- break;
- default:
- //I don't understand you.
- }
- break;
- default:
- //I don't understand who this is.
- }
- }
- Initialize();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement