- Jun 25, 2011
- 119
- 19
- 0
Hello, last year I posted a short tutorial on how to re-enable the Java Swing control panel that comes with the Hydrix and Harmony releases.
Shortly after doing this, I began refactoring it to have more/better options and a user list. I have since updated my own to have more features, but I wanted to release this middle-of-the-road version I used for a while. I developed and tested this using Harmony, but It should work just fine for Hydrix, too, since Harmony was based on Hydrix. It should just drop right in, build, and run, if you have enabled the panel.
Difficulty: 0/10
Step 1 of 1: Replace all the text in Panel.java with this and rebuild the class:
Media:

Edit: If you don't use the Discord parts of the src, comment out:
and any line that starts with:
This is far from perfect, but it should prove much more useful than what it comes with.
Shortly after doing this, I began refactoring it to have more/better options and a user list. I have since updated my own to have more features, but I wanted to release this middle-of-the-road version I used for a while. I developed and tested this using Harmony, but It should work just fine for Hydrix, too, since Harmony was based on Hydrix. It should just drop right in, build, and run, if you have enabled the panel.
Difficulty: 0/10
Step 1 of 1: Replace all the text in Panel.java with this and rebuild the class:
Java:
/**
* --------------------------------------------------------------------------------
* Java Swing GUI for in-game admin commands (ban, jail, teleport, etc.)
*
* @author Hydrix? Maybe? Unsure.
* @refactor Xeon - https://rune-server.org/members/x3on.167758/
* @date 2024-11-24
*
* @credits
* • Jack - https://rune-server.org/members/jack.266700/ | Harmony 718 release
* • Hydrix & anyone else who may have worked on this.
* --------------------------------------------------------------------------------
*/
package com.rs;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.discord.Discord;
import com.rs.Settings;
import com.rs.game.Animation;
import com.rs.game.ForceTalk;
import com.rs.game.Hit;
import com.rs.game.Hit.HitLook;
import com.rs.game.World;
import com.rs.game.WorldTile;
import com.rs.game.player.Player;
import com.rs.game.player.content.Magic;
import com.rs.game.player.content.BossSpotlight;
import com.rs.game.player.content.EventSpotlight;
import com.rs.game.player.content.event.season.SeasonEvent;
import com.rs.utils.IPBanL;
import com.rs.utils.SerializableFilesManager;
import com.rs.utils.ShopsHandler;
import com.rs.utils.Utils;
public class Panel extends JFrame {
private JTextField textField;
private DefaultListModel<String> playerListModel;
private JList<String> playerList;
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
try {
new Panel().setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
});
}
public Panel() {
setTitle("718 Control Panel");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel leftPanel = buildLeftPanel();
JTabbedPane tabs = new JTabbedPane();
tabs.addTab("Page 1", new JScrollPane(buildPage1()));
tabs.addTab("Page 2", new JScrollPane(buildPage2()));
tabs.addTab("Page 3", new JScrollPane(buildPage3()));
getContentPane().setLayout(new BorderLayout(10, 10));
getContentPane().add(leftPanel, BorderLayout.WEST);
getContentPane().add(tabs, BorderLayout.CENTER);
pack();
setLocationRelativeTo(null);
refreshPlayerList();
}
private JPanel buildLeftPanel() {
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
p.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel userPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
userPanel.add(new JLabel("USERNAME:"));
textField = new JTextField(15);
userPanel.add(textField);
p.add(userPanel);
playerListModel = new DefaultListModel<>();
playerList = new JList<>(playerListModel);
playerList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
playerList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
String selected = playerList.getSelectedValue();
if (selected != null) {
textField.setText(selected);
}
}
}
});
JScrollPane listScroll = new JScrollPane(playerList);
listScroll.setPreferredSize(new Dimension(200, 400));
JButton btnRefresh = new JButton("Refresh List");
btnRefresh.addActionListener(e -> refreshPlayerList());
JPanel listPanel = new JPanel(new BorderLayout(5, 5));
listPanel.setBorder(BorderFactory.createTitledBorder("Active Players"));
listPanel.add(listScroll, BorderLayout.CENTER);
listPanel.add(btnRefresh, BorderLayout.SOUTH);
p.add(listPanel);
return p;
}
private JPanel buildPage1() {
JPanel page = new JPanel();
page.setLayout(new BoxLayout(page, BoxLayout.Y_AXIS));
page.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel punish = new JPanel(new GridLayout(3, 2, 10, 10));
punish.setBorder(BorderFactory.createTitledBorder("Punishments"));
punish.add(makeButton("IP Ban", e -> IPban()));
punish.add(makeButton("Mute", e -> mute()));
punish.add(makeButton("Ban", e -> ban()));
punish.add(makeButton("Jail", e -> jail()));
punish.add(makeButton("Kill", e -> kill()));
punish.add(makeButton("Freeze", e -> freeze()));
page.add(punish);
page.add(Box.createVerticalStrut(10));
JPanel tele = new JPanel(new GridLayout(2, 2, 10, 10));
tele.setBorder(BorderFactory.createTitledBorder("Teleportation"));
tele.add(makeButton("Teleport Player", e -> teleport()));
tele.add(makeButton("Teleport All", e -> teleAll()));
tele.add(makeButton("Send Home", e -> sendHome()));
tele.add(new JLabel());
page.add(tele);
page.add(Box.createVerticalStrut(10));
JPanel items = new JPanel(new GridLayout(2, 2, 10, 10));
items.setBorder(BorderFactory.createTitledBorder("Item Management"));
items.add(makeButton("Give Item", e -> giveItem()));
items.add(makeButton("Take Item", e -> takeItem()));
items.add(makeButton("Give All", e -> giveAll()));
items.add(makeButton("Take All", e -> takeAll()));
page.add(items);
return page;
}
private JPanel buildPage2() {
JPanel page = new JPanel();
page.setLayout(new BoxLayout(page, BoxLayout.Y_AXIS));
page.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel extras = new JPanel(new GridLayout(2, 2, 10, 10));
extras.setBorder(BorderFactory.createTitledBorder("Extras"));
extras.add(makeButton("Force Talk", e -> forceChat()));
extras.add(makeButton("Smite Player", e -> smite()));
extras.add(makeButton("Make Player Dance", e -> makeDance()));
extras.add(makeButton("Make All Dance", e -> danceAll()));
page.add(extras);
page.add(Box.createVerticalStrut(10));
JPanel max = new JPanel(new GridLayout(3, 1, 10, 10));
max.setBorder(BorderFactory.createTitledBorder("Maxing & Rights"));
max.add(makeButton("Max Player", e -> maxPlayer()));
max.add(makeButton("Combat Max Player", e -> combatMaxPlayer()));
max.add(makeButton("Set Rights", e -> setRights()));
page.add(max);
page.add(Box.createVerticalStrut(10));
JPanel misc = new JPanel(new GridLayout(1, 1, 10, 10));
misc.setBorder(BorderFactory.createTitledBorder("Shutdown Server"));
misc.add(makeButton("Shutdown Server", e -> shutdown()));
page.add(misc);
page.add(Box.createVerticalStrut(10));
JPanel rewards = new JPanel(new GridLayout(5, 1, 5, 5));
rewards.setBorder(BorderFactory.createTitledBorder("World Rewards"));
rewards.add(makeButton("Give 2 Spins to All", e -> giveSquealSpins()));
rewards.add(makeButton("Give 1 Deathtouched Dart to All", e -> giveDeathtouchedDart()));
rewards.add(makeButton("Give 1 Elite Crystal Key to All", e -> giveEliteCrystalKey()));
rewards.add(makeButton("Give 1 Mystery Chest to All", e -> giveMysteryChest()));
rewards.add(makeButton("Give Clue Scroll to All", e -> giveClueScroll()));
page.add(rewards);
return page;
}
private JPanel buildPage3() {
JPanel page = new JPanel();
page.setLayout(new BoxLayout(page, BoxLayout.Y_AXIS));
page.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel events1 = new JPanel(new GridLayout(5, 1, 5, 5));
events1.setBorder(BorderFactory.createTitledBorder("Global Events"));
events1.add(makeButton("Npc Drop Event Tokens - 30 mins", e -> npcDropEventTokens()));
events1.add(makeButton("Hits Are Doubled - 30 mins", e -> doubleHits()));
events1.add(makeButton("10% Drop Rate Boost - 30 mins", e -> dropRateBoost()));
events1.add(makeButton("Double Raids Caskets - 60 mins", e -> doubleRaidsCaskets()));
events1.add(makeButton("No Damage in PvM - 30 mins", e -> noDamagePvM()));
page.add(events1);
page.add(Box.createVerticalStrut(10));
JPanel events2 = new JPanel(new GridLayout(6, 1, 5, 5));
events2.setBorder(BorderFactory.createTitledBorder("Global Events"));
events2.add(makeButton("Double Skilling Resources - 30 mins", e -> doubleSkillingResources()));
events2.add(makeButton("Increase Boss Pet Chance - 60 mins", e -> increaseBossPetChance()));
events2.add(makeButton("Activate 1h Double Experience", e -> activateDoubleExp()));
events2.add(makeButton("Double Drops", e -> doubleDrops()));
events2.add(makeButton("Spawn Party Demon", e -> spawnPartyDemon()));
events2.add(makeButton("Restock Shops", e -> restockShops()));
page.add(events2);
page.add(Box.createVerticalStrut(10));
JPanel spot = new JPanel(new GridLayout(3, 1, 5, 5));
spot.setBorder(BorderFactory.createTitledBorder("Spotlights"));
spot.add(makeButton("Re-roll Season Event", e -> rerollSeasonEvent()));
spot.add(makeButton("Re-roll Boss Spotlight", e -> rerollBossSpotlight()));
spot.add(makeButton("Re-roll Event Spotlight", e -> rerollEventSpotlight()));
page.add(spot);
return page;
}
private JButton makeButton(String text, ActionListener al) {
JButton btn = new JButton(text);
btn.addActionListener(al);
return btn;
}
private void refreshPlayerList() {
playerListModel.clear();
for (Player p : World.getPlayers()) {
if (p != null) {
playerListModel.addElement(p.getDisplayName());
}
}
}
public String getUsernameInput() {
return textField.getText().trim();
}
public void ban() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
target.getSession().getChannel().close();
World.removePlayer(target);
JOptionPane.showMessageDialog(this, "BANNED PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void IPban() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
IPBanL.ban(target, true);
JOptionPane.showMessageDialog(this, "IP-BANNED PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void mute() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
target.setMuted(Utils.currentTimeMillis() + 48L * 3600 * 1000);
JOptionPane.showMessageDialog(this, "MUTED PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void jail() {
String name = getUsernameInput();
if (name.isEmpty()) {
JOptionPane.showMessageDialog(
this,
"Please select a player or type a username first.",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
Player target = World.getPlayerByDisplayName(name);
long jailUntil = Utils.currentTimeMillis() + 24L * 3600 * 1000;
if (target != null) {
target.setJailed(jailUntil);
target.getControlerManager().startControler("JailControler");
target.getPackets().sendGameMessage(
"You've been jailed for 24 hours by an Admin!"
);
try {
SerializableFilesManager.storeSerializableClass(target,
new File("data/characters/"
+ target.getUsername().replace(" ", "_") + ".p"));
} catch (Exception e) {
JOptionPane.showMessageDialog(this,
"Error saving data for " + name,
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
JOptionPane.showMessageDialog(this,
"JAILED ONLINE PLAYER: " + target.getDisplayName(),
"Control Panel",
JOptionPane.PLAIN_MESSAGE
);
} else {
File accFile = new File("data/characters/"
+ name.replace(" ", "_") + ".p");
Player offline;
try {
offline = (Player) SerializableFilesManager.loadSerializedFile(accFile);
} catch (Exception e) {
JOptionPane.showMessageDialog(this,
"Could not load file for " + name,
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
offline.setJailed(jailUntil);
try {
SerializableFilesManager.storeSerializableClass(offline, accFile);
} catch (Exception e) {
JOptionPane.showMessageDialog(this,
"Could not save updated data for " + name,
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
JOptionPane.showMessageDialog(this,
"JAILED OFFLINE PLAYER: " + name +
" (will be jailed for 24h on next login)",
"Control Panel",
JOptionPane.PLAIN_MESSAGE
);
}
}
public void kill() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
target.applyHit(new Hit(target, target.getHitpoints(), HitLook.REGULAR_DAMAGE));
target.stopAll();
JOptionPane.showMessageDialog(this, "KILLED PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void freeze() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
target.addFreezeDelay(Integer.MAX_VALUE);
JOptionPane.showMessageDialog(this, "FROZE PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void giveItem() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
int item = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM I.D.:"));
int amount = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM AMOUNT:"));
target.getInventory().addItem(item, amount);
JOptionPane.showMessageDialog(this, "GAVE ITEM " + item + " x" + amount + " TO " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void takeItem() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
int item = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM I.D.:"));
int amount = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM AMOUNT:"));
target.getInventory().deleteItem(item, amount);
JOptionPane.showMessageDialog(this, "REMOVED ITEM " + item + " x" + amount + " FROM " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void giveAll() {
int item = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM I.D.:"));
int amount = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM AMOUNT:"));
for (Player p : World.getPlayers()) {
if (p != null) {
p.getInventory().addItem(item, amount);
}
}
JOptionPane.showMessageDialog(this, "GAVE ITEM " + item + " x" + amount + " TO ALL PLAYERS", "Control Panel", JOptionPane.PLAIN_MESSAGE);
}
public void takeAll() {
int item = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM I.D.:"));
int amount = Integer.parseInt(JOptionPane.showInputDialog(this, "ITEM AMOUNT:"));
for (Player p : World.getPlayers()) {
if (p != null) {
p.getInventory().deleteItem(item, amount);
}
}
JOptionPane.showMessageDialog(this, "REMOVED ITEM " + item + " x" + amount + " FROM ALL PLAYERS", "Control Panel", JOptionPane.PLAIN_MESSAGE);
}
public void teleport() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
int x = Integer.parseInt(JOptionPane.showInputDialog(this, "COORDINATE X:"));
int y = Integer.parseInt(JOptionPane.showInputDialog(this, "COORDINATE Y:"));
int h = Integer.parseInt(JOptionPane.showInputDialog(this, "HEIGHT LEVEL:"));
Magic.sendNormalTeleportSpell(target, 0, 0, new WorldTile(x, y, h));
JOptionPane.showMessageDialog(this, "TELEPORTED PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void teleAll() {
int x = Integer.parseInt(JOptionPane.showInputDialog(this, "COORDINATE X:"));
int y = Integer.parseInt(JOptionPane.showInputDialog(this, "COORDINATE Y:"));
int h = Integer.parseInt(JOptionPane.showInputDialog(this, "HEIGHT LEVEL:"));
for (Player p : World.getPlayers()) {
if (p != null) {
Magic.sendNormalTeleportSpell(p, 0, 0, new WorldTile(x, y, h));
}
}
JOptionPane.showMessageDialog(this, "TELEPORTED ALL PLAYERS", "Control Panel", JOptionPane.PLAIN_MESSAGE);
}
public void sendHome() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
if (target.getControlerManager().getControler() != null) {
JOptionPane.showMessageDialog(this, "Target is busy, cannot send home.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
target.unlock();
target.getControlerManager().forceStop();
if (target.getNextWorldTile() == null) {
target.setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
}
JOptionPane.showMessageDialog(this, "Sent home: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void forceChat() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
String msg = JOptionPane.showInputDialog(this, "WHAT DO YOU WANT THE PLAYER TO SAY?");
if (msg != null) {
target.setNextForceTalk(new ForceTalk(msg));
JOptionPane.showMessageDialog(this, "FORCE TALK FOR: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void smite() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
target.setPrayerDelay(Integer.MAX_VALUE);
JOptionPane.showMessageDialog(this, "SMITE PLAYER: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void makeDance() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
target.setNextAnimation(new Animation(7071));
JOptionPane.showMessageDialog(this, "MADE PLAYER DANCE: " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
public void danceAll() {
for (Player p : World.getPlayers()) {
if (p != null) {
p.setNextAnimation(new Animation(7071));
}
}
JOptionPane.showMessageDialog(this, "ALL PLAYERS DANCING", "Control Panel", JOptionPane.PLAIN_MESSAGE);
}
public void shutdown() {
String delayStr = JOptionPane.showInputDialog(this, "SHUTDOWN DELAY?");
try {
int delay = Integer.parseInt(delayStr);
World.safeShutdown(false, delay);
JOptionPane.showMessageDialog(this, "SERVER WILL SHUTDOWN IN " + delay + " SECONDS", "Control Panel", JOptionPane.PLAIN_MESSAGE);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Invalid delay.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
private void maxPlayer() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
for (int i = 0; i < 25; i++) {
target.getSkills().setXp(i, 360000000);
}
JOptionPane.showMessageDialog(this, "Maxed all skills for " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
private void combatMaxPlayer() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
int[] combatSkills = {0,1,2,3,4,5,6,23};
for (int skill : combatSkills) {
target.getSkills().setXp(skill, 360000000);
}
JOptionPane.showMessageDialog(this, "Maxed combat skills for " + name, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
private void setRights() {
String name = getUsernameInput();
Player target = World.getPlayerByDisplayName(name);
if (target != null) {
String rightsStr = JOptionPane.showInputDialog(this, "Enter rights level:");
try {
int rights = Integer.parseInt(rightsStr);
target.setRights(rights);
target.getAppearence().generateAppearenceData();
JOptionPane.showMessageDialog(this, "Set rights for " + name + " to " + rights, "Control Panel", JOptionPane.PLAIN_MESSAGE);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Invalid rights level.", "Error", JOptionPane.ERROR_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(this, name + " does not exist.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
private void npcDropEventTokens() {
Settings.eventdropeventtokens = 15;
World.sendWorldMessage("<col=ff0000>[News] NPCs are dropping Event tokens for 30 minutes!", false);
Discord.sendEventsMessage("NPCs are dropping Event tokens for 30 minutes!");
}
private void doubleHits() {
Settings.eventdoublehits = 15;
World.sendWorldMessage("<col=ff0000>[News] All player hits against monsters are doubled for 30 minutes!", false);
Discord.sendEventsMessage("All player hits against monsters are doubled for 30 minutes!");
}
private void dropRateBoost() {
Settings.amountdonated = 25;
World.sendWorldMessage("<col=ff0000>[News] 30 minutes of 10% drop rate buff will activate shortly!", false);
Discord.sendEventsMessage("Drop rate has been increased for 30 minutes!");
}
private void doubleRaidsCaskets() {
Settings.eventdoublecaskets = 30;
World.sendWorldMessage("<col=ff0000>[News] All OSRS raids are rewarding double caskets for 60 minutes & unlimited party cap!", false);
Discord.sendEventsMessage("All OSRS raids are rewarding double caskets for 60 minutes & unlimited party cap!");
}
private void noDamagePvM() {
Settings.eventspotlightdouble = 15;
World.sendWorldMessage("<col=ff0000>[News] All players are protected against PvM damage for 30 minutes!", false);
Discord.sendEventsMessage("All players are protected against PvM damage for 30 minutes!");
}
private void doubleSkillingResources() {
Settings.eventdoubleskillingresources = 15;
World.sendWorldMessage("<col=ff0000>[News] All gathering skills will provide double resources for 30 minutes!", false);
Discord.sendEventsMessage("All gathering skills will provide double resources for 30 minutes!");
}
private void increaseBossPetChance() {
Settings.eventbosspetchance = 30;
World.sendWorldMessage("<col=ff0000>[News] All boss pets are twice as likely to drop for 60 minutes!", false);
Discord.sendEventsMessage("All boss pets are twice as likely to drop for 60 minutes!");
}
private void activateDoubleExp() {
Settings.DONATED_TO_WELL = 0;
Settings.WELLDOUBLE = true;
Settings.WELLTIMER = 120;
World.runWellTimer();
World.sendIconWorldMessage("<col=00ff00>Double xp is now active for 1 hour!", false);
Discord.sendEventsMessage("Double experience is active for 1 hour!");
}
private void doubleDrops() {
Settings.DOUBLEDROPS = !Settings.DOUBLEDROPS;
World.sendWorldMessage(Settings.DOUBLEDROPS
? "<col=00ff00><img=1>Double drops are now active!"
: "<col=ff0000><img=1>Double drops are now inactive!", false);
}
private void spawnPartyDemon() {
WorldTile tile = new WorldTile(3239, 9867, 0);
World.spawnNPC(15581, tile, -1, true, true);
Settings.canteletopdemon = true;
World.sendWorldMessage("<col=00ff00> The Party Demon has arrived!</col>", false);
Discord.sendEventsMessage("Party demon has spawned! Come join in!");
}
private void restockShops() {
ShopsHandler.loadUnpackedShops();
World.sendWorldMessage("<col=00ff00>An Admin has just restocked all shops!</col>", false);
}
private void giveSquealSpins() {
for (Player p : World.getPlayers()) {
if (p != null) {
p.spins += 2;
p.sendMessage("<col=00ff00>An Admin has given you two free spins!");
}
}
}
private void giveDeathtouchedDart() {
for (Player p : World.getPlayers()) {
if (p != null) {
p.getBank().addItem(25202, 1, true);
p.sendMessage("<col=00ff00>An Admin has added a Deathtouched dart to your bank!");
}
}
}
private void giveEliteCrystalKey() {
for (Player p : World.getPlayers()) {
if (p != null) {
p.getBank().addItem(29425, 1, true);
p.sendMessage("<col=00ff00>An Admin has added an Elite crystal key to your bank!");
}
}
}
private void giveMysteryChest() {
for (Player p : World.getPlayers()) {
if (p != null) {
p.getBank().addItem(29426, 1, true);
p.sendMessage("<col=00ff00>An Admin has added a Mystery chest to your bank!");
}
}
}
private void giveClueScroll() {
for (Player p : World.getPlayers()) {
if (p != null) {
p.getBank().addItem(2677, 1, true);
p.sendMessage("<col=00ff00>An Admin has added a Clue scroll to your bank!");
}
}
}
private void rerollSeasonEvent() {
SeasonEvent.GrabEvent();
}
private void rerollBossSpotlight() {
BossSpotlight.GrabBoss();
}
private void rerollEventSpotlight() {
EventSpotlight.GrabEvent();
}
}
Media:



Edit: If you don't use the Discord parts of the src, comment out:
import com.discord.Discord;
and any line that starts with:
Discord.sendEventsMessage
This is far from perfect, but it should prove much more useful than what it comes with.
Last edited: