javascript: var res = {wood:500,stone:500,iron:500}; var coords = "457|456 456|460"; /* by VIVAZ <anasfourati1995@gmail.com> v1.0*/ if (window.frames.length > 0) $ = window.main.$;game = (window.frames.length > 0) ? window.main.game_data : game_data; if (game.screen != 'market') $(location).attr('href', game.link_base_pure + 'market'); function insert(name, val) { $('[name=' + name + ']').val(val) } function total(res) { return parseInt($('[name=' + res + ']').next().text().match(/\d+/)) } if ($('div[style*=red]').length > 0) { if ($('#send').length == 0) $('div[style*=red]').css('color', '#f00'); $('[name=x]').val(''); $('html').append('<i id="send"/>') } function send() { $.each(res, function (name, val) { (val <= total(name)) ? insert(name, val) : insert(name, total(name)) }); coords = coords.split(' '); id = $.cookie('sendRes' + game.wolrd); if (id == null || id >= coords.length) id = 0; coord = coords[id].split('|'); insert('x', coord[0]); insert('y', coord[1]); $.cookie('sendRes' + game.wolrd, parseInt(id) + 1, { expires: 7 }); $('[type=submit]').click() } if ($('form[action*="try=confirm_send"]').length > 0 && $('[name=x]').val() == '') send(); if ($('form[action*="action=send"]').length > 0 && $('#sr').length == 0) { $('[type=submit]').click(); $('html').append('<i id="sr"/>') } void 0;