Broman Posted December 18, 2020 Share Posted December 18, 2020 Hi, ATM working with a fletching script. So far, so good. logs = scriptgui.getSelectedLogs(); types = scriptgui.getSelectedType(); toMake = String.valueOf(logs) + " " + String.valueOf(types); toUse = String.valueOf(logs) + " logs"; I am a bit unsure about this tho. logs and types are enums, toMake and toUse are strings. It works good, but if I wanted to fletch normal logs obviously it would not work. Any thoughts? Quote Link to comment Share on other sites More sharing options...
Gunman Posted December 18, 2020 Share Posted December 18, 2020 @Broman Why not just make them the full name and remove that + " logs" bit? ex Logs, Oak logs, etc. Quote Link to comment Share on other sites More sharing options...
Broman Posted December 18, 2020 Author Share Posted December 18, 2020 13 minutes ago, Gunman said: @Broman Why not just make them the full name and remove that + " logs" bit? ex Logs, Oak logs, etc. For more simple GUI. eg. User selects Willow logs as material, and wishes to make longbow (u) out of it. (Yew, WIllow or Maple as material, make longbows) If I wanted to, I could just let user select material and then select the respective item eg (Yew Logs, Yew longbow (u)) Quote Link to comment Share on other sites More sharing options...
Gunman Posted December 18, 2020 Share Posted December 18, 2020 17 minutes ago, Broman said: For more simple GUI. eg. User selects Willow logs as material, and wishes to make longbow (u) out of it. (Yew, WIllow or Maple as material, make longbows) If I wanted to, I could just let user select material and then select the respective item eg (Yew Logs, Yew longbow (u)) Are you talking like an AIO where it would have more than just logs to withdraw? Quote Link to comment Share on other sites More sharing options...
Broman Posted December 18, 2020 Author Share Posted December 18, 2020 8 minutes ago, Gunman said: Are you talking like an AIO where it would have more than just logs to withdraw? In the future yes. Currently I only support bows (u). Planning to release this as my first script, and I think that AIO Fletcher with support for bolts, darts etc should be a premium script. Also now that you are here, is the following a good way to interact with Widgets? if(getWidgets().interact(270, 16, 38, "Make")) { //conditionalSleeeep } Quote Link to comment Share on other sites More sharing options...
Gunman Posted December 18, 2020 Share Posted December 18, 2020 7 minutes ago, Broman said: In the future yes. Currently I only support bows (u). Planning to release this as my first script, and I think that AIO Fletcher with support for bolts, darts etc should be a premium script. Also now that you are here, is the following a good way to interact with Widgets? if(getWidgets().interact(270, 16, 38, "Make")) { //conditionalSleeeep } If you want that on the SDN I don't think that would be allowed with the child ids being used Quote Link to comment Share on other sites More sharing options...
Broman Posted December 18, 2020 Author Share Posted December 18, 2020 Just now, Gunman said: If you want that on the SDN I don't think that would be allowed with the child ids being used Okay, I will fix that. Would you suggest identifying widgets by sprites or text? Quote Link to comment Share on other sites More sharing options...
Gunman Posted December 18, 2020 Share Posted December 18, 2020 1 hour ago, Broman said: Okay, I will fix that. Would you suggest identifying widgets by sprites or text? Think they prefer text then sprite id. Quote Link to comment Share on other sites More sharing options...
Broman Posted December 18, 2020 Author Share Posted December 18, 2020 1 hour ago, Gunman said: Think they prefer text then sprite id. Okay. So I changed it. Is using item id's from Widget considered OK? I cant seem to find any unique sprites / text for this one. private RS2Widget getFletchingMenu() { List<RS2Widget> allWidgets = getWidgets().getAll(); RS2Widget storedWidget = allWidgets.stream().filter(w -> w.getWidth() == 62 && w.getHeight() == 62 && w.getItemId() == 62).findFirst().orElse(null); return storedWidget; } private boolean isVisible() { return getFletchingMenu() != null && getFletchingMenu().isVisible(); } Any feedback is welcome Quote Link to comment Share on other sites More sharing options...
Broman Posted December 19, 2020 Author Share Posted December 19, 2020 2 hours ago, Malcolm said: private RS2Widget getFletchingMenu() { final List<RS2Widget> allWidgets = getWidgets().getAll(); final RS2Widget storedWidget = allWidgets.stream().filter(w -> w.getWidth() == 62 && w.getHeight() == 62 && w.getItemId() == 62).findFirst().orElse(null); return storedWidget; } private boolean isVisible() { final RS2Widget wid = getFletchingMenu(); return wid != null && wid.isVisible(); } Don't need to call getFletchingMenu() more than once in the isVisible() boolean Oh yeah, but this does not answer the question about using item ID as filter Quote Link to comment Share on other sites More sharing options...
Broman Posted December 19, 2020 Author Share Posted December 19, 2020 7 hours ago, Malcolm said: Sorry, I was just going off of this quote "Any feedback is welcome" In general for ID's and widgets, you're allowed to use root widgets and you're allowed to pull lists from sprites/actions/colors, etc but anything that is a child widget isn't allowed. So as long as it's not a child widget you should be good Such a savage you are. Much appreciated are you Anyways, thank you for pointing me towards the right direction. I am a complete noob with Bot scripting and new to Java in general. Luckily I use curly brackets the non retarded way. Quote Link to comment Share on other sites More sharing options...