예제 #1
0
 private void showStopScript(final Bot bot) {
   final ScriptHandler sh = bot.getScriptHandler();
   final Map<Integer, LoopTask> running = sh.getRunningScripts();
   if (running.size() > 0) {
     final int result =
         JOptionPane.showConfirmDialog(
             this,
             "Would you like to stop the script?",
             "Script",
             JOptionPane.OK_CANCEL_OPTION,
             JOptionPane.QUESTION_MESSAGE);
     if (result == JOptionPane.OK_OPTION) {
       sh.stopAllScripts();
       bot.getMethodContext().web.unloadWebScripts();
       updateScriptControls();
     }
   }
 }
예제 #2
0
 public void scriptPaused(final ScriptHandler handler) {
   if (handler.getBot() == getCurrentBot()) {
     updateScriptControls();
   }
 }