PlagueDoctor Posted September 29, 2016 Share Posted September 29, 2016 So i'm making a herb cleaning script and i'm having trouble finding a method of cleaning each herb that doesn't either suck(clicks each herb too slowly), or occasionally mess up(click every herb and then do it again even though they're all clean). As you read this i am trying out different things to try and reach a desirable result. How would you do this? Can you inform me of a good way to do this? Quote Link to comment Share on other sites More sharing options...
Token Posted September 29, 2016 Share Posted September 29, 2016 Try mouse.click(), it should be faster than interact() because it has no sleeps 1 Quote Link to comment Share on other sites More sharing options...
PlagueDoctor Posted September 29, 2016 Author Share Posted September 29, 2016 Try mouse.click(), it should be faster than interact() because it has no sleeps Yeah mouse click isn't great though, because when you're running out of herbs you might not have a full inventory, so it would click on nothing a bunch of times. Which could be okay, but isn't really perfect. Quote Link to comment Share on other sites More sharing options...
Token Posted September 29, 2016 Share Posted September 29, 2016 Yeah mouse click isn't great though, because when you're running out of herbs you might not have a full inventory, so it would click on nothing a bunch of times. Which could be okay, but isn't really perfect. No matter what you use, you will still check what you actually have in your inventory The API fortunately doesn't provide a Herblore#cleanAllGrimyHerbsInInventoryThenBank() 6 Quote Link to comment Share on other sites More sharing options...
Mr Pro Pop Posted September 30, 2016 Share Posted September 30, 2016 (edited) do it so it checks if the inventory has x28 of the cleaned thing then it stops and bank if (getInventory().getAmount("Item Name") == 28) { // bank } @@PlagueDoctor Edited September 30, 2016 by Mr Pro Pop Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 30, 2016 Share Posted September 30, 2016 do it so it checks if the inventory has x28 of the cleaned thing then it stops and bank if (getInventory().getAmount("Item Name") == 28) { // bank } @@PlagueDoctor Yeah... No... If it started with less than 28 or withdrew less than 28 (maybe the bank didn't have 28 remaining), it'll just be left standing there. @@PlagueDoctor If I were you, I would check if the inventory contains the grimy type herb. If it does, proceed to get its slot, make an InventorySlotDestination out of it (it's documented in the API), and click on the InventorySlotDestination. Then return how much you want to sleep for (maybe 50-150ms). 1 Quote Link to comment Share on other sites More sharing options...
Mr Pro Pop Posted September 30, 2016 Share Posted September 30, 2016 (edited) Yeah... No... If it started with less than 28 or withdrew less than 28 (maybe the bank didn't have 28 remaining), it'll just be left standing there. Then he could just do that to check if the bank has enough amount of the item or not.. if(bank.getItem("Item").getAmount() >= 28) { bank.withdraw("Item", 28); }else { stop(); } @@Imateamcape Edited September 30, 2016 by Mr Pro Pop Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 30, 2016 Share Posted September 30, 2016 Then he could do that to check if the bank has enough amount of the item or not.. if(bank.getItem("Item").getAmount() >= 28) { bank.withdraw("Item", 28); }else { stop(); } @@Imateamcape thats a very roundabout and less stable way of doing the exact same thing and would undoubtedly be prone to far more errors. not efficient. Quote Link to comment Share on other sites More sharing options...
Mr Pro Pop Posted September 30, 2016 Share Posted September 30, 2016 (edited) thats a very roundabout and less stable way of doing the exact same thing and would undoubtedly be prone to far more errors. not efficient. 1-) No don't just try to get me wrong, it's good nothing is wrong with it, Checks if the bank has enough amount of the item if so it withdraws and continue otherwise the script will close. This is how it is in the api and 100% working with no errors, In case you didn't like it you could code your own system! I didn't even ask you for your opinion and don't even care if you liked it or not Told you before I don't want to get on with you, Otherwise ill just ignore if you couldn't understand. I have no time to waste replying your nooby quotes. Edited September 30, 2016 by Mr Pro Pop Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 30, 2016 Share Posted September 30, 2016 1-) No, its good nothing is wrong with it, Checks if the bank has enough amount of the item if so it withdraws and continue otherwise the script will close. This is how it is in the api and 100% working with no errors, Otherwise get your own system if you did not like it. Its your own problem for understanding or not. 2-) Don't just try to get me wrong, Leave me alone I don't really care if you liked it or not, Didn't ask for your opinion. Told you before i don't want to get on with you, Otherwise ill just ignore if you couldn't understand. I have no time to waste replying your nooby quotes. come back to me when you understand basic day 1 for loops (quote from skype of you asking me): On 9/16/16, at 10:18 PM, Mr Pro Pop wrote: > Do you think you could provide us with a snippet you had a bad solution and i called you out on it. chill lol Quote Link to comment Share on other sites More sharing options...
Mr Pro Pop Posted September 30, 2016 Share Posted September 30, 2016 (edited) come back to me when you understand basic day 1 for loops (quote from skype of you asking me): you had a bad solution and i called you out on it. chill lol Well this was since 10 days now i am good enough at coding, Plus let me ask you how you were when you started coding and learnt from code academy/others resources, Weren't it step by step to get on your current level ? Thats exactly what i am currently doing right now! Plus no one doesn't need help, Helps getting others to memorize and cover it next time! I am not trying to be rude but since you won't understand it wasn't me the guy who sent you the message then i don't rather speak with you, I sent you skype chat proof and screenshots and tried to contact you but you ignored and wont deal with that. Edited September 30, 2016 by Mr Pro Pop Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 30, 2016 Share Posted September 30, 2016 Well this was since 10 days now i am good enough at coding, Plus let me ask you how you were when you started coding and learnt from code academy/others resources, Weren't it step by step to get on your current level ? Thats exactly what i am currently doing right now! I am not trying to be rude but since you won't understand it wasn't me the guy who sent you the message then i don't rather speak with you, I sent you skype chat proof and screenshots and tried to contact you but you ignored and wont deal with that. you dont just learn to code in 10 days m8. i dont know why you're reacting in such an aggressive way, but im not surprised after our initial interaction. look, here's why yours would not work in a straightforward way: yours would clean one, then the inventory wouldn’t contain 28 anymore, and it would bank everything again, then take out another full inventory, then clean one more, then repeat. this doesnt need to be a dispute and i'm not sure why you're disputing it (??). we had an altercation, it ended awhile ago. water under the bridge. idk why you continue acting like this... Quote Link to comment Share on other sites More sharing options...
Mr Pro Pop Posted September 30, 2016 Share Posted September 30, 2016 (edited) you dont just learn to code in 10 days m8. i dont know why you're reacting in such an aggressive way, but im not surprised after our initial interaction. look, here's why yours would not work in a straightforward way: yours would clean one, then the inventory wouldn’t contain 28 anymore, and it would bank everything again, then take out another full inventory, then clean one more, then repeat. this doesnt need to be a dispute and i'm not sure why you're disputing it (??). we had an altercation, it ended awhile ago. water under the bridge. idk why you continue acting like this... Well i didn't argue because of that. I argued because i have done it in the right way and then you came and said its wrong. If you didn't really read it well so here is what i said do it so it checks if the inventory has x28 of the "cleaned" thing then it stops and bank.. do you see that "cleaned" word ? it was your problem reading from the first. Edited September 30, 2016 by Mr Pro Pop Quote Link to comment Share on other sites More sharing options...
Team Cape Posted September 30, 2016 Share Posted September 30, 2016 Well i didn't argue because of that. I argued because i have done it in the right way and then you came and said its wrong. If you didn't really read it well so here is what i said do it so it checks if the inventory has x28 of the "cleaned" thing then it stops and bank.. do you see that "cleaned" word ? it was your problem reading from the first. then if it misclicks on one, it needs to go through the whole inventory again. why spend 3 hours debugging this, when you can just use 1 object to make simpler and more efficient code. christ. it is wrong. Quote Link to comment Share on other sites More sharing options...
Mr Pro Pop Posted September 30, 2016 Share Posted September 30, 2016 (edited) Okay sorry bro i thought you were still wanted to fight with me or being my enemie, Lets clear everything! Are we good now ? If so i guarantee you that we will never fight again, We could be friends. @@Imateamcape Edited September 30, 2016 by Mr Pro Pop Quote Link to comment Share on other sites More sharing options...