@@ -0,0 +1,16 @@
|
|||||||
|
package net.runelite.client.plugins.locationchatter;
|
||||||
|
|
||||||
|
import net.runelite.client.config.Config;
|
||||||
|
import net.runelite.client.config.ConfigGroup;
|
||||||
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
import net.runelite.client.config.Keybind;
|
||||||
|
|
||||||
|
@ConfigGroup("locationchatter")
|
||||||
|
public interface LocationChatterConfig extends Config
|
||||||
|
{
|
||||||
|
@ConfigItem(keyName = "keybind", name = "Send to CC", description = "Configure button to send current location to CC")
|
||||||
|
default Keybind keybind()
|
||||||
|
{
|
||||||
|
return Keybind.NOT_SET;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
package net.runelite.client.plugins.locationchatter;
|
||||||
|
|
||||||
|
import com.google.inject.Provides;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.runelite.api.Client;
|
||||||
|
import net.runelite.api.ScriptID;
|
||||||
|
import net.runelite.api.VarClientStr;
|
||||||
|
import net.runelite.api.events.GameTick;
|
||||||
|
import net.runelite.api.events.VarClientStrChanged;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
|
import net.runelite.client.callback.ClientThread;
|
||||||
|
import net.runelite.client.config.ConfigManager;
|
||||||
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
|
import net.runelite.client.input.KeyManager;
|
||||||
|
import net.runelite.client.plugins.Plugin;
|
||||||
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
|
import net.runelite.client.plugins.PluginManager;
|
||||||
|
import net.runelite.client.plugins.PluginType;
|
||||||
|
import net.runelite.client.plugins.wildernesslocations.WildernessLocationsPlugin;
|
||||||
|
import net.runelite.client.util.HotkeyListener;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@PluginDescriptor(
|
||||||
|
name = "Location Chatter",
|
||||||
|
tags = {"location", "exilent", "pklite", "spammer"},
|
||||||
|
type = PluginType.UTILITY
|
||||||
|
)
|
||||||
|
public class LocationChatterPlugin extends Plugin
|
||||||
|
{
|
||||||
|
@Inject
|
||||||
|
private Client client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ClientThread clientThread;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
LocationChatterConfig config;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private KeyManager keyManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private PluginManager pluginManager;
|
||||||
|
|
||||||
|
private WildernessLocationsPlugin wildyLocsPlugin;
|
||||||
|
|
||||||
|
private String oldChat = "";
|
||||||
|
private int currentCooldown = 0;
|
||||||
|
private final int COOLDOWN_TICKS = 30;
|
||||||
|
|
||||||
|
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.keybind())
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void hotkeyPressed()
|
||||||
|
{
|
||||||
|
sendLocToCC();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startUp()
|
||||||
|
{
|
||||||
|
for (Plugin pl : pluginManager.getPlugins())
|
||||||
|
{
|
||||||
|
if (pl instanceof WildernessLocationsPlugin)
|
||||||
|
{
|
||||||
|
wildyLocsPlugin = (WildernessLocationsPlugin) pl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
keyManager.registerKeyListener(hotkeyListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void shutDown()
|
||||||
|
{
|
||||||
|
keyManager.unregisterKeyListener(hotkeyListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
LocationChatterConfig getConfig(ConfigManager configManager)
|
||||||
|
{
|
||||||
|
return configManager.getConfig(LocationChatterConfig.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onGameTick(GameTick tickEvent)
|
||||||
|
{
|
||||||
|
if (currentCooldown != 0)
|
||||||
|
{
|
||||||
|
currentCooldown--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onVarClientStrChanged(VarClientStrChanged varClient)
|
||||||
|
{
|
||||||
|
String newChat = client.getVar(VarClientStr.CHATBOX_TYPED_TEXT);
|
||||||
|
if (varClient.getIndex() == VarClientStr.CHATBOX_TYPED_TEXT.getIndex() && !newChat.equals(oldChat))
|
||||||
|
{
|
||||||
|
oldChat = newChat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean inClanChat()
|
||||||
|
{
|
||||||
|
return client.getWidget(WidgetInfo.CLAN_CHAT_TITLE) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendMessage(String text)
|
||||||
|
{
|
||||||
|
int mode = 0;
|
||||||
|
if (inClanChat() && text.startsWith("/"))
|
||||||
|
{
|
||||||
|
mode = 2;
|
||||||
|
}
|
||||||
|
int finalMode = mode;
|
||||||
|
Runnable r = () ->
|
||||||
|
{
|
||||||
|
String cached = oldChat;
|
||||||
|
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, text);
|
||||||
|
client.runScript(ScriptID.CHATBOX_INPUT, finalMode, text);
|
||||||
|
oldChat = cached;
|
||||||
|
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, oldChat);
|
||||||
|
};
|
||||||
|
clientThread.invoke(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendLocToCC()
|
||||||
|
{
|
||||||
|
String location = wildyLocsPlugin.getLocationString();
|
||||||
|
if (location.equals(""))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sendMessage("/World: " + client.getWorld() + " Location: " + location);
|
||||||
|
currentCooldown = COOLDOWN_TICKS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.profiles;
|
package net.runelite.client.plugins.profiles;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.GridBagConstraints;
|
import java.awt.GridBagConstraints;
|
||||||
import java.awt.GridBagLayout;
|
import java.awt.GridBagLayout;
|
||||||
@@ -56,6 +57,7 @@ import javax.swing.border.EmptyBorder;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.client.ui.ColorScheme;
|
import net.runelite.client.ui.ColorScheme;
|
||||||
|
import net.runelite.client.ui.FontManager;
|
||||||
import net.runelite.client.ui.PluginPanel;
|
import net.runelite.client.ui.PluginPanel;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -67,7 +69,12 @@ class ProfilesPanel extends PluginPanel
|
|||||||
private static final String ACCOUNT_USERNAME = "Account Username";
|
private static final String ACCOUNT_USERNAME = "Account Username";
|
||||||
private static final String ACCOUNT_LABEL = "Account Label";
|
private static final String ACCOUNT_LABEL = "Account Label";
|
||||||
private static final String PASSWORD_LABEL = "Account Password";
|
private static final String PASSWORD_LABEL = "Account Password";
|
||||||
|
private static final String HELP = "To add and load accounts, first enter a password into the Encryption Password " +
|
||||||
|
"field then press Load Accounts. You can now add as many accounts as you would like. The next time you restart" +
|
||||||
|
" PKLite, enter your encryption password and click load accounts to see the accounts you entered";
|
||||||
private static final Dimension PREFERRED_SIZE = new Dimension(PluginPanel.PANEL_WIDTH - 20, 30);
|
private static final Dimension PREFERRED_SIZE = new Dimension(PluginPanel.PANEL_WIDTH - 20, 30);
|
||||||
|
private static final Dimension HELP_PREFERRED_SIZE = new Dimension(PluginPanel.PANEL_WIDTH - 20, 130);
|
||||||
|
|
||||||
private static final Dimension MINIMUM_SIZE = new Dimension(0, 30);
|
private static final Dimension MINIMUM_SIZE = new Dimension(0, 30);
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
@@ -79,6 +86,7 @@ class ProfilesPanel extends PluginPanel
|
|||||||
private final JPasswordField txtAccountLogin = new JPasswordField(ACCOUNT_USERNAME);
|
private final JPasswordField txtAccountLogin = new JPasswordField(ACCOUNT_USERNAME);
|
||||||
private final JPasswordField txtPasswordLogin = new JPasswordField(PASSWORD_LABEL);
|
private final JPasswordField txtPasswordLogin = new JPasswordField(PASSWORD_LABEL);
|
||||||
private final JPanel profilesPanel = new JPanel();
|
private final JPanel profilesPanel = new JPanel();
|
||||||
|
private final JPanel helpPanel = new JPanel(new BorderLayout());
|
||||||
private GridBagConstraints c;
|
private GridBagConstraints c;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -100,6 +108,18 @@ class ProfilesPanel extends PluginPanel
|
|||||||
c.weighty = 0;
|
c.weighty = 0;
|
||||||
c.insets = new Insets(0, 0, 4, 0);
|
c.insets = new Insets(0, 0, 4, 0);
|
||||||
|
|
||||||
|
helpPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
||||||
|
JLabel helpLabel = new JLabel("<html> <p>" + HELP + "</p></html>");
|
||||||
|
helpLabel.setFont(FontManager.getRunescapeSmallFont());
|
||||||
|
helpPanel.setPreferredSize(HELP_PREFERRED_SIZE);
|
||||||
|
//helpPanel.setSize(MINIMUM_SIZE);
|
||||||
|
helpPanel.add(helpLabel, BorderLayout.NORTH);
|
||||||
|
|
||||||
|
add(helpPanel);
|
||||||
|
c.gridy = c.gridy + 3;
|
||||||
|
c.gridy++;
|
||||||
|
|
||||||
|
|
||||||
txtDecryptPassword.setEchoChar((char) 0);
|
txtDecryptPassword.setEchoChar((char) 0);
|
||||||
txtDecryptPassword.setPreferredSize(PREFERRED_SIZE);
|
txtDecryptPassword.setPreferredSize(PREFERRED_SIZE);
|
||||||
txtDecryptPassword.setForeground(ColorScheme.MEDIUM_GRAY_COLOR);
|
txtDecryptPassword.setForeground(ColorScheme.MEDIUM_GRAY_COLOR);
|
||||||
@@ -434,7 +454,9 @@ class ProfilesPanel extends PluginPanel
|
|||||||
{
|
{
|
||||||
setProfileData(
|
setProfileData(
|
||||||
getProfileData().replaceAll(data + "\\n", ""));
|
getProfileData().replaceAll(data + "\\n", ""));
|
||||||
redrawProfiles();
|
revalidate();
|
||||||
|
repaint();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSalt(byte[] bytes)
|
void setSalt(byte[] bytes)
|
||||||
|
|||||||
@@ -88,18 +88,6 @@ public interface PvpToolsConfig extends Config
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "attackOptionsHotkey",
|
|
||||||
name = "Attack Option Hotkey",
|
|
||||||
description = "Enables a hotkey for attack options to disable or enable hiding quickly",
|
|
||||||
position = 10,
|
|
||||||
group = "Right-Click Attack Options"
|
|
||||||
)
|
|
||||||
default Keybind attackOptionsHotkey()
|
|
||||||
{
|
|
||||||
return Keybind.CTRL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "levelRangeAttackOptions",
|
keyName = "levelRangeAttackOptions",
|
||||||
name = "Moves Other Attack Options",
|
name = "Moves Other Attack Options",
|
||||||
|
|||||||
@@ -166,25 +166,6 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private final HotkeyListener attackOptionsHotKeyListener = new HotkeyListener(() -> config.attackOptionsHotkey())
|
|
||||||
{
|
|
||||||
long lastPress = 0;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void keyPressed(KeyEvent e)
|
|
||||||
{
|
|
||||||
attackHotKeyPressed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void keyReleased(KeyEvent e)
|
|
||||||
{
|
|
||||||
attackHotKeyPressed = (System.currentTimeMillis() - lastPress) < 800;
|
|
||||||
lastPress = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private int[] overheadCount = new int[]{0, 0, 0};
|
private int[] overheadCount = new int[]{0, 0, 0};
|
||||||
|
|
||||||
private Comparator<Item> itemPriceComparator = new Comparator<Item>()
|
private Comparator<Item> itemPriceComparator = new Comparator<Item>()
|
||||||
@@ -196,6 +177,7 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
- itemManager.getItemPrice(itemManager.getItemComposition(o2.getId()).getPrice()));
|
- itemManager.getItemPrice(itemManager.getItemComposition(o2.getId()).getPrice()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private String mtarget;
|
private String mtarget;
|
||||||
|
|
||||||
public List getMissingMembers()
|
public List getMissingMembers()
|
||||||
@@ -280,8 +262,6 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
clientToolbar.addNavigation(navButton);
|
clientToolbar.addNavigation(navButton);
|
||||||
|
|
||||||
|
|
||||||
keyManager.registerKeyListener(attackOptionsHotKeyListener);
|
|
||||||
|
|
||||||
if (config.missingPlayersEnabled())
|
if (config.missingPlayersEnabled())
|
||||||
{
|
{
|
||||||
panel.missingPlayers.setVisible(true);
|
panel.missingPlayers.setVisible(true);
|
||||||
@@ -298,7 +278,6 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
overlayManager.remove(pvpToolsOverlay);
|
overlayManager.remove(pvpToolsOverlay);
|
||||||
keyManager.unregisterKeyListener(hotkeyListener);
|
keyManager.unregisterKeyListener(hotkeyListener);
|
||||||
keyManager.unregisterKeyListener(attackOptionsHotKeyListener);
|
|
||||||
clientToolbar.removeNavigation(navButton);
|
clientToolbar.removeNavigation(navButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,8 +391,6 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
||||||
{
|
{
|
||||||
if (!attackHotKeyPressed)
|
|
||||||
{
|
|
||||||
if (config.attackOptionsFriend() || config.attackOptionsClan() || config.levelRangeAttackOptions())
|
if (config.attackOptionsFriend() || config.attackOptionsClan() || config.levelRangeAttackOptions())
|
||||||
{
|
{
|
||||||
if (client.getGameState() != GameState.LOGGED_IN)
|
if (client.getGameState() != GameState.LOGGED_IN)
|
||||||
@@ -450,10 +427,8 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void moveEntry(String mtarget)
|
private void moveEntry(String mtarget)
|
||||||
{
|
{
|
||||||
this.mtarget = mtarget;
|
this.mtarget = mtarget;
|
||||||
|
|||||||
@@ -1,130 +1,136 @@
|
|||||||
|
|
||||||
package net.runelite.client.plugins.wildernesslocations;
|
package net.runelite.client.plugins.wildernesslocations;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Player;
|
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.coords.WorldArea;
|
import net.runelite.api.coords.WorldArea;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
|
||||||
import net.runelite.client.plugins.PluginType;
|
import net.runelite.client.plugins.PluginType;
|
||||||
import net.runelite.client.plugins.wildernesslocations.WildernessLocationsOverlay;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
import net.runelite.client.util.WildernessLocation;
|
import net.runelite.client.util.WildernessLocation;
|
||||||
|
|
||||||
@PluginDescriptor(name="PvP Wild Locations",
|
@PluginDescriptor(
|
||||||
description="Indicates the players current location in the wild",
|
name = "Wild Locations",
|
||||||
tags={"Wildy,", "Wilderness Location", "location", "loc", "pvp", "pklite"},
|
description = "Indicates the players current location in the wild",
|
||||||
type = PluginType.PVP
|
tags = {"Wildy", "Wilderness Location", "location", "loc", "pvp", "pklite"},
|
||||||
|
type = PluginType.PVP
|
||||||
)
|
)
|
||||||
|
public class WildernessLocationsPlugin extends Plugin
|
||||||
|
{
|
||||||
|
|
||||||
public class WildernessLocationsPlugin extends Plugin {
|
@Inject
|
||||||
@Inject
|
private Client client;
|
||||||
private Client client;
|
|
||||||
@Inject
|
|
||||||
OverlayManager overlayManager;
|
|
||||||
@Inject
|
|
||||||
private WildernessLocationsOverlay overlay;
|
|
||||||
private final HashMap<WorldArea, String> wildLocs;
|
|
||||||
private boolean renderLocation;
|
|
||||||
private String locationString;
|
|
||||||
private WorldPoint worldPoint;
|
|
||||||
private static int UPDATE_INTERVAL = 3;
|
|
||||||
|
|
||||||
public WildernessLocationsPlugin() {
|
@Inject
|
||||||
overlay = new WildernessLocationsOverlay(client, this);
|
OverlayManager overlayManager;
|
||||||
wildLocs = WildernessLocationsPlugin.getLocationMap();
|
|
||||||
locationString = "";
|
|
||||||
worldPoint = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Inject
|
||||||
protected void startUp() throws Exception {
|
private WildernessLocationsOverlay overlay = new WildernessLocationsOverlay(this.client, this);
|
||||||
overlayManager.add(overlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private final HashMap<WorldArea, String> wildLocs = getLocationMap();
|
||||||
protected void shutDown() throws Exception {
|
@Getter
|
||||||
overlayManager.add(overlay);
|
private boolean renderLocation;
|
||||||
}
|
@Getter
|
||||||
|
private String locationString = "";
|
||||||
|
private WorldPoint worldPoint = null;
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGameTick(GameTick event) {
|
|
||||||
if (UPDATE_INTERVAL > 0) {
|
|
||||||
--UPDATE_INTERVAL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean bl = renderLocation = client.getVar(Varbits.IN_WILDERNESS) == 1;
|
|
||||||
if (renderLocation) {
|
|
||||||
if (client.getLocalPlayer().getWorldLocation() != worldPoint) {
|
|
||||||
locationString = location();
|
|
||||||
worldPoint = client.getLocalPlayer().getWorldLocation();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
worldPoint = null;
|
|
||||||
locationString = "";
|
|
||||||
}
|
|
||||||
UPDATE_INTERVAL = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String location() {
|
@Override
|
||||||
int dist = 10000;
|
protected void startUp() throws Exception
|
||||||
String s = "";
|
{
|
||||||
WorldArea closestArea = null;
|
overlayManager.add(overlay);
|
||||||
for (Map.Entry<WorldArea, String> entry : wildLocs.entrySet()) {
|
}
|
||||||
WorldArea worldArea = entry.getKey();
|
|
||||||
if (worldArea.toWorldPointList().contains(client.getLocalPlayer().getWorldLocation())) {
|
|
||||||
s = entry.getValue();
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
int distTo = worldArea.distanceTo(client.getLocalPlayer().getWorldLocation());
|
|
||||||
if (distTo >= dist) continue;
|
|
||||||
dist = distTo;
|
|
||||||
closestArea = worldArea;
|
|
||||||
}
|
|
||||||
if (client.getLocalPlayer().getWorldLocation().getY() > ((WorldArea)Objects.requireNonNull(closestArea)).toWorldPoint().getY() + closestArea.getHeight()) {
|
|
||||||
s = s + "N";
|
|
||||||
}
|
|
||||||
if (client.getLocalPlayer().getWorldLocation().getY() < closestArea.toWorldPoint().getY()) {
|
|
||||||
s = s + "S";
|
|
||||||
}
|
|
||||||
if (client.getLocalPlayer().getWorldLocation().getX() < closestArea.toWorldPoint().getX()) {
|
|
||||||
s = s + "W";
|
|
||||||
}
|
|
||||||
if (client.getLocalPlayer().getWorldLocation().getX() > closestArea.toWorldPoint().getX() + closestArea.getWidth()) {
|
|
||||||
s = s + "E";
|
|
||||||
}
|
|
||||||
s = s + " of ";
|
|
||||||
if ((s = s + wildLocs.get(closestArea)).startsWith(" of ")) {
|
|
||||||
s = s.substring(3);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static HashMap<WorldArea, String> getLocationMap() {
|
@Override
|
||||||
HashMap<WorldArea, String> hashMap = new HashMap<WorldArea, String>();
|
protected void shutDown() throws Exception
|
||||||
Arrays.stream(WildernessLocation.values()).forEach(wildernessLocation -> hashMap.put(wildernessLocation.getWorldArea(), wildernessLocation.getName()));
|
{
|
||||||
return hashMap;
|
overlayManager.remove(overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRenderLocation() {
|
@Subscribe
|
||||||
return renderLocation;
|
public void onGameTick(GameTick event)
|
||||||
}
|
{
|
||||||
|
renderLocation = client.getVar(Varbits.IN_WILDERNESS) == 1;
|
||||||
|
if (renderLocation)
|
||||||
|
{
|
||||||
|
if (client.getLocalPlayer().getWorldLocation() != worldPoint)
|
||||||
|
{
|
||||||
|
locationString = location();
|
||||||
|
worldPoint = client.getLocalPlayer().getWorldLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
worldPoint = null;
|
||||||
|
locationString = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getLocationString() {
|
|
||||||
return locationString;
|
private String location()
|
||||||
}
|
{
|
||||||
|
int dist = 10000;
|
||||||
|
String s = "";
|
||||||
|
WorldArea closestArea = null;
|
||||||
|
for (Map.Entry<WorldArea, String> entry : wildLocs.entrySet())
|
||||||
|
{
|
||||||
|
WorldArea worldArea = entry.getKey();
|
||||||
|
|
||||||
|
if (worldArea.toWorldPointList().contains(client.getLocalPlayer().getWorldLocation()))
|
||||||
|
{
|
||||||
|
s = entry.getValue();
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
int distTo = worldArea.distanceTo(client.getLocalPlayer().getWorldLocation());
|
||||||
|
if (distTo < dist)
|
||||||
|
{
|
||||||
|
dist = distTo;
|
||||||
|
closestArea = worldArea;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (client.getLocalPlayer().getWorldLocation().getY() >
|
||||||
|
(Objects.requireNonNull(closestArea).toWorldPoint().getY() + closestArea.getHeight()))
|
||||||
|
{
|
||||||
|
s = s + "N";
|
||||||
|
}
|
||||||
|
if (client.getLocalPlayer().getWorldLocation().getY() < closestArea.toWorldPoint().getY())
|
||||||
|
{
|
||||||
|
s = s + "S";
|
||||||
|
}
|
||||||
|
if (client.getLocalPlayer().getWorldLocation().getX() < closestArea.toWorldPoint().getX())
|
||||||
|
{
|
||||||
|
s = s + "W";
|
||||||
|
}
|
||||||
|
if (client.getLocalPlayer().getWorldLocation().getX() >
|
||||||
|
(closestArea.toWorldPoint().getX() + closestArea.getWidth()))
|
||||||
|
{
|
||||||
|
s = s + "E";
|
||||||
|
}
|
||||||
|
s = s + " of ";
|
||||||
|
s = s + wildLocs.get(closestArea);
|
||||||
|
if (s.startsWith(" of "))
|
||||||
|
{
|
||||||
|
s = s.substring(3);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static HashMap<WorldArea, String> getLocationMap()
|
||||||
|
{
|
||||||
|
HashMap<WorldArea, String> hashMap = new HashMap<>();
|
||||||
|
Arrays.stream(WildernessLocation.values()).forEach(wildernessLocation ->
|
||||||
|
hashMap.put(wildernessLocation.getWorldArea(), wildernessLocation.getName()));
|
||||||
|
return hashMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user