MachineAIExp 0 Share Posted June 9, 2020 Hello all! Currently I have a script that tries to mine some ores, there are already a lot of scripts out there, but I tried one myself. Everything works fine, except for one minor thing. Currently my code keeps clicking on the same rock even though I have a different ID when that case is running. So e.g. it runs case 1 and mines rock 1, wich is good, but then that rock depletes and the debugger goes to rock 2, but it mines rock 1 again which is still depleted. This is my code where I call these ID's. Any Ideas on how to fix this? case MINING1: log("Mining northern"); GameObject myORE = getGameObjects().closest(gameObject -> gameObject != null && getGameObjects().getTopObjectOnTile(north).getID() == 11364); myORE.interact("Mine"); sleepUntil( () -> getGameObjects().getTopObjectOnTile(north).getID() != 11364, Calculations.random(10000, 20000)); break; case MINING2: log("Mining middle"); GameObject myORE2 = getGameObjects().closest(gameObject -> getGameObjects().getTopObjectOnTile(middle).getID() == 11364); myORE2.interact("Mine"); sleepUntil( () -> getGameObjects().getTopObjectOnTile(middle).getID() != 11364, Calculations.random(10000, 20000)); break; case MINING3: log("Mining southern"); GameObject myORE3 = getGameObjects().closest(gameObject -> gameObject != null && getGameObjects().getTopObjectOnTile(south).getID() == 11365); myORE3.interact("Mine"); sleepUntil( () -> getGameObjects().getTopObjectOnTile(south).getID() != 11365, Calculations.random(10000, 20000)); break; Link to comment Share on other sites More sharing options...
MachineAIExp 0 Author Share Posted June 9, 2020 Never mind, already solved it myself Link to comment Share on other sites More sharing options...
abouhanafy87 4 Share Posted March 3, 2021 tell us how ? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.