MarWo22 Posted March 30, 2018 Share Posted March 30, 2018 Im trying to make a script where it takes stamina potions every two minutes. I've come up with this but it doesnt work. It keeps drinking the potions. Any idea why? public static long staminaPotionIntake = 0; public static long staminaPotionDuration = System.currentTimeMillis() - staminaPotionIntake; public static String[] staminaNames = {"Stamina potion(4)", "Stamina potion(3)", "Stamina potion(2)", "Stamina potion(1)"}; public Banking(Script sI) throws InterruptedException { if(staminaPotionDuration > 120000) { if(sI.getInventory().contains(staminaNames)) { sI.getInventory().interact("Drink", staminaNames); staminaPotionIntake = System.currentTimeMillis(); } } Quote Link to comment Share on other sites More sharing options...
kazemaru Posted March 30, 2018 Share Posted March 30, 2018 just use autoclicker? Quote Link to comment Share on other sites More sharing options...
Fruity Posted March 30, 2018 Share Posted March 30, 2018 (edited) looks as though you're checking the duration once oustside the method so only ever updated once? Also you can check if stamina potion is active via configs: public boolean isStaminaPotionActive() { return getConfigs().get(638) > 0; } Edited March 30, 2018 by Fruity 1 Quote Link to comment Share on other sites More sharing options...
Valid Posted February 28, 2020 Share Posted February 28, 2020 On 3/30/2018 at 10:02 PM, Fruity said: looks as though you're checking the duration once oustside the method so only ever updated once? Also you can check if stamina potion is active via configs: public boolean isStaminaPotionActive() { return getConfigs().get(638) > 0; } Thanks Big Boss. For those wondering, config changed to: 1575. Following code works as of date: public boolean isStaminaPotionActive() { return getConfigs().get(1575) > 0; } Quote Link to comment Share on other sites More sharing options...