Compare commits

..

3 Commits

Author SHA1 Message Date
2c015056fb Add releases 2022-01-22 12:09:59 +01:00
5c1991fb1a Fix weapon special usage 2022-01-22 12:09:39 +01:00
344ee6cb24 Re-add automatic start 2022-01-22 12:09:16 +01:00
5 changed files with 14 additions and 11 deletions

View File

@ -93,14 +93,14 @@ public class Birdhouse extends CScript implements KeyListener {
@SuppressWarnings("unused")
@Subscribe
private void onGameTick(GameTick event) {
// if (isLoggedIn()
// && game.localPlayer().position().regionID() == 14908) {
// if (!active && game.localPlayer().position().distanceTo(hillHousePosition) < 10 && game.inventory().withNamePart("logs").count() == 4) {
// execute();
// } else if (active && game.inventory().all().isEmpty() && !bank.isOpen() && game.localPlayer().position().distanceTo(islandPosition) < 10) {
// execute();
// }
// }
if (isLoggedIn()
&& game.localPlayer().position().regionID() == 14908) {
if (!active && game.localPlayer().position().distanceTo(hillHousePosition) < 10 && game.inventory().withNamePart("logs").count() == 4) {
execute();
} else if (active && game.inventory().all().isEmpty() && !bank.isOpen() && game.localPlayer().position().distanceTo(islandPosition) < 10) {
execute();
}
}
}
public boolean hasRecentlyBeenEmptied(BirdhouseSpace space) {

View File

@ -126,6 +126,7 @@ public class Consume extends Plugin implements KeyListener {
private boolean shouldDrinkMagic;
private long lastMagic;
private boolean shouldUseSpecial;
private long lastSpecial;
private boolean pkTeleport;
@SuppressWarnings("unused")
@ -179,7 +180,8 @@ public class Consume extends Plugin implements KeyListener {
if (config.useSpecial()
&& event.getIndex() == VarPlayer.SPECIAL_ATTACK_PERCENT.getId()
&& game.client().getVarpValue(VarPlayer.SPECIAL_ATTACK_PERCENT.getId()) > config.specialCost()) {
&& game.client().getVarpValue(VarPlayer.SPECIAL_ATTACK_PERCENT.getId()) / 10 >= config.specialCost()
&& lastSpecial + 2000 < System.currentTimeMillis()) {
shouldUseSpecial = true;
}
}
@ -281,8 +283,9 @@ public class Consume extends Plugin implements KeyListener {
if (shouldUseSpecial && game.client().getVarpValue(VarPlayer.SPECIAL_ATTACK_ENABLED.getId()) == 0) {
shouldUseSpecial = false;
lastSpecial = System.currentTimeMillis();
if (game.client().getVar(Varbits.PVP_SPEC_ORB) == 0) {
if (game.varb(Varbits.PVP_SPEC_ORB.getId()) == 0) {
iWidget special = game.widget(WidgetInfo.MINIMAP_SPEC_CLICKBOX);
if (special == null) return;
@ -400,7 +403,7 @@ public class Consume extends Plugin implements KeyListener {
private void onInteractingChanged(InteractingChanged event) {
if (!config.tpOnPlayerAttack() || !pkTeleport || game.client().getVar(Varbits.IN_WILDERNESS) == 0) return;
if (event.getSource() == null || event.getTarget() == null) return;
if (event.getSource() == null || event.getTarget() == null || event.getTarget().getName() == null) return;
if (event.getSource() instanceof Player && event.getTarget().equals(game.client().getLocalPlayer())) {
log.info("Player attacking us: " + event.getSource().getName());

Binary file not shown.

Binary file not shown.

Binary file not shown.