Comments by syntax53 on scripts
26 comments
|
Comment on: |
@kupony: the arriving merchants calculation works for me |
|
Comment on: |
thanks for the update, works great |
|
Comment on: |
script is broken on the send troops page now. travian made some changes to their code. |
|
Comment on: |
not getting any center numbers at all on the buildings with 2.9.0 (fields work). no time to check the code to see why atm. |
|
Comment on: |
couple other comments-- 1) it would be nice if after it calculated what it will send, if it showed you remaining number of merchants and remaining capacity (allowing you to manually edit in some more of a certain resource) 2) i edited in horizontal rows between the villages and made the village names bold so they stand out more. 3) when you click send it would be sweet if it told you "sent" right underneath the village instead of up top. could also add some information there (sent where, how many merchants used/available now, etc). -syn |
|
Comment on: |
not really sure what's causing it but every now and then when i go into it, one village will be missing from the list, and another will be repeated (name, current resources, and everything). happens with different villages too. |
|
Comment on: |
@studace: yes. however be aware that QP's script does not support village hopping. meaning if you change the village in another tab, and aren't on the right village when the script goes to start the attack it will fail. a better attack manager is this: http://userscripts.org/scripts/show/13872 |
|
Comment on: |
curious how you get the script to come up without control+alt+z?? also, it would be nice to have a drop down for the village coordinates (like http://userscripts.org/scripts/show/9544). dropdowns for fractions/percentages would be nice as well. lastly, maybe a checkbox to limit/push merchants to max capacity. e.g. if your merchants can carry 1200 and you have 1300 resources available, it only sends 1200. |
|
Comment on: |
seems it would be better with just a checkbox to "send max" for each village. you should be able to select which type of resources to send with checkboxes as well (all, only wood, wood/clay, wood/crop, etc). so then it would go through every village and send the most it can of the selected resources types based on merchant capacity and available merchants. there should also be an option to only use merchants to their fullest capabilities. so it wont sent one merchant with only 100 resources for example. great idea though, i hope it gets expanded on. -sin |
|
Comment on: |
sometimes it helps to explain the reason why it happens. QP's script needs to see that "There are no reports available" message from travian once it's done. If you stop the script or switch pages before it sees that message then it thinks it should keep deleting. So when that happens, the fix is to disable the script, go to the page, enable it, and then allow it to see the message so it knows it has finished. To QP: Wouldn't a possible solution for this be when your script goes to detect the page that it's on (dorf1, dorf2, marketplace, hero's mansion, etc etc etc...) if it's on any of those pages other than reports then it should just turn off report deleting? |
|
Comment on: |
regarding you thinking the config vars make things too complicated... it just prevents me from having to make a slew of edits everytime you release an update and also gives people more options and prevents others from releasing custom versions of your scripts. for example i just updated to your latest version and had to spend 10 minutes commenting and changing code. also, for the resource fields, it's much cleaner to make max level white (no color change), upgradable green, and not upgradable red. -sin |
|
Comment on: |
sorry for the tripple post... apparently non-breaking spaces don't display even under the "pre" tag. that's what is supposed to be there. |
|
Comment on: |
Weird... I don't know what happened with that paste, plus I missed one (wish you could edit your comments on here)... Supposed to be--
if (CONFIG_FEATURE_RESOURCES_INFO = 2) {
resOverflowSpanProd.innerHTML = ' (' + resOverflowSpanTime + ')';
} else {
resOverflowSpanProd.innerHTML = '(' + ( (g_res_prod[i] > 0) ? '+' : '' ) + g_res_prod[i] +
', ' + resOverflowSpanTime +
')';
}
And then I forgot the config var/comments changes--
// ########## Resource info and counters - 0=disable ; 1=full on ; 2=time only ########## var CONFIG_FEATURE_RESOURCES_INFO = 2; |
|
Comment on: |
Another configuration option... I know you love me =P Remove the production amounts from the resource timers...
// transformGeneric_addQPConfigurationMenu();
if (CONFIG_FEATURE_RESOURCES_INFO != 0) {
transformGeneric_addOverflowDepleteTimes();
}
And then in "transformGeneric_addOverflowDepleteTimes" ...
if (CONFIG_FEATURE_RESOURCES_INFO = 2) {
resOverflowSpanProd.innerHTML = ' (' + resOverflowSpanTime + ')';
} else {
resOverflowSpanProd.innerHTML = '(' + ( (g_res_prod[i] > 0) ? '+' : '' ) + g_res_prod[i] +
', ' + resOverflowSpanTime +
')';
}
The "?????" was just an attempt to make it a little more centered. Ultimately I would prefer each time to be centered under the current/max resource counts but I wasn't sure how to do that. -syn |
|
Comment on: |
Regarding Title prefix, I didn't comment anything. It was added code. My setting of 3 makes "Travian com5 - Village Name" just show as "Village Name" where as your #2 setting makes it "T com5 - Village name." Regarding additional config vars, I think it's a great idea you added them. One time code additions to make your script versatile for everyone needs and preferences. More options the better, IMO. good work,
|
|
Comment on: |
Marketplace fix works, thanks. Some additional configuration options-- I prefer to remove the title prefix all together...
/** transformGenericPage_fixTitle */
function transformGenericPage_fixTitle() {
if ((DEF_CONFIG_TITLEFIX != 1) && (DEF_CONFIG_TITLEFIX != 2) && (DEF_CONFIG_TITLEFIX != 3)) { return; }
var titleInPage = xpathEvaluate('//h1');
if (titleInPage.snapshotLength == 0) { return; } // just in case a page has no title
var titleInPageStr = titleInPage.snapshotItem(0).textContent;
if (document.location.pathname.indexOf('/dorf2.php') == 0) {
titleInPageStr = String.fromCharCode(164, 32) + titleInPageStr;
}
var dTitle = document.title;
if (DEF_CONFIG_TITLEFIX == 2) {
var spacePos = dTitle.indexOf(" ");
dTitle = dTitle.substr(0, 1) + dTitle.substr(spacePos);
}
if (DEF_CONFIG_TITLEFIX == 3) {
document.title = titleInPageStr;
} else {
document.title = dTitle + " - " + titleInPageStr;
}
}
Alter comment at the end..
// ########## Title Fix - 1 = appends title of current page; 2 = additionally shortens 1st word of real title to 1st letter (eg.: "Travian" -> "T"); 3 = remove "Travian Com" all together ########## ----------- I was adding code for another configuration option and found a bug with the field color coding... it doesn't seem to be matching up the link map to the colored circles. the place you click ends up being a little left and up from where the field number is. on my 15 cropper some level 14 fields were red and some were still white as well. and then on the only village that i currently don't have maxed fields, it doesn't show any colors at all. anyway, ultimately I think the feature looks much nicer when you don't show any number for buildings when it is maxed. I added the following: // ########## Color Coding :: 0=All Off, 1=All On, 2=On except for maxed buildings/fields var CONFIG_COLOR_CODING = 2; ... and then in the transformPageDorf2_addBuildingLevels function add this at the beginning:
if (CONFIG_COLOR_CODING == 0) { return; }
and then around where "DIV.style.backgroundColor = DEF_COLOR_RESOURCE_MAXLEVEL;" is, change it to this:
if (CONFIG_COLOR_CODING == 2) { DIV.style.visibility = "hidden";
} else { DIV.style.visibility = "visible"; DIV.style.backgroundColor = DEF_COLOR_RESOURCE_MAXLEVEL;
}
... once the issues are fixed with Dorf1, the same type of options should be added there. ----------- lastly, option to disable delayed troop sending functions (i use attack builder grease monkey script which supports "village hopping") // ########## Disable delayed troop sending features var CONFIG_DISABLE_TROOP_DELAY = true; add to beginning of "transformPageSendTroopsConfirm_addTimeOffArrivalSync" function--
if (CONFIG_DISABLE_TROOP_DELAY == true) { return; }
I hope this all makes sense =P -syn |
|
Comment on: |
i know i'm right because removing the direct link makes the hero's mansion start working. if you use the plus feature you can duplicate it yourself by creating a direct link with any any name "http://s5.travian.com/build.php?id=29&t=3" for the URL. then visit the hero's mansion page. i already have 2 sitters and i can't free up a slot. |
|
Comment on: |
RE: My Hero's Mansion not working. I figured out what was causing the problem. I looked at the code for how you were detecting the marketplace and I saw this-- var linksMyProfilePage = xpathEvaluate('//a[contains(@href, "&t=")]'); ... so i went looking at me hero's mansion page where it might be seeing that. then i realized why-- i place my marketplace in the same plot in all of my villages. that enabled me to make a "Direct Links" to the NPC trader using the plus feature. so one of my "Direct Links" is "http://s5.travian.com/build.php?id=29&t=3". Your script is seeing that and I assume thinking all of my pages are the marketplace then. |
|
Comment on: |
sorry for the multi-posting, but referring again to the auto-deleting of messages i figured out what is causing it because i did it again. it's if you click "delete trade" and then click out of the reports section before it has finished. when you return to the reports it starts deleting all of your reports. |
|
Comment on: |
follow up to my previous issue-- i had to uninstall the script from greasemonkey and choose "uninstall associated preferences" when I did so and then reinstall the script in order to get it to stop deleting all of my reports automatically. (and yes it was still doing it with all other scripts disabled). |
|
Comment on: |
new issue... QP targets suddenly wants to delete ALL of my reports any time i visit the reports page. as soon as i click the reports icon from the tool bar it starts selecting ALL of the reports on the pages, deletes them, and then continues page by page. i have to click to another page to stop it. it does this even after restarting firefox. i had to put an exclusion on "http://s5.travian.com/berichte.php" for QP targets to get it to stop deleting all of my messages automatically =\ |
|
Comment on: |
Still does it with all other scripts disabled. Playing on com5. Here is what the error console reports: http://travian.twistedtek.net/images/heros_mans... -syn |
|
Comment on: |
Something is weird with hero status for me. It doesn't show anything special at all on my hero's mansions. if i log into my sitter's account who is gaul it shows fine. i have a level 23 Equites Caesaris. It also shows on my other sitter who has a Equites Imperatoris. Something wrong with ECs?? |
|
Comment on: |
a suggestion-- provide a checkbox to ignore checking to see if you have enough troops. this way you could schedule attacks that will start later after troops have returned |
|
Comment on: |
any idea what would cause the time to become unsynchronized? i set up 4 attacks, each with 2 waves. they all went out in the right order and the waves all went out in proper concession. however, i set them up about 2-4 hours in advance. the first two attacks went off in 2 hours and the last two about 2 hours later. when i got back to my computer the first attack went off 8 seconds early according to the time they ended up landing at and the second attack 4 seconds early. time to land was 02:00:01 for all 4 attacks. the first attack ended up landing at at 01:59:51 and the second at 01:59:56. about an hour before the last two attacks were supposed to go off i had to leave again so i re-clicked "arrival time" and then "set timed arrival" and locked my computer. those two attacks ended up landing at 01:59:57 and at 02:00:04. i could understand attacks being later than expected due to server or network lag. however, what is causing the time to become so unsynchronized that they would actually go off early? is there any way to force more frequent time syncs or is there something i can do to prevent this from happening? thanks! |
