Advertisement
peacestorm

CommandManager

May 26th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DragOP.commandManager = function(cmd) {
  2.     var commandSplit = cmd.split(" ");
  3.     switch(commandSplit[0]) {
  4.         case "help":
  5.             clientMessage("[DragOP] Help command is coming soon!");
  6.             break;
  7.         case "t":
  8.             if(cmd.substring(2, cmd.length) != null && cmd.substring(2, cmd.length) != undefined) {
  9.                 DragOP.mods.forEach(function (entry, index, array) {
  10.                     if(entry.toLowerCase() == cmd.substring(2, cmd.length).toLowerCase() && DragOP.mods[index].isStateMode()) {
  11.                         DragOP.mods[index].onClick(null);
  12.                         DragOP.ctoast("Sucessfully toggled module " + entry.toLowerCase());
  13.                         return;
  14.                     }
  15.                 });
  16.                 DragOP.ctoast("Module " + cmd.substring(2, cmd.length) + " can't be found/toggled!");
  17.             } else {
  18.                 DragOP.ctoast("Syntax error!");
  19.             }
  20.             break;
  21.     }
  22. }
  23.  
  24. function chatHook(text) {
  25.     if(text.charAt(0) == ".") {
  26.         preventDefault();
  27.         com.mojang.minecraftpe.MainActivity.currentMainActivity.get().nativeSetTextboxText("");
  28.         com.mojang.minecraftpe.MainActivity.currentMainActivity.get().updateTextboxText("");
  29.         DragOP.commandManager(text.substring(1, text.length));
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement