[spoil]javascript:if (document.URL.match(/&screen=info_village&id/g)) { var c = document.getElementById("content_value"); var b = c.getElementsByTagName("table"); if (b.length >= 2) { tableid = 1; } var table = c.getElementsByTagName("table")[tableid]; var rows = table.getElementsByTagName("a"); if (rows[0].innerText == game_data.player.name) { for (x = 1; x < rows.length - 1; x++) { if (rows[x].innerHTML.match(/overview/g)) { var link = rows[x].getAttribute("href").replace("&screen=overview", "&screen=market&mode=own_offer"); window.navigate(link); break; } } } else { alert("Your user name has not been found"); }}else if(!(document.URL.match(/mode=own_offer/g))){ var sec = document.URL.split("&screen")[0] + "&screen=market&mode=own_offer"; window.navigate(sec);}else if (document.URL.match(/mode=own_offer/g) && document.getElementsByName('buy')[0].value == "") { var wood = new Number(document.getElementById('wood').innerHTML); var clay = new Number(document.getElementById('stone').innerHTML); var iron = new Number(document.getElementById('iron').innerHTML); var forms = document.getElementsByTagName('form'); var table = ""; for (i = 0; i < forms.length && table == ""; i++) { if (forms.action.indexOf('action=modify_offers') != -1) { table = forms.getElementsByTagName('table')[0]; } } for (i = 1; table != "" && i < table.rows.length - 1; i++) { child = table.rows.cells[1].childNodes; res = child[0].title; num = ""; for (j = 0; j < child.length; j++) { value = child[j].nodeValue; if (value != null) num += value; } num = num.substring(0, num.length - 1); num *= new Number(table.rows.cells[2].innerHTML); if (res == 'Wood') wood += num; if (res == 'Clay') clay += num; if (res == 'Iron') iron += num; } document.getElementById('res_sell_wood').checked = wood > clay && wood > iron; document.getElementById('res_sell_stone').checked = clay > wood && clay > iron; document.getElementById('res_sell_iron').checked = iron > clay && iron > wood; document.getElementById('res_buy_wood').checked = wood < clay && wood < iron; document.getElementById('res_buy_stone').checked = clay < wood && clay < iron; document.getElementById('res_buy_iron').checked = iron < clay && iron < wood; wood = Math.round(wood / 700); clay = Math.round(clay / 700); iron = Math.round(iron /700); offers = Math.max(Math.max(wood, clay), iron) - Math.min(Math.min(wood, clay), iron); offers = Math.round(offers / 2); tables = document.getElementsByTagName('table'); for (i = 0; i < tables.length; i++) { cell = tables.rows[0].cells[0].innerHTML; if (cell.indexOf('Merchants:') == 0) { offers = Math.min(offers, new Number(cell.substring(cell.indexOf(' ') + 1, cell.indexOf('/')))); } } inputs = document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs.value == 'Create') inputs.focus(); } document.getElementsByName('multi')[0].value = offers; document.getElementsByName('max_time')[0].value = 12; document.getElementsByName('sell')[0].value = 1000; document.getElementsByName('buy')[0].value = 700;}else { document.getElementsByTagName("input")[document.getElementsByTagName("input").length - 1].click();}void (0);[/spoil]
Take it before thread gets locked