Last active
August 29, 2015 14:01
-
-
Save RUJodan/0b9040a3edde69146fe4 to your computer and use it in GitHub Desktop.
dangerzone.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Using @Zirak's bot to generate an Archer themed command | |
Pings the user, and if they reply "WHAT?!" Caprica says "Danger Zone! back to them | |
lolz | |
*/ | |
(function() { | |
"use strict"; | |
bot.memory.save("roomKey"); | |
function dangerzone(user) { | |
var msg = user[1,user.length-1]; | |
var ping = msg+".. \n"; | |
var areyoulistening = msg+"! \n"; | |
var takeabreathandscream = "*breathes in deeply* "+msg.toUpperCase()+"!!!!!"; | |
user.send(ping); | |
user.send(areyoulistening); | |
user.send(takeabreathandscream); | |
bot.memory.set("roomKey",user.room_id) | |
} | |
IO.register( 'input', function WHAT ( msgObj ) { | |
var sentence = msgObj.content.toUpperCase(); | |
if (sentence === "WHAT?!" && bot.memory.get("roomKey")===msgObj.room_id) bot.adapter.out.add( "Danger Zone!",msgObj.room_id ); | |
}); | |
bot.addCommand({ | |
fun : dangerzone, | |
name : 'dangerzone', | |
permissions : { | |
del : 'NONE' | |
}, | |
description : 'Call Kenny Loggins because you\'ve just entered the Danger Zone! /reply WHAT?!', | |
unTellable : false | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment