Creeaza oferte!

  • Autor subiect DeletedUser5809
  • Data de început

DeletedUser17342

pai vezi ca mai sunt puse vreo 3 cu resurse cum vrei tu. daca nu raspunde nimeni inseamna ca nu mai intereseaza pe nimeni :(
 

genTTlemaN

nu sunt bune..am vazut ca multi au cerut dupa...poate cineva totusi a facut rost :)
 

DeletedUser35131

Vad ca au trecut cateva luni bune de cand tot va chinuiti..eu mereu cand am vrut ceva sa fac.. am cautat am citit si intrun final am obtinut..
am facut ptr voi "ofer FIER cumpar ARGILA"
defapt nu a fost chiar asa greu am luat cele 3 scripturi postate de jak mam uitat in ele si am modificat dorinele mele .. adika nu vreau fier pe lemn ,vreau fier pe piata si in loc de wood pui stone si gata script ..

javascript: var d=(window.frames.length>0)?window.main.document:document; function o(a) { b=location.search; c=new RegExp("\\b"+a+"\\b"); if(b.match(c)){return 1;} else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;} } function r() { l=d.getElementsByTagName('table'); for(j=0;j<l.length;j++) { e=l[j].rows[0].cells[0].innerHTML; if(e.match(/^Negustor/)) { return new Number(e.match(/(\d+)/)[1]); } } return 0; } function v() { var p=new Number(d.getElementById('wood').innerHTML); var q=new Number(d.getElementById('iron').innerHTML); var m=d.getElementsByTagName('form'); var k=""; for(j=0;j<m.length&&k=="";j++) { if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];} } for(j=1;k!=""&&j<k.rows.length-1;j++) { n=k.rows[j].cells[1].childNodes; u=n[0].title; f=""; for(g=0;g<n.length;g++) { h=n[g].nodeValue; if(h!=null)f+=h; } f=f.substring(0,f.length-1); f*=new Number(k.rows[j].cells[2].innerHTML); if(u=='fier')p+=f; if(u=='argila')q+=f; } d .getElementById('res_sell_wood').checked=p>q; d.getElementById('res_sell_iron').checked=q>p; d.getElementById('res_buy_wood').checked=p<q; d.getElementById('res_buy_iron').checked=q<p; p=Math.round(p/1000); q=Math.round(q/1000); t=Math.max(p,q)-Math.min(p,q); t=Math.min(t,r()); } function end() { i=''; if(o('screen=market&mode=own_offer')) { if(r()>0) { t=new Number(d.getElementsByName('sell')[0].value); if(t>0) { s=d.getElementsByTagName('input'); for(j=0;j<s.length;j++) { if(s[j].value=='Realizare') { s[j].click(); return; } } } v(); if(t==0){i='No deal';} else { d.getElementsByName('multi')[0].value=t; d.getElementsByName('max_time')[0].value=20; d.getElementsByName('sell')[0].value=1000; d.getElementsByName('buy')[0].value=1000; if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; } } } else{i='No merchants';} if(i!='') { s=d.links; for(j=0;j<s.length;j++) { if(s[j].accessKey=="d"){location.href=s[j].href;return;} } } } } end();
 

Wife

:(( Din pacate nu misca nimic, incercat pe IE, Mozilla si Opera, update-uri la zi.
 

skolka

Vad ca au trecut cateva luni bune de cand tot va chinuiti..eu mereu cand am vrut ceva sa fac.. am cautat am citit si intrun final am obtinut..
am facut ptr voi "ofer FIER cumpar ARGILA"
defapt nu a fost chiar asa greu am luat cele 3 scripturi postate de jak mam uitat in ele si am modificat dorinele mele .. adika nu vreau fier pe lemn ,vreau fier pe piata si in loc de wood pui stone si gata script ..

javascript: var d=(window.frames.length>0)?window.main.document:document; function o(a) { b=location.search; c=new RegExp("\\b"+a+"\\b"); if(b.match(c)){return 1;} else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;} } function r() { l=d.getElementsByTagName('table'); for(j=0;j<l.length;j++) { e=l[j].rows[0].cells[0].innerHTML; if(e.match(/^Negustor/)) { return new Number(e.match(/(\d+)/)[1]); } } return 0; } function v() { var p=new Number(d.getElementById('wood').innerHTML); var q=new Number(d.getElementById('iron').innerHTML); var m=d.getElementsByTagName('form'); var k=""; for(j=0;j<m.length&&k=="";j++) { if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];} } for(j=1;k!=""&&j<k.rows.length-1;j++) { n=k.rows[j].cells[1].childNodes; u=n[0].title; f=""; for(g=0;g<n.length;g++) { h=n[g].nodeValue; if(h!=null)f+=h; } f=f.substring(0,f.length-1); f*=new Number(k.rows[j].cells[2].innerHTML); if(u=='fier')p+=f; if(u=='argila')q+=f; } d .getElementById('res_sell_wood').checked=p>q; d.getElementById('res_sell_iron').checked=q>p; d.getElementById('res_buy_wood').checked=p<q; d.getElementById('res_buy_iron').checked=q<p; p=Math.round(p/1000); q=Math.round(q/1000); t=Math.max(p,q)-Math.min(p,q); t=Math.min(t,r()); } function end() { i=''; if(o('screen=market&mode=own_offer')) { if(r()>0) { t=new Number(d.getElementsByName('sell')[0].value); if(t>0) { s=d.getElementsByTagName('input'); for(j=0;j<s.length;j++) { if(s[j].value=='Realizare') { s[j].click(); return; } } } v(); if(t==0){i='No deal';} else { d.getElementsByName('multi')[0].value=t; d.getElementsByName('max_time')[0].value=20; d.getElementsByName('sell')[0].value=1000; d.getElementsByName('buy')[0].value=1000; if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; } } } else{i='No merchants';} if(i!='') { s=d.links; for(j=0;j<s.length;j++) { if(s[j].accessKey=="d"){location.href=s[j].href;return;} } } } } end();
Poate il pui si tu cod PHP

PHP:
javascript: var d=(window.frames.length>0)?window.main.document:do cument; function o(a) { b=location.search; c=new RegExp("\\b"+a+"\\b"); if(b.match(c)){return 1;} else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;} } function r() { l=d.getElementsByTagName('table'); for(j=0;j<l.length;j++) { e=l[j].rows[0].cells[0].innerHTML; if(e.match(/^Negustor/)) { return new Number(e.match(/(\d+)/)[1]); } } return 0; } function v() { var p=new Number(d.getElementById('wood').innerHTML); var q=new Number(d.getElementById('iron').innerHTML); var m=d.getElementsByTagName('form'); var k=""; for(j=0;j<m.length&&k=="";j++) { if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];} } for(j=1;k!=""&&j<k.rows.length-1;j++) { n=k.rows[j].cells[1].childNodes; u=n[0].title; f=""; for(g=0;g<n.length;g++) { h=n[g].nodeValue; if(h!=null)f+=h; } f=f.substring(0,f.length-1); f*=new Number(k.rows[j].cells[2].innerHTML); if(u=='fier')p+=f; if(u=='argila')q+=f; } d .getElementById('res_sell_wood').checked=p>q; d.getElementById('res_sell_iron').checked=q>p; d.getElementById('res_buy_wood').checked=p<q; d.getElementById('res_buy_iron').checked=q<p; p=Math.round(p/1000); q=Math.round(q/1000); t=Math.max(p,q)-Math.min(p,q); t=Math.min(t,r()); } function end() { i=''; if(o('screen=market&mode=own_offer')) { if(r()>0) { t=new Number(d.getElementsByName('sell')[0].value); if(t>0) { s=d.getElementsByTagName('input'); for(j=0;j<s.length;j++) { if(s[j].value=='Realizare') { s[j].click(); return; } } } v(); if(t==0){i='No deal';} else { d.getElementsByName('multi')[0].value=t; d.getElementsByName('max_time')[0].value=20; d.getElementsByName('sell')[0].value=1000; d.getElementsByName('buy')[0].value=1000; if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; } } } else{i='No merchants';} if(i!='') { s=d.links; for(j=0;j<s.length;j++) { if(s[j].accessKey=="d"){location.href=s[j].href;return;} } } } } end();
Insa nu este functional
 
Ultima editare de un moderator:

skolka

