Bigpoppa21 Posted January 28, 2015 Posted January 28, 2015 case SPIN: if (!player.isAnimating()){ if (SPIN_AREA.contains(player) && (inventory.contains("Flax"))){ objects.closest("Spinning wheel").interact("Spin"); sleep(random(200,600)); Inter.interactWithChild(459, 91, "Make X"); sleep(random(1000, 1500)); RS2Interface Inter = interfaces.get(118); if (Inter.getMessage(118) != null){ keyboard.typeString("99"); sleep(random(2000,4000)); }else{ sleep(random(60000, 62000)); } } } break; Why does my bot keep clicking on the spinning wheel even when it starts to spin flax? I tried making it sleep(random(60000, 62000)) but that didn't work...
Mysteryy Posted January 28, 2015 Posted January 28, 2015 (edited) case SPIN: if (!player.isAnimating()){ if (SPIN_AREA.contains(player) && (inventory.contains("Flax"))){ objects.closest("Spinning wheel").interact("Spin"); sleep(random(200,600)); Inter.interactWithChild(459, 91, "Make X"); sleep(random(1000, 1500)); RS2Interface Inter = interfaces.get(118); if (Inter.getMessage(118) != null){ keyboard.typeString("99"); sleep(random(2000,4000)); }else{ sleep(random(60000, 62000)); } } } break; Jesus i cant read OP Holy crap your sleeping for a minute l0l Edited January 28, 2015 by Mysteryy
Bigpoppa21 Posted January 28, 2015 Author Posted January 28, 2015 Lmao, I'm still learning! cut me some slack! How else could I make the bot stop clicking?
Joseph Posted January 28, 2015 Posted January 28, 2015 Lmao, I'm still learning! cut me some slack! How else could I make the bot stop clicking? i know your pain. You should use some logic and a timer to help yo determine when you should spin.
FrostBug Posted January 31, 2015 Posted January 31, 2015 (edited) Not getting any exceptions ? Inter.interactWithChild(459, 91, "Make X"); ^ Are you certain that 'Inter' is not null at this point? Furthermore, when you call getMessage(118) on the interface, you're basically saying that both the parent and child interfaces have the same ID of 118. Are you certain that this is the case? Edited January 31, 2015 by FrostBug
liverare Posted February 1, 2015 Posted February 1, 2015 // You should be checking you have flax to help redirect the programme to this case case SPIN: { // Check area first, and if true, assert objects valid if (SPIN_AREA.contains(player) && !player.isAnimating()) { // Declare the vars you want to discover RS2Object spinningWheel = objects.closest("Spinning wheel"); RS2InterfaceChild interfaceChild = interfaces.get(459, 91); RS2Interface xAmount = interfaces.get(118); // Check each of them and act accordingly if (xAmount != null) { // Last result first keyboard.typeString("99"); } else if (interfaceChild != null) { interfaceChild.interact("Make X"); } else if (spinningWheel != null && spinningWheel.exists()) { spinningWheel.interact("Spin"); } else { //niqqua youu dun fuked up! } } }
Joseph Posted February 1, 2015 Posted February 1, 2015 What you guys don't understand is that spinning flax is like cooking food. You animate for a sec then stop for two seconds. I'm not sure why it doesn't sleep for a whole minute. like I said use a timer it will help 1
Mysteryy Posted February 1, 2015 Posted February 1, 2015 What you guys don't understand is that spinning flax is like cooking food. You animate for a sec then stop for two seconds. I'm not sure why it doesn't sleep for a whole minute. like I said use a timer it will help Yea in my scripts I have a multithreaded animation listener. At any time I can get the time since the player last animated.
Joseph Posted February 1, 2015 Posted February 1, 2015 Yea in my scripts I have a multithreaded animation listener. At any time I can get the time since the player last animated. i would make a listener but im to lazy and i happ with my timer lol