here is a really really simple magma finder program i wrote a while ago.. it basically just takes a screenshot and scans relevant pixels for the magma color.
limitations:
-dwarf fortress window must be at the top left hand corner of the screen
-runs forever unless you locate some magma, so once it reaches the right hand side of the screen use shift-left arrow to get back over to the left
-if you are going back to the left hand side of the screen and it does find some magma and stops scanning, there's a good chance you'll miss it
-you've got 4 seconds to refocus on the dwarf fortress window before scanning begins
-some false positives, not only magma is that dark red color
-god help you if there's somehow no magma on the entire map
here's the source code:
import java.awt.AWTException;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
public class MagmaFinder {
static Robot robot;
public static void main(String[] args) throws AWTException {
robot = new Robot();
robot.delay(4000);
System.out.println("go!");
BufferedImage cap;
new Robot().createScreenCapture(
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );
Boolean magmafound = false;
search:
while(!magmafound){
cap = new Robot().createScreenCapture(
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );
for(int x=0;x<145;x++){
for(int y=0;y<250;y++){
if (cap.getRGB(x, y)==-8388608){
System.out.println("magma!");
magmafound = true;
break search;
}
}
}
robot.keyPress(KeyEvent.VK_RIGHT);
robot.keyRelease(KeyEvent.VK_RIGHT);
}
robot.keyPress(KeyEvent.VK_LEFT);
robot.keyRelease(KeyEvent.VK_LEFT);
System.out.println("done");
}
}
and, if you really want, a download link: http://rapidshare.com/files/76918237/MagmaFinder.jar.html
maybe someone can make it more useful, i dunno.. i used it to find a nice spot with a dolomite layer surrounding a magma vent, which means boatloads of magnetite and flux, so i'm happy
[ December 16, 2007: Message edited by: Boogaloo ]