Am reusit sa fac rost de un script functional, care vinde fier pe argila
PHP:
javascript:var doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;var start=url.indexOf("village");var end=url.indexOf('%26',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)location.search='?screen=market&mode=own_offer&'+id;else {var wood=new Number(doc.getElementById('wood').innerHTML);var clay=new Number(doc.getElementById('stone').innerHTML);var iron=new Number(doc.getElementById('iron').innerHTML);var forms=doc.getElementsByTagName('form');var table="";for(i=0;i<forms.length&&table=="";i++){if(forms[i].action.indexOf('action=modify_offers')!=-1){table=forms[i].getElementsByTagName('table')[0];}}for(i=1;table!=""&&i<table.rows.length-1;i++){child=table.rows[i].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[i].cells[2].innerHTML);if(res=='Wood')wood+=num;if(res=='Clay')clay+=num;if(res=='Iron')iron+=num;}doc.getElementById('res_sell_wood').checked=wood>clay&&wood>iron;doc.getElementById('res_sell_stone').checked=clay>wood&&clay>iron;doc.getElementById('res_sell_iron').checked=iron>clay&&iron>wood;doc.getElementById('res_buy_wood').checked=wood<clay&&wood<iron;doc.getElementById('res_buy_stone').checked=clay<wood&&clay<iron;doc.getElementById('res_buy_iron').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);inputs=doc.getElementsByTagName('input');for(i=0;i<inputs.length;i++){if(inputs[i].value=='Create')inputs[i].focus();}doc.getElementsByName('multi')[0].value=30;doc.getElementsByName('max_time')[0].value=80;doc.getElementsByName('sell')[0].value=1000;doc.getElementsByName('buy')[0].value=1000;}end();
Asta, insa, nu trece automat la satul urmator. Daca poate adauga cineva optiunea... e perfect
 

DeletedUser25287

Am reusit sa fac rost de un script functional, care vinde fier pe argila
PHP:
javascript:var doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;var start=url.indexOf("village");var end=url.indexOf('%26',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)location.search='?screen=market&mode=own_offer&'+id;else {var wood=new Number(doc.getElementById('wood').innerHTML);var clay=new Number(doc.getElementById('stone').innerHTML);var iron=new Number(doc.getElementById('iron').innerHTML);var forms=doc.getElementsByTagName('form');var table="";for(i=0;i<forms.length&&table=="";i++){if(forms[i].action.indexOf('action=modify_offers')!=-1){table=forms[i].getElementsByTagName('table')[0];}}for(i=1;table!=""&&i<table.rows.length-1;i++){child=table.rows[i].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[i].cells[2].innerHTML);if(res=='Wood')wood+=num;if(res=='Clay')clay+=num;if(res=='Iron')iron+=num;}doc.getElementById('res_sell_wood').checked=wood>clay&&wood>iron;doc.getElementById('res_sell_stone').checked=clay>wood&&clay>iron;doc.getElementById('res_sell_iron').checked=iron>clay&&iron>wood;doc.getElementById('res_buy_wood').checked=wood<clay&&wood<iron;doc.getElementById('res_buy_stone').checked=clay<wood&&clay<iron;doc.getElementById('res_buy_iron').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);inputs=doc.getElementsByTagName('input');for(i=0;i<inputs.length;i++){if(inputs[i].value=='Create')inputs[i].focus();}doc.getElementsByName('multi')[0].value=30;doc.getElementsByName('max_time')[0].value=80;doc.getElementsByName('sell')[0].value=1000;doc.getElementsByName('buy')[0].value=1000;}end();
Asta, insa, nu trece automat la satul urmator. Daca poate adauga cineva optiunea... e perfect
Acela de fapt face oferte in targ in functie de ce ai mai mult pe ce ai mai putin, spre exemplu daca in satul x ai mai mult fier si mai putina argila iti vinde fier pe argila, daca in schimb in satul y ai mai putin lemn iti vinde fier pe lemn, asta ar fi o chestie buna, insa nasol la el este ca are o limita prestabilita de negustori si daca vrei sa trimiti mai multe oferte dai de mai multe ori pe el, plus de asta nu trece din sat in sat deci nu prea ajuta.

Iata insa un script care trece din sat in sat, care ofera atat cati negustori ai acasa, distanta de trimitere se poate modifica simplu din el, am modificat eu cate o varianta de script pentru diverse oferte care cred eu sunt utile:

