All pastes #448963 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-19 23:29 UTC
rendered paste body
import stdlib;
import Game;

long xstart = 340;
long xend = 341;
long ystart = 202;
long yend = 203;

function SpawnIron(array argv, Game &game)
{
	for (long x = xstart; x < xend; x++)
	{
		for (long y = xstart; y < yend; y++)
		{
			if ((game.getTileOccupancy(x, y) & 0xD) == 0)
			{
				game.setTileType(x, y, 4);
				game.setTileSymbol(x, y, 0x9C);
				game.setTileDesignation(x, y, game.getTileDesignation(x, y) | 0x80);
			}
		}
	}
}

function long main(array argv)
{
	Game game;
	stdlib::Print("Rick's Tile Tool for Dwarf Fortress (v0.23.130.23a)\n\n");
	
	game = new Game();
	
	if (game.Open() == 0)
	{
		stdlib::Print("Failed to open Dwarf Fortress.\n");
		return 0;
	}
	
	while (game.mapAvailable)
	{
		SpawnIron(argv, game);
		stdlib::Sleep(5000);

	}
		
	game.Close();
	return 0;
}