diff --git a/Cache/sound1.wav b/Cache/sound1.wav index e5a7222..33496f9 100644 Binary files a/Cache/sound1.wav and b/Cache/sound1.wav differ diff --git a/Cache/sound2.wav b/Cache/sound2.wav index e5a7222..33496f9 100644 Binary files a/Cache/sound2.wav and b/Cache/sound2.wav differ diff --git a/Cache/sound3.wav b/Cache/sound3.wav index e5a7222..33496f9 100644 Binary files a/Cache/sound3.wav and b/Cache/sound3.wav differ diff --git a/Cache/sound4.wav b/Cache/sound4.wav index e5a7222..b046718 100644 Binary files a/Cache/sound4.wav and b/Cache/sound4.wav differ diff --git a/src/main/java/org/rebotted/Client.java b/src/main/java/org/rebotted/Client.java index 4d7f3c0..6449be6 100644 --- a/src/main/java/org/rebotted/Client.java +++ b/src/main/java/org/rebotted/Client.java @@ -494,7 +494,7 @@ public class Client extends GameApplet { private int anInt1193; private int splitPrivateChat; private IndexedImage mapBack; - private String[] menuActionText; + public String[] menuActionText; private Sprite flameLeftSprite; private Sprite flameRightSprite; private int minimapRotation; @@ -505,7 +505,7 @@ public class Client extends GameApplet { private int loginScreenCursorPos; private long aLong1220; private int hintIconNpcId; - private int inputDialogState; + public int inputDialogState; private int nextSong; private boolean fadeMusic; private CollisionMap[] collisionMaps; @@ -4762,7 +4762,7 @@ public class Client extends GameApplet { clicked = selectedMenuActions[index]; } - //System.out.println("First: "+first + " button: "+button + " action: "+action + " clicked: "+clicked+ " actionText: "+menuActionText[index]); + System.out.println("First: "+first + " button: "+button + " action: "+action + " clicked: "+clicked+ " actionText: "+menuActionText[index]); if (action >= 2000) { action -= 2000; } @@ -5927,7 +5927,7 @@ public class Client extends GameApplet { if (widget != null && widget.inventoryAmounts[first] >= 0x186a0) s5 = widget.inventoryAmounts[first] + " x " + itemDef.name; else if (itemDef.description != null) - s5 = itemDef.description; + s5 = new String(itemDef.description); else s5 = "It's a " + itemDef.name + "."; sendMessage(s5, 0, ""); @@ -6002,7 +6002,7 @@ public class Client extends GameApplet { ItemDefinition definition = ItemDefinition.lookup(clicked); String string; if (definition.description != null) - string = definition.description; + string = new String(definition.description); else string = "It's a " + definition.name + "."; sendMessage(string, 0, ""); diff --git a/src/main/java/org/rebotted/cache/def/ItemDefinition.java b/src/main/java/org/rebotted/cache/def/ItemDefinition.java index f8826a4..2165713 100644 --- a/src/main/java/org/rebotted/cache/def/ItemDefinition.java +++ b/src/main/java/org/rebotted/cache/def/ItemDefinition.java @@ -45,7 +45,7 @@ public final class ItemDefinition { } else if (opcode == 2) { name = buffer.readString(); } else if (opcode == 3) { - description = buffer.readString(); + description = buffer.readBytes(); } else if (opcode == 4) { modelZoom = buffer.readUShort(); } else if (opcode == 5) { @@ -92,7 +92,6 @@ public final class ItemDefinition { } actions[opcode - 35] = buffer.readString(); } else if (opcode == 40) { - int colors = buffer.readUnsignedByte(); modifiedModelColors = new int[colors]; originalModelColors = new int[colors]; @@ -302,7 +301,7 @@ public final class ItemDefinition { char c = itemDef_1.name.charAt(0); if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') s = "an"; - description = ("Swap this note at any bank for " + s + " " + itemDef_1.name + "."); + description = ("Swap this note at any bank for " + s + " " + itemDef_1.name + ".").getBytes(); stackable = true; } @@ -528,7 +527,7 @@ public final class ItemDefinition { public int inventoryModel; public int equippedMaleModelDialogue1; public boolean stackable; - public String description; + public byte[] description; public int unnotedItemId; private static int cacheIndex; public int modelZoom; diff --git a/src/main/java/org/rebotted/script/ScriptHandler.java b/src/main/java/org/rebotted/script/ScriptHandler.java index 7900814..1eed44e 100644 --- a/src/main/java/org/rebotted/script/ScriptHandler.java +++ b/src/main/java/org/rebotted/script/ScriptHandler.java @@ -2,6 +2,7 @@ package org.rebotted.script; import org.rebotted.script.scriptdata.ScriptData; import org.rebotted.script.types.Script; +import org.rebotted.ui.BotFrame; import org.rebotted.util.Condition; public class ScriptHandler implements Runnable { @@ -41,6 +42,7 @@ public class ScriptHandler implements Runnable { } } catch (Exception e) { stop(); + e.printStackTrace(); } } @@ -79,15 +81,18 @@ public class ScriptHandler implements Runnable { this.scriptState = State.STOPPED; this.script.onStop(); this.scriptThread.interrupt(); + BotFrame.setStopped(); } public void pause() { if (scriptState.equals(State.RUNNING)) { System.out.println("Script Paused: " + scriptData.getName()); this.scriptState = State.PAUSE; + BotFrame.setPaused(); } else if (scriptState.equals(State.PAUSE)) { System.out.println("Script resumed: " + scriptData.getName()); this.scriptState = State.RUNNING; + BotFrame.setRunning(); } } diff --git a/src/main/java/org/rebotted/ui/BotFrame.java b/src/main/java/org/rebotted/ui/BotFrame.java index 368c2af..fb55755 100644 --- a/src/main/java/org/rebotted/ui/BotFrame.java +++ b/src/main/java/org/rebotted/ui/BotFrame.java @@ -3,6 +3,7 @@ package org.rebotted.ui; import org.rebotted.Client; import org.rebotted.Configuration; import org.rebotted.GameApplet; +import org.rebotted.cache.def.ItemDefinition; import org.rebotted.script.ScriptHandler; import org.rebotted.script.loader.ScriptLoader; import org.rebotted.ui.menu.BotMenuBar; @@ -12,6 +13,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.Arrays; public final class BotFrame extends JFrame implements ActionListener {