Ofera fier pentru lemn
PHP:
javascript:   var d=(window.frames.length>0)?window.main.document:document;         function o(a) {         b=location.search;         c=new RegExp("\\b"+a+"\\b");         if(b.match(c)){return 1;}         else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;}         }     function r() {         l=d.getElementsByTagName('table');         for(j=0;j<l.length;j++) {             e=l[j].rows[0].cells[0].innerHTML;             if(e.match(/^Negustor/)) {                 return new Number(e.match(/(\d+)/)[1]);                 }             }         return 0;         }     function v() {         var p=new Number(d.getElementById('wood').innerHTML);         var q=new Number(d.getElementById('iron').innerHTML);         var m=d.getElementsByTagName('form');         var k="";         for(j=0;j<m.length&&k=="";j++) {             if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];}             }         for(j=1;k!=""&&j<k.rows.length-1;j++) {             n=k.rows[j].cells[1].childNodes;             u=n[0].title;             f="";             for(g=0;g<n.length;g++) {                 h=n[g].nodeValue;                 if(h!=null)f+=h;                 }             f=f.substring(0,f.length-1);             f*=new Number(k.rows[j].cells[2].innerHTML);             if(u=='fier')p+=f;             if(u=='wood')q+=f;             }         d .getElementById('res_sell_wood').checked=p>q;         d.getElementById('res_sell_iron').checked=q>p;         d.getElementById('res_buy_wood').checked=p<q;         d.getElementById('res_buy_iron').checked=q<p;         p=Math.round(p/1000);         q=Math.round(q/1000);         t=Math.max(p,q)-Math.min(p,q);         t=Math.min(t,r());         }     function end() {         i='';         if(o('screen=market&mode=own_offer')) {             if(r()>0) {                 t=new Number(d.getElementsByName('sell')[0].value);                 if(t>0) {                     s=d.getElementsByTagName('input');                     for(j=0;j<s.length;j++) {                         if(s[j].value=='Realizare') {                             s[j].click();                             return;                             }                         }                     }                 v();                 if(t==0){i='No deal';}                 else {                     d.getElementsByName('multi')[0].value=t;                     d.getElementsByName('max_time')[0].value=20;                     d.getElementsByName('sell')[0].value=1000;                     d.getElementsByName('buy')[0].value=1000;                     if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; }                     }                 }             else{i='No merchants';}             if(i!='') {                 s=d.links;                 for(j=0;j<s.length;j++) {                     if(s[j].accessKey=="d"){location.href=s[j].href;return;}                     }                 }             }         }     end();
Ofera fier pentru argila
PHP:
javascript:   var d=(window.frames.length>0)?window.main.document:document;         function o(a) {         b=location.search;         c=new RegExp("\\b"+a+"\\b");         if(b.match(c)){return 1;}         else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;}         }     function r() {         l=d.getElementsByTagName('table');         for(j=0;j<l.length;j++) {             e=l[j].rows[0].cells[0].innerHTML;             if(e.match(/^Negustor/)) {                 return new Number(e.match(/(\d+)/)[1]);                 }             }         return 0;         }     function v() {         var p=new Number(d.getElementById('wood').innerHTML);         var q=new Number(d.getElementById('iron').innerHTML);         var m=d.getElementsByTagName('form');         var k="";         for(j=0;j<m.length&&k=="";j++) {             if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];}             }         for(j=1;k!=""&&j<k.rows.length-1;j++) {             n=k.rows[j].cells[1].childNodes;             u=n[0].title;             f="";             for(g=0;g<n.length;g++) {                 h=n[g].nodeValue;                 if(h!=null)f+=h;                 }             f=f.substring(0,f.length-1);             f*=new Number(k.rows[j].cells[2].innerHTML);             if(u=='fier')p+=f;             if(u=='wood')q+=f;             }         d .getElementById('res_sell_stone').checked=p>q;         d.getElementById('res_sell_iron').checked=q>p;         d.getElementById('res_buy_stone').checked=p<q;         d.getElementById('res_buy_iron').checked=q<p;         p=Math.round(p/1000);         q=Math.round(q/1000);         t=Math.max(p,q)-Math.min(p,q);         t=Math.min(t,r());         }     function end() {         i='';         if(o('screen=market&mode=own_offer')) {             if(r()>0) {                 t=new Number(d.getElementsByName('sell')[0].value);                 if(t>0) {                     s=d.getElementsByTagName('input');                     for(j=0;j<s.length;j++) {                         if(s[j].value=='Realizare') {                             s[j].click();                             return;                             }                         }                     }                 v();                 if(t==0){i='No deal';}                 else {                     d.getElementsByName('multi')[0].value=t;                     d.getElementsByName('max_time')[0].value=20;                     d.getElementsByName('sell')[0].value=1000;                     d.getElementsByName('buy')[0].value=1000;                     if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; }                     }                 }             else{i='No merchants';}             if(i!='') {                 s=d.links;                 for(j=0;j<s.length;j++) {                     if(s[j].accessKey=="d"){location.href=s[j].href;return;}                     }                 }             }         }     end();
Ofera argila pentru lemn
PHP:
javascript:   var d=(window.frames.length>0)?window.main.document:document;         function o(a) {         b=location.search;         c=new RegExp("\\b"+a+"\\b");         if(b.match(c)){return 1;}         else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;}         }     function r() {         l=d.getElementsByTagName('table');         for(j=0;j<l.length;j++) {             e=l[j].rows[0].cells[0].innerHTML;             if(e.match(/^Negustor/)) {                 return new Number(e.match(/(\d+)/)[1]);                 }             }         return 0;         }     function v() {         var p=new Number(d.getElementById('stone').innerHTML);         var q=new Number(d.getElementById('iron').innerHTML);         var m=d.getElementsByTagName('form');         var k="";         for(j=0;j<m.length&&k=="";j++) {             if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];}             }         for(j=1;k!=""&&j<k.rows.length-1;j++) {             n=k.rows[j].cells[1].childNodes;             u=n[0].title;             f="";             for(g=0;g<n.length;g++) {                 h=n[g].nodeValue;                 if(h!=null)f+=h;                 }             f=f.substring(0,f.length-1);             f*=new Number(k.rows[j].cells[2].innerHTML);             if(u=='argila')p+=f;             if(u=='wood')q+=f;             }         d .getElementById('res_sell_wood').checked=p>q;         d.getElementById('res_sell_stone').checked=q>p;         d.getElementById('res_buy_wood').checked=p<q;         d.getElementById('res_buy_stone').checked=q<p;         p=Math.round(p/1000);         q=Math.round(q/1000);         t=Math.max(p,q)-Math.min(p,q);         t=Math.min(t,r());         }     function end() {         i='';         if(o('screen=market&mode=own_offer')) {             if(r()>0) {                 t=new Number(d.getElementsByName('sell')[0].value);                 if(t>0) {                     s=d.getElementsByTagName('input');                     for(j=0;j<s.length;j++) {                         if(s[j].value=='Realizare') {                             s[j].click();                             return;                             }                         }                     }                 v();                 if(t==0){i='No deal';}                 else {                     d.getElementsByName('multi')[0].value=t;                     d.getElementsByName('max_time')[0].value=20;                     d.getElementsByName('sell')[0].value=1000;                     d.getElementsByName('buy')[0].value=1000;                     if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; }                     }                 }             else{i='No merchants';}             if(i!='') {                 s=d.links;                 for(j=0;j<s.length;j++) {                     if(s[j].accessKey=="d"){location.href=s[j].href;return;}                     }                 }             }         }     end();
In caz ca mai doriti si alte variante de comert spuneti-mi si se rezolva.

