abouhanafy87 4 Share Posted August 13, 2021 How can i use thread to make mining function and run beside my code Link to comment Share on other sites More sharing options...
Hashtag 8688 Share Posted August 13, 2021 Are you sure you want to use a thread? It's generally not a good idea. What are you trying to achieve? Link to comment Share on other sites More sharing options...
abouhanafy87 4 Author Share Posted August 13, 2021 23 minutes ago, Hashtag said: Are you sure you want to use a thread? It's generally not a good idea. What are you trying to achieve? I want to check other rocks and regist it in table through mining Link to comment Share on other sites More sharing options...
abouhanafy87 4 Author Share Posted August 14, 2021 this is my mine func private void mine() { currentNode = GameObjects.closest(oreID ); if(currentNode !=null) { if (currentNode.getID() == oreID) { //if your'e free if (currentNode.interactForceLeft("Mine")) { sleepUntil(() -> !currentNode.exists(), Calculations.random(5000, 30000));// this make my code to freeze } } } } i want to make another function to catch other rocks and regist it's time how can i make it when my code is freeze in my mining function . i want to make catch function in another thread but i want some help . thanks for you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.