hreyvirtue Posted December 4, 2018 Share Posted December 4, 2018 I'm trying to make a flax bot, but it just refuses to acknowledge the "would you like to spin" widget on screen; the code: RS2Widget wouldyouliketospin = getWidgets().getWidgetContainingText("spin"); //spin RS2Widget spin= getWidgets().get(270, 5); if (getInventory().contains("Flax")) { //Does inventory contain flax? if (!Wheel_Area.contains(myPlayer())) { //Are we near the Spinning Wheel? log("In wheel area"); if (wheel != null) { //Is the Spinning Wheel in clickable distance? wheel.interact("Spin"); //Spin boy new ConditionalSleep(5000){ @Override public boolean condition(){ return myPlayer().isAnimating() || !wheel.exists(); } }.sleep(); log("Beginning to spin flax"); if (spin != null) { //Choose Bowstring this.getKeyboard().typeKey('3'); log("Spinning flax"); } else { log("I broke"); All it does is return "I broke"; what am I doing wrong? I've tried putting in the widget id for the bowstring button as well, with no success Thanks for your help Ignore my awful coding btw thx Quote Link to comment Share on other sites More sharing options...
Mysteryy Posted December 4, 2018 Share Posted December 4, 2018 Are you sure you have the right id? Also, why do you have "RS2Widget wouldyouliketospin" but not use that instead? Quote Link to comment Share on other sites More sharing options...
hreyvirtue Posted December 4, 2018 Author Share Posted December 4, 2018 (edited) On 12/4/2018 at 2:50 PM, Mysteryy said: Are you sure you have the right id? Also, why do you have "RS2Widget wouldyouliketospin" but not use that instead? Expand It was my first option, but didn't work so I tried the other way. is this the wrong one? And i've tried 270,16 (white border around bow string) to no avail Edited December 4, 2018 by hreyvirtue Quote Link to comment Share on other sites More sharing options...
Mysteryy Posted December 4, 2018 Share Posted December 4, 2018 On 12/4/2018 at 2:58 PM, hreyvirtue said: It was my first option, but didn't work so I tried the other way. is this the wrong one? And i've tried 270,16 (white border around bow string) to no avail Expand Well I'm at work at the moment, so I cant really try anything. But you might try like: RS2Widget spin = getWidgets().getWidgetContainingText(270, "What would you like to spin?"); //spin 1 Quote Link to comment Share on other sites More sharing options...
hreyvirtue Posted December 4, 2018 Author Share Posted December 4, 2018 On 12/4/2018 at 3:07 PM, Mysteryy said: Well I'm at work at the moment, so I cant really try anything. But you might try like: RS2Widget spin = getWidgets().getWidgetContainingText(270, "What would you like to spin?"); //spin Expand That worked, thank you so much :3 Quote Link to comment Share on other sites More sharing options...
Mysteryy Posted December 4, 2018 Share Posted December 4, 2018 (edited) On 12/4/2018 at 3:10 PM, hreyvirtue said: That worked, thank you so much :3 Expand Yea also, try using 270, 3 instead of 270, 5. Let me know if that works, just curious now. Edit: I told pat (because I also saw this same problem the other day). For me I used the same thing that I suggested to you and it worked. He took a look and said that getWidgetContainingText(text) ignores chatbox. Its probably to avoid falsely matching text if a user says something. Like if a user says a message with the word "spin" in it, it would match that message when really you wanted the spinning widget, not a message from some random user where they said the word "spin". Edited December 4, 2018 by Mysteryy Quote Link to comment Share on other sites More sharing options...
hreyvirtue Posted December 4, 2018 Author Share Posted December 4, 2018 On 12/4/2018 at 3:10 PM, Mysteryy said: Yea also, try using 270, 3 instead of 270, 5. Let me know if that works, just curious now. Expand 270, 3 didn't work On 12/4/2018 at 3:25 PM, Malcolm said: You don't even need to have the child widget here as you're using the keyboard to interact with the widget. so as long as widget 270 is visible you can just type 3. Expand Oooh, I see Thanks Quote Link to comment Share on other sites More sharing options...
Mysteryy Posted December 4, 2018 Share Posted December 4, 2018 On 12/4/2018 at 3:25 PM, Malcolm said: You don't even need to have the child widget here as you're using the keyboard to interact with the widget. so as long as widget 270 is visible you can just type 3. Expand On 12/4/2018 at 3:26 PM, hreyvirtue said: 270, 3 didn't work Oooh, I see Thanks Expand Probably still want to make sure that the correct text is present. Quote Link to comment Share on other sites More sharing options...