Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:
- var ofertas = 0;
- var viagem = 10;
- var redirecionar = 1;
- /*
- * @author Insanidade
- * @update: moms1983
- */
- if (game_data.player.premium == false) {
- alert("Para utilizar esse script é necessário uma Conta Premium.");
- end();
- }
- if (typeof viagem === 'undefined')
- viagem = 10;
- var doc = document;
- if (window.frames.length > 0)
- doc = window.main.document;
- url = document.URL;
- var start = url.indexOf("village");
- var end = url.indexOf('&', start);
- var id;
- if (end > 0)
- id = url.substring(start, end);
- elseid = url.substring(start);
- if (url.indexOf('screen=market') == -1 || url.indexOf('mode=own_offer') == -1) {
- if (redirecionar == 0) {
- alert('Redirecionando para a página correta. \n Por favor, execute novamente o script.');
- }
- location.search = '?screen=market&mode=own_offer&' + id;
- }
- else {
- var wood = parseInt($('span[id=wood]').html());
- var clay = parseInt($('span[id=stone]').html());
- var iron = parseInt($('span[id=iron]').html());
- e = $('input[id=res_sell_wood]');
- e[e.length - 1].checked = wood > clay && wood > iron;
- e = $('input[id=res_sell_stone]');
- e[e.length - 1].checked = clay > wood && clay > iron;
- e = $('input[id=res_sell_iron]');
- e[e.length - 1].checked = iron > clay && iron > wood;
- e = $('input[id=res_buy_wood]');
- e[e.length - 1].checked = wood < clay && wood < iron;
- e = $('input[id=res_buy_stone]');
- e[e.length - 1].checked = clay < wood && clay < iron;
- e = $('input[id=res_buy_iron]');
- e[e.length - 1].checked = iron < clay && iron < wood;
- wood = Math.round(wood / 1000);
- clay = Math.round(clay / 1000);
- iron = Math.round(iron / 1000);
- offers = Math.max(Math.max(wood, clay), iron) - Math.min(Math.min(wood, clay), iron);
- offers = Math.round(offers / 2);
- $('input[value=Criar]').focus();
- $('input[name=multi]').val(ofertas > 0 ? ofertas : offers);
- $('input[name=max_time]').val(viagem);
- $('input[name=sell]:not([id$=Amount])').val(1000);
- $('input[name=buy]:not([id$=Amount])').val(1000);
- }
- var max = Number($("#content_value th:contains('Quantidade')").text().split(": ")[1]);
- if (Number($("input[name='sell']:not([id$=Amount])").val()) > max) {
- $("input[name='sell']:not([id$=Amount])").val(Number($("#content_value th:contains('Quantidade')").text().split(": ")[1]));
- $("input[name='buy']:not([id$=Amount])").val(Number($("#content_value th:contains('Quantidade')").text().split(": ")[1]));
- }
- var qtd_vender = Number($("input[name='sell']:not([id$=Amount])").val());
- if ((Number($("input[name='multi']").val()) * qtd_vender) > max)
- $("input[name='multi']").val(Math.floor(max / qtd_vender))
- void(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement