Best way is to do something like...
PHP Code:
function onTimeout() {
player.chat=tiles[mousex,mousey];
setTimer(0.05);
}
And basically it's all logic from there
PHP Code:
temp.staketiles={blah,blah2,blah3,blah4}; // the four tiles for the stake
temp.downstake={blah,blah2,blah3,blah4}; // the four tiles for the stake
if (tiles[player.x,player.y] in temp.staketiles) {
tiles[player.x,player.y]=temp.downstake[0];
updateboard(player.x,player.y,1,1);
}
Of course, it's more complicated than that, but you get the idea. tiles[x,y] will tell you the tile hexcode at the given coordinates, and you can also change them like so. Also, the editor will give you the hexcode of all highlighted tiles when you press the one button that looks like a circle with a + going through it.
Early apologies for the sloppy instructions, if you need something more in-depth I can do that. But hopefully this is enough to get you started.