mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 08:39:12 +00:00
Merge pull request #214 from Parabot/development
[MERGE] Development into Master
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ env:
|
|||||||
- secure: UG+b1tEgc8xv9x4r//2OAIK1RrYv6n209KTTFMMwcnAa7DI8HaP8nljRa5/VhDhuKHdlVrYH/tI90v7UVBs0GDVNwK5V17Io0fMm3FUGZekSthTCqqno5wAGa9r6a6mMLtSaSmIFeIKi0+0d2ZwplRuhj/dtEYjjBBj+kK8g4nE=
|
- secure: UG+b1tEgc8xv9x4r//2OAIK1RrYv6n209KTTFMMwcnAa7DI8HaP8nljRa5/VhDhuKHdlVrYH/tI90v7UVBs0GDVNwK5V17Io0fMm3FUGZekSthTCqqno5wAGa9r6a6mMLtSaSmIFeIKi0+0d2ZwplRuhj/dtEYjjBBj+kK8g4nE=
|
||||||
- secure: St/fecUDInFBCRriYqgp2F8PU9/SooorgxD9Mrs+b0EsC7AbtSsQXvdIv2Lp6xzdQ0VSXPcLIhULPOYrmBKnGQ/NjXTIZXxnroyQxxnI6xyEWIZwiHRY/bKRJDRbQTxD9NL32szKiDSwnw7pu6llF4D64UqQvziq4Gm6VohU75M=
|
- secure: St/fecUDInFBCRriYqgp2F8PU9/SooorgxD9Mrs+b0EsC7AbtSsQXvdIv2Lp6xzdQ0VSXPcLIhULPOYrmBKnGQ/NjXTIZXxnroyQxxnI6xyEWIZwiHRY/bKRJDRbQTxD9NL32szKiDSwnw7pu6llF4D64UqQvziq4Gm6VohU75M=
|
||||||
- secure: bD15GVZWowiknbfLavh8CxSh0GsnF5kT4kZ6ggCuUDGyj0mzqf7dNRnchQIKkCG0WRYyTrFN4pEiygeywWsipEeAVv9Xhx3cuUZmzeQaR5KCWabSwJ8gK6jZd1YhcWmM9vrdPHobZr65MP0y/8mu/Fovgky9dY7KDf4G3SebNrM=
|
- secure: bD15GVZWowiknbfLavh8CxSh0GsnF5kT4kZ6ggCuUDGyj0mzqf7dNRnchQIKkCG0WRYyTrFN4pEiygeywWsipEeAVv9Xhx3cuUZmzeQaR5KCWabSwJ8gK6jZd1YhcWmM9vrdPHobZr65MP0y/8mu/Fovgky9dY7KDf4G3SebNrM=
|
||||||
- PARABOT_VERSION=2.6.4
|
- PARABOT_VERSION=2.6.6
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>org.parabot</groupId>
|
<groupId>org.parabot</groupId>
|
||||||
<artifactId>client</artifactId>
|
<artifactId>client</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.6</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.parabot;
|
package org.parabot;
|
||||||
|
|
||||||
import org.parabot.api.translations.TranslationHelper;
|
import org.parabot.api.translations.TranslationHelper;
|
||||||
import org.parabot.core.Configuration;
|
|
||||||
import org.parabot.core.Core;
|
import org.parabot.core.Core;
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
import org.parabot.core.forum.AccountManager;
|
import org.parabot.core.forum.AccountManager;
|
||||||
@@ -10,13 +9,10 @@ import org.parabot.core.network.proxy.ProxySocket;
|
|||||||
import org.parabot.core.network.proxy.ProxyType;
|
import org.parabot.core.network.proxy.ProxyType;
|
||||||
import org.parabot.core.ui.BotUI;
|
import org.parabot.core.ui.BotUI;
|
||||||
import org.parabot.core.ui.ServerSelector;
|
import org.parabot.core.ui.ServerSelector;
|
||||||
import org.parabot.core.ui.utils.UILog;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parabot v2.6
|
* Parabot v2.6
|
||||||
@@ -46,9 +42,11 @@ public final class Landing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) {
|
if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) {
|
||||||
|
if (Core.newVersionAlert() == JOptionPane.YES_OPTION) {
|
||||||
Core.downloadNewVersion();
|
Core.downloadNewVersion();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER"));
|
Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER"));
|
||||||
AccountManager.validate();
|
AccountManager.validate();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class Configuration extends org.parabot.api.Configuration {
|
|||||||
public static final String GET_SCRIPTS = "http://bdn.parabot.org/api/get.php?action=scripts_scripts&server=";
|
public static final String GET_SCRIPTS = "http://bdn.parabot.org/api/get.php?action=scripts_scripts&server=";
|
||||||
public static final String GET_SCRIPT = "http://bdn.parabot.org/api/get.php?action=scripts_script&id=";
|
public static final String GET_SCRIPT = "http://bdn.parabot.org/api/get.php?action=scripts_script&id=";
|
||||||
public static final String GET_SERVER_PROVIDERS = "http://bdn.parabot.org/api/get.php?action=server_providers";
|
public static final String GET_SERVER_PROVIDERS = "http://bdn.parabot.org/api/get.php?action=server_providers";
|
||||||
public static final String GET_SERVER_PROVIDER = "http://v3.bdn.parabot.org/api/bot/download/provider?nightly=%s";
|
public static final String GET_SERVER_PROVIDER = "http://v3.bdn.parabot.org/api/bot/download/provider?nightly=%s&server=%s";
|
||||||
public static final String GET_SERVER_PROVIDER_INFO = "http://bdn.parabot.org/api/get.php?action=server_information&name=";
|
public static final String GET_SERVER_PROVIDER_INFO = "http://bdn.parabot.org/api/get.php?action=server_information&name=";
|
||||||
public static final String GET_SERVER_SETTINGS = "http://bdn.parabot.org/api/get.php?action=get_settings";
|
public static final String GET_SERVER_SETTINGS = "http://bdn.parabot.org/api/get.php?action=get_settings";
|
||||||
public static final String GET_BOT_VERSION = "http://bdn.parabot.org/api/v2/bot/version";
|
public static final String GET_BOT_VERSION = "http://bdn.parabot.org/api/v2/bot/version";
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ public class Context {
|
|||||||
* Loads the game
|
* Loads the game
|
||||||
*/
|
*/
|
||||||
public void load() {
|
public void load() {
|
||||||
BotUI.getInstance().getJMenuBar().remove(2);
|
|
||||||
Core.verbose(TranslationHelper.translate("PARSING_SERVER_JAR"));
|
Core.verbose(TranslationHelper.translate("PARSING_SERVER_JAR"));
|
||||||
serverProvider.init();
|
serverProvider.init();
|
||||||
serverProvider.parseJar();
|
serverProvider.parseJar();
|
||||||
|
|||||||
@@ -14,13 +14,11 @@ import java.io.BufferedReader;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The core of parabot
|
* The core of parabot
|
||||||
@@ -251,4 +249,11 @@ public class Core {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alerts the user that there is a new version
|
||||||
|
*/
|
||||||
|
public static int newVersionAlert() {
|
||||||
|
return UILog.alert("Parabot Update", "There's a new version of Parabot! \nDo you wish to download it?\n\nThe current version could have some problems!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -125,6 +125,14 @@ public class ClassRedirect {
|
|||||||
return c.getResourceAsStream(res);
|
return c.getResourceAsStream(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean desiredAssertionStatus(Class<?> c) {
|
||||||
|
if (validStack()) {
|
||||||
|
return c.desiredAssertionStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
return !c.getName().contains("parabot") && c.desiredAssertionStatus();
|
||||||
|
}
|
||||||
|
|
||||||
private static boolean validStack() {
|
private static boolean validStack() {
|
||||||
Exception e = new Exception();
|
Exception e = new Exception();
|
||||||
for (StackTraceElement elem : e.getStackTrace()) {
|
for (StackTraceElement elem : e.getStackTrace()) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.parabot.core.asm.redirect;
|
package org.parabot.core.asm.redirect;
|
||||||
|
|
||||||
|
import org.parabot.core.Core;
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -33,7 +34,8 @@ public class SystemRedirect {
|
|||||||
value = System.getProperty(s);
|
value = System.getProperty(s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
System.out.printf("GetSystemProp %s = %s\n", s, value);
|
|
||||||
|
Core.verbose(String.format("GetSystemProp %s = %s", s, value));
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +57,8 @@ public class SystemRedirect {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.printf("GetSystemProp %s = %s\n", s, value);
|
|
||||||
|
Core.verbose(String.format("GetSystemProp %s = %s", s, value));
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,12 +67,12 @@ public class SystemRedirect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String setProperty(String s1, String s2) {
|
public static String setProperty(String s1, String s2) {
|
||||||
System.out.printf("SetSystemProp %s = %s\n", s1, s2);
|
Core.verbose(String.format("SetSystemProp %s = %s", s1, s2));
|
||||||
return System.setProperty(s1, s2);
|
return System.setProperty(s1, s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getenv(String string) {
|
public static String getenv(String string) {
|
||||||
System.out.printf("getEnv %s = %s\n", string, System.getenv(string));
|
Core.verbose(String.format("getEnv %s = %s", string, System.getenv(string)));
|
||||||
return System.getenv(string);
|
return System.getenv(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.parabot.core.asm.redirect;
|
package org.parabot.core.asm.redirect;
|
||||||
|
|
||||||
|
import org.parabot.core.Core;
|
||||||
import org.parabot.core.asm.RedirectClassAdapter;
|
import org.parabot.core.asm.RedirectClassAdapter;
|
||||||
|
|
||||||
public class ThreadRedirect {
|
public class ThreadRedirect {
|
||||||
@@ -58,4 +59,8 @@ public class ThreadRedirect {
|
|||||||
Thread.sleep(time);
|
Thread.sleep(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void setUncaughtExceptionHandler(Thread t, Thread.UncaughtExceptionHandler handler){
|
||||||
|
t.setUncaughtExceptionHandler(handler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,13 @@ public class ToolkitRedirect {
|
|||||||
public static Dimension getScreenSize(Toolkit t){
|
public static Dimension getScreenSize(Toolkit t){
|
||||||
return new Dimension(0,0);
|
return new Dimension(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Image createImage(Toolkit t,byte[] b){
|
public static Image createImage(Toolkit t,byte[] b){
|
||||||
return t.createImage(b);
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Image createImage(Toolkit t, String s){
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Image getImage(Toolkit t,URL u){
|
public static Image getImage(Toolkit t,URL u){
|
||||||
|
|||||||
@@ -34,9 +34,12 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
private static BotUI instance;
|
private static BotUI instance;
|
||||||
private static JDialog dialog;
|
private static JDialog dialog;
|
||||||
|
|
||||||
private JMenuItem run, pause, stop;
|
private JMenuBar menuBar;
|
||||||
|
private JMenu features, scripts, file;
|
||||||
|
private JMenuItem run, pause, stop, cacheClear, notifications;
|
||||||
private boolean runScript, pauseScript;
|
private boolean runScript, pauseScript;
|
||||||
|
|
||||||
|
|
||||||
public BotUI(String username, String password) {
|
public BotUI(String username, String password) {
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
throw new IllegalStateException("BotUI already created");
|
throw new IllegalStateException("BotUI already created");
|
||||||
@@ -74,11 +77,11 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
|
|
||||||
|
|
||||||
private void createMenu() {
|
private void createMenu() {
|
||||||
JMenuBar menuBar = new JMenuBar();
|
menuBar = new JMenuBar();
|
||||||
|
|
||||||
JMenu file = new JMenu("File");
|
file = new JMenu("File");
|
||||||
JMenu scripts = new JMenu("Script");
|
scripts = new JMenu("Script");
|
||||||
JMenu features = new JMenu("Features");
|
features = new JMenu("Features");
|
||||||
|
|
||||||
JMenuItem screenshot = new JMenuItem("Create screenshot");
|
JMenuItem screenshot = new JMenuItem("Create screenshot");
|
||||||
JMenuItem proxy = new JMenuItem("Network");
|
JMenuItem proxy = new JMenuItem("Network");
|
||||||
@@ -104,10 +107,10 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
stop.setEnabled(false);
|
stop.setEnabled(false);
|
||||||
stop.setIcon(new ImageIcon(Images.getResource("/storage/images/stop.png")));
|
stop.setIcon(new ImageIcon(Images.getResource("/storage/images/stop.png")));
|
||||||
|
|
||||||
JMenuItem cacheClear = new JMenuItem("Clear cache");
|
cacheClear = new JMenuItem("Clear cache");
|
||||||
cacheClear.setIcon(new ImageIcon(Images.getResource("/storage/images/trash.png")));
|
cacheClear.setIcon(new ImageIcon(Images.getResource("/storage/images/trash.png")));
|
||||||
|
|
||||||
JMenuItem notifications = new JMenuItem("Notifications");
|
notifications = new JMenuItem("Notifications");
|
||||||
notifications.setIcon(new ImageIcon(Images.getResource("/storage/images/bell.png")));
|
notifications.setIcon(new ImageIcon(Images.getResource("/storage/images/bell.png")));
|
||||||
|
|
||||||
screenshot.addActionListener(this);
|
screenshot.addActionListener(this);
|
||||||
@@ -157,7 +160,7 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
case "Create screenshot":
|
case "Create screenshot":
|
||||||
try {
|
try {
|
||||||
Robot robot = new Robot();
|
Robot robot = new Robot();
|
||||||
Rectangle parabotScreen = new Rectangle((int) getLocation().getX(), (int) getLocation().getY(), getWidth(), getHeight());
|
Rectangle parabotScreen = new Rectangle((int) getLocation().getX(), (int) getLocation().getY() + (menuBar.getHeight() + features.getHeight()), getWidth(), getHeight());
|
||||||
BufferedImage image = robot.createScreenCapture(parabotScreen);
|
BufferedImage image = robot.createScreenCapture(parabotScreen);
|
||||||
String randString = StringUtils.randomString(10);
|
String randString = StringUtils.randomString(10);
|
||||||
boolean search = true;
|
boolean search = true;
|
||||||
@@ -341,4 +344,23 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
public void windowOpened(WindowEvent arg0) {
|
public void windowOpened(WindowEvent arg0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JMenu getFeatures() {
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JMenu getScripts() {
|
||||||
|
return scripts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JMenu getFile() {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JMenuItem getCacheClear() {
|
||||||
|
return cacheClear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JMenuItem getNotifications() {
|
||||||
|
return notifications;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,6 @@ public class Logger extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
public static void addMessage(String message){
|
public static void addMessage(String message){
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package org.parabot.core.ui.utils;
|
package org.parabot.core.ui.utils;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Log messages to the log user interface which is attached to the bot user interface
|
* Log messages to the log user interface which is attached to the bot user interface
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class UILog {
|
public class UILog {
|
||||||
|
|
||||||
@@ -21,4 +19,15 @@ public class UILog {
|
|||||||
messageType);
|
messageType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int alert(final String title, final String message) {
|
||||||
|
return alert(title, message, JOptionPane.YES_NO_OPTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int alert(final String title, final String message, int option) {
|
||||||
|
return alert(title, message, option, JOptionPane.DEFAULT_OPTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int alert(final String title, final String message, int optionType, int messageType) {
|
||||||
|
return JOptionPane.showConfirmDialog(null, message, title, optionType, messageType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class RandomHandler {
|
|||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
RandomParser.enable();
|
RandomParser.enable();
|
||||||
checkAndRun(RandomType.ON_SERVER_START);
|
runAll(RandomType.ON_SERVER_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,6 +100,40 @@ public class RandomHandler {
|
|||||||
this.activeRandoms.clear();
|
this.activeRandoms.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes a specific random
|
||||||
|
*
|
||||||
|
* @param r
|
||||||
|
* @return True if the random is executed, false if not
|
||||||
|
*/
|
||||||
|
public boolean executeRandom(Random r){
|
||||||
|
if (r.activate()) {
|
||||||
|
Logger.addMessage("Running random '" + r.getName() + "'", true);
|
||||||
|
try {
|
||||||
|
r.execute();
|
||||||
|
return true;
|
||||||
|
}catch (Exception e){
|
||||||
|
Logger.addMessage("Random failed: '" + r.getName() + "'", false);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs all randoms of a certain type
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public void runAll(RandomType type){
|
||||||
|
for (Random r : this.activeRandoms) {
|
||||||
|
if (r.getRandomType().getId() == type.getId()) {
|
||||||
|
executeRandom(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if random occurs and runs it
|
* Checks if random occurs and runs it
|
||||||
*
|
*
|
||||||
@@ -107,15 +141,8 @@ public class RandomHandler {
|
|||||||
*/
|
*/
|
||||||
public boolean checkAndRun(RandomType type) {
|
public boolean checkAndRun(RandomType type) {
|
||||||
for (Random r : this.activeRandoms) {
|
for (Random r : this.activeRandoms) {
|
||||||
if (r.getRandomType().getId() == type.getId() && r.activate()) {
|
if (r.getRandomType().getId() == type.getId()) {
|
||||||
Logger.addMessage("Running random '" + r.getName() + "'", true);
|
return executeRandom(r);
|
||||||
try {
|
|
||||||
r.execute();
|
|
||||||
}catch (Exception e){
|
|
||||||
Logger.addMessage("Random failed: '" + r.getName() + "'", false);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class Script implements Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.getRandomHandler().checkAndRun(RandomType.ON_SCRIPT_START);
|
context.getRandomHandler().runAll(RandomType.ON_SCRIPT_START);
|
||||||
|
|
||||||
Core.verbose("Detecting script framework...");
|
Core.verbose("Detecting script framework...");
|
||||||
context.setRunningScript(this);
|
context.setRunningScript(this);
|
||||||
@@ -120,7 +120,7 @@ public class Script implements Runnable {
|
|||||||
Core.verbose("Script stopped/finished, unloading and stopping...");
|
Core.verbose("Script stopped/finished, unloading and stopping...");
|
||||||
onFinish();
|
onFinish();
|
||||||
|
|
||||||
context.getRandomHandler().checkAndRun(RandomType.ON_SCRIPT_FINISH);
|
context.getRandomHandler().runAll(RandomType.ON_SCRIPT_FINISH);
|
||||||
|
|
||||||
Logger.addMessage("Script stopped.", false);
|
Logger.addMessage("Script stopped.", false);
|
||||||
context.getServerProvider().unloadScript(this);
|
context.getServerProvider().unloadScript(this);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class PublicServerExecuter extends ServerExecuter {
|
|||||||
|
|
||||||
final File destination = new File(Directories.getCachePath(),
|
final File destination = new File(Directories.getCachePath(),
|
||||||
serverProviderInfo.getCRC32() + ".jar");
|
serverProviderInfo.getCRC32() + ".jar");
|
||||||
final String jarUrl = String.format(Configuration.GET_SERVER_PROVIDER, Configuration.BOT_VERSION.isNightly());
|
final String jarUrl = String.format(Configuration.GET_SERVER_PROVIDER, Configuration.BOT_VERSION.isNightly(), serverName);
|
||||||
|
|
||||||
Core.verbose("Downloading: " + jarUrl + " ...");
|
Core.verbose("Downloading: " + jarUrl + " ...");
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
package org.parabot.environment.servers.executers;
|
package org.parabot.environment.servers.executers;
|
||||||
|
|
||||||
import org.parabot.core.Context;
|
import org.parabot.core.Context;
|
||||||
import org.parabot.core.Core;
|
import org.parabot.core.ui.BotUI;
|
||||||
import org.parabot.core.parsers.randoms.RandomParser;
|
|
||||||
import org.parabot.core.ui.components.PaintComponent;
|
import org.parabot.core.ui.components.PaintComponent;
|
||||||
import org.parabot.environment.servers.ServerProvider;
|
import org.parabot.environment.servers.ServerProvider;
|
||||||
|
|
||||||
import java.io.PrintStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Executes a server provider
|
* Executes a server provider
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class ServerExecuter {
|
public abstract class ServerExecuter {
|
||||||
|
|
||||||
@@ -24,6 +19,8 @@ public abstract class ServerExecuter {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
BotUI.getInstance().getCacheClear().setEnabled(false);
|
||||||
|
|
||||||
Context context = Context.getInstance(provider);
|
Context context = Context.getInstance(provider);
|
||||||
context.load();
|
context.load();
|
||||||
PaintComponent.getInstance().startPainting(context);
|
PaintComponent.getInstance().startPainting(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user