Aceste variante sunt setate sa trimita negustorii la o distanta maxima de 20 de ore, daca doriti sa o modificati o puteti face de la aceasta portiune a codului: d.getElementsByName('max_time')[0].value=20; unde modificati cifra 20 cu oricare alta cifra doriti, astfel incat negustorii vor merge la distanta maxima dorita de voi.

Enjoy;)
 

DeletedUser36522

m-am uitat in discutiile anterioare...dar nu am gasit ceea ce caut..

Cine ma poate ajuta:

argila pentru fier.
 

DeletedUser25287

m-am uitat in discutiile anterioare...dar nu am gasit ceea ce caut..

Cine ma poate ajuta:

argila pentru fier.
Am rezolvat si aceasta varianta:

Ofera Argila pentru Fier

PHP:
javascript:   var d=(window.frames.length>0)?window.main.document:document;         function o(a) {         b=location.search;         c=new RegExp("\\b"+a+"\\b");         if(b.match(c)){return 1;}         else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;}         }     function r() {         l=d.getElementsByTagName('table');         for(j=0;j<l.length;j++) {             e=l[j].rows[0].cells[0].innerHTML;             if(e.match(/^Negustor/)) {                 return new Number(e.match(/(\d+)/)[1]);                 }             }         return 0;         }     function v() {         var p=new Number(d.getElementById('stone').innerHTML);         var q=new Number(d.getElementById('iron').innerHTML);         var m=d.getElementsByTagName('form');         var k="";         for(j=0;j<m.length&&k=="";j++) {             if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];}             }         for(j=1;k!=""&&j<k.rows.length-1;j++) {             n=k.rows[j].cells[1].childNodes;             u=n[0].title;             f="";             for(g=0;g<n.length;g++) {                 h=n[g].nodeValue;                 if(h!=null)f+=h;                 }             f=f.substring(0,f.length-1);             f*=new Number(k.rows[j].cells[2].innerHTML);             if(u=='argila')p+=f;             if(u=='iron')q+=f;             }         d .getElementById('res_sell_iron').checked=p>q;         d.getElementById('res_sell_stone').checked=q>p;         d.getElementById('res_buy_iron').checked=p<q;         d.getElementById('res_buy_stone').checked=q<p;         p=Math.round(p/1000);         q=Math.round(q/1000);         t=Math.max(p,q)-Math.min(p,q);         t=Math.min(t,r());         }     function end() {         i='';         if(o('screen=market&mode=own_offer')) {             if(r()>0) {                 t=new Number(d.getElementsByName('sell')[0].value);                 if(t>0) {                     s=d.getElementsByTagName('input');                     for(j=0;j<s.length;j++) {                         if(s[j].value=='Realizare') {                             s[j].click();                             return;                             }                         }                     }                 v();                 if(t==0){i='No deal';}                 else {                     d.getElementsByName('multi')[0].value=t;                     d.getElementsByName('max_time')[0].value=20;                     d.getElementsByName('sell')[0].value=1000;                     d.getElementsByName('buy')[0].value=1000;                     if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; }                     }                 }             else{i='No merchants';}             if(i!='') {                 s=d.links;                 for(j=0;j<s.length;j++) {                     if(s[j].accessKey=="d"){location.href=s[j].href;return;}                     }                 }             }         }     end();
 

GigiLuptator

nu merge scriptul de creare oferte la targ
ma poate ajuta ceva
pt mozilla
 

geticul

Am rezolvat si aceasta varianta:

Ofera Argila pentru Fier

PHP:
javascript:   var d=(window.frames.length>0)?window.main.document:document;         function o(a) {         b=location.search;         c=new RegExp("\\b"+a+"\\b");         if(b.match(c)){return 1;}         else{location.search=b.replace(/.*?(\bvillage=\d+).*/i,'?$1&'+a);return 0;}         }     function r() {         l=d.getElementsByTagName('table');         for(j=0;j<l.length;j++) {             e=l[j].rows[0].cells[0].innerHTML;             if(e.match(/^Negustor/)) {                 return new Number(e.match(/(\d+)/)[1]);                 }             }         return 0;         }     function v() {         var p=new Number(d.getElementById('stone').innerHTML);         var q=new Number(d.getElementById('iron').innerHTML);         var m=d.getElementsByTagName('form');         var k="";         for(j=0;j<m.length&&k=="";j++) {             if(m[j].action.indexOf('action=modify_offers')!=-1){k=m[j].getElementsByTagName('table')[0];}             }         for(j=1;k!=""&&j<k.rows.length-1;j++) {             n=k.rows[j].cells[1].childNodes;             u=n[0].title;             f="";             for(g=0;g<n.length;g++) {                 h=n[g].nodeValue;                 if(h!=null)f+=h;                 }             f=f.substring(0,f.length-1);             f*=new Number(k.rows[j].cells[2].innerHTML);             if(u=='argila')p+=f;             if(u=='iron')q+=f;             }         d .getElementById('res_sell_iron').checked=p>q;         d.getElementById('res_sell_stone').checked=q>p;         d.getElementById('res_buy_iron').checked=p<q;         d.getElementById('res_buy_stone').checked=q<p;         p=Math.round(p/1000);         q=Math.round(q/1000);         t=Math.max(p,q)-Math.min(p,q);         t=Math.min(t,r());         }     function end() {         i='';         if(o('screen=market&mode=own_offer')) {             if(r()>0) {                 t=new Number(d.getElementsByName('sell')[0].value);                 if(t>0) {                     s=d.getElementsByTagName('input');                     for(j=0;j<s.length;j++) {                         if(s[j].value=='Realizare') {                             s[j].click();                             return;                             }                         }                     }                 v();                 if(t==0){i='No deal';}                 else {                     d.getElementsByName('multi')[0].value=t;                     d.getElementsByName('max_time')[0].value=20;                     d.getElementsByName('sell')[0].value=1000;                     d.getElementsByName('buy')[0].value=1000;                     if(d.getElementById('res_sell_wood').checked){ i='Don\'t sell clay'; }                     }                 }             else{i='No merchants';}             if(i!='') {                 s=d.links;                 for(j=0;j<s.length;j++) {                     if(s[j].accessKey=="d"){location.href=s[j].href;return;}                     }                 }             }         }     end();
nu functioneaza deloc scriptul
 

suresh

am incercat si pe mozila si nu merge :|

@jack incearca tu sa-l pui la punct
 

rookmaster

M-am chinuit si eu sa gasesc un script de completare oferte in targ dar nu am gasit nimic acceptabil ... asa ca am facut unul conform dorintelor mele.
Cine are altul mai "smecher" sa il posteze.

Scriptul functioneaza in felul urmator:
- apasati pe script oriunde sunteti: daca nu sunteti in pagina care trebuie va redirectioneaza in pagina de targ la oferte proprii in satul pe care va aflati (apoi mai dati un click pe script pentru afisarea listei derulante)
- daca nu sunt negustori disponibili trece la urmatorul sat (cand ajunge la ultimul trece la primul s.a.m.d.)
- daca sunteti unde trebuie (in pagina de targ la oferte proprii) apare o lista derulanta cu tipurile de oferte predefinite
- alegeti pe cea care o doriti

Tot ce trebuie sa modificati este urmatorul text:
var tip = {'0':['','','','','',''],'1':[1000,'argila',600,'lemne',10,10],'2':[1000,'argila',700,'lemne',20,10],'3':[1000,'argila',800,'lemne',30,10],'4':[1000,'argila',900,'lemne',40,0]};
Prima oferta cu numarul 0 nu o modificati ... e oferta de resetare.
Sa luam de exemplu oferta cu numarul 2:
- primul termen 1000 si al doilea "argila" reprezinta cantitatea si tipul de resursa pe care o oferiti la vanzare
- al treilea termen 700 si al patrulea "lemne" reprezinta cantitatea si tipul de resursa pe care doriti sa o primiti la schimb
- al cincilea termen 20 reprezinta numarul maxim de ore
- al saselea termen 10 reprezinta de cate ori reluati oferta

P.S. In cazul in care doriti sa calculeze automat de cate ori sa reluati oferta in functie de resursele si negustorii disponibili treceti 0 la al saselea termen (ca in oferta cu numarul 4)


[/QUOTE]
 
Ultima editare de un moderator:

rookmaster

E in curs de legalizare :))
Singura modificare fata de varianta analizata de Jackass20 este adaugarea ofertei automata la selectare fara sa mai dai click pe "Realizare" ... adica am adaugat textul: "$('form')[0].submit()"
Ramane de vazut daca aceasta adaugare este permisa sau nu.
Fara aceasta adaugare cred ca e legala ... cel putin asa am inteles din raspunsulu lui Jackass20

Jackass20 a spus:
Salut,

Scuze ca nu am raspuns, am fost ocupat:(

Poti sa faci tu un topic, pui scriptul, instructiunile si le zici sa lase feedback, imbunatatiri, bug-uri, etc. Pe urma o sa il pun si eu la colectie, inca am niste probleme si nu am timp.:(

Ma bucur ca ti-ai dat interesul sa faci ceva bun pentru toti si sa il si impartasesti cu ei:D