Rubick 30 Share Posted July 5, 2017 Been trying to find the sleepUntil method in the Java API with no luck. Any help here, or am I just looking at the wrong API? Link to comment Share on other sites More sharing options...
Rubick 30 Author Share Posted July 5, 2017 Thank you!! I must be a complete noob, can you link me also? Thanks man. Link to comment Share on other sites More sharing options...
dQw4w9WgXcQ 184 Share Posted July 5, 2017 ur probs better off not using that anyways Link to comment Share on other sites More sharing options...
Just Chill 26 Share Posted July 5, 2017 Thank you!! I must be a complete noob, can you link me also? Thanks man. It's under MethodProvider Link to comment Share on other sites More sharing options...
Rubick 30 Author Share Posted July 5, 2017 ur probs better off not using that anyways Why is that? I'm pretty new so I'll explain what I'm trying to do and you tell me what you think. I'm trying to make a simple feather collector script. All it will do is go around at Lummy chickens and pickup feathers that other players have missed. So once I have the code that says to select "Take" on the feather, I need the script to wait until the feather is picked up to continue. So why not use "sleepUntil(feather count increases)" or something like that? (I haven't quite gotten the syntax and methods but you get the idea.) It's under MethodProvider Thank you my friend. Not sure why my Ctrl+F and Google searches didn't find it. Link to comment Share on other sites More sharing options...
dQw4w9WgXcQ 184 Share Posted July 5, 2017 Why is that? I'm pretty new so I'll explain what I'm trying to do and you tell me what you think. I'm trying to make a simple feather collector script. All it will do is go around at Lummy chickens and pickup feathers that other players have missed. So once I have the code that says to select "Take" on the feather, I need the script to wait until the feather is picked up to continue. So why not use "sleepUntil(feather count increases)" or something like that? (I haven't quite gotten the syntax and methods but you get the idea.) Thank you my friend. Not sure why my Ctrl+F and Google searches didn't find it. it uses a shit ton of resources and generally isnt needed. sleepuntil checks a condition every 25ms and then stops when it returns true. polling every 25ms is excessive if ur just going to return a 1-2 sec sleep afterwards. checking for invent changes isnt a good idea because someone else might pick up the item before you. for picking up ground items you can cache the item in a global variable and do if(item != null){pickup} sleepuntil isnt always bad, but try to avoid it unless absolutely necessary. also never put resource intensive calls like getting widgets/grounditems/pathfinding/etc. in sleepuntil. Link to comment Share on other sites More sharing options...
Rubick 30 Author Share Posted July 6, 2017 it uses a shit ton of resources and generally isnt needed. sleepuntil checks a condition every 25ms and then stops when it returns true. polling every 25ms is excessive if ur just going to return a 1-2 sec sleep afterwards. checking for invent changes isnt a good idea because someone else might pick up the item before you. for picking up ground items you can cache the item in a global variable and do if(item != null){pickup} sleepuntil isnt always bad, but try to avoid it unless absolutely necessary. also never put resource intensive calls like getting widgets/grounditems/pathfinding/etc. in sleepuntil. How can I verify the item was picked up before continuing on? As it stands my script would issue the Pickup command in game, then start looking for another feather immediately. Should I just do a regular sleep timer for a few seconds, knowing it will pick it up in time but never actually confirming the pickup in the code? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.