committed by
Tomas Slusny
parent
fe3cf40f2d
commit
7a98b4ed55
@@ -408,6 +408,11 @@ public enum Varbits
|
|||||||
*/
|
*/
|
||||||
ACCOUNT_TYPE(1777),
|
ACCOUNT_TYPE(1777),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The varbit that stores the oxygen percentage for player
|
||||||
|
*/
|
||||||
|
OXYGEN_LEVEL(5811),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Corp beast damage
|
* Corp beast damage
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -96,4 +96,16 @@ public interface IdleNotifierConfig extends Config
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "oxygen",
|
||||||
|
name = "Oxygen Notification Threshold",
|
||||||
|
position = 7,
|
||||||
|
description = "The amount of remaining oxygen to send a notification at. A value of 0 will disable notification."
|
||||||
|
)
|
||||||
|
default int getOxygenThreshold()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
private Actor lastInteract;
|
private Actor lastInteract;
|
||||||
private boolean notifyHitpoints = true;
|
private boolean notifyHitpoints = true;
|
||||||
private boolean notifyPrayer = true;
|
private boolean notifyPrayer = true;
|
||||||
|
private boolean notifyOxygen = true;
|
||||||
private boolean notifyIdleLogout = true;
|
private boolean notifyIdleLogout = true;
|
||||||
private boolean notify6HourLogout = true;
|
private boolean notify6HourLogout = true;
|
||||||
private int lastCombatCountdown = 0;
|
private int lastCombatCountdown = 0;
|
||||||
@@ -345,6 +346,32 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
notifier.notify("[" + local.getName() + "] has low prayer!");
|
notifier.notify("[" + local.getName() + "] has low prayer!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (checkLowOxygen())
|
||||||
|
{
|
||||||
|
notifier.notify("[" + local.getName() + "] has low oxygen!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkLowOxygen()
|
||||||
|
{
|
||||||
|
if (config.getOxygenThreshold() == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (config.getOxygenThreshold() >= client.getVar(Varbits.OXYGEN_LEVEL) * 0.1)
|
||||||
|
{
|
||||||
|
if (!notifyOxygen)
|
||||||
|
{
|
||||||
|
notifyOxygen = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
notifyOxygen = false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkLowHitpoints()
|
private boolean checkLowHitpoints()
|
||||||
|
|||||||
Reference in New Issue
Block a user