javascript: units = { 'spear' : 0, 'sword' : 0, 'axe' : 0, 'archer' : 0, 'spy' : 0, 'light' : 12, 'marcher' : 0, 'heavy' : 0, 'catapult' : 0, 'ram' : 0, 'knight' : 0, 'snob' : 0};coords = '473|470 470|457 471|456 471|455 471|453';name = 'ChiFarm';
var d = document;
function N(a) { return (d.getElementsByName(a)[0]);}
function max(a) { return parseInt(d.units[a].nextSibling.nextSibling.innerHTML.match(/\d+/), 10);}if (N('x') && N('x').value == '') { if (!N(name)) $('h3').append('<span name="' + name + '" style="color:green;font-size:11px;"></span>'); coords = coords.split(' '); index = 0; farmcookie = d.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)'); if (farmcookie != null) index = parseInt(farmcookie[2]); N(name).innerHTML = ' Tinta nr.' + (index + 1) + ' (' + coords[index] + '). Total: ' + coords.length; if (index >= coords.length) { N(name).style.color = '#F00'; N(name).innerHTML = ' Ai ajuns la capatul listei!'; } else N(name).style.color = 'green'; if (index >= coords.length) index = 0; coords = coords[index]; coords = coords.split('|'); index++; cookie_date = new Date(2051, 08, 11); d.cookie = name + '=' + index + ';expires=' + cookie_date.toGMTString(); N('x').value = coords[0]; N('y').value = coords[1]; for (i in units) { if (N(i)) { u = parseInt(units[i], 10); n = max(i) + u; if (isNaN(u)) insertUnit(N(i), max(i)); else if (u < 0) n < 0 ? '' : insertUnit(N(i), n); else if (max(i) >= units[i]) insertUnit(N(i), u); } }}void 0