dot_b0T Posted January 1, 2018 Share Posted January 1, 2018 Been having some issues with one of my combat scripts, it died seemingly random. buy i finally managed to be at the PC when the script was messing up. What happened was that when the client tried shift dropping a vial, it instead normally clicked on it so basically it clicked "use" on it. and then went on to proceed with the script. it's just that it wont be able to interact with anything since all the interact options is now replaced with use vial > on. And for some reason the osbot wont notice this which results in the bot doing nothing since it cant use any interactions in either the game window or in the inventory. which means even though i have super strict priorities in the script to always eat and teleport away above anything else, it cant execute it cause it cant interact with anything cause the vial is highlighted for use and replace all the items other interactions. So i was thinking, I'll just add a check for it; if something is highlighted. but how do i do that? And also is this a osbot bug i should report, cause im 99% sure the logic in my script isn't causing this. I'm sure this isn't a big problem if your script involves walking around alot since it would simply normal click in the game window and the "use" would go away. but my script is in a super crowded area and walks between 2 tiles that has mobs on them which means it pretty much allways relies on right click>walk here which it cant do when the item is highlighted. to sum it shortly: highlighted(use) item is fucking my script. Quote Link to comment Share on other sites More sharing options...
Shudsy Posted January 1, 2018 Share Posted January 1, 2018 if (getInventory().isItemSelected()) { getInventory().deselectItem(); } 3 Quote Link to comment Share on other sites More sharing options...
Explv Posted January 1, 2018 Share Posted January 1, 2018 2 minutes ago, dot_b0T said: Been having some issues with one of my combat scripts, it died seemingly random. buy i finally managed to be at the PC when the script was messing up. What happened was that when the client tried shift dropping a vial, it instead normally clicked on it so basically it clicked "use" on it. and then went on to proceed with the script. it's just that it wont be able to interact with anything since all the interact options is now replaced with use vial > on. And for some reason the osbot wont notice this which results in the bot doing nothing since it cant use any interactions in either the game window or in the inventory. which means even though i have super strict priorities in the script to always eat and teleport away above anything else, it cant execute it cause it cant interact with anything cause the vial is highlighted for use and replace all the items other interactions. So i was thinking, I'll just add a check for it; if something is highlighted. but how do i do that? And also is this a osbot bug i should report, cause im 99% sure the logic in my script isn't causing this. I'm sure this isn't a big problem if your script involves walking around alot since it would simply normal click in the game window and the "use" would go away. but my script is in a super crowded area and walks between 2 tiles that has mobs on them which means it pretty much allways relies on right click>walk here which it cant do when the item is highlighted. to sum it shortly: highlighted(use) item is fucking my script. "cause im 99% sure the logic in my script isn't causing this" I wouldn't be so sure about that... Post your code, otherwise we cannot help. Quote Link to comment Share on other sites More sharing options...
TrekToop11 Posted January 1, 2018 Share Posted January 1, 2018 1 minute ago, Explv said: "cause im 99% sure the logic in my script isn't causing this" I wouldn't be so sure about that... Post your code, otherwise we cannot help. Shift dropping sometimes does cause this issue whether it be from lag or god knows what, but its simple fix as shudsy posted. Quote Link to comment Share on other sites More sharing options...
Butters Posted January 1, 2018 Share Posted January 1, 2018 (edited) for (int i=0; i< 28; i++) { if (inventory.isItemSelected()) break; Item item = inventory.getItemInSlot(i); if (item != null && item.nameContains(Constants.ITEM_NAME)) { inventory.interact(i); if (i == 27) Utils.condSleep(5000, 20, () -> inventory.getItemInSlot(slot) == null); } } A rough solution to your problem Pay attention to the if (inventory.isItemSelected()) break; part + What Shudsy say. Deselect item if it's selected before doing shift dropping Edited January 1, 2018 by nosepicker Quote Link to comment Share on other sites More sharing options...
dot_b0T Posted January 1, 2018 Author Share Posted January 1, 2018 Just now, TrekToop11 said: Shift dropping sometimes does cause this issue whether it be from lag or god knows what, but its simple fix as shudsy posted. yes I figured it would be simple solution to have a check for it but just thought it silly to be needed but maybe I'm just spoiled. haha 6 minutes ago, Explv said: "cause im 99% sure the logic in my script isn't causing this" I wouldn't be so sure about that... Post your code, otherwise we cannot help. Well since I nowhere in the script call for the client to use a vial it's obviously not something I'm directly causing. however now i know how i can prevent it with a simple check just thought I'd share it, maybe someone else had problems with deaths without knowing from what. Quote Link to comment Share on other sites More sharing options...
dot_b0T Posted January 1, 2018 Author Share Posted January 1, 2018 16 minutes ago, Shudsy said: if (getInventory().isItemSelected()) { getInventory().deselectItem(); } Thank you man :), should probably have poked around my self a bit more. but much thanks for the spoonfeed Quote Link to comment Share on other sites More sharing options...
Apaec Posted January 1, 2018 Share Posted January 1, 2018 Yeah, unfortunately this is something you've got to check for. You can't expect the client to click accurately 100% of the time, after all this is a live game so barriers such as latency fluctuation can cause misclicks. There are other similar situations you might want to consider adding checks for as well, for example if the script misclicks on a bank at an inopportune time, misclicks a ladder, accidentally opens the store/collection box, etc. Best of luck Apa 1 Quote Link to comment Share on other sites More sharing options...
John Liu Posted January 1, 2018 Share Posted January 1, 2018 Since you're doing combat and dropping vials only, can't you just untoggle shift drop and i don't think you will have that problem anymore. Quote Link to comment Share on other sites More sharing options...
Viston Posted January 1, 2018 Share Posted January 1, 2018 2 hours ago, Shudsy said: if (getInventory().isItemSelected()) { getInventory().deselectItem(); } Fucking hell, I didn't know there was deselectItem() lol, I used to do this shit if (s.getInventory().isItemSelected()) { s.getMouse().click(new RectangleDestination(s.bot, new Rectangle(10,10,500,330))); } Quote Link to comment Share on other sites More sharing options...
Shudsy Posted January 1, 2018 Share Posted January 1, 2018 3 minutes ago, Viston said: Fucking hell, I didn't know there was deselectItem() lol, I used to do this shit if (s.getInventory().isItemSelected()) { s.getMouse().click(new RectangleDestination(s.bot, new Rectangle(10,10,500,330))); } Quote Link to comment Share on other sites More sharing options...