mirror of
https://github.com/davpapp/PowerMiner
synced 2025-01-08 12:28:06 -05:00
Multithreading working, BRobot seems to be failing
This commit is contained in:
parent
ae260edfc0
commit
488abeb1c9
@ -13,7 +13,7 @@ public class DropperThread implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
inventory.update();
|
||||
//inventory.update();
|
||||
cursor.moveAndRightlickAtCoordinatesWithRandomness(inventory.getClickCoordinatesForInventorySlot(0, 0), 15, 15);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
@ -71,6 +71,7 @@ public class IronMiner {
|
||||
}
|
||||
|
||||
DetectedObject closestIronOre = getClosestObjectToCharacter(ironOres);
|
||||
|
||||
if (closestIronOre != null) {
|
||||
cursor.moveAndLeftClickAtCoordinatesWithRandomness(closestIronOre.getCenterForClicking(), 10, 10);
|
||||
|
||||
@ -85,15 +86,14 @@ public class IronMiner {
|
||||
|
||||
System.out.println("Both threads finished?");
|
||||
}
|
||||
|
||||
humanBehavior.randomlyCheckMiningXP(cursor);
|
||||
randomDetector.dealWithRandoms(screenCapture, cursor);
|
||||
//dropInventoryIfFull();
|
||||
if (count % 100 == 0) {
|
||||
System.out.println((System.currentTimeMillis() - startTime) / 1000);
|
||||
if (count % 30 == 0) {
|
||||
System.out.println("WAITING #############################################");
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
//humanBehavior.randomlyCheckMiningXP(cursor);
|
||||
//randomDetector.dealWithRandoms(screenCapture, cursor);
|
||||
//dropInventoryIfFull();
|
||||
}
|
||||
System.out.println("Completed full mining session.");
|
||||
}
|
||||
|
||||
/*private void dropOre() throws Exception {
|
||||
|
@ -31,8 +31,9 @@ public class TrackerThread implements Runnable {
|
||||
boolean oreAvailable = true;
|
||||
int oreLostCount = 0;
|
||||
while (!objectTrackingFailure && oreLostCount < 3 && !isTimeElapsedOverLimit(miningStartTime, maxTimeToMine)) {
|
||||
BufferedImage screenCapture2 = objectDetector.captureScreenshotGameWindow();
|
||||
ArrayList<DetectedObject> detectedObjects = objectDetector.getObjectsInImage(screenCapture2, 0.15);
|
||||
long frameStartTime = System.currentTimeMillis();
|
||||
screenCapture = objectDetector.captureScreenshotGameWindow();
|
||||
ArrayList<DetectedObject> detectedObjects = objectDetector.getObjectsInImage(screenCapture, 0.15);
|
||||
ArrayList<DetectedObject> ironOres = objectDetector.getObjectsOfClassInList(detectedObjects, "ironOre");
|
||||
objectTrackingFailure = ironOreTracker.update(screenCapture, boundingBox);
|
||||
oreAvailable = objectDetector.isObjectPresentInBoundingBoxInImage(ironOres, boundingBox, "ironOre");
|
||||
@ -42,7 +43,8 @@ public class TrackerThread implements Runnable {
|
||||
else {
|
||||
oreLostCount = 0;
|
||||
}
|
||||
System.out.println("trackerThread working...");
|
||||
System.out.println("Threaded tracker took " + (System.currentTimeMillis() - frameStartTime) + " milliseconds.");
|
||||
//System.out.println("trackerThread working...");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user