Last active
March 19, 2018 20:36
-
-
Save dancodan/675f6fd93bf4598bb77ace0fb7e80544 to your computer and use it in GitHub Desktop.
NPC random attack
This file contains hidden or 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
on('ready',function(){ | |
"use strict"; | |
on('chat:message',function(msg){ | |
var cmd; | |
if('api' !== msg.type || !playerIsGM(msg.playerid) ){ | |
return; | |
} | |
cmd = msg.content.split(/\s+/)[0]; | |
switch(cmd){ | |
case '!obr': | |
switch(randomInteger(3)){ | |
case 1: sendChat('','!ob 4'); break; | |
case 2: sendChat('','!ob 3'); break; | |
case 3: sendChat('','!ob 5'); break; | |
} | |
break; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment