Error
|
|
Congratulations for the work, but he has a mistake, I do not know if it's only in my case and also with others, but when the script reads the report for no longer continue to send attacks. I wish it solves the problem. |
|
|
please deactivate all other script and see if it works then. if not open the error console (ctrl+alt+j) and give me any errors given from the script. |
|
|
I tried disabling all scripts but still does not.
userscripts.org / FarmingMachine - MOD Teutonia: Main function called userscripts.org / FarmingMachine - MOD Teutonia: In the Village Profile Page userscripts.org / FarmingMachine - Teutonia mod: FarmEditBox Inserton done userscripts.org / FarmingMachine - Teutonia mod: 1 userscripts.org / FarmingMachine - Teutonia mod: 3 |
|
|
looks like you have two different versions of the farmingmachine script installer. two different names for the script appear.
|
|
|
Já desinstalei o outro e mesmo assim ele pára.
|
|
|
Now uninstall the other and even then it stops.
|
|
|
http://i276.photobucket.com/albums/kk32/m4rtini...
there's seams that the script don't work with single village account for some reason. |
|
|
This is the q appears: Warning: Error in processing the value of property 'FILTER'. Statement ignored.
Error: document.getElementsByTagName ( "tr") [8] is undefined
|
|
|
On travian.org this script don't work( |
|
|
isn't travian.org a T3.5 server? if so that version is not supported. |
|
|
Czech lang. didnt display corectly special symbols (i tried to change to unicode atc.. -it doenst help) so i rewrite it in source and it works well:
|
|
|
i think i found a bug: the script sets farms to inactive even if i did not loose troops to the
is it possible to modify the script so when i add a farm it autosets it to normal attack instead of raid? |
|
|
Script is awsome, but i am having a major problem.
|
|
|
Solved! The script no longer gets stuck in the report page. There are some hardcoded references to dorf3.php - the report page doesn't have any a href=...dorf3.php -> throws error -> gets stuck. Just rewrite the function by copy/paste-ing the code below over the original. Enjoy!
function checkreports()
{
for (i=0; i<document>=0;i--){
pulled.innerHTML = tag.snapshotItem(i).innerHTML;
attackreporturl = pulled.getElementsByTagName('a')[0].href;
//alert(attackreporturl);
endofA = tag.snapshotItem(i).innerHTML.indexOf("");
testIndex = tag.snapshotItem(i).innerHTML.indexOf("(",endofA);
if (testIndex != -1 && endofA < testIndex) {
//Timeout(1000);
//alert(url);
GM_setValue("lastreportpage", url);
window.open(attackreporturl, "_self");
setTimeout("window.location.replace('" + attackreporturl + "')",1000);
break;
}
}
if (i==-1){
newreport = document.getElementsByTagName('html')[0].innerHTML.indexOf("m1.gif")+document.getElementsByTagName('html')[0].innerHTML.indexOf("m3.gif");
//alert (newreport);
//Timeout(1000);
if ( newreport == -2 || url.indexOf("berichte.php?s=1000") != -1) {
GM_setValue("lastreportpage", "/berichte.php");
setTimeout("window.location.replace('" + rootPath + "a2b.php')",1000);
} else {
//alert(document.getElementsByTagName('a')[33].href);
window.open(document.getElementsByTagName('a')[dorf3index-1].href, "_self");
}
}
}
//Is this any report page?
if ((url.indexOf("berichte.php?id=") != -1 || url.indexOf("berichte.php?newdid=") != -1) )
{
var test = find("//a[contains(@href,'uid=')]",XPList);
var uids = find("//a[contains(@href,'karte.php?d=')]",XPList);
//test = find("//a[contains(@href,'uid=')]",XPList);
if(test.snapshotLength == 3 && uids.snapshotLength==2)
{
troopsinattack = document.getElementsByTagName('tr')[7].innerHTML.match(/\d+/g).join();
casualties = document.getElementsByTagName('tr')[8].innerHTML.match(/\d+/g).join();
//attackedId = (document.getElementsByTagName('a')[dorf3index-1].href.split('d=')[1].split('&c')[0]);
attackedId = uids.snapshotItem(1).href.split('d=')[1].split('&c')[0];
//attackerVillageId = (document.getElementsByTagName('a')[dorf3index-3].href.split('d=')[1].split('&c')[0]);
attackerVillageId = uids.snapshotItem(0).href.split('d=')[1].split('&c')[0];
//attackerPlayerId = (document.getElementsByTagName('a')[dorf3index-4].href.split('uid=')[1]);
attackerPlayerId = test.snapshotItem(1).href.split('uid=')[1];
playerId = getPlayerId()
//thisCValue = getParamFromUrl(document.getElementsByTagName('a')[dorf3index-3].href, 'c')
thisCValue = getParamFromUrl(uids.snapshotItem(0).href.split('d=')[1].split('&c')[0], 'c');
coords = id2xy(attackedId);
temp = attacktable();
efficiency = temp[0]
gain = temp[1];
if (troopsinattack.split(',').join() == casualties || gain < 0)
{
suffix = suffixGlobal + '_' + attackerVillageId;
index = getSindexFromXY(coords.x,coords.y, suffix);
if (index != -1)
{
farmSetInactive(index, suffix);
//alert("farm set inactive");
}
}
if(casualties == "0,0,0,0,0,0,0,0,0,0" && efficiency == 100 && playerId == attackerPlayerId )
{
temptroops = troopsinattack.split(',')
tempsum = 0;
for (i=0; i>9;i++)
{
tempsum = tempsum + parseInt(temptroops[i]);
}
troopsinattack = tempsum +",0,0,0,0,0,0,0,0,0";
//alert("1");
//no loses and max res gathered. put target in priority queue for asap attack.
//villageName = document.getElementsByTagName('a')[dorf3index-1].innerHTML
//playerName = document.getElementsByTagName('a')[dorf3index-2].innerHTML + '(Priority)';
villageName = uids.snapshotItem(1).innerHTML;
playerName = test.snapshotItem(2).innerHTML + '(Priority)';
attackInfo = coords.x +','+ coords.y +'|'+ troopsinattack +'|1|'+playerName+'|1234|'+villageName+'|'+ thisCValue +'|true|4';
addtoprio(attackInfo, attackerVillageId);
suffix = suffixGlobal + '_' + attackerVillageId;
index = getSindexFromXY(coords.x,coords.y, suffix);
if (index != -1)
{
newEditFarm(index, suffix, tempsum+1);
}
//alert("adding one ekstra soldier to the farm, since it maxed out.");
//alert("added to prio");
}
}
setTimeout("window.location.replace('" + rootPath + "berichte.php')",1000);
}
}
|
|
|
Thanks, I'll try this out. Edit: It started "working" like the sowrov's script, a.k.a. acting like its not even there. Maybe its a copy-paste mistake, I don't know. I tried it for two times and it still doesn't work, tho. Edit no. 2: Here's what the error console says: Error: [Exception... "'JavaScript component does not have a method named: "handleEvent"' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: chrome://global/content/bindings/popup.xml :: hidePopup :: line 98" data: no]
and: Error: missing ) in parenthetical
|
|
|
can you please post the line. I'm not sure which line that is. the only changes done by me are: 1.added the uids var and defined both uids and test as local vars
var test = find("//a[contains(@href,'uid=')]",XPList);
var uids = find("//a[contains(@href,'karte.php?d=')]",XPList);
2.
//attackedId = (document.getElementsByTagName('a')[dorf3index-1].href.split('d=')[1].split('&c')[0]);
attackedId = uids.snapshotItem(1).href.split('d=')[1].split('&c')[0];
//attackerVillageId = (document.getElementsByTagName('a')[dorf3index-3].href.split('d=')[1].split('&c')[0]);
attackerVillageId = uids.snapshotItem(0).href.split('d=')[1].split('&c')[0];
//attackerPlayerId = (document.getElementsByTagName('a')[dorf3index-4].href.split('uid=')[1]);
attackerPlayerId = test.snapshotItem(1).href.split('uid=')[1];
playerId = getPlayerId()
//thisCValue = getParamFromUrl(document.getElementsByTagName('a')[dorf3index-3].href, 'c')
thisCValue = getParamFromUrl(uids.snapshotItem(0).href.split('d=')[1].split('&c')[0], 'c');
and
//villageName = document.getElementsByTagName('a')[dorf3index-1].innerHTML
//playerName = document.getElementsByTagName('a')[dorf3index-2].innerHTML + '(Priority)';
villageName = uids.snapshotItem(1).innerHTML;
playerName = test.snapshotItem(2).innerHTML + '(Priority)';
|
|
|
try making the changes yourself, don't rely on copy paste. maybe some characters get altered - i'm thinking < instead of < |
|
|
sorry, I'm not much of a coder, I just tried to copy & paste into the part of script that starts with "function checkreports()" and it stops working. It may as well be my fault :( Anyone else tried this? |
|
|
i'm running out of ideas so i uploaded my patched script here http://userscripts.org/scripts/show/44170 see if that works for you. try this:
the best thing would be for m4rtini to fix his version so I can erase mine instead of polluting this site with yet another script. |
|
|
If i don't want increase troop count. what should i do?
|
|
|
I tried your fix Upgrayedd, and it wroks! Thank you a lot, now I can farm 24/7 ;) |
|
|
m4rtin - check out my fixes. it would be great if you can integrate them in your next release. they're here http://userscripts.org/scripts/show/44170 |
|
|
Thanks Upgrayedd I've integrated your fix in this update. |
|
|
the prioritized attack queue was removed?
|
|
|
no it wasn't removed. are you sure that it's not working for you? |