// ==UserScript== // @name MyFreeFarm Automat // @namespace https://github.com/BastianKanaan/GMscripts_MyFreeFarm // @author BastianKanaan // @description Extends MyFreeFarm // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB94BGgo6NO+u5q4AAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAS0ElEQVRo3t2aeYxl11ngf+fub3+172t3V1cv7sVuJ3bs7jh2QtoMDoHEwRlCbMJEATRiSaKBQTNBCKGwBwSDNAyTQVGCYJIMEINjxrFix3E73mO7TW/V1VXVtS+v6i13v+ee+aNvQSXDaCTS7W7nSE/v3veuzrm/8y3nO9934Dq08cE+APv9E/1//tDN+16/9+hNJ/l+bXv3jAHw4zf1P/sLdx5TRqXyc++fHPvsGzW+/kbC5vMOyyvrfOSDJz99eM/gj+09fkK9Na/fW8sVzr86NfOl7ydgB+iK46TnVz75wJNtHZX3rcuUI8dvFS9cnuHQ7YcOWprTfvb8pUe/H4BzwH7g0H/59INfq3Z09++ZHBPHbn8LpVKF3WNdWPlOdeIdd962MDf/8vSl+XPX8mW0awxrAiPAgd/4xXf+wdaG74yP7BL9w/vp7x2h1WrRM3SYwf5+8cLz31Yf/w8f/fK1nn3tGkt2D3AE6J7o6xoc7Cjyq//pt3ntm88wMzvDhfMX+dmP/AJJnDKxe0j09HQZDzzwns+9GVW6CBwGjgIdhbz91vfdffjg6soWrhcwf+p5Cu7L3DwhWTkdYvVWCeOEQsFm//5dY1/4wld+880kYQeYBG4CqoD23uMTk0mcQJTQF9R4/48PM3mwDU2HDz5Y5dk/+VPc5YuErZpKooZ9LSVsXOX+BNAB7AUK2X1yx97C7oXpNQb7Nrn5pw5hOA6FthLFYh4hdD7+B8NceHGKi2eqYmTfmAGwb3I3Z85O3fAS1oHubckC6IZ9u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IFj64gWTFaUfA37kken6oyA/HHUMfwqWuV6tANwJ/BrwF9le+W7gs6OVwnYq4k9vGuy8cP/+8jPQb/4L6/0w8BPAFxHi+I7//puZyx/YMc5f2MXKEa5z07Ii2k8AN2c7KwG8e8czd+Rs+wN2tTM33Nv9L/XRA9wP3PVdGpf7rue6rsYL/x8HbwtumjbAVwAAAABJRU5ErkJggg== // @date 31.08.2015 // @version 2.5.6 // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html // @include /^http:\/\/(|www\.|s\d+\.)au\.myfreefarm\.com\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)veselaferma\.com\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\.br\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.de\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.cz\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.dk\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.gr\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)migranjalinda\.es\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)mabelleferme\.fr\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\.hr\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.ae\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.ir\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.it\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)enkicsitanyam\.hu\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.nl\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.co\.nz\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.no\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)wolnifarmerzy\.pl\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)pt\.myfreefarm\.com\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)fermavesela\.ro\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)mojaderewnja\.ru\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.se\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)th\.myfreefarm\.com\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)tr\.myfreefarm\.com\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.co\.uk\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\/.*$/ // @include /^http:\/\/(|www\.|s\d+\.)myfreefarm\.com\.vn\/.*$/ // @exclude http://*/dyn_bubbles.php* // @exclude http://*/login_inc.php* // @exclude http://*/stadt/* // @exclude http://*/nachrichten/* // @exclude http://*/vertraege/* // @exclude http://*/nutzer/* // @exclude http://*/payment/* // @grant GM_addStyle // @grant GM_deleteValue // @grant GM_getValue // @grant GM_listValues // @grant GM_log // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant unsafeWindow // @require https://raw.githubusercontent.com/BastianKanaan/GMscripts_MyFreeFarm/master/MyFreeFarm_Common_functions.user.js // ==/UserScript== const VERSION=GM_info["script"]["version"]; const neededVersionBerater="2.5.9"; const neededVersionFunctionFile="2.1.7"; const GM_Home =GM_info["script"]["namespace"]; const GM_Source=GM_info["script"]["namespace"]; // [version,date,[[de,en],[de,en],...]] const CHANGELOG=[["2.0","29.05.2014",[["Migration nach openuserjs.org","Migration to openuserjs.org"],["Script wird jetzt auf GitHub entwickelt","Script now developed on GitHub"]]] ,["2.1","11.07.2014",[["Neu: Changelog","New: Changelog"],["Refaktorierung der Zonen-Daten","Refactoring of zones data"]]] ,["2.1.1","12.07.2014",[["Bugfix","Bugfix"]]] ,["2.1.2","22.08.2014",[["Bugfix: Sägewerk und Schreinerei durch Patch 18.08.2014","Bugfix: Sawmill and carpentry by patch 18.08.2014"]]] ,["2.1.3","02.09.2014",[["Neu: Doppelte Sicherung des Bots gegen Ausfälle. Entsprechende Optionen.","New: Double protection against failing of the bot. Corresponding options."],["Refaktorierung der Optionen","Refactoring of settings"]]] ,["2.1.4","09.09.2014",[["Bugfix","Bugfix"]]] ,["2.1.5","09.12.2014",[["Bugfix","Bugfix"]]] ,["2.1.6","18.12.2014",[["Neu: Bot für Waltraud kann jetzt in den Optionen aktiviert werden","New: Bot for donkey can be activated in options"]]] ,["2.2.0","01.02.2015",[["Neu: Ernte-Bot für Güterhof","New: Cropping bot for megafield"]]] ,["2.4.0","12.02.2015",[["Anpassung an Firefox 35","Fix for Firefox 35"]]] ,["2.4.1","13.02.2015",[["Bugfix: Optionen","Bugfix: Settings"]]] ,["2.5","27.06.2015",[["Neu: Bot für Güterhof","New: Bot for megafield"],["Korrektur der Queue-Berechnung","Correction of queue calculation"],["Refaktorierung des Loggings","Refactoring of logging"]]] ,["2.5.1","03.07.2015",[["Neu: Anpassung für Pflanzen der Kräuter","New: Fix for planting herbs"]]] ,["2.5.2","05.07.2015",[["Text-Korrekturen","Text fixes"]]] ,["2.5.3","11.07.2015",[["Kleinere technische Korrekturen","Smaller technical fixes"]]] ,["2.5.4","28.07.2015",[["Fix: Fünftes Regal","Fix: Fifth rack"]]] ,["2.5.5","31.07.2015",[["Anpassung an Spiel-Update","Fix for game update"]]] ,["2.5.6","31.08.2015",[["Anpassung an Spiel-Update","Fix for game update"]]] ]; if(!VERSIONfunctionFile){ alert("Hi, I am the Automaton-Script.\nThe function-file is missing.\nPlease install me again."); location.href=GM_Source; }else if(compareVersions(neededVersionFunctionFile,VERSIONfunctionFile)>0){ alert("Hi, I am the Automaton-Script.\nThe function-file is too old.\nPlease install me again."); location.href=GM_Source; } const LOGGING_ARBITER=false; const PRODSTOP=-1; const PRODSTOPold=66; // TODO remove const MILLSTOPold=0; // TODO remove const ExtendedListCHAR="l"; var extendedListReg=/^l(\d+)$/; const REPEAT_NO_LIMIT=-1; const REPEAT_RESTART=0; const OPTION_ITEM_REPEAT=false; // should be OPTION_LIST_REPEAT=!OPTION_ITEM_REPEAT, But is not needed const OPTION_LIST_REPEAT=true; // should be OPTION_LIST_REPEAT=!OPTION_ITEM_REPEAT, But is not needed const DEFAULT_ZONELIST_ITEM=[PRODSTOP,0,0,false,false,REPEAT_NO_LIMIT];// ["prodId","AmntToDo","AmntToGo","rackMode","mode","AmntToRepeat"] //mode=Field,Rack,Time,Repeat const DEFAULT_ZONELIST_ITEM_ARRAY=[DEFAULT_ZONELIST_ITEM]; const DEFAULT_ZONELIST_ITEM_ARRAY2=[DEFAULT_ZONELIST_ITEM,DEFAULT_ZONELIST_ITEM]; const DEFAULT_ZONELIST_MILL=[PRODSTOP,0,0,0,[]]; // {"pId":PRODSTOP,"AmntTodo":0,"AmntMax":0,"AmntItem":[]} const DEFAULT_ZONELIST_MILL_ARRAY=[DEFAULT_ZONELIST_MILL]; const _TEXTE_STOP="----"; const row1=2;const row2=21;const row3=38;const row4=55;const row5=72;const row6=89;const row7=108; const col1=2;const col2=21;const col3=40;const col4=55; //Icon images const IMAGES={"repeat_off":'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAAACXBIWXMAAAsSAAALEgHS3X78AAABoUlEQVR4nK2TQW7aQBRAfZ54wKEhEaA48djYhDiqMQdooKRpthjqdgHYSjcp66B0GYsDhB273IJUjdQcoVd4XUApVqqWViye%2Fnz90dOfmT8KoGyCjUj%2BS1T363x7evr%2BR9F0OmU0Gq1wPY%2FX8%2FzzzQ2WaWIcGiRJwjPRl4cHfK%2FGoX6AKeUSS0osaWIucKwybvWY46Mq0pD0%2B72lTHl8%2FIpjO1jSpFKpcHF%2BQdAO6LTbBCkCukGHE9flxHXxfT%2Fd0eXHS0xDYts269xRxbZ5%2B%2BYcQJlM7u6T24TZbGYoZ60zTEMSR9Faok9XV8t9Yfcde%2FldBv0BSqv1mgNd50P4fi3RKmEYUioUaTQaKNEgolQo0gmCpajb7awl7Q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I3sCFvuuWewds%2BgatRAvyOkKzouLZOZM1TX0HTmhIz0m4gXnCDiuYtd5YYcfWjrqSViID4JP6%2Fgf6IinjPjgQMginLJYd%2BKDjpG%2F7q1chNMW07MGyoVlpB%2BctxoNfziVMJveNp2K40oJGTBRhtkQ0vb4u%2B8uIQEDCcJYahUt%2BWtD2Mn7pa1%2F5En8QAIryE1Qpy2mXtZQBhfZr5XQkuWGk8AKu0cXGveO8QJd2lec2gKdoSIS1JEIOGK2F8%2FUMhI2kRsVZKhEZ6iI4%2Fo3JAISMlAGv6zt0aSBRKoNonDwcbNIb7KOEgOJYtdMGvY5CnLPxB3LI%2F6ZMuczFc6la%2FQ%2Br20pNv66gj%2B9iueZicRB4tD%2Fotp6j9pl56M2x%2F%2Bv%2FAYjnimH96%2FpaAAAAABJRU5ErkJggg%3D%3D' ,"rotate":'data:image/gif;base64,R0lGODlhEAAPAKEAAICAgAAAAP%2F%2F%2F%2F%2F%2F%2FyH5BAEKAAIALAAAAAAQAA8AAAIrlI%2BpAOGgTnM0xAmlTS9yF21CRSGlQZrVcaKkKKqxNylBZmDhiy8U4wkiCgA7' ,"minus":'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABGdBTUEAAK%2FINwWK6QAAAClJREFUKFNj%2FA8EDKQAkAZSAAMpisGuGcQagAEFCi28eLD7gdjgJTkeAMUo9xhLWaTjAAAAAElFTkSuQmCC' ,"plus":'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABGdBTUEAAK%2FINwWK6QAAAChJREFUKFNj%2FA8EDKQAkAZSAAMuxUBLsUoNZg0gNxPC4BAdTp4mNrYBvNHfMGxUbs8AAAAASUVORK5CYII%3D' ,"reload_all":'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAARCAYAAAAougcOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAeBJREFUeNq0lEsoRGEYhg%2FjmksZcivkspIslGwoFohcSixkx2Kk7Ni5bIaNhWthocbIzlIoSaFYkIQikdhKNBkZl%2FH%2B03vq6%2FTPSPLVc%2Br83%2Ftfzve%2F37EZoSMF%2BMGH8Yew%2FZDvB7VgH%2FiCaKJAAojnep882I%2BRA4rAKiccggqLJhl0gXXwQN0tWAJ1IDLY4gVgBlyBd0408QAndVlgy5KXvIEp3Ual4FoIP8Wn%2B5lrYWn2xPgKaANloBsciNyk3CANXDLxCEZAKpjn2CywU%2BsUi%2FRoqhED3Mx7eaeBGOPgK09rhgO0ivdocE%2FtTIg7zQSn1M0rN2SAYX6NmjghxEegBpQw3wwa6KI1EA6ywQtPbYaH4%2BWsjNEB7mjRRs2pjjUX%2B2W5rzHNvE7mDiLwSKILVKmeNeITNqWN5bKLu%2FOxNHFBnGp%2BlVFFy%2Frpe91Fqgm5wEXdBagEhaCaZZGRwcP5aZ5AmJ7fYZPpIg%2BcU7doMYObNjbfXTp3tYj6LoB0ywb5YEM0pXnyJtFbg6Dd0ifTcpEwMCeSZ2Ac9HH8RuTU%2FyyRh%2Fn4bcdHs9F8QSY%2BgV5qY2l7r0WjXLoM6kP9u1QUg1Gwy1JsggHhFhnqJ7rNDRwcizD%2BIVQFhug2bXwLMABxaqOs9lkr9wAAAABJRU5ErkJggg%3D%3D' ,"singleArrowUp":'data:image/gif;base64,R0lGODlhBQAJAIAAAP%2F%2F%2FwAAACH5BAEAAAAALAAAAAAFAAkAAAIMhBEXibz2FIOzHVQAADs%3D' ,"singleArrowDown":'data:image/gif;base64,R0lGODlhBQAJAIAAAP%2F%2F%2FwAAACH5BAEAAAAALAAAAAAFAAkAAAIMDA5hqJh72otLJlcAADs%3D' ,"timlinebutton":'data:image/gif;base64,R0lGODlhFwAXAKIBAG1MG%2F%2F%2F%2F3FoUpiLZYhzTm1SNHthPF1BGSH5BAEAAAEALAAAAAAXABcAAAOIGLrc%2FjBCAoAhpBQj1dgLwIhRFgyCUgTCGoAOxwz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JEALzoDMA87NyoSFhI9OTgPDjBCDgc2tzY5OR8cOT3CPRcMFD07PTgOBEIvxzjHzzgHzxXPHSURz9AbpT4wxz3I6bg4ERkWOQcTOMjxDgJCOMDHNsDp%2FRdYHDCxQkS%2FHuR4hcixL0cFChQqVOiXoceBAxIu1HMiBMYBdBcaiGyAAUcGDQxuRGiWTt4LIQ8OXMv2rAGKHfRyRNCQIgKO2J8w%2FPgYMOHADZw3elhgsANnrKZQcewYgM%2BHjgc3sMbSICHWjaNfbxAgsIOAWDVDXzwYcDVCgwFmxxJgO6Au3LFodbxgpWNEAwsYMDDQQViGDAAydCQmXFWHgBcAYpyQwKByB8SoZKACENkwDyEyDOiIIWNBjUU1UC1SRIUHa0BCFtBYsKDOoEF16Awy5AmAAASSECD4jcAAAMJE9wpY%2FmKUkxsGaPhAQMNADQMIUgtYvEqHcRl7X8iAwQOLjxaiYxggXSN1%2B%2FY8EKA%2BHb9AbBKmhujfz19IEAA7' ,"functionR":'data:image/gif;base64,R0lGODlhDwAPAIABAAAAAP%2F%2F%2FyH5BAEAAAEALAAAAAAPAA8AAAIcjI%2BpixAOn2R0SmdwXbHbnXgeqGhRRpbXqqVuAQA7' ,"functionF":'data:image/gif;base64,R0lGODlhDwAPAIABAAAAAP%2F%2F%2FyH5BAEAAAEALAAAAAAPAA8AAAIdjI%2Bpy20AAwQynlkpvhFvB4ZiRn5lZz2olo6uWwAAOw%3D%3D' ,"functionT":'data:image/gif;base64,R0lGODlhDQANAIABAAAAAP%2F%2F%2FyH5BAEAAAEALAAAAAANAA0AAAIYjI9pEMz5oFozNmRPphrPK4Xbx4WeQ34FADs%3D' ,"mode_repeat":'data:image/gif;base64,R0lGODlhDQANALMCABiI%2BqvI%2BQAAAIit902Q9ypz8gNN8Ory%2FgZ6%2B2yX79Xh%2Bkqn%2FEh26X%2B5%2BypX1v%2F%2F%2FyH5BAEAAAIALAAAAAANAA0AAARFUMhJa3XBisSKM85QMQZYGgRFGMUQBOg7FUgmpUGRSLQ9BYiCJFHIpCRAITJAqAUGAESDskAgotdFpQEALL5TDUBDrkQAADs%3D' ,"mode_1time":'data:image/gif;base64,R0lGODlhDQANALMPAEtJSkJBQmVkZZWVlXNxciwrKz49PlFQUYqJiX5%2BfYCAgE9PT4CAf6GgoDAvLwAAACH5BAEAAA8ALAAAAAANAA0AAAQv8MlJq33n1hAm%2Fx8AdA9hnoQALIsmAYIrEbJUANPB6jrg%2FLaCcFj4FWTCmqFWiQAAOw%3D%3D' ,"arrowright":'data:image/gif;base64,R0lGODlhGQARALMPAGAzHPvNoK5tTcWQZva%2FknZMMLN%2FWMBzTc%2BrfuuvfoJYP8eCXJtlRP%2Foudmabf%2F%2F%2FyH5BAEAAA8ALAAAAAAZABEAAATZ8L2iCrj26g2Kl5NBNA0RnGVCrAGRBORQPNWwJo6T7HmfDwhYw6NQGAYDw2K5ODifAsZhORoUjUjDQTB9Tj0UgWCEqBgRjoVBqWU6MIw4olH2GNBRgYERZQwCHRcMBQN0RH8KDFeLDAYVGQUCdFc2HJYARRmSCIcBOQsDDqGgCWUKGgJznEUMKjw8Cy8NGGJAhol%2BaUsDTU46F0drDpNFerxNvFxTDn4GXAYJDVasSrwHony%2BaVJTL4ODBXwLYs5ceXlSA6UUNESKi5lgRJkKIFfyFh4YGvMSEQA7' ,"arrowleft":'data:image/gif;base64,R0lGODlhGQARALMPAGAzHPvNoK5tTcWQZva%2FknZMMLN%2FWMBzTc%2BrfuuvfoJYP8eCXJtlRP%2Foudmabf%2F%2F%2FyH5BAEAAA8ALAAAAAAZABEAAATa8L2iCrj26g2Kl5NBNA0RnGVCrAGRBORQPNWwJo6T7HmfDwhYw6NQiAYLAUNwaDoPi2h00BgUjQkmw1NYOKMHpgHYQFSMCMY24wAfDAsD3IEoVwrwwvoSGCgNS0oCdGVEfhlEgBRXRQwKMGZFCAIYRRyXACMIhpMakglIDgMDbTmQiwwIfgIZDQEJCwM8Oy6FCmoOcgMGFggOX79RonaNsAICcgxtYVADULEGVVcMY0g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p6cQ1gRwZYsnqKh6aOR2kMckJAiCFACXoaz/KSysXs2LVc44d+QWFAM7k6dRNRsdGMLQs3bEobZ2XSUfmcuVKH/PnViClObEAKCxhgZRkUimeeXa53TifzZs2MpSIA7Bt+y6SySH0bAbNjieefIrmY6cofKAM09Io8CuENomAVKAUBH0AOFMX2PFfUjfHMQ0DgMj0UkJFYbuuwL2KQS+34S5ZlkBKO0zhTCeFwDQtEvHBnP8Cw9Ac/6cUhSi7v5xQeCqWZYIynPV4VhH0TPINLvzWRoAAaUtiGjrZTMa5fsIS7q3RtSzTIiWUls10fi66rjlDGbpBQCqkHUqICQUWNWx9+8zTL7xMqDhC+ew5nDt7mvLycl6vrqJkxn0A9uRhQqGp+P0BRkeG+eNyH7qmUYQPYWgYXolyDUMBbuYHFgKnuAcenr+YS9FfAV4B2oAxRyAn5AMKcxFw1/8/CjCBNJD9F+Hva8TmTxPaAAAAAElFTkSuQmCC" }; const BUILDING2FEED=[,,[1,2],[3,4],[5,6],[7,8],,[9,21],[10,110],[11,151],[12],[92,93],[108,109],,,[153,154]]; // task_new_product const FEEDBONUSTIME={"1":600,"2":1200,"3":900,"4":1800,"5":2400,"6":4800,"7":4800,"8":9600,"92":14400,"93":28800,"108":3600,"109":1800,"153":1560,"154":3120};//in sek // task_new_product const CROPCOST={"13":2.5,"14":180,"15":30,"16":500}; var linecount=0; var handled=new Object(); handled.set=function(zoneNrS){ try{ handled.zoneNrS=zoneNrS.toString(); handled.slot=(handled.zoneNrS.match(/\.(\d+)$/)?parseInt(/\.(\d+)$/.exec(handled.zoneNrS)[1],10):null); handled.zoneNrF=handled.zoneNrS.replace(/\.\d+$/,""); handled.farmNr=Math.floor((handled.zoneNrF-1)/6)+1; handled.zoneNr=getGarden(handled.zoneNrF); handled.zoneNrL=getZoneListId(handled.zoneNrF); handled.zoneBuildingTyp=getBuildingTyp(handled.zoneNrF); }catch(err){GM_logError("handled.set","zoneNrS="+zoneNrS,"",err);} }; const queueItemBoxWidth=58; const queueItemBoxTimeHeight=28; const STEPPINGRACK=100; const STEPPINGFIELD=1; var zoneList=new Object(); // zoneList[zoneNrL][queueNum]=DEFAULT_ZONELIST_ITEM var zoneToList=new Object(); var emergencyPlants=new Array(); var zoneWaiting=new Object(); var zoneSettings=new Object(); var autoMillStorage=new Object(); var modeOverViewFarms=null; /* quest-bot needs review var valQuestActivate=null; var valQuestActivateUntilNr=null; var valQuestSolving= null; var valQuestSolvingUntilNr=null; var valLodgeQuestSolving=null; */ var automatStarted=unsafeData.automatStarted=false; var zoneTimeline=new Object(); var automatIcons=new Object(); const CLOSETIME=180; const RAISETIME=2000; //milliseconds const OpenWindow={"all":["multiframe","divQueueBox","divChooseBox","infoPanel","friendscontainer","guildmaincontainer","createguildbox","reallocateBuildingContainer","messages_main"] ,"farm":["farmhousecontainer"] ,"city1":["cart","shop","shopframe","animaldealer","wbwcontainer","adcolumn"] ,"city2":["lotterycontainer","fishpoolinner","formuladealer","windmillinner","collectorscontainer"] }; const MenuCommand=["_currRack","autoMillStorage","buildinginfos","city","cityzones","currentslot","farm","farmamount","farmisinfo","farmisaway","forestry_action","forestry_area","forestry_area_name","forestry_area_pid","forestry_area_run","forestry_area_time","forestry_area_watertime","forestry_cache_area","forestry_farmis","forestry_production_products","forestry_production_run","forestry_production_time","forestry_questdelay_run","forestry_questdelay_time","forestry_quests","forestry_quicknavi","forestry_remain","forestry_run","forestry_slotremain","forestry_slotrun","forestry_slots","forestry_stock","forestry_unlock","forestry_user_buildings","forestry_waterall_cost","formulas","fremains","ftimer","garten_kategorie","garten_prod","garten_zeit","GMberaterDone","GMberaterVersion","GMbotConfigData","GMcalcToLodgeCampaignNr","GMcalcToLodgeQuestNr","GMcalcToQuestNr","GMcurrentPowerup","GMguid","GMgut","GMlodgeCampaignNr","GMlodgeQuestData","GMlodgeQuestNr","GMlodgeTimeEnd","GMlotteryCollectForPrize","GMnpcSaison","GMpreisBeob","GMprodBlock","GMprodGrowTime","GMprodMinRack","GMprodMinRackInit","GMprodMinRackSettings","prodName","prodNameSort","GMprodPlantSize","GMprodRequire","prodStock","prodTyp","prodYield","GMquestNr","GMquestState","readyZone","reallocateBuildingSet","GMsetCalcToLodgeQuest","GMsetCalcToQuest","GMstatBotgutBeob","GMstatBotpreisBeob","GMstatBotVersion","GMusername","GMvalFarmiLimits","GMzoneAddToGlobalTime","guildquestlist_level","locationinfo","lotrack","lotteryprizes","now","poweruprack","produkt_category","produkt_ernte","produkt_level","produkt_name","produkt_x","produkt_y","punkte","QUESTS","rackElement","racksortinfo","unsolvedquests","userfarminfos","userquests","windmillinfo","zoneList","zoneSettings","zoneToList","zoneWaiting"]; var botArbiter=new function(){ var stack=new Object(); var interval=null; var intervalBusy=false; this.add=function(event){ try{ if(LOGGING_ARBITER){ GM_logInfo("botArbiter.add","event="+event,"bot.isActive()="+bot.isActive(),"Begin"); } var priority,fkt=null; switch(event){ case "sessionEnds": priority=999;fkt=doGameSessionEnds; break; case "megafield": priority= 35;fkt=autoMegafield; break; case "farm": priority= 30;fkt=autoFarm; break; case "farmersmarket": priority= 25;fkt=autoFarmersmarket; break; case "windmill": priority= 20;fkt=autoWindmill; break; case "forestry": priority= 10;fkt=autoForestry; break; case "foodworld": priority= 10;fkt=autoFoodworld; break; case "donkey": priority= 5;fkt=autoDonkey; break; case "lottery": priority= 5;fkt=autoLottery; break; case "activatePowerUp":priority= 5;fkt=autoActivatePowerUp;break; case "farmi": priority= 5;fkt=autoFarmi; break; // case "quest": priority= 5;fkt=autoActivateQuest; break; // case "lodgeQuest": priority= 5;fkt=autoActivateLodgeQuest;break; case "otherAccReady": priority= 1;fkt=doGameOtherAccReady;break; } if(!bot.isActive()){ GM_logWarning("botArbiter.add","event="+event,"","Bot is off"); }else if(fkt==null){ GM_logWarning("botArbiter.add","event="+event,"","No bot-function"); }else{ if(intervalBusy){ window.setTimeout(botArbiter.add,100,event); }else{ stack[event]=[priority,fkt]; window.setTimeout(botArbiter.start,100); } } }catch(err){GM_logError("botArbiter.add","event="+event,"",err);} } this.clear=function(event){ try{ if(LOGGING_ARBITER){ GM_logInfo("botArbiter.clear","event="+event,"intervalBusy="+intervalBusy,"Begin"); } if(stack[event]){ if(intervalBusy){ window.setTimeout(botArbiter.clear,100,event); // window.setTimeout(function(){ // botArbiter.clear(event); // },100); }else{ delete stack[event]; } } if(LOGGING_ARBITER){ GM_logInfo("botArbiter.clear","","stack="+implode(stack,"botArbiter.clear/stack"),"End"); } }catch(err){GM_logError("botArbiter.clear","event="+event,"",err);} } this.run=function(){ try{ // GM_log("stack="+implode(stack)); intervalBusy=true; //if(LOGGING_ARBITER){ GM_log("interval, busy:"+busy+" zoneWaiting:"+implode(zoneWaiting)+" stack:"+implode(stack)); } //if(LOGGING_ARBITER){ GM_log("interval, busy:"+busy+" zoneWaiting:"+implode(zoneWaiting)+" stack:"+print_r(stack)); } try{ if(LOGGING_ARBITER){ GM_logInfo("botArbiter.run","","stack="+implode(stack,"botArbiter.run/stack")+" readyZone="+implode(unsafeData.readyZone,"botArbiter.run/readyZone"),"Begin"); } if(bot.isActive()&&(!bot.isBusy())&&checkOpenWindow()){ var found=null; var count=0; for(event in stack){ if(!stack.hasOwnProperty(event)){ continue; } count++; if((found==null)||(stack[found][0]=unsafeData.questData["farm"]["1"]["nr"]){ botArbiter.add("quest"); }else if(unsafeData.questData["farm"]["1"]["state"]==2 && valQuestSolving && valQuestSolvingUntilNr>=unsafeData.questData["farm"]["1"]["nr"] && checkQuest()){ botArbiter.add("quest"); } } if(settings.get("account","botUseQuest")&&valLodgeQuestSolving&&checkLodgeQuest()){ botArbiter.add("lodgeQuest"); } */ if($("linkOtherAccReady")){ botArbiter.add("otherAccReady"); } } if(LOGGING_ARBITER){GM_logInfo("botArbiter.check","","","End");} }catch(err){GM_logError("botArbiter.check","","",err);} } }; var bot=new function(){ try{ var action,active,busy,interval,durationRun,durationStep,runId=0,divInfo; this.isActive=function(){ try{ return !!active; }catch(err){GM_logError("bot.isActive","","",err);} }; this.isBusy=function(){ try{ return !!busy; }catch(err){GM_logError("bot.isBusy","","",err);} }; this.init=function(){ try{ divInfo=$("divBotInfo"); active=settings.get("server","botActive");; if(active===undefined){active=false;} if(active){ bot.activate(); }else{ bot.deactivate(); } }catch(err){GM_logError("bot.init","","",err);} }; this.activate=function(){ try{ active=true; settings.set("server","botActive",active); busy=false; var cell; if(cell=$("divAutomatButtonBot")){ cell.style.backgroundColor="#f55"; cell.setAttribute("mouseOverText",getText("automat_botStop")); cell.firstElementChild.classList.add("rotating"); } if(cell=$("divBotInfo")){ cell.style.display="block"; cell.innerHTML="Busy:--"; } cell=null; botArbiter.check(); }catch(err){GM_logError("bot.activate","","",err);} }; this.deactivate=function(){ try{ active=false; settings.set("server","botActive",active); bot.end(); var cell if(cell=$("divAutomatButtonBot")){ cell.style.backgroundColor=""; cell.setAttribute("mouseOverText",getText("automat_botStart")); cell.firstElementChild.classList.remove("rotating"); } if(cell=$("divBotInfo")){ cell.style.display="none"; } cell=null; botArbiter.stop();//TODO the bot is not deactivated until the timer is runS out .. after that the buttoN should change.. inbetween it should have a inbetween state. stopCloseWindowTimer(); }catch(err){GM_logError("bot.deactivate","","",err);} }; this.start=function(){ try{ GM_logInfo("bot.start","","","",0); try {window.clearInterval(interval);} catch (err){} durationRun=settings.get("country","maxDurationBotRun"); durationStep=settings.get("country","maxDurationBotStep"); busy=true; interval=window.setInterval(bot.run,1000); runId++; return runId; }catch(err){GM_logError("bot.start","","",err);} }; this.end=function(){ try{ GM_logInfo("bot.end","","","",0); top.unsafeData.autoAction=null; runId++; busy=false; }catch(err){GM_logError("bot.end","","",err);} }; this.run=function(){ try{ GM_logInfo("bot.run","","","",0); durationRun--; durationStep--; if(divInfo.style.display!="block"){ divInfo.style.display="block"; } if(divInfo.innerHTML!="Busy: "+action){ divInfo.innerHTML="Busy: "+action; } if(!busy){ try {window.clearInterval(interval);} catch (err){} divInfo.innerHTML="Busy: --"; botArbiter.check(); }else if((durationRun>0)&&(durationStep>0)){ divInfo.innerHTML +="
Reset:"+getTimeStr(durationRun); divInfo.innerHTML +="
Reset:"+getTimeStr(durationStep); }else{ switch(settings.get("country","botErrorBehaviour")){ case "reload": top.location.href=top.location.href; break; default: try {window.clearInterval(interval);} catch (err){} busy=false; divInfo.innerHTML="Busy: --"; botArbiter.check(); } } }catch(err){GM_logError("bot.run","","",err);} }; this.setAction=function(str){ try{ durationStep=settings.get("country","maxDurationBotStep"); action=str; top.unsafeData.autoAction="automat: "+action; }catch(err){GM_logError("bot.setAction","str="+str,"",err);} }; this.checkRun=function(type,run,noBot){ try{ if((!noBot)&&(!active)){ GM_logInfo("bot.checkRun","type="+type+" run="+run,"","BOT INACTIVE"); return false; }else if(!busy){ GM_logInfo("bot.checkRun","type="+type+" run="+run,"","BOT BUSY NOT SET"); return false; }else if(run!=runId){ GM_logInfo("bot.checkRun","type="+type+" run="+run,"runId="+runId,"BOT WRONG RUN ID"); return false; }else{ return true; } }catch(err){GM_logError("bot.checkRun","type="+type,"",err);} }; }catch(err){GM_logError("bot","","",err);} }; var settings=new function(){ var data={"global":{},"country":{},"server":{},"account":{}}; var dataDefault={"global":{}, "country":{"pauseShort":[300,700],"pause":[2000,4000],"maxDurationBotRun":300,"maxDurationBotStep":30,"botErrorBehaviour":"reload"}, "server":{"botActive":false}, "account":{"autoPlant":true,"autoWater":true,"autoFeed":true,"botUseFarmersmarket":false,"botUseFarmi":false,"botUseDonkey":false,"botUseLottery":false,"botUseFoodworld":false,"botUseForestry":false,"botUseWindmill":false,"disableCropFields":false,"farmiAccept":false,"farmiAcceptAboveNr":100,"farmiAcceptBelowMinValue":false,"farmiReject":false,"farmiRejectUntilNr":90,"farmiRemoveMissing":false,"farmiRemoveMissingAboveNr":10,"lotteryActivate":false,"lotteryDailyLot":false,"powerUpActivate":false,"seedWaitForCrop":30,"showQueueTime":true,"useQueueList":false} }; var require= {"global":{}, "country":{}, "server":{}, "account":{"farmiAccept":[["account","botUseFarmi"]],"farmiAcceptAboveNr":[["account","botUseFarmi"]],"farmiAcceptBelowMinValue":[["account","botUseFarmi"],["account","farmiAccept"]],"farmiReject":[["account","botUseFarmi"]],"farmiRejectUntilNr":[["account","botUseFarmi"]],"farmiRemoveMissing":[["account","botUseFarmi"]],"farmiRemoveMissingAboveNr":[["account","botUseFarmi"]],"lotteryActivate":[["account","botUseLottery"]],"lotteryDailyLot":[["account","botUseLottery"],["account","lotteryActivate"]],"powerUpActivate":[["account","botUseWindmill"]]} }; this.init=function(){ try{ settings.load("global"); settings.load("country"); settings.load("server"); settings.load("account"); }catch(err){GM_logError("settings.init","","",err);} } this.load=function(scope){ try{ var key; switch(scope){ case "global": key="settings"; break; case "country": if(COUNTRY){ key=COUNTRY+"_settings"; } break; case "server": if(COUNTRY&&SERVER){ key=COUNTRY+"_"+SERVER+"_settings"; } break; case "account": if(COUNTRY&&SERVER&&USERNAME){ key=COUNTRY+"_"+SERVER+"_"+USERNAME+"_settings"; } break; } if(key){ data[scope]=explode(GM_getValue(key,"{}"),"settings"); } }catch(err){GM_logError("settings.load","scope="+scope,"",err);} } this.save=function(scope){ try{ var key; switch(scope){ case "global": key="settings"; break; case "country": if(COUNTRY){ key=COUNTRY+"_settings"; } break; case "server": if(COUNTRY&&SERVER){ key=COUNTRY+"_"+SERVER+"_settings"; } break; case "account": if(COUNTRY&&SERVER&&USERNAME){ key=COUNTRY+"_"+SERVER+"_"+USERNAME+"_settings"; } break; } if(key){ GM_setValue(key,implode(data[scope],"settings")); } }catch(err){GM_logError("settings.save","scope="+scope,"",err);} } this.get=function(scope,key){ try{ if((scope in data)&&(key in data[scope])){ return data[scope][key]; }else if((scope in dataDefault)&&(key in dataDefault[scope])){ return dataDefault[scope][key]; }else{ GM_logWarning("settings.get","scope="+scope+" key="+key,"","Settings unknown. Function returns null."); return null; } }catch(err){GM_logError("settings.get","scope="+scope+" key="+key,"",err);} } this.set=function(scope,key,value){ try{ data[scope][key]=value; settings.save(scope); }catch(err){GM_logError("settings.set","scope="+scope+" key="+key,"",err);} } this.reset=function(scope,key){ try{ delete data[scope][key]; settings.save(scope); return settings.get(scope,key); }catch(err){GM_logError("settings.reset","scope="+scope+" key="+key,"",err);} } this.checkRequire=function(scope,key){ try{ if(require[scope][key]){ for(var j=require[scope][key].length-1;j>=0;j--){ if(!settings.get(require[scope][key][j][0],require[scope][key][j][1])){ return false; } } } return true; }catch(err){GM_logError("settings.checkRequire","scope="+scope+" key="+key,"",err);} } // Special functions this.getPause=function(isShort){ try{ var val=settings.get("country",isShort?"pauseShort":"pause"); return getRandom(val[0],val[1]); }catch(err){GM_logError("settings.set","scope="+scope+" key="+key,"",err);} } }; var closeWindowTimer=null; var closeWindowTime=CLOSETIME; var openWindows=null; function startCloseWindowTimer(){ try{ var divCWL=$("divCloseWindowLayer"); if(divCWL.style.display!="block"){ divCWL.style.display="block"; } var divCW=$("divCloseWindow"); if(divCW.style.display!="block"){ divCW.style.display="block"; } var cell; if(!bot.isBusy()){ if(--closeWindowTime>0 && !checkOpenWindow(true)){ GM_logInfo("startCloseWindowTimer","","closeWindowTime="+closeWindowTime+" openWindows="+implode(openWindows,"startCloseWindowTimer"),"",0); divCW.innerHTML=getText("automat_CloseWindowTimer").replace("%1%", getTimeStr(closeWindowTime)) + "
" + getText("automat_CloseWindowTimerClick"); if(!closeWindowTimer) closeWindowTimer=window.setInterval(startCloseWindowTimer,1000); }else{ //-- GM_log("closingEventTimer closeWindowTime:"+closeWindowTime); if((cell=$("multiframe"))&&(cell.style.display=="block")){ click($("multiframe").contentDocument.getElementsByClassName("link2")[0].firstElementChild); }else if((cell=$("divQueueBox"))&&(cell.style.display=="block")){ click($("divQueueBoxClose")); }else if((cell=$("divChooseBox"))&&(cell.style.display=="block")){ click($("divChooseBoxClose")); }else if((cell=$("infoPanel"))&&(cell.style.display=="block")){ click($("infoPanelClose")); }else if((cell=$("friendscontainer"))&&(cell.style.display=="block")){ click($("friendsclose").getElementsByClassName("link")[0]); }else if((cell=$("guildmaincontainer"))&&(cell.style.display=="block")){ click($("cancelscreen2").getElementsByClassName("link")[0]); }else if((cell=$("reallocateBuildingContainer"))&&(cell.style.display=="block")){ click($("reallocateBuildingContainerHeader").getElementsByClassName("link")[0]); }else if((cell=$("farmhousecontainer"))&&(cell.style.display=="block")){ click($("fhclose").getElementsByClassName("link")[0]); }else if((cell=$("cart"))&&(cell.style.display=="block")){ unsafeWindow.clearCart(); }else if((cell=$("shop"))&&(cell.style.display=="block")){ $('transp3').style.display='none'; $('shopframe').src=''; $('shop').style.display='none'; //click($("shopframe").contentDocument.getElementsByClassName("link2")[0].firstElementChild); }else if((cell=$("shopframe"))&&(cell.style.display=="block")){ $('transp3').style.display='none'; $('shopframe').src=''; $('shop').style.display='none'; //click($("shopframe").contentDocument.getElementsByClassName("link2")[0].firstElementChild); }else if((cell=$("animaldealer"))&&(cell.style.display=="block")){ click($("animaldealerheader").getElementsByClassName("link")[0]); }else if((cell=$("wbwcontainer"))&&(cell.style.display=="block")){//competitie click($("wbwhead").getElementsByClassName("link")[0]); }else if((cell=$("adcolumn"))&&(cell.style.display=="block")){ click($("adcolumnheader").getElementsByClassName("link")[0]); }else if((cell=$("lotterycontainer"))&&(cell.style.display=="block")){ click($("lotteryhead").getElementsByClassName("link")[0]); }else if((cell=$("fishpoolinner"))&&(cell.style.display=="block")){ click($("fishpoolheader").getElementsByClassName("link")[0]); }else if((cell=$("formuladealer"))&&(cell.style.display=="block")){ click($("formuladealerheader").getElementsByClassName("link")[0]); }else if((cell=$("windmillinner"))&&(cell.style.display=="block")){ click($("windmillheader").getElementsByClassName("link")[0]); }else if((cell=$("collectorscontainer"))&&(cell.style.display=="block")){ click($("collectorshead").getElementsByClassName("link")[0]); } botArbiter.start(); stopCloseWindowTimer(); } }else{ stopCloseWindowTimer(); } cell=null; }catch(err){GM_logError("startCloseWindowTimer","","",err);} } function stopCloseWindowTimer(){ try{ GM_logInfo("stopCloseWindowTimer","","closeWindowTimer="+closeWindowTimer,"Begin",1); try{ window.clearInterval(closeWindowTimer); }catch(err){} closeWindowTimer=null; closeWindowTime=CLOSETIME; if($("divCloseWindowLayer")){ $("divCloseWindowLayer").style.display="none";} if($("divCloseWindow")){ $("divCloseWindow").style.display="none";} GM_logInfo("stopCloseWindowTimer","","closeWindowTimer="+closeWindowTimer,"End",1); }catch(err){GM_logError("stopCloseWindowTimer","","",err);} } function checkOpenWindow(justcheck){ try{ var allWinClosed=true; var help; openWindows=""; GM_logInfo("checkOpenWindow","justcheck="+justcheck,"automatStarted="+automatStarted+" busy="+bot.isBusy()+" closeWindowTimer="+closeWindowTimer,"Begin",1); if(automatStarted&&!bot.isBusy()){ var currLocation=unsafeData.gameLocation.get(); for(var ctn in OpenWindow){ if(!OpenWindow.hasOwnProperty(ctn)){ continue; } if((ctn=="all")||(ctn=="farm"&&currLocation[0]=="farm")||(ctn=="city1"&&currLocation.equals(["city","1"]))||(ctn=="city2"&&currLocation.equals(["city","2"]))){ for(var i=OpenWindow[ctn].length-1;i>=0;i--){ if((help=$(OpenWindow[ctn][i]))&&(help.style.display=="block")){ openWindows +=(openWindows!=""?", ":"")+OpenWindow[ctn][i]; GM_logInfo("checkOpenWindow","justcheck="+justcheck,"container="+ctn+" window="+OpenWindow[ctn][i],"Window is open"); allWinClosed=false; } } } } if(justcheck===true){ return allWinClosed; }else if(allWinClosed){ if(closeWindowTimer&&!justcheck){ //-- GM_log("checkOpenWindow 1"); stopCloseWindowTimer(); } return true; }else if(!closeWindowTimer&&!justcheck){ //garden can be open for eve //-- GM_log("checkOpenWindow 2"); startCloseWindowTimer(); } }else if(bot.isBusy()&&closeWindowTimer&&!justcheck){ //-- GM_log("checkOpenWindow 3"); stopCloseWindowTimer(); } help=null; return false; }catch(err){GM_logError("checkOpenWindow","justcheck="+justcheck,"ctn="+ctn+" wn="+wn,err);} } function getFarmZoneBonus(zoneNr,product){ GM_logInfo("getFarmZoneBonus","zoneNr="+zoneNr+" product="+product,"","Begin",1); try{ var bonus=1; var zoneNrF=zoneNr.toString().replace(/\.\d+$/,""); var currBonus=unsafeData.zones.getBonus(zoneNrF); var currBonusSpecial=unsafeData.zones.getBonusSpecial(zoneNrF); if(currBonusSpecial&&(currBonusSpecial[0]==product)){ bonus-=currBonusSpecial[1]/100; } if(currBonus){ bonus-=currBonus/100; } }catch(err){ GM_logError("getFarmZoneBonus","zoneNr="+zoneNr+" product="+product,"",err); if(Math.ceil(zoneNrF/6)==parseInt(unsafeWindow.farm,10)){ if(unsafeWindow.userfarminfos[Math.ceil(zoneNrF/6)][getGarden(zoneNrF)]["specialwaterbonus"][0]==product){ bonus=1 - parseInt(unsafeWindow.userfarminfos[Math.ceil(zoneNrF/6)][getGarden(zoneNrF)]["specialwaterbonus"][1],10)/100; }else if(unsafeWindow.userfarminfos[Math.ceil(zoneNrF/6)][getGarden(zoneNrF)]["waterbonus"]){ bonus=1 - parseInt(unsafeWindow.userfarminfos[Math.ceil(zoneNrF/6)][getGarden(zoneNrF)]["waterbonus"],10)/100; }else if(unsafeWindow.userfarminfos[Math.ceil(zoneNrF/6)][getGarden(zoneNrF)]["time"]){ bonus=1 - parseInt(unsafeWindow.userfarminfos[Math.ceil(zoneNrF/6)][getGarden(zoneNrF)]["time"],10)/100; } } } GM_logInfo("getFarmZoneBonus","zoneNr="+zoneNr+" product="+product,"bonus="+bonus,"End",1); return bonus; } function getLowestTimeFarmZone(timeTable){ GM_logInfo("getLowestTimeFarmZone","timeTable="+implode(timeTable,"getLowestTimeFarmZone/timeTable"),"","Begin",1); for(var i in timeTable){ if(!timeTable.hasOwnProperty(i)){ continue; } if(zoneNrF===undefined) var zoneNrF=i; if(timeTable[i] < timeTable[zoneNrF]){ zoneNrF=i; } } GM_logInfo("getLowestTimeFarmZone","","zoneNrF="+zoneNrF,"End",1); return zoneNrF; } function getHighestTimeFarmZone(timeTable){ GM_logInfo("getHighestTimeFarmZone","timeTable="+implode(timeTable,"getLowestTimeFarmZone/timeTable"),"","Begin",1); for(var i in timeTable){ if(!timeTable.hasOwnProperty(i)){ continue; } if(zoneNrF===undefined) var zoneNrF=i; if(timeTable[i] > timeTable[zoneNrF]){ zoneNrF=i; } } GM_logInfo("getHighestTimeFarmZone","","zoneNrF="+zoneNrF,"End",1); return zoneNrF; } String.prototype.count=function(match){ var res=this.match(new RegExp(match,"g")); if(res==null){ return 0; } return res.length; }; String.prototype.repeat=function(num){ return new Array(num+1).join(this); }; String.prototype.leftPad=function(len, str){ return (new Array(len - this.length + 1)).join(str).concat(this); }; String.prototype.replaceArray=function(arr){ if(typeof arr!="object") throw("Argument not a Object or Array :" + typeof arr +"
"); // if(!(arr instanceof Array)) throw("Argument not a Array :" + typeof arr +"
"); var val=this; for(var key in arr){ if(!arr.hasOwnProperty(key)){ continue; } // GM_log("replace :" + key + " with : " + arr[key] + " : " + val); val=val.replace(new RegExp("%"+key+"%","gi"),arr[key]); } return val; }; String.prototype.toTitleCase=function(){ return this.toLowerCase().replace(/^./, this.match(/^./)[0].toUpperCase()); }; Object.prototype.allEqual=function(){ var equal=true, num=null; for(var key in this){ if(!this.hasOwnProperty(key)){ continue; } // GM_log("prototype.average key: " + key + " num: " + this[key] + " tot: " + total + " len: " + len); if( typeof this[key]=="number"){ if(num!=this[key] && num!=null){ equal=false; break; } num=this[key]; } } return equal; }; Object.prototype.average=function(){ var total=0, len=0; for(var key in this){ if(!this.hasOwnProperty(key)){ continue; } // GM_log("prototype.average key: " + key + " num: " + this[key] + " tot: " + total + " len: " + len); if( typeof this[key]=="number"){ total +=this[key]; len++; } } return total/len; }; Object.prototype.averageFieldTime=function(amount){ var total=0, len=0; for(var key in this){ if(!this.hasOwnProperty(key)){ continue; } if( typeof this[key]=="number"){ // GM_log("prototype.averageFieldTime key: " + key + " num: " + this[key] + " tot: " + total + " len: " + len); total +=this[key]; len++; } } // GM_log("End prototype.averageFieldTime tot: " + total + " amount: " + amount + " len: " + len); return (total*amount)/(len*len); }; function calcDauer(dauer,bonus){ //dauer in sek, bonus zB 0.85 var gesamtdauer=0; while(dauer>0){ dauer *=bonus; help=Math.min(dauer,86400); dauer -=help; gesamtdauer +=help; } return gesamtdauer; } function calcProductScore(product, zoneNrF, amount, endtime){ GM_logInfo("calcProductScore","product="+product+" zoneNrF="+zoneNrF+" amount="+amount+" endtime="+endtime,"","Begin",1); switch(getBuildingTyp(zoneNrF)){ case "windmill": return unsafeData.prodPoints[3][product]; break; case "sawmill":case "carpentry": if(amount==null || amount===undefined){ amount=1; } return unsafeData.prodPoints[1][product]*amount; break; case "forest": if(amount==null || amount===undefined){ amount=calcProductPositions(product, zoneNrF); } return unsafeData.prodPoints[1][product]*amount; break; case 1: if(amount==null || amount===undefined) amount=calcProductPositions(product, zoneNrF); if(unsafeData.currentPowerup && unsafeData.currentPowerup[product] && unsafeData.currentPowerup[product][0] > (endtime==null?now:endtime)){ return (unsafeData.prodPoints[0][product]+unsafeData.currentPowerup[product][2])*amount; }else{ return unsafeData.prodPoints[0][product]*amount; } break; case 2: if(amount==null || amount===undefined){ amount=unsafeData.zones.getAnimals(zoneNrF); } return unsafeData.prodPoints[0][product]*unsafeData.prodYield[0][product]*amount; break; case 3:case 4: if(amount==null || amount===undefined){ amount=1; } return unsafeData.prodPoints[0][product]*unsafeData.prodYield[0][product]*amount; break; case "megafield": return unsafeData.prodPoints[4][product]; break; default: GM_logWarning("calcProductScore","product="+product+" zoneNrF="+zoneNrF+" amount="+amount+" endtime="+endtime,"getBuildingTyp="+getBuildingTyp(zoneNrF),"Building type unknown. Function returns 0."); return 0; } } function calcProductAmount(product, zoneNrF, amount, endtime, minPlanted){ GM_logInfo("calcProductAmount","product="+product+" zoneNrF="+zoneNrF+" amount="+amount+" endtime="+endtime+" minPlanted="+minPlanted,"","Begin",1); switch(getBuildingTyp(zoneNrF)){ case "windmill": return 1; break; case "sawmill":case "carpentry": if(amount==null || amount===undefined){ amount=1; } return unsafeData.prodYield[1][product]*amount; break; case "forest": if(amount==null || amount===undefined){ amount=calcProductPositions(product, zoneNrF); } return unsafeData.prodYield[1][product]*amount; //no minPlanted because planted is other product. break; case 1:case 4: if(amount==null || amount===undefined){ amount=calcProductPositions(product, zoneNrF); } if(unsafeData.currentPowerup && unsafeData.currentPowerup[product] && unsafeData.currentPowerup[product][0] > ((endtime==null||endtime===undefined)?now:endtime)){ return (unsafeData.prodYield[0][product]-(minPlanted?1:0)+unsafeData.currentPowerup[product][1])*amount; }else{ return (unsafeData.prodYield[0][product]-(minPlanted?1:0))*amount; } break; case 2: return unsafeData.zones.getAnimals(zoneNrF) * unsafeData.prodYield[0][product]; break; case 3: return unsafeData.prodYield[0][product]; break; case "megafield": return unsafeData.prodYield[4][product]; break; default: GM_logWarning("calcProductAmount","product="+product+" zoneNrF="+zoneNrF+" amount="+amount+" endtime="+endtime,"getBuildingTyp="+getBuildingTyp(zoneNrF),"Function returns 0"); return 0; } } function calcEmptyProductPositions(product, zoneNrF){ var returnn=0; if(getBuildingTyp(zoneNrF)==1){ var size=unsafeData.prodPlantSize[0][product]; var tempZoneProductionData=unsafeData.zones.getProduction(zoneNrF); if(tempZoneProductionData){ if(tempZoneProductionData[1] && !isNaN(tempZoneProductionData[1][size])){ returnn=tempZoneProductionData[1][size]; }else{ returnn=120/size; } } }else if(isNaN(zoneNrF)){ var size=unsafeData.prodPlantSize[1][product]; var tempZoneProductionData=unsafeData.zones.getProduction(zoneNrF); if(tempZoneProductionData){ if(tempZoneProductionData[1] && !isNaN(tempZoneProductionData[1][size])){ returnn=tempZoneProductionData[1][size]; } } } if(!tempZoneProductionData[3]){ GM_logInfo("calcEmptyProductPositions","zoneNrF="+zoneNrF+" product="+product,"return="+returnn,"Returned data is flagged to be old.",0); } GM_logInfo("calcEmptyProductPositions","zoneNrF="+zoneNrF+" product="+product,"return="+returnn,"End",1); return returnn; } function calcProductPositions(product, zoneNrF){ try{ var returnn=1; if(getBuildingTyp(zoneNrF)==1){ var size=unsafeData.prodPlantSize[0][product]; var tempZoneProductionData=unsafeData.zones.getProduction(zoneNrF); if(tempZoneProductionData){ if(tempZoneProductionData[2] && !isNaN(tempZoneProductionData[2][size])){ returnn=tempZoneProductionData[2][size]; }else{ returnn=120/size; } } }else if(isNaN(zoneNrF)){ var tempZoneProductionData=unsafeData.zones.getProduction(zoneNrF); if(tempZoneProductionData){ // var size=unsafeData.prodPlantSize[1][product]; if(tempZoneProductionData[2] && !isNaN(tempZoneProductionData[2])){ returnn=tempZoneProductionData[2]; } } } if(tempZoneProductionData&&(!tempZoneProductionData[3])){ GM_logInfo("calcProductPositions","zoneNrF="+zoneNrF+" product="+product,"return="+returnn,"Returned data is flagged to be old.",0); } // GM_log("calcProductPositions: zoneNrF:"+zoneNrF+" product:"+product+" return:"+returnn); return returnn; }catch(err){ GM_logError("calcProductPositions","product="+product+" zoneNrF="+zoneNrF,"",err); } } function calcInGameProductAmountOnField(product, zoneNrF, endtime){ try{ var iBase=0; var tempZoneProductionData=unsafeData.zones.getProduction(zoneNrF); if(tempZoneProductionData){ if(tempZoneProductionData[0][0][product]){ for(var i in tempZoneProductionData[0][0][product]){ if(!tempZoneProductionData[0][0][product].hasOwnProperty(i)){ continue; } if(endtime===undefined || endtime==null || tempZoneProductionData[0][0][product][i][1]<=endtime){ iBase +=calcProductAmount(product,zoneNrF,tempZoneProductionData[0][0][product][i][0],tempZoneProductionData[0][0][product][i][1],false); } } } if(!tempZoneProductionData[3]){ GM_logWarning("calcInGameProductAmountOnField","zoneNrF="+zoneNrF+" product="+product+" endtime="+endtime,"return="+iBase,"Returned data is flagged to be old.",0); } } return iBase; }catch(err){ GM_logError("calcInGameProductAmountOnField","product="+product+" zoneNrF="+zoneNrF+" endtime="+endtime,"",err); return 0; } } function calcInGameProductAmount(product,zoneNrF,endtime,includeThisField){ try{ GM_logInfo("calcInGameProductAmount","product="+product+" zoneNrF="+zoneNrF+" endtime="+endtime+" includeThisField="+includeThisField,"","Begin",1); var type=getZoneStockType(zoneNrF); var iBase=unsafeData.prodStock[type][product]?unsafeData.prodStock[type][product]:0; var fzType=getBuildingTyp(zoneNrF); if(includeThisField||(fzType=="sawmill")||(fzType=="carpentry")||(fzType=="forest")){ iBase +=calcInGameProductAmountOnField(product, zoneNrF, endtime); } for(var i=0;i0){ time -=zoneList[zoneNrL][1][1]*FEEDBONUSTIME[zoneList[zoneNrL][1][0]]/unsafeData.zones.getAnimals(zoneNrF); } } break; case 3: time=(product==PRODSTOP?0:unsafeData.prodGrowTime[0][product]*60); time*=bonus; break; case "megafield": time=(product==PRODSTOP?0:unsafeData.prodGrowTime[4][product]*60); break; case "windmill": time=(product==PRODSTOP?0:parseInt(unsafeWindow.formulas[0][product][4],10)); //time*=bonus; break; case "forest": time=(product==PRODSTOP?0:unsafeData.prodGrowTime[1][product]*60); time=calcDauer(time,bonus); break; case "sawmill": case "carpentry": time=(product==PRODSTOP?0:unsafeData.prodGrowTime[1][product]*60); time*=bonus; break; } return time; }catch(err){ GM_logError("calcProductionTime","product="+product+" zoneNrF="+zoneNrF,"",err); return 0; } } function isVisibleZone(zoneNr){ if(extendedListReg.test(zoneNr)){ return false; }else if(isNaN(zoneNr)){ zoneNr=zoneNr.toString().replace(/\.\d+$/,""); switch(zoneNr){ case "windmill": return(unsafeData.gameLocation.check("city",2)); break; case "sawmill": case "carpentry": case "forest": return(unsafeData.gameLocation.check("forestry")); break; case "foodworld-1": case "foodworld-2":case "foodworld-3":case "foodworld-4": return(unsafeData.gameLocation.check("foodworld")); break; case "farmersmarket-0": case "farmersmarket-1": case "farmersmarket-2":case "farmersmarket-3":case "farmersmarket-4":case "farmersmarket-5":case "farmersmarket-6": return(unsafeData.gameLocation.check("farmersmarket")); break; default: return false; } } else { zoneNr=(parseInt(zoneNr,10)); return(unsafeData.gameLocation.check("farm",Math.floor((zoneNr-1)/6))); } } function getZoneTimes(zoneNrL){ // return: {"sawmill.1":1426123455,"sawmill.2":1426123455} GM_logInfo("getZoneTimes","zoneNrL="+zoneNrL,"","Begin",1); try{ var help, fz; if(!settings.get("account","showQueueTime")){ GM_logInfo("getZoneTimes","zoneNrL="+zoneNrL,"","End: disabled",1); return new Object(); } noTime=false; var zoneTimes=new Object(); if("megafield"==zoneNrL){ for(var i=1,l=unsafeData.BUILDING_SLOTS["megafield"];i<=l;i++){ fz="megafield."+i; help=unsafeData.zones.getEndtime(fz); zoneTimes[fz]=((help==NEVER)?now:help); } }else{ for(var fz in unsafeData.ALL_SLOTS){ if(!unsafeData.ALL_SLOTS.hasOwnProperty(fz)){ continue; } help=unsafeData.zones.getEndtime(fz); zoneTimes[fz]=((help==NEVER)?now:help); } } if(zoneNrL===undefined){ GM_logInfo("getZoneTimes","zoneNrL="+zoneNrL,"","End",1); return zoneTimes.clone(); }else{ var returnn=new Object(); var zones=getZonesFromList(zoneNrL); for(var i=0;i10){throw("TOO MUCH RECURSION")} GM_logInfo("getZoneName","recursionCount="+recursionCount+" zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL,"","Begin",1); if(showName===undefined){ showName=true; } zoneNrS=zoneNrS.toString(); var zoneNrF=zoneNrS.replace(/\.\d+$/,""); var zones=getZonesFromList(zoneNrL); var txt="", txtLength=0, txtNew; if((extendedList=extendedListReg.exec(zoneNrL))!=null){ txt=getText("automat_titleGeneral").replace(" "," ")+" "+extendedList[1]; // TODO ? // if(zones.length==1){ // txt +=" ("+ getZoneName(recursionCount+1,zones[0],zoneNrL,null,false,false,showBonus,showName) + ")"; // } }else if(showPaired&&("megafield"!=zoneNrS)&&(zones.length > 1 || zoneNrS!=zoneNrL)){ // if(showName) txt +=unsafeWindow.buildinginfos[0][unsafeData.zones.getBuilding(zoneNrF)][10].replace(" "," ")+" "; if(showName){ txt +=(isNaN(zoneNrF)?getText(getZoneType(zoneNrF)):unsafeWindow.buildinginfos[0][getZoneType(zoneNrF)][10].replace(" "," "))+" "; } if(showLocation){ txt+=''; for(var i=0;i0){ txt +="|"; txtLength+=1; } if(zones[i][0]==zoneNrF) txt+=""; if(zones[i][0]==zoneNrL) txt+=""; txtNew=getZoneName(recursionCount+1,zones[i][1],zoneNrL,null,false,true,false,(zones.length==1)); if(txtLength+txtNew.length > showPaired){ txtNew="..."; } txt += txtNew; txtLength+=txtNew.length; if(zones[i][0]==zoneNrL) txt+=""; if(zones[i][0]==zoneNrF) txt+=''; if("..."==txtNew){ break; } } txt+=""; if(settings.get("account","useQueueList") && queueNum!=null && queueNum>=0) txt+=" {" + queueNum + "}"; zones=null;lz=null; } }else{ switch(getBuildingTyp(zoneNrF)){ case 1: if(settings.get("account","useQueueList") && showLocation && queueNum!=null && queueNum>=0){ // && showPaired txt=" {" + queueNum + "}"; } if(showBonus){ var currBonus=unsafeData.zones.getBonus(zoneNrF); var currBonusSpecial=unsafeData.zones.getBonusSpecial(zoneNrF); txt='
'; if(currBonus>0){ txt+=''+currBonus+'%'; } if(currBonusSpecial){ txt+=',
'+(currBonus+currBonusSpecial[1])+'%
'; } txt+='
'; } break; case 2: if(showBonus){ if(unsafeData.zones.getBonus(zoneNrF)>0){ txt+=unsafeData.zones.getBonus(zoneNrF)+"%"; } if(txt!="") txt+=","; txt+="#"+unsafeData.zones.getAnimals(zoneNrF); } break; case 3: if(showBonus && unsafeData.zones.getBonus(zoneNrF)>0){ txt=unsafeData.zones.getBonus(zoneNrF)+"%"; } break; default: if(showBonus && unsafeData.zones.getBonus(zoneNrF)>0){ txt=unsafeData.zones.getBonus(zoneNrF)+"%"; } } if(showLocation){ txt=(zoneNrS.toString().match(/\./)?"["+zoneNrS.replace(/^.*\./,"")+"]":"")+(txt!=""?" ("+txt+")":""); if(!isNaN(zoneNrF)){ txt=Math.ceil(zoneNrF/6)+"."+getGarden(zoneNrF)+txt; } } if(showName){ txt=(isNaN(zoneNrF)?getText(getZoneType(zoneNrF)):unsafeWindow.buildinginfos[0][getZoneType(zoneNrF)][10].replace(" "," "))+" "+txt; } } GM_logInfo("getZoneName","zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL,"zoneNrF="+zoneNrF,"End",1); return txt; }catch(err){ GM_logError("getZoneName","zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL,"zoneNrF="+zoneNrF,err); return "Error. See console."; } } function drawAutomatIcon(name,zoneNrS,appendTo,style){ try { GM_logInfo("drawAutomatIcon","name="+name+" zoneNrS="+zoneNrS,"","Begin",1); if(!(automatIcons[name]&&automatIcons[name][1])){ automatIcons[name]=[zoneNrS]; switch(getBuildingTyp(zoneNrS)){ case "windmill": automatIcons[name][1]=createElement("div",{"id":"divAutomatIcon_"+name,"class":"link divWindmillIcon","product":PRODSTOP,"zoneNrS":zoneNrS,"style":style},appendTo); createElement("div",{"class":"fmm"+PRODSTOP,"style":"position:relative;"},automatIcons[name][1]); break; case "forest":case "sawmill":case "carpentry": automatIcons[name][1]=createElement("div",{"id":"divAutomatIcon_"+name,"class":"link divForestryIcon","product":PRODSTOP,"zoneNrS":zoneNrS,"style":style},appendTo); createElement("div",{"class":"f_symbol"+PRODSTOP,"style":"position:relative;"},automatIcons[name][1]); break; case 4: automatIcons[name][1]=createElement("div",{"id":"divAutomatIcon_"+name,"class":"link divFoodworldIcon","product":PRODSTOP,"zoneNrS":zoneNrS,"style":style},appendTo); break; default: automatIcons[name][1]=createElement("div",{"id":"divAutomatIcon_"+name,"class":"link divZoneIcon v"+PRODSTOP,"product":PRODSTOP,"zoneNrS":zoneNrS,"style":style},appendTo); } automatIcons[name][1].addEventListener("click", function(event){ try { event.stopPropagation(); var zoneNrF=getFarmZone(this.id.replace("divAutomatIcon_","").replace("global_","")); var zoneNrS=this.getAttribute("zoneNrS"); var zoneNrL=getZoneListId(zoneNrS); switch(getBuildingTyp(zoneNrS)){ case 1: if(settings.get("account","useQueueList")){ redrawQueueBox(zoneNrS, zoneNrL, $("divQueueBoxInner")); }else{ drawQueueChooseItemBox(zoneNrS, zoneNrL, 0, $("divChooseBoxInner")); } break; case 2: drawStableChooseFeedBox(zoneNrS, zoneNrL,$("divChooseBoxInner")); break; case 3: if(settings.get("account","useQueueList")){ redrawQueueBox(zoneNrS, zoneNrL, $("divQueueBoxInner")); }else{ drawFactoryChooseItemBox(zoneNrS, zoneNrL,$("divChooseBoxInner")); } break; case 4: case "windmill": case "forest":case "sawmill":case "carpentry": case "megafield": redrawQueueBox(zoneNrS, zoneNrL, $("divQueueBoxInner")); break; default: throw("Building type '"+getBuildingTyp(zoneNrS)+"' unknown."); } zoneNrF=null;zoneNrS=null;zoneNrL=null; }catch(err){GM_logError("automatIcon.click","$('"+this.id+"') zoneNrF="+zoneNrF+" zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL,"",err);} },false); automatIcons[name][1].addEventListener("mouseover", function(event){ toolTip.show(event, toolTipProductSmall(this.getAttribute("zoneNrS"),this.getAttribute("zoneNrL"),0,this)); },false); updateQueueBox(zoneNrS); }else if(appendTo&&(!automatIcons[name][1].offsetParent)){ // append again appendTo.appendChild(automatIcons[name][1]); } GM_logInfo("drawAutomatIcon","zoneNrS="+zoneNrS,"","End",1); }catch(err){GM_logError("drawAutomatIcon","zoneNrS="+zoneNrS,"",err);} } function drawQueueBox(zoneNrS, zoneNrL, appendTo){ try{ GM_logInfo("drawQueueBox","zoneNrS="+zoneNrS +" zoneNrL="+zoneNrL +" appendTo.id="+appendTo.id,"","Begin",1); if(zoneNrS===undefined){ return; } if(zoneNrL===undefined || zoneNrL==null){ zoneNrL=getZoneListId(zoneNrS); } var fzType=getBuildingTyp(zoneNrS); appendTo.innerHTML=""; appendTo.style.display="none"; appendTo.setAttribute("zoneNrS",zoneNrS); appendTo.setAttribute("zoneNrL",zoneNrL); createElement("div",{id:"divAutoMatTitle_"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrS, zoneNrL, null, 50, true, true)); createElement("div",{id:"divAutoMatEndTime"+zoneNrL,"class":"queueTime"},appendTo); createElement("div",{style:"clear:both;"},appendTo); createElement("div",{id:"divAutoMatButton"+zoneNrL, "class":"queueBoxerButton"},appendTo); // Repeat button if(OPTION_LIST_REPEAT && zoneSettings[zoneNrL]["repeat"]!=undefined){ newelm=createElement("div",{id:"divAutoMatButtonRepeat"+zoneNrL,"class":"link queueButtonRepeat"},$("divAutoMatButton"+zoneNrL)); newelm.addEventListener("mouseover", function(event){ var zoneNrL=this.parentNode.parentNode.getAttribute("zoneNrL"); toolTip.show(event, zoneSettings[zoneNrL]["repeat"]?getText("automat_repeat_on"):getText("automat_repeat_off")); },false); newelm.style.backgroundImage=(zoneSettings[zoneNrL]["repeat"])?"url("+IMAGES["repeat_on"]+")":"url("+IMAGES["repeat_off"]+")"; newelm.addEventListener("click", function(){ var zoneNrS=this.parentNode.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.parentNode.getAttribute("zoneNrL"); zoneSettings[zoneNrL]["repeat"]=!zoneSettings[zoneNrL]["repeat"]; this.style.backgroundImage=(zoneSettings[zoneNrL]["repeat"])?"url("+IMAGES["repeat_on"]+")":"url("+IMAGES["repeat_off"]+")"; if(!zoneSettings[zoneNrL]["repeat"]){ for(var i=0;i 0){ scrlelm.scrollLeft=Math.max(0,scrlelm.scrollLeft-queueItemBoxWidth); } this.style.visibility=(scrlelm.scrollLeft>0?"visible":"hidden"); $("divAutoMatScrollRight"+zoneNrL).style.visibility=((scrlelm.scrollLeft + scrlelm.clientWidth)0?"visible":"hidden"); this.style.visibility=((scrlelm.scrollLeft + scrlelm.clientWidth) scrlelm.clientWidth)?"block":"none"); $("divAutoMatScrollRight"+zoneNrL).style.display=((scrlelm.scrollWidth > scrlelm.clientWidth)?"block":"none"); $("divAutoMatScrollLeft"+zoneNrL).style.visibility=(scrlelm.scrollLeft>0?"visible":"hidden"); $("divAutoMatScrollRight"+zoneNrL).style.visibility=((scrlelm.scrollLeft + scrlelm.clientWidth) zoneList[zoneNrL][i][2]){ foundActive=true; break; } } if(!foundActive){ for(var i=0;i0 && getBuildingTyp(zoneNrL)==1) break; if(fzType=="windmill"){ newdiv=createElement("div",{id:"divQueueItemListList"+zoneNrL+"Q"+queueNum+"Item","class":"divQueueItemListChooseItem"},appendTo); createElement("div",{"class":"fmm"+zoneList[zoneNrL][queueNum][0],style:"position:relative;"},newdiv); }else if(fzType=="sawmill"||fzType=="carpentry"||fzType=="forest"){ newdiv=createElement("div",{id:"divQueueItemListList"+zoneNrL+"Q"+queueNum+"Item","class":"divQueueItemListChooseItem f_symbol"+zoneList[zoneNrL][queueNum][0]},appendTo); }else{ newdiv=createElement("div",{id:"divQueueItemListList"+zoneNrL+"Q"+queueNum+"Item","class":"divQueueItemListChooseItem v"+zoneList[zoneNrL][queueNum][0]},appendTo); } if(fzType!=3 && zoneList[zoneNrL][queueNum][0]!=PRODSTOP){ var iLastInf=((zoneList[zoneNrL].length-1)==queueNum) && !lRepeat && !lShuffle; var amount=""+Math.max(0,zoneList[zoneNrL][queueNum][1] - zoneList[zoneNrL][queueNum][2]); createElement("div",{"class":"divQueueItemListNumber"},newdiv,((!settings.get("account","useQueueList") && fzType==1)||lRepeat&&iLastInf)?"∞":amount); } } } newdiv=null; appendTo.style.display="block"; } function drawQueueChooseItemBox(zoneNrS, zoneNrL, queueNum, appendTo){ try{ // GM_log("Begin drawQueueChooseItemBox zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL+" queueNum="+queueNum+" appendTo.id="+appendTo.id); if(zoneNrL===undefined || zoneNrL==null){ zoneNrL=getZoneListId(zoneNrS); } if(queueNum===undefined){ queueNum=0; } appendTo.innerHTML=""; appendTo.setAttribute("zoneNrS",zoneNrS); appendTo.setAttribute("zoneNrL",zoneNrL); appendTo.setAttribute("queueNum",queueNum); var fzZoneType=getZoneType(zoneNrS); createElement("div",{"id":"divChooseTitle"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrS,zoneNrL, ($("divChooseBoxInner")==appendTo)?queueNum:null, 20, true, true)); createElement("div",{"id":"divChooseEndTime"+zoneNrL,"class":"queueTime"},appendTo); createElement("div",{"style":"clear:both;"},appendTo); newdiv=createElement("div",{id:"divChooseItem"+zoneNrL+"Q"+queueNum + "I"+PRODSTOP,"class":"divChooseItem link v"+PRODSTOP,"product":PRODSTOP},appendTo); newdiv.addEventListener("click",function(){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); zoneList[zoneNrL][queueNum]=DEFAULT_ZONELIST_ITEM.clone(); toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrS, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); for(var iProd=0;iProd0)?1:0.4; newdiv.addEventListener("click",function(){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); var product=parseInt(this.getAttribute("product"),10); if(zoneList[zoneNrL][queueNum][0]!=product){ zoneList[zoneNrL][queueNum][0]=product; zoneList[zoneNrL][queueNum][1]=(zoneNrS!="windmill"&&zoneList[zoneNrL][queueNum][3])?((unsafeData.prodMinRack&&(unsafeData.prodMinRack[0][product]!=undefined))?unsafeData.prodMinRack[0][product]:100):(zoneList[zoneNrL][queueNum][1]>=1?zoneList[zoneNrL][queueNum][1]:1); zoneList[zoneNrL][queueNum][2]=0; } toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrS, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); } } /* if(settings.get("account","useQueueList")){ //TODO //display powerups createElement("div",{style:"clear:both;"},appendTo); createElement("div",{style:"width:100%;border-top:1px solid black;margin-top:4px;padding-top:4px;height:0px;"},appendTo); for(var v in unsafeWindow.poweruprack){ if(!unsafeWindow.poweruprack.hasOwnProperty(v)){ continue; } if(unsafeWindow.poweruprack[v][5][0]==0){ rProd=unsafeWindow.poweruprack[v][0]; iProd=unsafeWindow.poweruprack[v][5][1]==0?unsafeWindow.poweruprack[v][5][2][0]:unsafeWindow.poweruprack[v][5][1][0]; newdiv=createElement("div",{id:"divChooseItem"+zoneNrL+"Q"+queueNum+"R"+rProd,"class":"divChooseItem link r"+rProd,"product":rProd},appendTo); createElement("div",{"class":"kp"+iProd,style:"position:absolute;right:0px;bottom:0px;"},newdiv); // newdiv.addEventListener("click", function(){ // },false); newdiv.addEventListener("mouseover",function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); } } } */ if(appendTo==$("divChooseBoxInner")){ $("divChooseBox").style.display="block"; $("divChooseBox").style.top=Math.round(255 - $("divChooseBox").offsetHeight/2)+"px"; } newdiv=null;appendTo=null; updateQueueBox(zoneNrS, zoneNrL); // GM_log("End drawQueueChooseItemBox :" + zoneNrL); }catch(err){GM_logError("drawQueueChooseItemBox ","","",err);} } function drawFactoryChooseItemBox(zoneNrS, zoneNrL, appendTo){ try{ // GM_log("Begin drawFactoryChooseItemBox :" + zoneNrS+":"+zoneNrL); var zoneNrF=zoneNrS.toString().replace(/\.\d+$/,""); if(zoneNrL===undefined || zoneNrL==null){ zoneNrL=getZoneListId(zoneNrS); } appendTo.innerHTML=""; appendTo.setAttribute("zoneNrF",zoneNrF); appendTo.setAttribute("zoneNrS",zoneNrS); appendTo.setAttribute("zoneNrL",zoneNrL); appendTo.setAttribute("queueNum",0); createElement("div",{"id":"divChooseTitle"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrS,zoneNrL,null,20,true,true,true)); createElement("div",{"id":"divChooseEndTime"+zoneNrL,"class":"queueTime"},appendTo); createElement("div",{"style":"clear:both;"},appendTo); newdiv=createElement("div",{"class":"divChooseItem link v"+PRODSTOP,"id":"divChooseItem"+zoneNrL+"Q0I"+PRODSTOP},appendTo); if(zoneList[zoneNrL][0][0]==PRODSTOP){ newdiv.style.border="2px solid black"; } newdiv.addEventListener("click",function(){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); zoneList[zoneNrL]=DEFAULT_ZONELIST_ITEM_ARRAY.clone(); if(this.parentNode==$("divChooseBoxInner")){ click($("divChooseBoxClose")); } updateQueueBox(zoneNrF, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); toolTip.show(event, toolTipProductSmall(zoneNrF, zoneNrL, 0, this)); },false); for(var v in unsafeData.BUILDING_INPUT[getZoneType(zoneNrS)]){ if(!unsafeData.BUILDING_INPUT[getZoneType(zoneNrS)].hasOwnProperty(v)){ continue; } if(unsafeData.prodBlock[0][v]){ continue; } newdiv=createElement("div",{"class":"divChooseItem link v"+v,"id":"divChooseItem"+zoneNrL+"Q0I"+v},appendTo); if(zoneList[zoneNrL][0][0]==v){ newdiv.style.border="2px solid black"; } newdiv.addEventListener("click",function(){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); zoneList[zoneNrL]=DEFAULT_ZONELIST_ITEM_ARRAY.clone(); zoneList[zoneNrL][0][0]=parseInt(/Q0I(.*)$/.exec(this.id)[1],10); if(this.parentNode==$("divChooseBoxInner")){ click($("divChooseBoxClose")); } updateQueueBox(zoneNrF, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, 0, this)); },false); } if(appendTo==$("divChooseBoxInner")){ $("divChooseBox").style.display="block"; $("divChooseBox").style.top=Math.round(255 - $("divChooseBox").offsetHeight/2)+"px"; } updateQueueBox(zoneNrF, zoneNrL); zoneFeedCurr=null;zoneProdCurr=null; newdiv=null;appendTo=null; // GM_log("End drawFactoryChooseItemBox :" + zoneNrL); }catch(err){GM_logError("drawFactoryChooseItemBox ","","",err);} } function drawStableChooseFeedBox(zoneNrF, zoneNrL, appendTo){ try{ // GM_log("Begin drawStableChooseFeedBox zoneNrF:" + zoneNrF + " zoneNrL:"+zoneNrL); if(zoneNrL===undefined || zoneNrL==null) zoneNrL=getZoneListId(zoneNrF); var level=parseInt($("levelnum").innerHTML,10); // catch bad data // should be zoneList[zoneNrL]=[[feed1,amount1,0,false],[feed2,amount2,0,false]] // or if deactivated [[PRODSTOP,amount1,0],[PRODSTOP,amount2,0]] if(zoneList[zoneNrL].length!=2){ zoneList[zoneNrL]=DEFAULT_ZONELIST_ITEM_ARRAY2.clone(); }else{ if(zoneList[zoneNrL][0][0]==PRODSTOP){ zoneList[zoneNrL][0]=DEFAULT_ZONELIST_ITEM.clone(); } if(zoneList[zoneNrL][1][0]==PRODSTOP){ zoneList[zoneNrL][1]=DEFAULT_ZONELIST_ITEM.clone(); } } var feedSort=[,]; var feedAmount=[0,0]; var feedMax=[0,0]; var feedTime=[,]; // the time needed if full fed var growTime=30 * unsafeData.prodGrowTime[0][unsafeData.BUILDING2PRODUCT[unsafeData.zones.getBuilding(zoneNrF)][0]] * getFarmZoneBonus(zoneNrF, null); if(unsafeWindow.premium==0 && level>9){ growTime -=1; } // small hack. non-premiums cant feed completely function calcStableChooseFeedBox(index,val){ var noTime=false; // GM_log("calcStableChooseFeedBox "+index+":"+val); feedAmount[index]=val; var cand=appendTo.getElementsByClassName("divChooseFeed"); cand[index].getElementsByClassName("divChooseFeedAmountSpan")[0].innerHTML=feedAmount[index]; cand=null; if(feedAmount[0]+feedAmount[1]==0){ // no feed zoneList[zoneNrL]=DEFAULT_ZONELIST_ITEM_ARRAY2; }else{ // feed var calcTime=feedAmount[index]*feedTime[index]; index=(index+1)%2; if(feedSort[index]){ if(feedAmount[index]>0){ if(feedAmount[(index+1)%2]>0){ calcTime++; } // a bit time is lost when 2 feeds are used var help=calcTime+feedAmount[index]*feedTime[index]; while((feedAmount[index]>0) && (help>growTime)){ feedAmount[index]--; help=calcTime+feedAmount[index]*feedTime[index]; } calcTime=help-1; } } if(feedAmount[0]>feedAmount[1]){ zoneList[zoneNrL]=[[feedSort[0],feedAmount[0],0,false],[feedSort[1],feedAmount[1],0,false]]; }else{ zoneList[zoneNrL]=[[feedSort[1],feedAmount[1],0,false],[feedSort[0],feedAmount[0],0,false]]; } } GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList", implode(zoneList,"calcStableChooseFeedBox/zoneList")); updateQueueBox(zoneNrF, zoneNrL); } appendTo.innerHTML=""; appendTo.setAttribute("zoneNrF",zoneNrF); appendTo.setAttribute("zoneNrL",zoneNrL); appendTo.setAttribute("queueNum",0); createElement("div",{"id":"divChooseTitle"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrF,zoneNrL,null,20,true,true,true)); var newdiv=createElement("div",{"id":"divChooseEndTime"+zoneNrL,"class":"divChooseFeedTime"},appendTo); createElement("div",{"style":"clear:both;"},appendTo); var newdiv1,newspan; for(var k=0;k 0){ newdiv=createElement("div",{id:"divChooseItem"+zoneNrL+"Q"+queueNum+"I"+iProd,"class":"divMillChooseItem link","product":iProd},appendTo); newdiv.addEventListener("click",function(){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); var recipe=parseInt(this.getAttribute("product"),10); // GM_log("Click" + zoneNrF + " : " + queueNum + " : " + recipe); if(zoneList[zoneNrL][queueNum][0]!=recipe) zoneList[zoneNrL][queueNum]=[recipe,1,0,0,[]]; toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrF, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ toolTip.show(event, unsafeWindow.showFormulaInfos(parseInt(this.childNodes[0].getAttribute("class").replace("fm",""),10))); },false); newdiv.style.backgroundColor=(zoneList[zoneNrL][queueNum][0]==iProd)? "black":""; createElement("div",{"class":"fm"+iProd,style:"position:absolute;"},newdiv); createElement("div",{"class":"divMillChooseItemNumber"},newdiv,(autoMillStorage[iProd][0]-autoMillStorage[iProd][1])); } } if(appendTo==$("divChooseBoxInner")){ $("divChooseBox").style.display="block"; $("divChooseBox").style.top=Math.round(255 - $("divChooseBox").offsetHeight/2)+"px"; } updateQueueBox(zoneNrF,zoneNrL); newdiv=null;appendTo=null; // GM_log("End drawMillChooseItemBox :" + queueNum); }catch(err){GM_logError("drawMillChooseItemBox ","","",err);} } function drawForestryChooseItemBox(zoneNrF, zoneNrL, queueNum, appendTo){ try{ // GM_log("Begin drawForestryChooseItemBox zoneNrF:"+zoneNrF+" zoneNrL:" + zoneNrL); var fzType=getBuildingTyp(zoneNrF); var zoneStockTyp = (fzType=="forest"?"f1":(fzType=="sawmill"?"f3":(fzType=="carpentry"?"f4":null))); // GM_log("drawForestryChooseItemBox zoneStockTyp:"+zoneStockTyp); if(zoneNrL===undefined || zoneNrL==null) zoneNrL=getZoneListId(zoneNrF); if(queueNum===undefined) queueNum=0; var level=parseInt($("levelnum").innerHTML,10); appendTo.innerHTML=""; appendTo.setAttribute("zoneNrF",zoneNrF); appendTo.setAttribute("zoneNrL",zoneNrL); appendTo.setAttribute("queueNum",queueNum); createElement("div",{"id":"divChooseTitle"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrF,zoneNrL, ($("divChooseBoxInner")==appendTo)?queueNum:null, 20, true, true)); createElement("div",{"id":"divChooseEndTime"+zoneNrL,"class":"queueTime"},appendTo); createElement("div",{"style":"clear:both;"},appendTo); newdiv=createElement("div",{id:"divChooseItem"+zoneNrL+"Q"+queueNum + "I"+PRODSTOP,"class":"divChooseItem link f_symbol"+PRODSTOP,"product":PRODSTOP},appendTo); newdiv.addEventListener("click",function(){ var zoneNrF =this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); zoneList[zoneNrL][queueNum]=DEFAULT_ZONELIST_ITEM.clone(); toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrF, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrF, zoneNrL, queueNum, this)); },false); // GM_log("drawForestryChooseItemBox prodName:"+implode(unsafeData.prodName[1],"GMprodName[1]")); for(var iProd in unsafeData.prodName[1]){ if(!unsafeData.prodName[1].hasOwnProperty(iProd)){continue;} if(unsafeData.prodTyp[1][iProd]!=zoneStockTyp){continue;} var help,opacity=false; // GM_log("drawForestryChooseItemBox iProd:"+iProd+" prodTyp:"+unsafeData.prodTyp[1][iProd]+" prodBlock:"+unsafeData.prodBlock[1][iProd]); if(!(unsafeData.prodBlock[1][iProd]&&unsafeData.prodBlock[1][iProd].match(/q/))){ newdiv=createElement("div",{"id":"divChooseItem"+zoneNrL+"Q"+queueNum+"I"+iProd,"class":"divChooseItem link f_symbol"+iProd,"product":iProd},appendTo); opacity=false;help=null; for(var i in unsafeData.prodRequire[1][iProd]){ if(!unsafeData.prodRequire[1][iProd].hasOwnProperty(i)){continue;} help=unsafeData.prodRequire[1][iProd][i]; //GM_log("drawForestryChooseItemBox prodStock["+help[0]+"]["+help[1]+"]:"+unsafeData.prodStock[help[0]][help[1]]+" > "+help[2]); opacity=opacity&&(unsafeData.prodStock[help[0]][help[1]]>help[2]); } newdiv.style.opacity=(opacity)?0.4:1; newdiv.addEventListener("click",function(){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); var product=parseInt(this.getAttribute("product"),10); if(zoneList[zoneNrL][queueNum][0]!=product){ zoneList[zoneNrL][queueNum][0]=product; zoneList[zoneNrL][queueNum][1]=(zoneNrF!="windmill"&&zoneList[zoneNrL][queueNum][3])?((unsafeData.prodMinRack&&(unsafeData.prodMinRack[0][product]!=undefined))?unsafeData.prodMinRack[0][product]:100):(zoneList[zoneNrL][queueNum][1]>=1?zoneList[zoneNrL][queueNum][1]:1); zoneList[zoneNrL][queueNum][2]=0; } toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrF, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrF=this.parentNode.getAttribute("zoneNrF"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrF, zoneNrL, queueNum, this)); },false); } } if(appendTo==$("divChooseBoxInner")){ $("divChooseBox").style.display="block"; $("divChooseBox").style.top=Math.round(255 - $("divChooseBox").offsetHeight/2)+"px"; } newdiv=null;appendTo=null; updateQueueBox(zoneNrF, zoneNrL); // GM_log("End drawForestryChooseItemBox zoneNrF:"+zoneNrF+" zoneNrL:" + zoneNrL); }catch(err){GM_logError("drawForestryChooseItemBox","iProd:"+iProd,"",err);} } function drawFoodworldChooseItemBox(zoneNrS, zoneNrL, queueNum, appendTo){ try{ // GM_log("Begin drawFoodworldChooseItemBox zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL+" queueNum="+queueNum+" appendTo.id="+appendTo.id); if(zoneNrL===undefined || zoneNrL==null){ zoneNrL=getZoneListId(zoneNrS); } if(queueNum===undefined){ queueNum=0; } appendTo.innerHTML=""; appendTo.setAttribute("zoneNrS",zoneNrS); appendTo.setAttribute("zoneNrL",zoneNrL); appendTo.setAttribute("queueNum",queueNum); var fzZoneType=getZoneType(zoneNrS); createElement("div",{"id":"divChooseTitle"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrS,zoneNrL, ($("divChooseBoxInner")==appendTo)?queueNum:null, 20, true, true)); createElement("div",{"id":"divChooseEndTime"+zoneNrL,"class":"queueTime"},appendTo); createElement("div",{"style":"clear:both;"},appendTo); newdiv=createElement("div",{id:"divChooseItem"+zoneNrL+"Q"+queueNum + "I"+PRODSTOP,"class":"divChooseItem link v"+PRODSTOP,"product":PRODSTOP},appendTo); newdiv.addEventListener("click",function(){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); zoneList[zoneNrL][queueNum]=DEFAULT_ZONELIST_ITEM.clone(); toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrS, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); for(var iProd=0;iProd0)?1:0.4; newdiv.addEventListener("click",function(){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); var product=parseInt(this.getAttribute("product"),10); if(zoneList[zoneNrL][queueNum][0]!=product){ zoneList[zoneNrL][queueNum][0]=product; zoneList[zoneNrL][queueNum][1]=(zoneNrS!="windmill"&&zoneList[zoneNrL][queueNum][3])?((unsafeData.prodMinRack&&(unsafeData.prodMinRack[0][product]!=undefined))?unsafeData.prodMinRack[0][product]:100):(zoneList[zoneNrL][queueNum][1]>=1?zoneList[zoneNrL][queueNum][1]:1); zoneList[zoneNrL][queueNum][2]=0; } toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrS, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); } } } if(appendTo==$("divChooseBoxInner")){ $("divChooseBox").style.display="block"; $("divChooseBox").style.top=Math.round(255 - $("divChooseBox").offsetHeight/2)+"px"; } newdiv=null;appendTo=null; updateQueueBox(zoneNrS, zoneNrL); // GM_log("End drawFoodworldChooseItemBox :" + zoneNrL); }catch(err){GM_logError("drawFoodworldChooseItemBox ","","",err);} } function drawChooseItemBoxMegafield(zoneNrS, zoneNrL, queueNum, appendTo){ try{ // GM_log("Begin drawChooseItemBoxMegafield zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL+" queueNum="+queueNum+" appendTo.id="+appendTo.id); if(zoneNrL===undefined || zoneNrL==null){ zoneNrL=getZoneListId(zoneNrS); } if(queueNum===undefined){ queueNum=0; } appendTo.innerHTML=""; appendTo.setAttribute("zoneNrS",zoneNrS); appendTo.setAttribute("zoneNrL",zoneNrL); appendTo.setAttribute("queueNum",queueNum); var fzZoneType=getZoneType(zoneNrS); createElement("div",{"id":"divChooseTitle"+zoneNrL,"class":"queueTitle"},appendTo, getZoneName(0,zoneNrS,zoneNrL, ($("divChooseBoxInner")==appendTo)?queueNum:null, 20, true, true)); createElement("div",{"id":"divChooseEndTime"+zoneNrL,"class":"queueTime"},appendTo); createElement("div",{"style":"clear:both;"},appendTo); newdiv=createElement("div",{id:"divChooseItem"+zoneNrL+"Q"+queueNum + "I"+PRODSTOP,"class":"divChooseItem link v"+PRODSTOP,"product":PRODSTOP},appendTo); newdiv.addEventListener("click",function(){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); zoneList[zoneNrL][queueNum]=DEFAULT_ZONELIST_ITEM.clone(); toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrS, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); var iProd; var products=unsafeWindow.megafield_data.job.products; for(var i=0;iproducts[i].amount)?1:0.4; newdiv.addEventListener("click",function(){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); var product=parseInt(this.getAttribute("product"),10); if(zoneList[zoneNrL][queueNum][0]!=product){ zoneList[zoneNrL][queueNum][0]=product; zoneList[zoneNrL][queueNum][1]=(zoneList[zoneNrL][queueNum][1]>=1?zoneList[zoneNrL][queueNum][1]:1); zoneList[zoneNrL][queueNum][2]=0; } toolTip.hide(this); if(this.parentNode==$("divChooseBoxInner")) click($("divChooseBoxClose")); updateQueueBox(zoneNrS, zoneNrL); },false); newdiv.addEventListener("mouseover", function(event){ var zoneNrS=this.parentNode.getAttribute("zoneNrS"); var zoneNrL=this.parentNode.getAttribute("zoneNrL"); var queueNum=parseInt(this.parentNode.getAttribute("queueNum"),10); toolTip.show(event, toolTipProductSmall(zoneNrS, zoneNrL, queueNum, this)); },false); } } if(appendTo==$("divChooseBoxInner")){ $("divChooseBox").style.display="block"; $("divChooseBox").style.top=Math.round(255 - $("divChooseBox").offsetHeight/2)+"px"; } newdiv=null;appendTo=null; updateQueueBox(zoneNrS, zoneNrL); // GM_log("End drawChooseItemBoxMegafield :" + zoneNrL); }catch(err){GM_logError("drawChooseItemBoxMegafield ","","",err);} } function updateQueueBox(zoneNrS,zoneNrL){ try{ GM_logInfo("updateQueueBox","zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL,"","Begin",1); if(zoneNrS===undefined){ return; } var err_trace="init"; if(zoneNrL===undefined || zoneNrL==null){ zoneNrL=getZoneListId(zoneNrS); } var fzType=getBuildingTyp(zoneNrS); var fzZoneType=getZoneType(zoneNrS); var fzForestry=(fzType=="forest"||fzType=="sawmill"||fzType=="carpentry"); var fzMegafield=(fzType=="megafield"); var fzWindmill=(fzType=="windmill"); var iType=getZoneStockType(zoneNrS); var noTime=false; var level=parseInt($("levelnum").innerHTML,10); var zones=getZonesFromList(zoneNrL); var lShowTime=(zones.length>0); var zoneTimes=getZoneTimes(zoneNrL); // GM_log("updateQueueBox zoneNrS="+zoneNrS+" zoneNrL="+zoneNrL+" zonetimes="+implode(zoneTimes,"updateQueueBox/zoneTimes")); var help,prod; if(fzWindmill){ reCalculateWindmill(); } // automat icons err_trace="automat icons"; for(var i in automatIcons){ if(!automatIcons.hasOwnProperty(i)){continue;} if((zoneNrL==getZoneListId(automatIcons[i][0]))&&automatIcons[i][1]&&automatIcons[i][1].parentNode){ // isVisibleZone() ? // global_ ? switch(fzType){ case "windmill": automatIcons[i][1].childNodes[0].setAttribute("class","fmm"+zoneList[zoneNrL][0][0]); break; case "forest":case "sawmill":case "carpentry": automatIcons[i][1].childNodes[0].setAttribute("class","f_symbol"+zoneList[zoneNrL][0][0]); break; case 1: // Field case 3: // Factory case 4: // Foodworld case "megafield": // Megafield automatIcons[i][1].setAttribute("class","link divZoneIcon v"+zoneList[zoneNrL][0][0]); break; case 2: // Stable //catch wrong feed var futter1=BUILDING2FEED[fzZoneType][0]; var futter2=BUILDING2FEED[fzZoneType][1]; for(var queueNum=0;queueNumunsafeData.prodStock[sType][sProd]){ iRequireMissing=true; break; } } if(!newRackAmount[iProd] && !fzWindmill && !fzMegafield){ newRackAmount[iProd]=calcInGameProductAmount(iProd,zoneNrS,null,true); } } divAutoMatQueueItemBox.style.backgroundColor=(foundStop?"red":(iRequireMissing?"yellow":"transparent")); if(iStop){ foundStop=true; } if(!fzWindmill && !fzMegafield && !iStop){ newRackAmount[iProd] +=iTogoAmount; divAutoMatQueueItemBox.setAttribute("iTogo",iTogo); divAutoMatQueueItemBox.setAttribute("iTogoAmount",iTogoAmount); divAutoMatQueueItemBox.setAttribute("iTogoScore",iTogoScore); } divAutoMatQueueItemBox.setAttribute("totalInQue",totalInQue); divAutoMatQueueItemBox.setAttribute("foundStop",foundStop); totalInQue +=iTogo; // GM_log("updateQueueBox Box :" + zoneNrL + ":"+queueNum + " | 4"); $(divAutoMatQueueItemBoxId+"Item").style.opacity=(iTogo<=0 && !iStop)? 0.4:1; $(divAutoMatQueueItemBoxId+"Item").setAttribute("product",iProd); if(fzWindmill){ $(divAutoMatQueueItemBoxId+"Item").childNodes[0].className="fmm"+iProd; }else if(fzForestry){ $(divAutoMatQueueItemBoxId+"Item").childNodes[0].className="f_symbol"+iProd; }else{ $(divAutoMatQueueItemBoxId+"Item").className="link queueItemProduct v"+iProd; } // GM_log("updateQueueBox Box :" + zoneNrL + ":"+queueNum + " | 5"); $("divAutoMatQueueBox"+zoneNrL).style.width=($("divAutoMatQueueBox"+zoneNrL).parentNode==$("divQueueBoxInner"))?"348px":"530px"; $("divAutoMatQueueBox"+zoneNrL).style.height=row7+2+((settings.get("account","showQueueTime") && lShowTime)?queueItemBoxTimeHeight:0)+"px"; $("divAutoMatButton"+zoneNrL).style.height=row7+2+((settings.get("account","showQueueTime") && lShowTime)?queueItemBoxTimeHeight:0)+"px"; $(divAutoMatQueueItemBoxId+"I1").className=(iRackMode)?"queueItemInput1 queueItemInputWidth1":"queueItemInput1 queueItemInputWidth2"; $(divAutoMatQueueItemBoxId+"I1").value=(iTot===undefined)?1:iTot; //TODO remove setting val here $(divAutoMatQueueItemBoxId+"I1").style.display=(iLastInf || iStop)?"none":"block"; $(divAutoMatQueueItemBoxId+"I1").maxLength=(iRackMode)?"6":"4"; $(divAutoMatQueueItemBoxId+"I2").value=(iDone===undefined)?0:iDone; //TODO remove setting val here $(divAutoMatQueueItemBoxId+"I2").style.opacity=(iTogo<=0)?0.4:1; $(divAutoMatQueueItemBoxId+"I2").style.display=(!iRackMode && (iRepeat || lRepeat) && !iStop)?"block":"none"; if(OPTION_ITEM_REPEAT){ $(divAutoMatQueueItemBoxId+"Mode").style.display=(!iRackMode && !iStop)?"block":"none"; $(divAutoMatQueueItemBoxId+"Mode").style.backgroundImage="url("+(zoneList[zoneNrL][queueNum][4]?IMAGES["mode_repeat"]:IMAGES["mode_1time"])+")"; $(divAutoMatQueueItemBoxId+"IListRepeat").style.display=(!iRackMode && (iRepeat || lRepeat) && !iStop)?"block":"none"; $(divAutoMatQueueItemBoxId+"IListRepeat").value=(zoneList[zoneNrL][queueNum][5]===undefined)?REPEAT_NO_LIMIT:zoneList[zoneNrL][queueNum][5]; } $(divAutoMatQueueItemBoxId+"M").style.opacity=iTogo<=0?0.4:1; $(divAutoMatQueueItemBoxId+"M").style.display=(iLastInf || iStop || iTot<=1) ?"none":"block"; if(iLastInf||iStop){ $(divAutoMatQueueItemBoxId+"P").style.display="none"; }else if(fzWindmill){ $(divAutoMatQueueItemBoxId+"P").style.display=(autoMillStorage[iProd][1]" + getDaytimeStr(endTime,true)):null; $(divAutoMatQueueItemBoxId+"ET").style.color=noTime? "#DD0000":"black"; $(divAutoMatQueueItemBoxId+"ET").style.display=(iTogo<=0 || foundStop || !settings.get("account","showQueueTime") || !lShowTime)?"none":"block"; $(divAutoMatQueueItemBoxId+"T").innerHTML=(iStop)?_TEXTE_STOP:"∞"; $(divAutoMatQueueItemBoxId+"T").setAttribute("class",(iStop?"queueItemText queueItemTextStop":"queueItemText queueItemTextInf")); $(divAutoMatQueueItemBoxId+"T").style.display=(iLastInf || iStop)?"block":"none"; $(divAutoMatQueueItemBoxId+"Up").style.display=(queueNum==0) ?"none":"block"; $(divAutoMatQueueItemBoxId+"Down").style.display=((zoneList[zoneNrL].length-1)==queueNum) ?"none":"block"; $(divAutoMatQueueItemBoxId+"A").style.top=((iRackMode))?row4+"px":""; $(divAutoMatQueueItemBoxId+"D").style.left=(iRackMode)?col3+"px":""; $(divAutoMatQueueItemBoxId+"D").style.display=(zoneList[zoneNrL].length > 1) ?"block":"none"; $(divAutoMatQueueItemBoxId+"B").style.display=(!fzWindmill && !fzMegafield && !iLastInf && !iStop)?"block":"none"; $(divAutoMatQueueItemBoxId+"B").style.backgroundImage="url("+(iRackMode?IMAGES["functionR"]:IMAGES["functionF"])+")"; // GM_log("updateQueueBox Box :" + zoneNrL + ":"+queueNum + " END"); } // GM_log("updateQueueBox Box :" + zoneNrL + ":"+queueNum + " AFTER"); $("divAutoMatEndTime"+zoneNrL).style.display=(settings.get("account","showQueueTime"))?"block":"none"; if(settings.get("account","showQueueTime")){ $("divAutoMatEndTime"+zoneNrL).innerHTML=(!fzWindmill && !fzMegafield && !fRepeat && !lShuffle && !foundStop)? getText("automat_inftext"):(getText("automat_QueTimeReady") + (lShowTime?(((!foundStop && (lRepeat || iRepeat || noTime))?" ~ ":" ") + getDateText(endTime,0) + " "+ getDaytimeStr(endTime,true)):" ~ ")); // why +- (\u00B1)? $("divAutoMatEndTime"+zoneNrL).style.color=(noTime?"#DD0000":((foundStop || fRepeat)?"#0000DD":"#000000")); } divAutoMatQueueItemBox=null; totalCrop=null;aGrowingTotal=null; } // console.log(debugStr); zoneTimes=null; //ChooseBox part err_trace="ChooseBox"; var divChooseEndTimeCurr = $("divChooseEndTime"+zoneNrL) if(divChooseEndTimeCurr){ var zoneTimes=getZoneTimes(zoneNrL); // GM_log("updateQueueBox chooseBox zoneNrS:" + zoneNrS + " zoneNrL:" + zoneNrL + " queueNum:" + queueNum ); var queueNum=divChooseEndTimeCurr.parentNode.getAttribute("queueNum"); var foundStop=false; for(var i=0;i<=queueNum;i++){ if(foundStop=zoneList[zoneNrL][i][0]==PRODSTOP) break; } // GM_log("updateQueueBox chooseBox foundStop:" + foundStop + " lShowTime:"+lShowTime); switch(fzType){ case 1:case 4:case "megafield":{ // fields, foodworld, megafield // GM_log("updateQueueBox chooseBox fields 1:" + zoneNrS); if(settings.get("account","showQueueTime")){ if($("divAutoMatQueueItemBox"+zoneNrL+"Q"+queueNum) && lShowTime){ var zoneBeginTime=explode($("divAutoMatQueueItemBox"+zoneNrL+"Q"+queueNum).getAttribute("zoneBeginTime"),"updateQueueBox/chooseBox/zoneBeginTime",{}); }else{ var zoneBeginTime=zoneTimes; } var fz=getLowestTimeFarmZone(zoneBeginTime); var productTime=calcProductionTime(zoneList[zoneNrL][queueNum][0],fz); divChooseEndTimeCurr.style.display=lShowTime?"block":"none"; divChooseEndTimeCurr.parentNode.setAttribute("zoneBeginTime",implode(zoneBeginTime,"updateQueueBox/chooseBox/zoneBeginTime")); divChooseEndTimeCurr.style.color=noTime? "#DD0000":"black"; divChooseEndTimeCurr.innerHTML=(foundStop? getText("automat_QueDontWork"):(($("divChooseBoxInner")==divChooseEndTimeCurr.parentNode)?getText("automat_QueTimeFirstReady"):getText("automat_QueTimeReady")) + " " + getDateText(zoneBeginTime[fz]+productTime,0) + " "+ getDaytimeStr(zoneBeginTime[fz]+productTime,true)); } // GM_log("updateQueueBox chooseBox fields 2:" + zoneNrS); help=$("divChooseBoxInner").querySelectorAll(".link"); for(var i=help.length-1;i>=0;i--){ prod=parseInt(help[i].getAttribute("product"),10); help[i].style.border=(zoneList[zoneNrL][queueNum][0]==prod?"2px solid black":""); } zoneBeginTime=null;fz=null;productTime=null;help=null; break;} case 2:{ // stable if(settings.get("account","showQueueTime")){ divChooseEndTimeCurr.parentNode.setAttribute("zoneBeginTime",implode(zoneTimes,"updateQueueBox/chooseBox/zoneTimes")); divChooseEndTimeCurr.style.display=lShowTime?"block":"none"; //for(var queueNum=0;queueNum0){ $("divChooseItem"+zoneNrL+"Q"+queueNum+"I"+iProd).style.border=(zoneList[zoneNrL][queueNum][0]==iProd)?"2px solid black":""; } } iProd=null;endTime=null; break;} case "forest":case "sawmill":case "carpentry":{ // (fzForestry) // GM_log("updateQueueBox chooseBox forestry :" + zoneNrS); if(settings.get("account","showQueueTime")){ if($("divAutoMatQueueItemBox"+zoneNrL+"Q"+queueNum) && lShowTime){ var zoneBeginTime=explode($("divAutoMatQueueItemBox"+zoneNrL+"Q"+queueNum).getAttribute("zoneBeginTime"),"updateQueueBox/chooseBox/zoneBeginTime",{}); }else{ var zoneBeginTime=zoneTimes; } var fz=getLowestTimeFarmZone(zoneBeginTime); var productTime=calcProductionTime(zoneList[zoneNrL][queueNum][0],fz); // GM_log("updateQueueBox chooseBox fields 1:" + zoneNrS + " queueNum:" + queueNum + " fz:" + fz + " productTime:" + productTime + " zoneTimes:" + implode(zoneBeginTime,"") + " uhr:" + zoneBeginTime[fz]+ ":" + typeof productTime); divChooseEndTimeCurr.style.display=lShowTime?"block":"none"; divChooseEndTimeCurr.parentNode.setAttribute("zoneBeginTime",implode(zoneBeginTime,"updateQueueBox/chooseBox/zoneBeginTime")); divChooseEndTimeCurr.style.color=noTime? "#DD0000":"black"; divChooseEndTimeCurr.innerHTML=(foundStop? getText("automat_QueDontWork"):(($("divChooseBoxInner")==divChooseEndTimeCurr.parentNode)?getText("automat_QueTimeFirstReady"):getText("automat_QueTimeReady")) + " " + getDateText(zoneBeginTime[fz]+productTime,0) + " "+ getDaytimeStr(zoneBeginTime[fz]+productTime,true)); } // GM_log("updateQueueBox chooseBox fields 2:" + zoneNrS); $("divChooseItem"+zoneNrL+"Q"+queueNum+"I"+PRODSTOP).style.border=(zoneList[zoneNrL][queueNum][0]==PRODSTOP?"2px solid black":""); for(var iProd=0;iProd scrlelm.clientWidth)?"block":"none"); $("divAutoMatScrollRight"+zoneNrL).style.display=((scrlelm.scrollWidth > scrlelm.clientWidth)?"block":"none"); $("divAutoMatScrollLeft"+zoneNrL).style.visibility=(scrlelm.scrollLeft>0?"visible":"hidden"); $("divAutoMatScrollRight"+zoneNrL).style.visibility=((scrlelm.scrollLeft + scrlelm.clientWidth) 0); var fzWindmill=(fzType=="windmill"); var fzForestry=(fzType=="sawmill"||fzType=="carpentry"||fzType=="forest"); var fzPowerUp=(fzType=="powerup");//TODO powerup var iType=(fzWindmill?3:(fzForestry?1:0)); var noTime=false; // GM_log("toolTipProductSmall 0 zoneNrF:" + zoneNrF + " zoneNrL:" + zoneNrL + " queueNum:" + queueNum + " isIcon:" + isIcon +" fzType:"+ fzType + " zoneTyp:"+getZoneType(zoneNrF)+ " parent:"+parent.innerHTML); if(isIcon){ if(fzType==2){ var iProd=(zoneList[zoneNrL][0][0]==PRODSTOP?PRODSTOP:unsafeData.BUILDING2PRODUCT[getZoneType(zoneNrF)][0]); // }else if(fzType==3){ // var iProd=(zoneList[zoneNrL][0][0]==PRODSTOP?PRODSTOP:zoneList[zoneNrL][0][0]); }else{ var iProd=zoneList[zoneNrL][0][0]; } if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.getAttribute("zoneBeginTime"),"toopTipProductSmall/[0]/zoneBeginTime",{}); }else if(isTimeLine){ var iProd=parseInt(parent.getAttribute("iProd"),10); //unsafeData.BUILDING2PRODUCT[getZoneType(zoneNrF)]; if(settings.get("account","showQueueTime")){ var zoneBeginTime=new Array(); zoneBeginTime[zoneNrF]=parseFloat(parent.getAttribute("zoneBeginTime")); } }else if(fzType==2){ // stable var iProd=unsafeData.BUILDING2PRODUCT[getZoneType(zoneNrL)][0]; // zoneNrF? //parseInt(parent.getAttribute("class").replace("divChooseFeedIcon v",""),10); if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.parentNode.parentNode.getAttribute("zoneBeginTime"),"zoneBeginTimeStable"); // }else if(fzType==3){ // factory // var iProd=parseInt(parent.getAttribute("class").replace("divChooseItem link v",""),10); // if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.parentNode.getAttribute("zoneBeginTime"),"zoneBeginTimeFactory"); }else if(fzWindmill){ var iProd=parseInt(parent.firstElementChild.getAttribute("class").replace("fmm",""),10); //TODO getAttribute("product") if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.parentNode.getAttribute("zoneBeginTime"),"toopTipProductSmall/[2]/zoneBeginTime",{}); }else if(fzForestry){ var iProd=parseInt(parent.getAttribute("class").replace("divChooseItem link f_symbol",""),10); if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.parentNode.getAttribute("zoneBeginTime"),"toopTipProductSmall/[5]/zoneBeginTime",{}); }else if(fzPowerUp){//parseInt(parent.getAttribute("class").replace("divChooseItem link r",""),10)>0){ var iProd=parseInt(parent.getAttribute("class").replace("divChooseItem link r",""),10); if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.parentNode.getAttribute("zoneBeginTime"),"toopTipProductSmall/[3]/zoneBeginTime",{}); }else{ // Field, Factory var iProd=parseInt(parent.getAttribute("class").replace("divChooseItem link v",""),10); if(settings.get("account","showQueueTime")) var zoneBeginTime=explode(parent.parentNode.getAttribute("zoneBeginTime"),"toopTipProductSmall/[4]/zoneBeginTime",{}); } var iStop=(iProd==PRODSTOP); var foundStop=false; for(var i=0;i0){ newrow=createElement("div",{style:"display:table-row;width:100%;"},content); createElement("div",{"class":"tableTd1"},newrow,""); newdiv=createElement("div",{"class":"tableTd2"},newrow); produktPic(iType,zoneList[zoneNrL][1][0],newdiv); createElement("span",{},newdiv, zoneList[zoneNrL][1][1] + " " + unsafeData.prodName[iType][zoneList[zoneNrL][1][0]]); } }else if(fzType==3){ createElement("div",{"class":"tableSepBorder"},createElement("div",{"class":"tableSeperater"},content)); createElement("div",{"class":"tableSepBorder"},createElement("div",{"class":"tableSeperater"},content)); for(var i=0;i 1 || fzType=="sawmill"){ createElement("div",{style:"margin:2px 0px 2px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); createElement("div",{style:"display:block"},content,queueNum==0?getText("automat_QueTimeNextReady"):getText("automat_QueTimeFirstReady"));//getText("automat_usedFarmFieldsReadyAt")); createElement("div",{style:"margin:2px 0px 2px 0px;width:100%;height:1px;border-bottom:1px dashed black;"},content); var help=0; for(var fz in zoneBeginTime){ if(!zoneBeginTime.hasOwnProperty(fz)){ continue; } newrow=createElement("div",{style:"display:table-row;white-space:nowrap;"+(fz!=zoneNrF&&isIcon?"color:#505050;":"")},content); if(++help>10){ createElement("div",{"style":"display:table-cell;"},newrow,"..."); break; }else{ createElement("div",{"style":"display:table-cell;"},newrow,getZoneName(0,fz,fz,null,false,true,true,false)); createElement("div",{"style":"display:table-cell;padding:0px 2px;"},newrow, "->"); createElement("div",{"style":"display:table-cell;padding:0px 3px;font-weight:bold;"},newrow, getDateText(Math.max(now,zoneBeginTime[fz])+calcProductionTime(iProd,fz),0).toLowerCase()); createElement("div",{"style":"display:table-cell;padding:0px 3px;"},newrow, getDaytimeStr(Math.max(now,zoneBeginTime[fz])+calcProductionTime(iProd,fz),true)); } } }else{ createElement("div",{"class":"tableSepBorder"},createElement("div",{"class":"tableSeperater"},content));createElement("div",{"class":"tableSepBorder"},createElement("div",{"class":"tableSeperater"},content)); newrow=createElement("div",{style:"display:table-row;width:100%;"},content); createElement("div",{"class":"tableTd1"},newrow,queueNum==0?getText("automat_QueTimeNextReady"):getText("automat_QueTimeFirstReady"));//getText("automat_usedFarmFieldsReadyAt")); createElement("div",{"class":"tableTd2"},newrow, ""+getDateText(Math.max(now,zoneBeginTime[fz])+productTime,0).toLowerCase()+" "+getDaytimeStr(Math.max(now,zoneBeginTime[fz])+productTime,true)); } } if(iStop){ createElement("div",{style:"margin:2px 0px 2px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); createElement("div",{style:""},content,fzWindmill?getText("automat_MillStop0"):(fzType==1?getText("automat_QueStop0"):getText("automat_QueDontWork"))); }else if(foundStop){ createElement("div",{style:"margin:2px 0px 2px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); createElement("div",{style:""},content,fzWindmill?getText("automat_MillStoped"):getText("automat_QueueStoped")); }else{ createElement("div",{style:"margin:2px 0px 2px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); createElement("div",{style:""},content,fzWindmill?getText("automat_MillDoWork"):getText("automat_QueDoWork")); } } var thisTitle=content.innerHTML; content=null;fz=null;zoneBeginTime=null;newrow=null;newdiv=null;productTime=null; //%PRODNAME%=iProd name thisTitle=thisTitle.replace(/%PRODNAME%/gi, unsafeData.prodName[0][iProd]); // GM_log("End toolTipProductSmall : " + zoneNrF + " : " + queueNum); return thisTitle; }catch(err){ GM_logError("toolTipProductSmall","zoneNrF="+zoneNrF+" zoneNrL="+zoneNrL+" queueNum="+queueNum+" parent.id="+parent.id,"",err); return "Error. See console."; } } function toolTipMain(zoneNrF, zoneNrL, queueNum, parent){ if(zoneNrF=="windmill"){ return toolTipRecipe(zoneNrF, zoneNrL, queueNum, parent); }else if(zoneNrF=="sawmill"||zoneNrF=="carpentry"||zoneNrF=="forest"){ return toolTipProduct(zoneNrF, zoneNrL, queueNum, parent); }else{ return toolTipProduct(zoneNrF, zoneNrL, queueNum, parent); } } function toolTipProduct(zoneNrF, zoneNrL, queueNum, parent){ try{ if(zoneNrL===undefined || zoneNrL==null) zoneNrL=getZoneListId(zoneNrF); // GM_log("Begin toolTipProduct zoneNrF="+zoneNrF+" zoneNrL="+zoneNrL+" queueNum="+queueNum+" parent.id="+parent.id); var totalInQue=parseInt(parent.getAttribute("totalInQue"),10); var foundStop=parent.getAttribute("foundStop")=="true"; var lRepeat=(!OPTION_LIST_REPEAT || zoneSettings[zoneNrL]["repeat"]===undefined)?false:zoneSettings[zoneNrL]["repeat"]; var lShuffle=zoneSettings[zoneNrL]["shuffle"]===undefined?false:zoneSettings[zoneNrL]["shuffle"]; var iRepeat=(!OPTION_ITEM_REPEAT)?false:zoneList[zoneNrL][queueNum][4]; var iLastInf=((zoneList[zoneNrL].length-1)==queueNum) && !(lRepeat || iRepeat) && !lShuffle; var iRackMode=zoneNrL!="windmill" && zoneList[zoneNrL][queueNum][3]; var iProd=parseInt(zoneList[zoneNrL][queueNum][0],10); var iTot=parseInt(zoneList[zoneNrL][queueNum][1],10); var iDone=iRackMode?0:parseInt(zoneList[zoneNrL][queueNum][2],10); var iStop=(iProd==PRODSTOP); var lShowTime=getZonesFromList(zoneNrL).length > 0; var fzType=getBuildingTyp(zoneNrF); var fzWindmill=(fzType=="windmill"); var fzPowerUp=(fzType=="powerup");//TODO powerup var fzForestry=(fzType=="sawmill"||fzType=="carpentry"||fzType=="forest"); var iType=(fzWindmill?2:(fzForestry?1:0)); // GM_log("toolTipProductSmall fzType:"+fzType); if(settings.get("account","showQueueTime") && lShowTime){ var iTogoArray=explode(parent.getAttribute("iTogoArray"),"toolTipProduct/iTogoArray",{}); var timeArray=explode(parent.getAttribute("timeArray"),"toolTipProduct/timeArray",{}); var timesArray=explode(parent.getAttribute("timesArray"),"toolTipProduct/timesArray",{}); var aMissing=explode(parent.getAttribute("aMissing"),"toolTipProduct/aMissing",{}); var zoneBeginTime=explode(parent.getAttribute("zoneBeginTime"),"toolTipProduct/zoneBeginTime",{}); var zoneEndTime=explode(parent.getAttribute("zoneEndTime"),"toolTipProduct/zoneEndTime",{}); var equalTimeArray=timeArray.allEqual(); } var iTogo=parseInt(parent.getAttribute("iTogo"),10); var iTogoAmount=parseInt(parent.getAttribute("iTogoAmount"),10); var iTogoScore=parseInt(parent.getAttribute("iTogoScore"),10); var iDoneAmount=calcProductAmount(iProd, zoneNrF, null, null, true) * iDone; var iDoneScore=calcProductScore(iProd, zoneNrF, null, null) * iDone; var content=createElement("div"); createElement("div",{"class":"queueTitle"},content,iRackMode?getText("automat_QueRackMode"):(((lRepeat || iRepeat) && lShuffle)?getText("automat_QueRepeatShuffle"):(lShuffle?getText("automat_QueShuffle"):((lRepeat || iRepeat)?getText("automat_QueRepeat"):(iTot<=1?getText("automat_QueFieldInRow1"):getText("automat_QueFieldInRowX")))))); createElement("div",{style:"font-weight:bold;"},content,(iStop)?getText("automat_stop").toTitleCase():(fzWindmill)?unsafeWindow.formulas[0][iProd][2]:(fzPowerUp)?unsafeWindow.poweruprack[iProd][2]:unsafeData.prodName[iType][iProd]); createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); if(iStop){ createElement("div",{style:""},content,(totalInQue==0)?getText("automat_QueStop0"):(totalInQue==1)? getText("automat_QueStop1"):getText("automat_QueStopX")); }else{ if((lRepeat || iRepeat || lShuffle || iRackMode) && iTogo<=0){//iTot<=iDone){ var newspan=createElement("div",{style:"display:block"},content,((iRackMode && !(lRepeat || iRepeat) && !lShuffle)?getText("automat_QueRoundDoneR"):(iDone<=1?getText("automat_QueRoundDone1"):getText("automat_QueRoundDoneX")))); }else{ //normal var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("yield")); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("points")); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_fields")); //TODO text -> "fields" much be "zone" for isNaN(zoneNrF) if(!extendedListReg.test(zoneNrL)){ if(!iRackMode){ //TOTAL var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,(lRepeat || iRepeat || lShuffle ?getText("automat_QueRoundMake"):getText("automat_QueFieldMake"))); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (equalTimeArray?"":" ~ ") + (iLastInf?"∞":numberFormat(iTogoAmount+iDoneAmount)+"×")); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (equalTimeArray?"":" ~ ") + (iLastInf?"∞":numberFormat(iTogoScore+iDoneScore))); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (iLastInf?"∞":numberFormat(iTot))); if((lRepeat || iRepeat || lShuffle) && iDone>0){ //DONE var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_QueRoundMade")); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (equalTimeArray?"":" ~ ") + numberFormat(iDoneAmount)+"×"); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (equalTimeArray?"":" ~ ") + numberFormat(iDoneScore)); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, iDone); } } } if(iTogo>0){//TOGO var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan, (lRepeat || iRepeat || lShuffle ?getText("automat_QueRoundToGo"):getText("automat_QueFieldToGo"))); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (settings.get("account","showQueueTime")?"":" ~ ") + (iLastInf?"∞":numberFormat(iTogoAmount)+"×")); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (settings.get("account","showQueueTime")?"":" ~ ") + (iLastInf?"∞":numberFormat(iTogoScore))); createElement("div",{style:"display:table-cell;padding-right:10px;text-align:right;"},newspan, (iLastInf?"∞":numberFormat(iTogo))); } } createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); // GM_log("toolTipProduct Title :" + zoneNrF + ": 1"); if(foundStop){ createElement("div",{"style":""},content,getText("automat_QueueStoped")); }else if(settings.get("account","showQueueTime") && lShowTime && (iTogo>0)){ var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_QueTimeThis")); //createElement("div",{style:"display:table-cell;"},newspan, getTimeStr(timeArray[zoneNrF],true) + " " + getText("shortHours")); createElement("div",{style:"display:table-cell;"},newspan, (equalTimeArray?"":" ~ ") + getTimeStr(timeArray.average(),true) + " " + getText("shortHours")); if((lRepeat || iRepeat || lShuffle)&& !iLastInf){ var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_QueTimeRound")); //createElement("div",{style:"display:table-cell;"},newspan, getTimeStr(timeArray[zoneNrF]*Math.max(iTogo+iDone,0),true) + " " + getText("shortHours")); createElement("div",{style:"display:table-cell;"},newspan, (equalTimeArray?"":" ~ ") + getTimeStr(timeArray.averageFieldTime(Math.max(iTogo+iDone,1)),true) + " " + getText("shortHours")); } //GM_log("toolTipProduct Title :" + zoneNrF + ": 2"); if(iTogo>0){ if(!iLastInf){ var beginTime=zoneBeginTime[getLowestTimeFarmZone(zoneBeginTime)]; var endTime=zoneEndTime[getHighestTimeFarmZone(zoneEndTime)]; var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_QueTimeToGo")); createElement("div",{style:"display:table-cell;"},newspan, getTimeStr(endTime - beginTime,true) + " " + getText("shortHours")); var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_QueTimeReady")); createElement("div",{style:"display:table-cell;"},newspan, getDateText(endTime,0).toLowerCase() + " " + getDaytimeStr(endTime,true)); beginTime=null;endTime=null; } createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:1px;border-bottom:1px solid black;"},content); var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-left:5px;"},newspan); createElement("div",{style:"display:table-cell;padding-left:5px;"},newspan,getText("automat_number")); createElement("div",{style:"display:table-cell;padding-left:5px;"},newspan,getText("total")); createElement("div",{style:"display:table-cell;padding-left:5px;"},newspan,getText("automat_lack")); createElement("div",{style:"display:table-cell;padding-left:5px;"},newspan,getText("product")); var help; for(var i in unsafeData.prodRequire[iType][iProd]){ if(!unsafeData.prodRequire[iType][iProd].hasOwnProperty(i)){continue;} help=unsafeData.prodRequire[iType][iProd][i].clone(); var newspan=createElement("div",{style:"display:table-row;"},content); if(help[0]<0){ createElement("div",{style:"display:table-cell;"},newspan); createElement("div",{style:"display:table-cell;padding-left:8px;text-align:right;"},newspan, numberFormat(help[1])); help[1]*=iTot; createElement("div",{style:"display:table-cell;padding-left:8px;text-align:right;"},newspan, numberFormat(help[1])); help[1]-=unsafeData.money; createElement("div",{style:"display:table-cell;padding-left:8px;text-align:right;"},newspan, help[1]>0?numberFormat(help[1]):""); createElement("div",{style:"display:table-cell;padding-left:8px;"},newspan,getText("gamecurrency")); }else{ produktPic(help[0],help[1],newspan); createElement("div",{style:"display:table-cell;padding-left:8px;text-align:right;"},newspan, numberFormat(help[2])); help[2]*=iTot; createElement("div",{style:"display:table-cell;padding-left:8px;text-align:right;"},newspan, numberFormat(help[2])); help[2]=(aMissing[help[0]]?aMissing[help[0]][help[1]]:0); createElement("div",{style:"display:table-cell;padding-left:8px;text-align:right;"},newspan, help[2]>0?numberFormat(help[2]):""); createElement("div",{style:"display:table-cell;padding-left:8px;"},newspan,unsafeData.prodName[help[0]][help[1]]); } } createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:1px;border-bottom:1px solid black;"},content); createElement("div",{style:"display:block"},content,getText("automat_usedFarmFieldsReadyAt")); createElement("div",{style:"margin:2px 0px 2px 0px;width:100%;height:1px;border-bottom:1px dashed black;"},content); var timesCount=0; for(var fz in timesArray){ if(!timesArray.hasOwnProperty(fz)){ continue; } timesCount=Math.max(timesArray[fz].length,timesCount); } for(var fz in timesArray){ if(!timesArray.hasOwnProperty(fz)){ continue; } // GM_log("toolTipProduct Title :" + zoneNrF + "/" + fz); var newspan=createElement("div",{style:"display:table-row;white-space:nowrap;"},content); if(lShowTime){ createElement("div",{style:"display:table-cell;"},newspan, getZoneName(0,fz,fz,null,false,true,true,false)); //Math.ceil(fz/6) + "." + getGarden(fz)); createElement("div",{style:"display:table-cell;padding:0px 2px;"},newspan, "->"); createElement("div",{style:"display:table-cell;text-align:right;"},newspan, iTogoArray[fz]); createElement("div",{style:"display:table-cell;text-align:right;padding:0px 3px;"},newspan, "×"); createElement("div",{style:"display:table-cell;padding:0px 2px;"},newspan,getTimeStr(timeArray[fz],true) + " " + getText("shortHours")); createElement("div",{style:"display:table-cell;padding:0px 2px;"},newspan, "->"); } for(k=0;k < Math.min(10,timesCount-1);k++){ createElement("div",{style:"display:table-cell;padding:0px 3px;"},newspan, (k<(timesArray[fz].length-1))?(k==0&&queueNum>0?""+getDateText(timesArray[fz][k],0)+" ":"")+getDaytimeStr(timesArray[fz][k],true):" "); } if(timesCount>=11) createElement("div",{style:"display:table-cell;padding:0px 2px;"},newspan, timesArray[fz].length>=11?" .... ":""); if(!iLastInf){ createElement("div",{style:"display:table-cell;padding:0px 3px;"},newspan, ""+getDateText(zoneEndTime[fz],0) + " " + getDaytimeStr(zoneEndTime[fz],true)); }else{ createElement("div",{style:"display:table-cell;padding:0px 3px;"},newspan, "∞"); } } timesArray=null;fz=null;k=null; } } } var thisTitle=content.innerHTML; content=null;newspan=null;timeArray=null;zoneBeginTime=null;zoneEndTime=null;timesArray=null; //%PRODNAME%=product name, %FLDFROM%=field nr from, %FLDTO%=field nr until, thisTitle=thisTitle.replace(/%PRODNAME%/gi, unsafeData.prodName[iType][iProd]); thisTitle=thisTitle.replace(/%FLDFROM%/gi, totalInQue + (iProd==PRODSTOP?0:1)); thisTitle=thisTitle.replace(/%FLDTO%/gi, iLastInf?"∞":(totalInQue+iTot)); // GM_log("End toolTipProduct :" + zoneNrF + " : " + queueNum); return thisTitle; }catch(err){ GM_logError("toolTipProduct","","",err); return "Error. See console."; } } function toolTipRecipe(zoneNrF, zoneNrL, queueNum, parent){ try{ // GM_log("Begin toolTipRecipe :" + zoneNrF + " : " + queueNum); if(zoneNrL===undefined || zoneNrL==null) zoneNrL=getZoneListId(zoneNrF); var totalInQue=parseInt(parent.getAttribute("totalInQue"),10); var foundStop=parent.getAttribute("foundStop")=="true"; var lRepeat=(!OPTION_LIST_REPEAT || zoneSettings[zoneNrL]["repeat"]===undefined)?false:zoneSettings[zoneNrL]["repeat"]; var lShuffle=zoneSettings[zoneNrL]["shuffle"]===undefined?false:zoneSettings[zoneNrL]["shuffle"]; var iProd=parseInt(zoneList[zoneNrL][queueNum][0],10); var iTot=parseInt(zoneList[zoneNrL][queueNum][1],10); var iDone=parseInt(zoneList[zoneNrL][queueNum][2],10); var iStop=(iProd==PRODSTOP); var lShowTime=getZonesFromList(zoneNrL).length > 0; if(settings.get("account","showQueueTime") && lShowTime){ var timeArray=explode(parent.getAttribute("timeArray"),"toolTipRecipe/timeArray",false); var timesArray=explode(parent.getAttribute("timesArray"),"toolTipRecipe/timesArray",false); var zoneBeginTime=explode(parent.getAttribute("zoneBeginTime"),"toolTipRecipe/zoneBeginTime",false); var zoneEndTime=explode(parent.getAttribute("zoneEndTime"),"toolTipRecipe/zoneEndTime",false); } var content=createElement("div"); createElement("div",{"class":"queueTitle"},content,(zoneSettings[zoneNrL]["shuffle"]?getText("automat_MillShuffle"):(iTot<=1?getText("automat_MillInRow1"):getText("automat_MillInRowX")))); createElement("div",{style:"font-weight:bold;"},content,(iStop?getText("automat_stop").toTitleCase():unsafeWindow.formulas[0][iProd][2])); createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); //item title info creation if(iStop){ createElement("div",{style:""},content,(totalInQue==0)?getText("automat_MillStop0"):(totalInQue==1)? getText("automat_MillStop1"):getText("automat_MillStopX")); }else{ if(unsafeWindow.formulas[0][iProd]){ var info=unsafeWindow.formulas[0][iProd]; if(settings.get("account","showQueueTime") && lShowTime){ var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_MillTimeThis")); createElement("div",{style:"display:table-cell;"},newspan,getTimeStr(timeArray["windmill"],true) + " " + getText("shortHours")); var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_MillTimeTotal")); createElement("div",{style:"display:table-cell;"},newspan,getTimeStr(timeArray["windmill"]*Math.max(iTot,0),true) + " " + getText("shortHours")); if(!foundStop){ var beginTime=zoneBeginTime[getLowestTimeFarmZone(zoneBeginTime)]; //not used !? var endTime=zoneEndTime[getHighestTimeFarmZone(zoneEndTime)]; //not used !? var newspan=createElement("div",{style:"display:table-row;"},content); createElement("div",{style:"display:table-cell;padding-right:10px;"},newspan,getText("automat_MillTimeReady")); createElement("div",{style:"display:table-cell;"},newspan,getDateText(zoneEndTime[zoneNrF],0).toLowerCase() + " " + getDaytimeStr(zoneEndTime[zoneNrF],true)); createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:1px;border-bottom:1px solid black;"},content); } } for( var bonus=0;bonus"+getDateText(timesArray[fz][k],0)+" ":"")+getDaytimeStr(timesArray[fz][k],true):" "); } if(timesCount>=11) createElement("div",{style:"display:table-cell;padding:0px 2px;"},newspan, timesArray[fz].length>=11?" .... ":""); createElement("div",{style:"display:table-cell;padding:0px 3px;"},newspan, ""+getDateText(zoneEndTime[fz],0) + " " + getDaytimeStr(zoneEndTime[fz],true)); } timesArray=null;fz=null;k=null; } info=null; } if(foundStop){ createElement("div",{style:"margin:4px 0px 4px 0px;width:100%;height:1px;border-bottom:1px solid black;"},content); createElement("div",{style:""},content,getText("automat_MillStoped")); } } var thisTitle=content.innerHTML; content=null;newspan=null;timeArray=null;zoneBeginTime=null;zoneEndTime=null; // GM_log("toolTipRecipe Box :"+queueNum + " | 2"); thisTitle=thisTitle.replace(/%PRODNAME%/gi, (iProd==PRODSTOP?getText("automat_stop"):unsafeWindow.formulas[0][iProd][2])); thisTitle=thisTitle.replace(/%FLDFROM%/gi, totalInQue + (iProd==PRODSTOP?0:1)); thisTitle=thisTitle.replace(/%FLDTO%/gi, totalInQue + iTot); // GM_log("End toolTipRecipe :" + zoneNrF + " : " + queueNum); return thisTitle; }catch(err){ GM_logError("toolTipRecipe ","","",err); return "Error. See console."; } } function setNextQueueItem(zoneNrS){ try{ GM_logInfo("setNextQueueItem","zoneNrS="+zoneNrS,"","Setting next queue item"); var zoneNrL=getZoneListId(zoneNrS); if(isNaN(zoneList[zoneNrL][0][1])){ zoneList[zoneNrL][0]=DEFAULT_ZONELIST_ITEM.clone(); } if(isNaN(zoneList[zoneNrL][0][2])){ zoneList[zoneNrL][0][2]=0; } if((settings.get("account","useQueueList")||isNaN(zoneNrS)) && (zoneList[zoneNrL][0][0]!=PRODSTOP) && (!zoneList[zoneNrL][0][3])){ if((OPTION_LIST_REPEAT && (zoneSettings[zoneNrL]["repeat"]))||(OPTION_ITEM_REPEAT && (zoneList[zoneNrL][0][4]))){ zoneList[zoneNrL][0][2]++; }else{ zoneList[zoneNrL][0][1]--; } } reSortQueue(zoneNrS, true); //->reFillQueueBox GM_logInfo("setNextQueueItem","zoneNrS="+zoneNrS,"","End",1); return zoneList[zoneNrL][0]; }catch(err){ GM_logError("setNextQueueItem","zoneNrS="+zoneNrS,"",err); return DEFAULT_ZONELIST_ITEM.clone(); } } function reSortQueue(zoneNrF, nextItemMode){ try{ GM_logInfo("reSortQueue","zoneNrF="+zoneNrF,"","Resort queue items"); var itemsRackDone=0,itemsRepeatDone=0,itemsStopsFound=0,iDoRack=false; var zoneNrL=getZoneListId(zoneNrF); if((settings.get("account","useQueueList")||isNaN(zoneNrF)) && (zoneList[zoneNrL][0][0]!=PRODSTOP) && (nextItemMode || (((zoneList[zoneNrL][0][3] && calcInGameProductAmount(zoneList[zoneNrL][0][0],zoneNrF,null,true) < zoneList[zoneNrL][0][1]) || (!zoneList[zoneNrL][0][3] && zoneList[zoneNrL][0][1]<=((OPTION_ITEM_REPEAT && zoneList[zoneNrL][0][4])||(OPTION_LIST_REPEAT&&zoneSettings[zoneNrL]["repeat"])?zoneList[zoneNrL][0][2]:0))) ))){ // && (getBuildingTyp(zoneNrF)==1||isNaN(zoneNrF)) // GM_log("auto plant volgende " + zoneList[zoneNrL][0][0]); for(i=0;i zoneList[zoneNrL][i][1]){ itemsRackDone++; } // }else if((zoneList[zoneNrL][i][5]!=REPEAT_NO_LIMIT && zoneList[zoneNrL][i][5]<=(REPEAT_RESTART+(zoneList[zoneNrL][i][1]<=zoneList[zoneNrL][i][2]?1:0)) && OPTION_ITEM_REPEAT && zoneList[zoneNrL][i][4])||(OPTION_LIST_REPEAT && zoneSettings[zoneNrL]["repeat"]&& zoneList[zoneNrL][i][1]<=zoneList[zoneNrL][i][2])){ // }else if((zoneList[zoneNrL][i][5]!=REPEAT_NO_LIMIT && zoneList[zoneNrL][i][5]<=(REPEAT_RESTART+(zoneList[zoneNrL][i][1]<=zoneList[zoneNrL][i][2]?1:0)) && OPTION_ITEM_REPEAT && zoneList[zoneNrL][i][4])||(((OPTION_LIST_REPEAT && zoneSettings[zoneNrL]["repeat"])||(zoneList[zoneNrL][i][5]==REPEAT_NO_LIMIT)) && zoneList[zoneNrL][i][1]<=zoneList[zoneNrL][i][2])){ }else if((zoneList[zoneNrL][i][1]<=zoneList[zoneNrL][i][2] && OPTION_ITEM_REPEAT && zoneList[zoneNrL][i][4])||(OPTION_LIST_REPEAT && zoneSettings[zoneNrL]["repeat"] && zoneList[zoneNrL][i][1]<=zoneList[zoneNrL][i][2])){ itemsRepeatDone++; } } // GM_log("reSortQueue itemsRackDone:"+itemsRackDone+" itemsRepeatDone:"+itemsRepeatDone+" itemsStopsFound:"+itemsStopsFound+" length:"+zoneList[zoneNrL].length); if(zoneList[zoneNrL].length==itemsRackDone){ // GM_log("reSortQueue "+zoneNrF+":4"); // GM_log("Added PRODSTOP zoneNrL:"+zoneNrL + " itemsRackDone:"+itemsRackDone+" : "+ typeof itemsRackDone); zoneList[zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); }else if(zoneList[zoneNrL].length==1 && 1==itemsRepeatDone && zoneList[zoneNrL][0][5]<=REPEAT_RESTART && zoneList[zoneNrL][0][5]!=REPEAT_NO_LIMIT){ zoneList[zoneNrL][0]=DEFAULT_ZONELIST_ITEM.clone(); }else if(zoneSettings[zoneNrL]["shuffle"] && zoneList[zoneNrL].length==(itemsRepeatDone+itemsRackDone+itemsStopsFound)){ for(queueNum=0;queueNum1"); zoneList[zoneNrL].splice(0,1); } } if(zoneList[zoneNrL].length>1){ zoneList[zoneNrL].push(zoneList[zoneNrL].splice(0,1)[0]); } } }else if(zoneList[zoneNrL][0][3]){ if(!iDoRack){ if(zoneList[zoneNrL].length<=1){ zoneList[zoneNrL][0]=DEFAULT_ZONELIST_ITEM.clone(); // stop if no items to go. }else{ zoneList[zoneNrL].splice(0,1); } } }else if(zoneList[zoneNrL][0][1]<=0 && zoneList[zoneNrL].length<=1 && !zoneSettings[zoneNrL]["shuffle"]){ zoneList[zoneNrL][0][1]=1; // reset to 1 only for displaying in repeat modus needed. }else if(zoneList[zoneNrL][0][1]<=0 && zoneList[zoneNrL].length<=1 && zoneSettings[zoneNrL]["shuffle"]){ zoneList[zoneNrL][0]=DEFAULT_ZONELIST_ITEM.clone(); // stop if no items to go. //TODO do i realy have to stop. if no rackmode no repeat length=1 and shuffle or do i have to repeat as is !shuffle? }else if(zoneList[zoneNrL][0][1]<=0){ zoneList[zoneNrL].splice(0,1); } if(zoneSettings[zoneNrL]["shuffle"]){ zoneList[zoneNrL].shuffle(); } //TODO do here remove PRODSTOP in shuffle or repeat mode list and not in RACK-mode }while (((zoneList[zoneNrL][0][3] && calcInGameProductAmount(zoneList[zoneNrL][0][0],zoneNrF,null,false)>=zoneList[zoneNrL][0][1])||(!zoneList[zoneNrL][0][3] && (zoneList[zoneNrL][0][1]<=(((OPTION_ITEM_REPEAT && zoneList[zoneNrL][0][4])||(OPTION_LIST_REPEAT && zoneSettings[zoneNrL]["repeat"]))?zoneList[zoneNrL][0][2]:0)))) && zoneList[zoneNrL].length>=1 && zoneList[zoneNrL][0][0]!=PRODSTOP); //GM_log("End Do:" + zoneList[zoneNrL][0][0]); } if(zoneList[zoneNrL].length<1){ zoneList[zoneNrL]=DEFAULT_ZONELIST_ITEM_ARRAY.clone(); } itemsRackDone=null;itemsRepeatDone=null;itemsStopsFound=null;iDoRack=null; reFillQueueBox(zoneNrF); // GM_log("End reSortQueue :" + zoneNrF); return zoneList[zoneNrL][0][0]; }catch(err){ GM_logError("reSortQueue ","","",err); return PRODSTOP; } } function reSortWindmill(shuffle){ try{ GM_logInfo("reSortWindmill","shuffle="+shuffle,"","Begin",1); var zoneNrF="windmill"; var zoneNrS="windmill.1"; var zoneNrL=getZoneListId(zoneNrS); do { if(shuffle){ zoneList[zoneNrL].shuffle(); } if(zoneList[zoneNrL][0][0]==PRODSTOP){ break; }else if(autoMillStorage[zoneList[zoneNrL][0][0]]&&autoMillStorage[zoneList[zoneNrL][0][0]][2]<=0){ var pCount=0; for(var rId=0;rId autoMillStorage[rId][0]){ // change the zoneList[zoneNrL] amount to the max amount that is bought zoneList[zoneNrL][v][1] -=(autoMillStorage[rId][1] - autoMillStorage[rId][0]); autoMillStorage[rId][1]=autoMillStorage[rId][0]; if(zoneList[zoneNrL][v][1]<=0){ zoneList[zoneNrL].splice(v,1); v--; continue; } } //give the lowest number of recipes that can be made with these products. for(var i=0;i0){ // GM_log("prodMinRackAddon add windmill\n"+implode([0,v,getText("automat_titleQueue")+" "+getText("windmill"),autoMillUsedProducts[v]])); unsafeWindow.prodMinRackAddon.add(0,v,getText("automat_titleQueue")+" "+getText("windmill"),autoMillUsedProducts[v]); } } autoMillUsedProducts=null; err_trace="saving"; GM_setValueCache(COUNTRY+"_"+SERVER+"_"+USERNAME+"_autoMillStorage",implode(autoMillStorage,"reCalculateWindmill/autoMillStorage")); GM_setValueCache(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList",implode(zoneList,"reCalculateWindmill/zoneList")); // GM_log("End reCalculateWindmill"); }catch(err){ GM_logError("reCalculateWindmill","","err_trace="+err_trace,err);} } function checkReadyZone(zoneNr){ try{ GM_logInfo("checkReadyZone","zoneNr="+zoneNr,"readyZone="+implode(unsafeData.readyZone,"checkReadyZone/readyZone"),"Begin",1); var help,lz; if(!bot.isActive()){ return false; }else if(zoneNr){ lz = getZoneListId(zoneNr); if((help=unsafeData.readyZone[zoneNr])&&help[2]&&((help[1]=="w")||(help[1]=="r" && (zoneList[lz][0][0]!=PRODSTOP||!settings.get("account","disableCropFields")))||(help[1]=="e" && zoneList[lz][0][0]!=PRODSTOP))){ if(zoneWaiting[zoneNr]){ GM_logInfo("checkReadyZone","zoneNr="+zoneNr,"zoneWaiting="+getDateText(zoneWaiting[zoneNr])+" "+getDaytimeStr(zoneWaiting[zoneNr]),getText("automat_zoneXWaiting").replace(/%1%/,unsafeData.zones.getName(zoneNr))); } else { if(isNaN(zoneNr)){ if(settings.get("account","botUse"+getGarden(zoneNr).toTitleCase())){ botArbiter.add(getGarden(zoneNr)); } } else { botArbiter.add("farm"); } } } }else{ for(var fz in unsafeData.readyZone){ if(!unsafeData.readyZone.hasOwnProperty(fz)){ continue; } if((help=unsafeData.readyZone[fz])&&help[2]){ lz = getZoneListId(fz); if((help[1]=="w")||(help[1]=="r" && (zoneList[lz][0][0]!=PRODSTOP||!settings.get("account","disableCropFields")))||(help[1]=="e" && zoneList[lz][0][0]!=PRODSTOP)){ if(zoneWaiting[fz]){ GM_logInfo("checkReadyZone","zoneNr="+zoneNr,"fz="+fz+" zoneWaiting="+getDateText(zoneWaiting[fz])+" "+getDaytimeStr(zoneWaiting[fz]),getText("automat_zoneXWaiting").replace(/%1%/,unsafeData.zones.getName(fz))); } else { if(isNaN(fz)){ if(settings.get("account","botUse"+getGarden(fz).toTitleCase())){ botArbiter.add(getGarden(fz)); } } else { botArbiter.add("farm"); } } } } } } GM_logInfo("checkReadyZone","zoneNr="+zoneNr,"return="+false,"End",1); return false; }catch(err){ GM_logError("checkReadyZone","zoneNr="+zoneNr,"readyZone="+implode(unsafeData.readyZone,"checkReadyZone/readyZone"),err);} } function getReadyZone(location){ GM_logInfo("getReadyZone","location="+location,"readyZone="+implode(unsafeData.readyZone,"getReadyZone/readyZone"),"Begin",1); var help,zoneNrS,zoneNrL; if(!bot.isActive()){ return null; }else{ for(var zoneNrS in unsafeData.readyZone){ if(!unsafeData.readyZone.hasOwnProperty(zoneNrS)){ continue; } if((help=unsafeData.readyZone[zoneNrS])&&help[2]&&((location===undefined)||(location==help[0]))){ zoneNrL = getZoneListId(zoneNrS); if((help[1]=="w")||(help[1]=="r" && (zoneList[zoneNrL][0][0]!=PRODSTOP||!settings.get("account","disableCropFields")))||(help[1]=="e" && zoneList[zoneNrL][0][0]!=PRODSTOP)){ if(zoneWaiting[zoneNrS]){ GM_logInfo("getReadyZone","location="+location,"zoneNrS="+zoneNrS+" zoneWaiting="+getDateText(zoneWaiting[zoneNrS])+" "+getDaytimeStr(zoneWaiting[zoneNrS]),getText("automat_zoneXWaiting").replace(/%1%/,unsafeData.zones.getName(zoneNrS))); } else if((!isNaN(zoneNrS))||settings.get("account","botUse"+getGarden(zoneNrS).toTitleCase())){ return zoneNrS; } } } } } GM_logInfo("getReadyZone","location="+location,"return="+null,"End",1); return null; } // Bot-functions handling fields,stables and factories /* function autoZone(){ try{ if(DEVMODE_FUNCTION){GM_log("Begin autoZone readyZone:"+implode(unsafeData.readyZone,"autoZone/readyZone"));} if(DEVMODE){ logBubble.add("autoZone"); } // busy=true; if(!busy){ GM_log("BUSY NOT SET: autoZone"); return false;} var farmNr=(unsafeWindow.forestry_quicknavi?"f1":((unsafeWindow.cities&&unsafeWindow.city)?("c"+unsafeWindow.city):(parseInt(unsafeWindow.farm,10)-1))); var zoneNrF=null; zoneNrF=getReadyZone(farmNr); if(DEVMODE){GM_log("autoZone 1 farmNr:"+farmNr+" zoneNrF:"+zoneNrF);} if(zoneNrF==null){ zoneNrF=getReadyZone(); if(DEVMODE){GM_log("autoZone 2 zoneNrF:"+zoneNrF);} if(zoneNrF==null){ // nothing to work (all fields waiting !?) if(DEVMODE){GM_log("autoZone farmNr:"+farmNr+" zoneNrF:"+zoneNrF);} autoZoneFinish(); }else{ handled.zoneBuildingTyp=getBuildingTyp(zoneNrF); GM_log("autoZone handled.zoneBuildingTyp:"+handled.zoneBuildingTyp); switch(handled.zoneBuildingTyp){ case 1:case 2:case 3: document.addEventListener("gameFarmOpened",function(){ document.removeEventListener("gameFarmOpened",arguments.callee,false); logBubble.add("Arrived in farm"); autoZone(); },false); window.setTimeout(function(){ logBubble.add("Change to farm "+(parseInt(unsafeData.readyZone[zoneNrF][0],10)+1)); click($("farmlinks").getElementsByClassName("link")[unsafeData.readyZone[zoneNrF][0]]); },settings.getPause(true)); break; case "windmill": document.addEventListener("gameCity2",function(){ document.removeEventListener("gameCity2",arguments.callee,false); logBubble.add("Arrived in city 2"); autoZone(); },false); window.setTimeout(function(){ logBubble.add("Change to city 2"); click($top("citylineitem2")); },settings.getPause(true)); break; case "forest": case "sawmill": case "carpentry": document.addEventListener("gameOpenForestry",function(){ document.removeEventListener("gameOpenForestry",arguments.callee,false); logBubble.add("Arrived in forestry"); autoZone(); },false); window.setTimeout(function(){ logBubble.add("Change to forestry"); click($top("speedlink_forestry")); },settings.getPause(true)); break; } } }else{ handled.zoneNr=getGarden(zoneNrF); handled.zoneNrF=zoneNrF; handled.zoneNrL=getZoneListId(zoneNrF); handled.zoneBuildingTyp=getBuildingTyp(zoneNrF); unsafeWindow.jsTimeStamp=unsafeWindow.Zeit.Client - unsafeWindow.Zeit.Verschiebung; if(!unsafeData.readyZone[handled.zoneNrS][2]){ // close wrong zone var OpenZoneNrF=getOpenZoneNrF(); if(OpenZoneNrF!=handled.zoneNrF){ if($("gardenmaincontainer").style.display=="block"){ click($("gardencancel").getElementsByClassName("link")[0]); } if($("innermaincontainer").style.display=="block"){ click($("cancelscreen").getElementsByClassName("link")[0]); } } if(unsafeData.readyZone[handled.zoneNrS][1]=="e" && zoneList[handled.zoneNrL][0][0]==PRODSTOP){ if(handled.zoneNrF=="windmill"||handled.zoneNrF=="sawmill"||handled.zoneNrF=="carpentry"||handled.zoneNrF=="forest"){ autoZoneFinish(); }else if(unsafeWindow.forestry_unlock!=undefined){ autoZoneFinish($("button_cancel"+handled.zoneNrF)); }else if(handled.zoneBuildingTyp>1){ autoZoneFinish($("cancelscreen").getElementsByClassName("link")[0]); }else{ autoZoneFinish($("gardencancel").getElementsByClassName("link")[0]); } }else if(OpenZoneNrF!=handled.zoneNrF){ if(DEVMODE) GM_log("click zone: " + farmNr + "." + handled.zoneNr + " readyZone=" +implode(unsafeData.readyZone,"autoZone/readyZone")); switch(handled.zoneBuildingTyp){ case 1: document.addEventListener("gameFieldOpened",function(){//gameFieldModified document.removeEventListener("gameFieldOpened",arguments.callee,false);//gameFieldModified autoZoneHandle(); },false); click($("zone"+handled.zoneNr).firstElementChild.firstElementChild); break; case 2: document.addEventListener("gameOpenStable",function(){ document.removeEventListener("gameOpenStable",arguments.callee,false); autoZoneHandle(); },false); click($("zone"+handled.zoneNr).firstElementChild.firstElementChild); break; case 3: document.addEventListener("gameOpenFactory",function(){ document.removeEventListener("gameOpenFactory",arguments.callee,false); autoZoneHandle(); },false); click($("zone"+handled.zoneNr).firstElementChild.firstElementChild); break; default://sawmill/carpentry/forest/windmill => not need to open an extra zone inside the farm/forestry/city autoZoneHandle(); break; } if(DEVMODE){GM_log("autoZone click zone:"+handled.zoneNr+" readyZone:"+implode(unsafeData.readyZone,"autoZone/readyZone"));} logBubble.add("Open zone "+handled.zoneNr); }else{ logBubble.add("Zone "+handled.zoneNr+" is opened"); autoZoneHandle(); } } } if(DEVMODE_FUNCTION){ GM_log("End autoZone handled.zoneNr:"+handled.zoneNr);} }catch(err){GM_logError("boterror ","","",err);autoZoneFinish();} //busy=false; } */ function autoZoneHandle(runId){ /* DE-1: ERROR autoZoneHandle case 2* handled.zoneNrF=18 readyZone:{} TypeError: can't convert undefined to object DE-1: ERROR autoZoneHandle case 2* handled.zoneNrF=14 readyZone:{"15":{"0":2,"1":"r","2":true},"18":{"0":2,"1":"r","2":true}} TypeError: can't convert undefined to object */ GM_logInfo("autoZoneHandle","runId="+runId,"","Begin",1); bot.setAction("autoZoneHandle"); window.setTimeout(function(){ switch(handled.zoneBuildingTyp){ case 1: //-- GM_log("autoZoneHandle run nextFkt case:1"); try{ if(!unsafeData.zones.getProduction(handled.zoneNrF)[3]){ GM_logInfo("autoZoneHandle","runId="+runId,"handled="+implode(handled,"autoZoneHandle/handled"),"Field-Data not ready"); window.setTimeout(autoZoneHandle,settings.getPause()); }else{ autoZoneCrop(); window.setTimeout(function(runId){ return function(){ if(unsafeData.readyZone[handled.zoneNrS]&&(unsafeData.readyZone[handled.zoneNrS][1]=="w")){ unsafeData.readyZone[handled.zoneNrS][2]=false; autoFarmWater(runId,1,false,true); // just water }else if(zoneList[handled.zoneNrL][0][0]==PRODSTOP){ autoZoneFinish(runId,$("gardencancel")); }else{ reSortQueue(handled.zoneNrF, false); autoFarmPlantInit(runId,zoneList[handled.zoneNrL][0][0]); // init planting } } }(runId),settings.getPause()); } }catch(err){GM_logError("autoZoneHandle (case 1)","","handled.zoneNrF="+handled.zoneNrF+" readyZone="+implode(unsafeData.readyZone,"autoZoneHandle/readyZone"),err);} break; case 2: //-- GM_log("autoZoneHandle run nextFkt case:2"); // try{ // autoZoneCrop(); // }catch(err){GM_logError("autoZoneHandle (case 2)","","handled.zoneNrF="+handled.zoneNrF+" readyZone="+implode(unsafeData.readyZone,"autoZoneHandle/readyZone"),err);} window.setTimeout(function(runId){ try{ bot.setAction("autoZoneHandle(2,cases)"); if(!unsafeData.readyZone[handled.zoneNrS]){ bot.setAction("autoZoneHandle(2,autoZoneFinish)"); autoZoneFinish(runId,$("building_inner").querySelector(".big_close")); }else{ bot.setAction("autoZoneHandle(2,autoFarmStable)"); unsafeData.readyZone[handled.zoneNrS][2]=false; autoFarmStable(runId,1,false,true,zoneList[handled.zoneNrL][0][0],0,zoneList[handled.zoneNrL][0][1]); } }catch(err){GM_logError("autoZoneHandle (case 2*)","","handled.zoneNrF="+handled.zoneNrF+" readyZone:"+implode(unsafeData.readyZone,"autoZoneHandle/readyZone"),err);} },settings.getPause(),runId); break; case 3: //-- GM_log("autoZoneHandle run nextFkt case:3"); try{ autoZoneCrop(); window.setTimeout(function(runId){ if(zoneList[handled.zoneNrL][0][0]==PRODSTOP){ autoZoneFinish(runId,$("cancelscreen").getElementsByClassName("link")[0]); }else{ if (unsafeData.readyZone[handled.zoneNrS] === undefined) { autoZoneFinish(runId,$("cancelscreen").getElementsByClassName("link")[0]); } else { unsafeData.readyZone[handled.zoneNrS][2]=false; autoFarmFactory(runId,1); } } },settings.getPause(),runId); }catch(err){GM_logError("autoZoneHandle (case 3)","","handled.zoneNrF="+handled.zoneNrF+" readyZone:"+implode(unsafeData.readyZone,"autoZoneHandle/readyZone"),err);} break; /* case "windmill": autoWindmill(); break; case "sawmill": reSortQueue(handled.zoneNrF, false); autoForestrySawmill(); break; case "carpentry": reSortQueue(handled.zoneNrF, false); autoForestryCarpentry(); break; case "forest": try{ if(!unsafeData.getProduction(handled.zoneNrF)[3]){ if(DEVMODE){ logBubble.add("Field-Data not ready"); } window.setTimeout(autoZoneHandle,settings.getPause()); }else{ autoZoneCrop(); window.setTimeout(function(){ if(unsafeData.readyZone[handled.zoneNrS]&&(unsafeData.readyZone[handled.zoneNrS][1]=="w")){ unsafeData.readyZone[handled.zoneNrS][2]=false; autoForestryWatering(); }else if(zoneList[handled.zoneNrL][0][0]==PRODSTOP){ autoZoneFinish(); }else{ reSortQueue(handled.zoneNrF, false); autoForestryPlantInit(zoneList[handled.zoneNrL][0][0]); // init planting } },settings.getPause()); } }catch(err){GM_logError("autoZoneHandle (forest)","","handled.zoneNrF="+handled.zoneNrF+" readyZone:"+implode(unsafeData.readyZone,"autoZoneHandle/readyZone"),err);} break; */ } },settings.getPause()); } function autoZoneCrop(){ try{ var zoneTyp; switch(unsafeData.gameLocation.get()[0]){ case "farm": if($("gardenmaincontainer").style.display=="block"){ zoneTyp=1; } else if($("innermaincontainer").style.display=="block"){ zoneTyp=unsafeData.BUILDINGTYPE[unsafeWindow.locationinfo[6]]; } break; case "forestry": zoneTyp="forest"; break; } GM_logInfo("autoZoneCrop","","zoneTyp="+zoneTyp,"Begin",1); switch (zoneTyp){ case 1: var cropable=false; var NowServer=unsafeWindow.Zeit.Server; var emptycounter=0; for(var v=1;v<=120;v++){ // GM_log(v); if(("v"==unsafeWindow.garten_kategorie[v]||"hr"==unsafeWindow.garten_kategorie[v]) && (unsafeWindow.garten_zeit[v]!="0") && (parseInt(unsafeWindow.garten_zeit[v],10)0)&&(unsafeWindow.garten_x[v]==1)&&(unsafeWindow.garten_y[v]==1)){ // first part plants if(z5)){ // non-plant-rack opened GM_logInfo("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Switching rack to plants"); document.addEventListener("gameUpdateRack",function(runId,rackitemNr){ return function(){ document.removeEventListener("gameUpdateRack",arguments.callee,false); window.setTimeout(autoFarmPlantInit,settings.getPause(),runId,rackitemNr); }; }(runId,rackitemNr),false); click($("rackcat1")); }else if(!(unsafeData.prodStock[0][rackitemNr]&&unsafeData.prodStock[0][rackitemNr]>0)){ // product is missing // this is correct set, even if rack is updating GM_logWarning("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Plant is not in rack"); autoFarmPlantDefault(runId); }else if(unsafeWindow.selected==rackitemNr){ // calculate time of next cropping // here its not important if rack is updating var time=NEVER; var NowServer=unsafeWindow.Zeit.Server; for(var v=1;v<=120;v++){ if("v"==unsafeWindow.garten_kategorie[v]||"hr"==unsafeWindow.garten_kategorie[v]){ // only plants var z=parseInt(unsafeWindow.garten_zeit[v],10); if(z>0){ time=Math.min(time,z-NowServer); } } } time=Math.max(time,0); if(time<=settings.get("account","seedWaitForCrop")){ zoneWaiting[handled.zoneNrF]=now+time; window.setTimeout(function(){ //TIMEOUT for(var fz in zoneWaiting){ if(!zoneWaiting.hasOwnProperty(fz)){continue;} if(zoneWaiting[fz]<=now){ delete zoneWaiting[fz]; } } checkReadyZone(); },(1000*time)+settings.getPause()); GM_logInfo("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Waiting for crop in "+getTimeStr(time)); autoZoneFinish(runId); return false; } // Correct plant selected if(calcEmptyProductPositions(rackitemNr,handled.zoneNrF)>0){ if((unsafeWindow.premium==1) && (unsafeWindow.currentuserlevel>=unsafeWindow.autoplantlevel)){ autoFarmPlantPremium(runId,1); }else{ autoFarmPlant(runId,1,false,true); } }else{ autoFarmPlantDefault(runId); } }else{ GM_logInfo("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Wrong plant selected"); var nextRack=(unsafeWindow.racksort%unsafeWindow.userracks)+1; while(unsafeWindow.racklocks&&unsafeWindow.racklocks[nextRack]){ nextRack=(nextRack%unsafeWindow.userracks)+1; } if($("rackitem"+rackitemNr)){ if(unsafeWindow.updateRackBusy){ // Rack not loaded GM_logWarning("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"Rack not loaded"); document.addEventListener("gameUpdateRack",function(runId,rackitemNr){ return function(){ document.removeEventListener("gameUpdateRack",arguments.callee,false); window.setTimeout(autoFarmPlantInit,settings.getPause(),runId,rackitemNr); }; }(runId,rackitemNr),false); }else{ if($("rackitem"+rackitemNr).style.display!="none"){ GM_logInfo("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Seed found"); click($("rackitem"+rackitemNr)); // rackitem found window.setTimeout(autoFarmPlantInit,settings.get("country","pause")[0],runId,rackitemNr); }else if(unsafeWindow.racksort!=nextRack){ // call next rack document.addEventListener("gameUpdateRack",function(runId,rackitemNr){ return function(){ document.removeEventListener("gameUpdateRack",arguments.callee,false); window.setTimeout(autoFarmPlantInit,settings.getPause(),runId,rackitemNr); }; }(runId,rackitemNr),false); GM_logInfo("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Switching to next rack ("+nextRack+")"); click($("rackswitch"+nextRack)); }else{ // should not happen GM_logWarning("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"Invisible non-empty rackitem and only 1 rack"); autoFarmPlantDefault(runId); } } }else if(unsafeWindow.racksort!=nextRack){ // rackamount>0 but no rackitem // = 2nd, 3rd or 4th rack was not loaded yet document.addEventListener("gameUpdateRack",function(runId,rackitemNr){ return function(){ document.removeEventListener("gameUpdateRack",arguments.callee,false); window.setTimeout(autoFarmPlantInit,settings.getPause(),runId,rackitemNr); }; }(runId,rackitemNr),false); GM_logInfo("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"","Switching to next rack ("+nextRack+")(rackitem not found)"); click($("rackswitch"+nextRack)); // unsafeWindow.updateRack((1+parseInt(unsafeWindow._currRack,10))%unsafeWindow.userracks); // call next rack }else{// rackamount>0 but no rackitem and 1 rack // should not happen because thats "product is missing" (1.case) GM_logWarning("autoFarmPlantInit","runId="+runId+" rackitemNr="+rackitemNr,"No rackitem but rackamount and only 1 rack"); autoFarmPlantDefault(runId); } nextRack=null; } } }catch(err){GM_logError("autoFarmPlantInit","runId="+runId,"",err);} } function autoFarmPlantDefault(runId){ try{ GM_logInfo("autoFarmPlantDefault","runId="+runId,"","Begin",1); if(bot.checkRun("autoFarmPlantDefault",runId)){ bot.setAction("autoFarmPlantDefault"); GM_logInfo("autoFarmPlantDefault","runId="+runId,"","Searching other plant"); if(unsafeWindow.updateRackBusy){ // Rack not loaded GM_logWarning("autoFarmPlantDefault","runId="+runId,"","Rack not loaded"); document.addEventListener("gameUpdateRack",function(runId){ return function(){ document.removeEventListener("gameUpdateRack",arguments.callee,false); window.setTimeout(autoFarmPlantDefault,settings.getPause(),runId); }; }(runId),false); }else{ var rackitemNr=null; // try emergency plants for(var v=0;v0&&(calcEmptyProductPositions(emergencyPlants[v],handled.zoneNrF)>0)){ rackitemNr=emergencyPlants[v]; GM_logInfo("autoFarmPlantDefault","runId="+runId,"","Taking emergency plant "+rackitemNr); autoFarmPlantInit(runId,rackitemNr); return; } } if(rackitemNr==null){ // first plant in loaded rack var cand=$("rackItems").getElementsByClassName("sack"); for(var v=0;v0)){ rackitemNr=prod; break; } } cand=null; if(rackitemNr!=null){ GM_logInfo("autoFarmPlantDefault","runId="+runId,"","Taking "+unsafeData.prodName[0][rackitemNr]); autoFarmPlantInit(runId,rackitemNr); return; }else if(unsafeWindow.userracks>1){ // does a plant exist in other rack? var plants=false; for(var v=0;v0)&&unsafeData.prodStock[0][v]&&unsafeData.prodStock[0][v]>0){ plants=true; break; } } if(plants){ document.addEventListener("gameUpdateRack",function(runId){ return function(){ document.removeEventListener("gameUpdateRack",arguments.callee,false); window.setTimeout(autoFarmPlantDefault,settings.getPause(),runId); }; }(runId),false); GM_logInfo("autoFarmPlantDefault","runId="+runId,"","Switching to next rack"); unsafeWindow.updateRack((1+parseInt(unsafeWindow._currRack,10))%unsafeWindow.userracks); // call next rack }else{ GM_logWarning("autoFarmPlantDefault","runId="+runId,"","No plant in racks.
Would add stop."); autoZoneFinish(runId,$("gardencancel")); } }else{ GM_logWarning("autoFarmPlantDefault","runId="+runId,"","No plant in rack.
Would add stop."); autoZoneFinish(runId,$("gardencancel")); } } } } }catch(err){GM_logError("autoFoodworldBuilding","runId="+runId,"",err);} } function autoFarmPlant(runId,v,didPlant,isBot){ try{ GM_logInfo("autoFarmPlant","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"","Begin",1); if(bot.checkRun("autoFarmPlant",runId,!isBot)){ bot.setAction("autoFarmPlant"); if(v==1){ GM_logInfo("autoFarmPlant","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"",getText("automat_planting")); } if(unsafeWindow.mode!="0"){ click($("anpflanzen")); } if(v<121){ if((unsafeData.prodTyp[0][unsafeWindow.selected]=="v")&&unsafeData.prodStock[0][unsafeWindow.selected]&&unsafeData.prodStock[0][unsafeWindow.selected]>0){ bot.setAction("autoFarmPlant "+getText("automat_planting")); if(v%12==1){ linecount=0; } var frei=true; if(unsafeWindow.garten_kategorie[v] && ((unsafeWindow.garten_kategorie[v]!="v") || (unsafeWindow.garten_zeit[v]!="0"))){ frei=false; } else{ if(unsafeWindow.global_x=="2"){ if(v%12==0){ frei=false; } else{ w=v+1; if(unsafeWindow.garten_kategorie[w] && ((unsafeWindow.garten_kategorie[w]!="v") || (unsafeWindow.garten_zeit[w]!="0"))){ frei=false; } else{ if(unsafeWindow.global_y=="2"){ if(v>108){ frei=false; } else{ w=v+12; if(unsafeWindow.garten_kategorie[w] && ((unsafeWindow.garten_kategorie[w]!="v") || (unsafeWindow.garten_zeit[w]!="0"))){ frei=false; } else{ w=v+13; if(unsafeWindow.garten_kategorie[w] && ((unsafeWindow.garten_kategorie[w]!="v") || (unsafeWindow.garten_zeit[w]!="0"))){ frei=false; } } } } } } } } if(frei){ unsafeData.zones.flagProduction(handled.zoneNrF); click($("f"+v)); v+=parseInt(unsafeWindow.global_x,10); linecount +=parseInt(unsafeWindow.global_x,10); if(linecount>11){ v +=12*(parseInt(unsafeWindow.global_y,10)-1); } window.setTimeout(autoFarmPlant,settings.getPause(true),runId,v,true,isBot); }else{ autoFarmPlant(runId,v+1,didPlant,isBot); } }else{ GM_logInfo("autoFarmPlant","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"","Invalid plant"); if(didPlant&&isBot){ setNextQueueItem(handled.zoneNrS); } autoFarmWater(runId,1,didPlant,isBot); } }else{ GM_logInfo("autoFarmPlant","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"","All fields done"); if(autoZoneCrop()){ window.setTimeout(autoFarmPlant,settings.getPause(),runId,1,didPlant,isBot); }else{ if(didPlant&&isBot){ setNextQueueItem(handled.zoneNrS); } window.setTimeout(autoFarmWater,settings.getPause(),runId,1,didPlant,isBot); } } GM_logInfo("autoFarmPlant","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"","End",1); } }catch(err){GM_logError("autoFarmPlant","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"",err);} } function autoFarmPlantPremium(runId, step){ try{ if(bot.checkRun("autoFarmPlantPremium",runId)){ bot.setAction("autoFarmPlantPremium ("+step+")"); var help,help2,action=null,listeningEvent=null; switch(step){ case 1:{ // call automatic planting GM_logInfo("autoFarmPlantPremium","runId="+runId+" step="+step,"","(Premium) "+getText("automat_planting")); var leereFelder=0; for(var v=1;v<=120;v++){ if("v"==unsafeWindow.garten_kategorie[v]||"hr"==unsafeWindow.garten_kategorie[v]){ if(!unsafeWindow.garten_prod[v]){ leereFelder++; } }else{ if((unsafeWindow.garten_kategorie[v]!="z") && (unsafeWindow.garten_kategorie[v]!="u")){ leereFelder++; } } } if(leereFelder>0){ action=function(){ click($("autoplantbuttoninner")); }; // open automat listeningEvent="gameOpenGlobalBox"; }else{ autoFarmWater(runId,1,false,true); } break;} case 2:{ // commit automatic planting unsafeData.zones.flagProduction(handled.zoneNrF); setNextQueueItem(handled.zoneNrS); action=function(){ click($("globalbox_button1")); } listeningEvent="gameFieldPlanted"; break;} case 3:{ autoFarmWater(runId,1,true,true); break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoFarmPlantPremium,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } help=null;listeningEvent=null;action=null; } }catch(err){GM_logError("autoFarmPlantPremium","runId="+runId+" step="+step,"",err);} } function autoFarmWater(runId,v,didPlant,isBot){ try{ if(bot.checkRun("autoFarmWater",runId,!isBot)){ if(isBot&&!settings.get("account","autoWater")){ // bot shall not water (option) autoZoneFinish(runId,$("gardencancel")); }else{ GM_logInfo("autoFarmWater","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"","Begin",1); bot.setAction("autoFarmWater "+v+": init"); if(v==1){ GM_logInfo("autoFarmWater","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"",getText("automat_watering")); } //20151014 Linus--Tux waterall_inactive //if($("tooltipwaterall")) if(document.getElementsByClassName('waterall_inactive').length==0) { bot.setAction("autoFarmWater "+v+": premium"); GM_logInfo("autoFarmWater","runId="+runId+" v="+v+" didPlant="+didPlant+" isBot="+isBot,"","Water all"); unsafeData.zones.flagProduction(handled.zoneNrF); document.addEventListener("gameFieldWatered",function(runId,v,didPlant,isBot){ return function(){ document.removeEventListener("gameFieldWatered",arguments.callee,false); window.setTimeout(autoZoneFinish,settings.getPause(),runId,isBot?$("gardencancel"):null); }; }(runId,v,didPlant,isBot),false); //20151014 Linus--Tux //click($("waterall").getElementsByTagName("img")[0]); click($("waterall")); }else if(unsafeWindow.mode!="2"){ click($("giessen")); window.setTimeout(autoFarmWater,settings.getPause(),runId,v,didPlant,isBot); }else{ bot.setAction("autoFarmWater "+v+": non-premium"); if(v<121){ if((unsafeWindow.garten_kategorie[v]=="v") && (unsafeWindow.garten_zeit[v]!="0") && (isNaN(parseInt(unsafeWindow.garten_wasser[v],10))||(parseInt(unsafeWindow.garten_wasser[v],10)+864000){ window.setTimeout(autoFarmStable, 3*settings.getPause(true),runId,step+1,didFeed,isBot,sorte,feedcounter,maxFeed) }else{ // feed not found if(1+parseInt(unsafeWindow._currRack,10)Stopping zone."); zoneList[handled.zoneNrL][0][0]=PRODSTOP; // sleep zone updateQueueBox(handled.zoneNrF); } autoFarmStable(runId,9,didFeed,isBot,sorte,feedcounter,maxFeed); // exit } } } break;} case 5:{ // Feeding (Premium): start if((unsafeWindow.premium==1) || (parseInt($("levelnum").innerHTML,10)<10)){ // check if premium feeding click($("feed_item"+sorte).firstElementChild); // start feed window.setTimeout(autoFarmStable,3*settings.getPause(true),runId,step+1,didFeed,isBot,sorte,feedcounter,maxFeed); } else { autoFarmStable(runId,8,didFeed,isBot,sorte,feedcounter,maxFeed); // go to non-premium feeding } break;} case 6:{ // Feeding (Premium): amount if(help=$("building_dialogbox_input")){ maxFeed=Math.min(unsafeData.prodStock[0][sorte],maxFeed); GM_logInfo("autoFarmStable","runId="+runId+" step="+step+" didFeed="+didFeed+" isBot="+isBot+" sorte="+sorte+" feedcounter="+feedcounter+" maxFeed="+maxFeed,"",getText("automat_feeding")+"
"+maxFeed+" "+unsafeData.prodName[0][sorte]); help.value=maxFeed; // enter amount keyup(help); help=null; window.setTimeout(autoFarmStable,3*settings.getPause(true),runId,step+1,didFeed,isBot,sorte,feedcounter,maxFeed); }else{ window.setTimeout(autoFarmStable,1000,runId,step,didFeed,isBot,sorte,feedcounter,maxFeed); } break;} case 7:{ // Feeding (Premium): submit feedcounter+=maxFeed; unsafeData.prodStock[0][sorte]-=maxFeed; didFeed=true; click($("building_dialogbox_submit")); if(isBot&&(sorte==zoneList[handled.zoneNrL][0][0])&&(zoneList[handled.zoneNrL][1])&&(zoneList[handled.zoneNrL][1][1]>0)){ window.setTimeout(autoFarmStable,3*settings.getPause(true),runId,4,didFeed,isBot,zoneList[handled.zoneNrL][1][0],0,zoneList[handled.zoneNrL][1][1]); // do other food }else{ window.setTimeout(autoFarmStable,3*settings.getPause(true),runId,9,didFeed,isBot,sorte,feedcounter,maxFeed); // exit } break;} case 8:{ // Feeding (Non-Premium) feedcounter++; unsafeData.prodStock[0][sorte]--; didFeed=true; GM_logInfo("autoFarmStable","runId="+runId+" step="+step+" didFeed="+didFeed+" isBot="+isBot+" sorte="+sorte+" feedcounter="+feedcounter+" maxFeed="+maxFeed,"",getText("automat_feeding")+"
"+feedcounter+" "+unsafeData.prodName[0][sorte]); click($("feed_item"+sorte).firstElementChild); // give feed if(feedcounter>=maxFeed){ if((sorte==zoneList[handled.zoneNrL][0][0]) && (zoneList[handled.zoneNrL][1][1]>0)){ window.setTimeout(autoFarmStable,3*settings.getPause(true),runId,4,didFeed,isBot,zoneList[handled.zoneNrL][1][0],0,zoneList[handled.zoneNrL][1][1]); // do other food }else{ window.setTimeout(autoFarmStable,3*settings.getPause(true),runId,9,didFeed,isBot,sorte,feedcounter,maxFeed); // exit } }else{ window.setTimeout(autoFarmStable,settings.getPause(true),runId,step,true,isBot,sorte,feedcounter,maxFeed); // next feeding } break;} case 9:{ // click errorbox if opened if($("errorboxinner").style.display=="block"){ click($("errorboxfooterinner").getElementsByClassName("link")[0]); window.setTimeout(autoFarmStable,settings.getPause(),runId,step+1,didFeed,isBot,sorte,feedcounter,maxFeed); } else { autoFarmStable(runId,step+1,didFeed,isBot,sorte,feedcounter,maxFeed); } break;} case 10:{ // exit autoZoneFinish(runId,isBot?$("building_inner").querySelector(".big_close"):null); break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step,didFeed,isBot,sorte,feedcounter,maxFeed){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoFarmStable,settings.getPause(),runId,step+1,didFeed,isBot,sorte,feedcounter,maxFeed); }; }(listeningEvent,runId,step,didFeed,isBot,sorte,feedcounter,maxFeed),false); } if(action){ action(); } help=null;listeningEvent=null;action=null; } }catch(err){GM_logError("autoFarmStable","runId="+runId+" step="+step+" didFeed="+didFeed+" isBot="+isBot+" sorte="+sorte+" feedcounter="+feedcounter+" maxFeed="+maxFeed,"",err);} } function autoFarmFactory(runId,step){ try{ if(!step){ step=1; } if(bot.checkRun("autoFarmFactory",runId)){ bot.setAction("autoFarmFactory ("+step+")"); var action=null,listeningEvent=null; switch(step){ case 1:{ if($("innermaincontainer").style.display=="block"){ GM_logInfo("autoFarmFactory","runId="+runId+" step="+step,"",getText("automat_automatFactory")); if($("infoblock"+unsafeWindow.locationinfo[6])){ // zone is running autoFarmFactory(runId,4); // exit } else { // click on "Produktion starten" click($("advancedproductionbutton"+unsafeWindow.locationinfo[6]+"_"+unsafeData.BUILDING_INPUT[getZoneType(handled.zoneNrL)][zoneList[handled.zoneNrL][0][0]][0][0][0]).firstElementChild); window.setTimeout(autoFarmFactory,settings.getPause(),runId,step+1); } }else{ window.setTimeout(autoFarmFactory,settings.getPause(),runId,step); } break;} case 2:{ if($("globalbox").style.display=="block"){ click($("globalbox_button1")); setNextQueueItem(handled.zoneNrS); window.setTimeout(autoFarmFactory,settings.getPause(),runId,step+1); }else{ window.setTimeout(autoFarmFactory,settings.getPause(),runId,step); } break;} case 3:{ if($("infoblock"+unsafeWindow.locationinfo[6]) && $("infoblock"+unsafeWindow.locationinfo[6]).style.display=="block"){ autoFarmFactory(runId,4); }else{ window.setTimeout(autoFarmFactory,settings.getPause(),runId,step); } break;} case 4:{ // exit autoZoneFinish(runId,$("cancelscreen").getElementsByClassName("link")[0]); break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoFarmFactory,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } listeningEvent=null;action=null; } }catch(err){ GM_logError("autoFarmFactory","runId="+runId+" step="+step,"",err); } } function autoFarmFactoryOil(runId,step){ try{ if(!step){ step=1; } if(bot.checkRun("autoFarmFactoryOil",runId)){ bot.setAction("autoFarmFactoryOil ("+step+")"); var action=null,listeningEvent=null; switch(step){ case 1:{ // init // TODO check required products earlier (recalcQueue) if(unsafeData.zones.getBlock(handled.zoneNrS)){ zoneList[handled.zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); updateQueueBox(handled.zoneNrS); window.setTimeout(autoFarmFactoryOil,settings.getPause(),runId,6); }else{ if(zoneList[handled.zoneNrL][0][0]!=PRODSTOP){ var req=unsafeData.BUILDING_INPUT[getZoneType(handled.zoneNrS)][zoneList[handled.zoneNrL][0][0]][0]; for(var i=0;i0)){ // vehicle selected GM_logInfo("autoMegafield","runId="+runId+" step="+step,"zoneNrF="+handled.zoneNrF+" zoneNrL="+handled.zoneNrL,getText("automat_automatMegafield")+": "+getText("automat_vehicleXSelected").replace("%1%",unsafeWindow.megafield_vehicle_id)); autoMegafield(runId,step+2); }else if(unsafeWindow.megafield_data.vehicles_unlock[unsafeWindow.megafield_vehicle_id]){ // buy vehicle GM_logInfo("autoMegafield","runId="+runId+" step="+step,"zoneNrF="+handled.zoneNrF+" zoneNrL="+handled.zoneNrL,getText("automat_automatMegafield")+": "+getText("automat_vehicleXBuying").replace("%1%",unsafeWindow.megafield_vehicle_id)); listeningEvent="gameMegafieldDialogStarted"; action=function(){ click($("megafield_vehicle"+unsafeWindow.megafield_vehicle_id).querySelector(".lock_open")); }; }else{ GM_logWarning("autoMegafield","runId="+runId+" step="+step,"zoneNrF="+handled.zoneNrF+" zoneNrL="+handled.zoneNrL,getText("automat_automatMegafield")+": "+getText("automat_vehicleXNotAvailable").replace("%1%",unsafeWindow.megafield_vehicle_id)+" "+getText("automat_stopAdding")); zoneList[handled.zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); updateQueueBox(handled.zoneNrS); autoMegafield(runId,9); // exit } }else{ // TODO select vehicle ? GM_logWarning("autoMegafield","runId="+runId+" step="+step,"zoneNrF="+handled.zoneNrF+" zoneNrL="+handled.zoneNrL,getText("automat_automatMegafield")+": "+getText("automat_vehicleNotKnown")+" "+getText("automat_stopAdding")); zoneList[handled.zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); updateQueueBox(handled.zoneNrS); autoMegafield(runId,9); // exit } break;} case 4:{ // crop vehicle dialogue step=step-2; listeningEvent="gameMegafieldVehicleBought"; action=function(){ click($("globalbox_button1")); }; break;} case 5:{ // crop mode if(unsafeWindow.megafield_plant_pid>0){ click($("megafield_vehicle_select_slot")); window.setTimeout(autoMegafield,settings.getPause(),runId,step+1); }else{ autoMegafield(runId,step+1); } break;} case 6:{ // crop var area=unsafeWindow.megafield_data.area; var areaSize=unsafeData.BUILDING_SIZE["megafield"][0]*unsafeData.BUILDING_SIZE["megafield"][1]; // Generate route var i=0; while(i<=areaSize){ for(i=1;i<=areaSize;i++){ if(area[i]&&(area[i].remain<0)&&($("megafield_tile_tour"+i).className=="megafield_area_tour_possible")){ click($("megafield_tile"+i)); break; } } } // Commit if($("megafield_vehicle_go"+unsafeWindow.megafield_vehicle_id).style.display=="block"){ GM_logInfo("autoMegafield","runId="+runId+" step="+step,"zoneNrF="+handled.zoneNrF+" zoneNrL="+handled.zoneNrL,getText("automat_automatMegafield")+": "+getText("automat_tourStarting")); listeningEvent="gameMegafieldTourStarted"; action=function(){ click($("megafield_vehicle_go"+unsafeWindow.megafield_vehicle_id)); }; }else{ GM_logWarning("autoMegafield","runId="+runId+" step="+step,"zoneNrF="+handled.zoneNrF+" zoneNrL="+handled.zoneNrL,getText("automat_automatMegafield")+": "+getText("automat_nothingToCrop")); autoMegafield(runId,step+1); } break;} case 7:{ // Plant if((zoneList[handled.zoneNrL][0][0]==PRODSTOP)||(!unsafeData.readyZone[handled.zoneNrS])){ autoMegafield(runId,9); // exit }else if(unsafeWindow.megafield_plant_pid){ var actionField=null; var area=unsafeWindow.megafield_data.area; var areaFree=unsafeWindow.megafield_data.area_free; var tour=unsafeWindow.megafield_data.tour; var tourSteps={}; if(tour&&tour.steps){ for(var i=0;i pop from queue if(isNaN(zoneList[handled.zoneNrL][0][1])){ zoneList[handled.zoneNrL][0][1]=1; } if(autoMillStorage[zoneList[handled.zoneNrL][0][0]]&&autoMillStorage[zoneList[handled.zoneNrL][0][0]][2]>0){ zoneList[handled.zoneNrL][0][1]--; autoMillStorage[zoneList[handled.zoneNrL][0][0]][0]--; } if(zoneList[handled.zoneNrL][0][1]<=0 && zoneList[handled.zoneNrL].length<=1){ zoneList[handled.zoneNrL]=DEFAULT_ZONELIST_MILL_ARRAY.clone(); } // } else { // // windmill not started -> stop queue // zoneList[zoneNrL].unshift(DEFAULT_ZONELIST_MILL.clone()); //insert stop item at begin // } GM_setValueCache(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList",implode(zoneList,"autoWindmill/zoneList"),"autoWindmill/zoneList"); reCalculateWindmill(); reSortWindmill(zoneSettings[handled.zoneNrL]["shuffle"]); reFillQueueBox(handled.zoneNrF, handled.zoneNrL, 0); autoWindmill(runId,step+1); } break; case 8: // close windmill if($("windmillinner").style.display=="block"){ click($("windmillinner").querySelector(".big_close")); window.setTimeout(autoWindmill,settings.getPause(),runId,step+1); } else { autoWindmill(runId,step+1); } case 9: // bot.end(); botArbiter.check(); // -> calls activatePowerUp if needed break; } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoWindmill,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } listeningEvent=null;action=null; } }catch(err){ GM_logError("autoWindmill","runId="+runId+" step="+step,"",err); } } function checkPowerUp(mode){ try{ var foundPowerUp=false; if(settings.get("account","powerUpActivate")){ for(var v in unsafeWindow.poweruprack){ // find powerup if(!unsafeWindow.poweruprack.hasOwnProperty(v)){ continue; } if(unsafeWindow.poweruprack[v][5] && unsafeWindow.poweruprack[v][5][0] && unsafeWindow.poweruprack[v][5][0][1]){ foundPowerUp=v; break; } } } return mode==0?(!!foundPowerUp):foundPowerUp; }catch(err){ GM_logError("checkPowerUp","mode="+mode,"",err); return null; } } function autoActivatePowerUp(runId,step,foundPowerUp){ try{ if(bot.checkRun("autoActivatePowerUp",runId)){ if(!settings.get("account","powerUpActivate")){ step=5; }else if(!step){ step=1; } bot.setAction("autoActivatePowerUp ("+step+")"); var help,action=null,listeningEvent=null; switch(step){ case 1:{ foundPowerUp=checkPowerUp(); if(foundPowerUp==null){ // no power-up GM_logWarning("autoActivatePowerUp","runId="+runId+" step="+step,"","Power-up: Exiting, no powerup found"); if($("powerupselector").style.display=="block"){ click($("powerupbar")); } autoActivatePowerUp(runId,5,foundPowerUp) // exit }else if(unsafeWindow.farm!=1){ //switch to farm listeningEvent="gameFarmOpened"; action=function(){ GM_logInfo("autoActivatePowerUp","runId="+runId+" step="+step,"","Power-up: Goto Farm"); click($("speedlink_farm1")); }; }else if(unsafeWindow.poweruprack[foundPowerUp]){ autoActivatePowerUp(runId,step+1,foundPowerUp); }else{ GM_logWarning("autoActivatePowerUp","runId="+runId+" step="+step,"","Power-up: Exiting, unknown combination"); if($("powerupselector").style.display=="block"){ click($("powerupbar")); } autoActivatePowerUp(runId,5,foundPowerUp) // exit } break;} case 2:{ // open power-up container if($("powerupselector").style.display=="block"){ autoActivatePowerUp(runId,step+1,foundPowerUp); }else{ listeningEvent="gamePoweruprackUpdated"; action=function(){ GM_logInfo("autoActivatePowerUp","runId="+runId+" step="+step,"","Power-up: Open container"); click($("powerupbar")); }; } break;} case 3:{ // click power-up / scroll to power-up var help; if(help=$("powerup_rackitem"+unsafeWindow.poweruprack[foundPowerUp][0]+"_tt")){ listeningEvent="gameOpenGlobalBox"; action=function(){ GM_logInfo("autoActivatePowerUp","runId="+runId+" step="+step,"","Power-up: Click power-up"); click(help.parentNode); }; }else if(help=$("powerselectorcontent")){ help=parseInt(/activatePowerupCommit\((\d+)/.exec(help.firstElementChild.getAttribute("onclick"))[1],10); listeningEvent="gamePoweruprackUpdated"; if(help exit } break;} case 2:{ // set zoneWaiting var time=NEVER; var NowServer=unsafeWindow.Zeit.Server; for(var v=0;v0){ time=Math.min(time,unsafeWindow.forestry_area_time[v]); } } time=Math.max(time,0); if(time<=settings.get("account","seedWaitForCrop")){ zoneWaiting[handled.zoneNrF]=now+time; window.setTimeout(function(){ for(var fz in zoneWaiting){ if(!zoneWaiting.hasOwnProperty(fz)){continue;} if(zoneWaiting[fz]<=now){ delete zoneWaiting[fz]; } } checkReadyZone(); },(1000*time)+settings.getPause()); GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","Waiting for crop in "+getTimeStr(time)); // TODO text autoForestryForest(runId,9,field,didPlant,isBot); // -> exit }else{ autoForestryForest(runId,step+1,field,didPlant,isBot); } break;} case 3:{ // cropping if((!isBot)||(zoneList[handled.zoneNrL][0][0]!=PRODSTOP)||(!settings.get("account","disableCropFields"))){ GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","Forest automat
Cropping"); //TODO text if(!unsafeData.zones.getProduction(handled.zoneNrS)[3]){ // data not ready window.setTimeout(autoForestryForest,settings.getPause(),runId,step,field,didPlant,isBot); }else if(unsafeWindow.premium==1){ if(unsafeData.zones.getEndtime(handled.zoneNrS) exit } }else{ autoForestryForest(runId,step+1,1,didPlant,isBot); } break;} case 4:{ // select tree if(zoneList[handled.zoneNrL][0][0]==PRODSTOP){ autoForestryForest(runId,8,1,didPlant,isBot); // -> water }else if((unsafeWindow.premium!=1)&&(zoneList[handled.zoneNrL][0][0]!=unsafeWindow.forestry_plant)){ GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","Forest automat
Select tree"); //TODO text if(help=$("f_stock_item"+zoneList[handled.zoneNrL][0][0])){ click(help); window.setTimeout(autoForestryForest,settings.getPause(true),runId,step,field,didPlant,isBot); }else{ // tree not available GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","Tree not available"); //TODO text zoneList[handled.zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); //add PRODSTOP to begin of list updateQueueBox(handled.zoneNrS); autoForestryForest(runId,8,1,didPlant,isBot); // -> water } }else{ autoForestryForest(runId,step+1,1,didPlant,isBot); } break;} case 5:{ // planting if(field==1){ GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","Forest automat
"+getText("automat_planting")); //TODO text } help=false; for(var i in unsafeWindow.forestry_area){ //if not in forestry_area the field is empty if(!unsafeWindow.forestry_area.hasOwnProperty(i)){continue;} if(parseInt(unsafeWindow.forestry_area[i]["position"],10)==field){ help=true; break; } } if(help){ autoForestryForest(runId,step,field+1,didPlant,isBot); }else if(field>25){ autoForestryForest(runId,7,1,didPlant,isBot); // finish planting }else if(unsafeWindow.premium==1){ click($("forestry_forest_button6")); window.setTimeout(autoForestryForest,settings.getPause(true),runId,step+1,field,didPlant,isBot); }else{ unsafeData.zones.flagProduction(handled.zoneNrS); GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","click field:"+field); //TODO text click($("forestry_pos"+field)); window.setTimeout(autoForestryForest,settings.getPause(true),runId,step,field+1,true,isBot); } break;} case 6:{ // premium planting: select tree and commit var help=$("forestry_autoplant_pid"); if(help.value==zoneList[handled.zoneNrL][0][0]){ unsafeData.zones.flagProduction(handled.zoneNrS); click($("globalbox_button1")); window.setTimeout(autoForestryForest,settings.getPause(true),runId,step+1,field,true,isBot); }else{ help.value=zoneList[handled.zoneNrL][0][0]; window.setTimeout(autoForestryForest,settings.getPause(),runId,step,field,didPlant,isBot); } break;} case 7:{ // finish planting if(unsafeData.zones.getProduction(handled.zoneNrS)[3]){ // if(autoZoneCrop()){ ... go back } if(isBot&&didPlant){ setNextQueueItem(handled.zoneNrS); } autoForestryForest(runId,step+1,1,didPlant,isBot); }else{ window.setTimeout(autoForestryForest,settings.getPause(),runId,step,field,didPlant,isBot); } break;} case 8:{ // watering if(unsafeData.zones.getBonus(handled.zoneNrF)>0){ GM_logInfo("autoForestryForest","runId="+runId+" step="+step+" field="+field+" didPlant="+didPlant+" isBot="+isBot,"","Forest automat
"+getText("automat_watering")); //TODO text if(!unsafeData.zones.getProduction(handled.zoneNrS)[3]){ window.setTimeout(autoForestryForest,settings.getPause(),runId,step,field,didPlant,isBot); }else if(unsafeData.zones.getWatertime(handled.zoneNrS) exit } break;} case 2:{ // check required products and open building help=true; if(zoneList[handled.zoneNrL][0][0]!=PRODSTOP){ help=unsafeData.prodRequire[1][zoneList[handled.zoneNrL][0][0]]; if(typeof help=="object"){ for(var i=0;iOpening"); //TODO text action=function(){ click($("forestry_building_click"+(handled.zoneNrF=="sawmill"?"1":"2"))); }; listeningEvent="game"+handled.zoneNrF.capitalize()+"Opened"; } }else{ autoForestryBuilding(runId,8); // -> exit } break;} case 3:{ // cropping if((help=unsafeData.readyZone[handled.zoneNrS])&&help[2]&&(help[1]=="r")&&(zoneList[handled.zoneNrL][0][0]!=PRODSTOP||!settings.get("account","disableCropFields"))){ GM_logInfo("autoForestryBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Cropping"); //TODO text if(help=$("forestry_building_inner_slot_info"+handled.slot)){ action=function(){ click(help); }; listeningEvent="game"+handled.zoneNrF.capitalize()+"Cropped"; }else{ autoForestryBuilding(runId,step+2); } }else{ autoForestryBuilding(runId,step+2); } break;} case 4:{ // confirm autoForestryBuilding(runId,step+1); break;} case 5:{ // open slot if(zoneList[handled.zoneNrL][0][0]!=PRODSTOP){ GM_logInfo("autoForestryBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Opening slot"); //TODO text action=function(){ click($("forestry_building_inner_slot_info"+handled.slot)); }; listeningEvent="game"+handled.zoneNrF.capitalize()+"SlotOpened"; }else{ autoForestryBuilding(runId,8); //->exit } break;} case 6:{ // start production if((help=$("forestry_selectproduction_scrollcontent"))&&(help=help.querySelector(".f_symbol"+zoneList[handled.zoneNrL][0][0]))&&(help=help.parentNode.parentNode)&&(help.getAttribute("onclick")!="")){ GM_logInfo("autoForestryBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Start production"); //TODO text action=function(){ click(help); }; listeningEvent="gameOpenGlobalBox"; }else{ zoneList[handled.zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); updateQueueBox(handled.zoneNrS); autoForestryBuilding(runId,8); //->exit } break;} case 7:{ // confirm GM_logInfo("autoForestryBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Confirm start production"); //TODO text action=function(){ click($("globalbox_button1")); setNextQueueItem(handled.zoneNrS); }; listeningEvent="game"+handled.zoneNrF.capitalize()+"Started"; break;} case 8:{ // other slots var zoneNrS,zoneNrL,help,next=false; for(var slot=1;slot<=3;slot++){ zoneNrS=handled.zoneNrF+"."+slot; if((help=unsafeData.readyZone[zoneNrS])&&help[2]){ zoneNrL=getZoneListId(zoneNrS); if(((help[1]=="r")&&((zoneList[zoneNrL][0][0]!=PRODSTOP)||!settings.get("account","disableCropFields")))||((help[1]=="e")&&(zoneList[zoneNrL][0][0]!=PRODSTOP))){ next=true; handled.set(zoneNrS); break; } } } if(next){ autoForestryBuilding(runId,2); }else{ autoZoneFinish(runId,$("forestry_building_inner").querySelector(".big_close")); // exit } break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoForestryBuilding,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } help=null;listeningEvent=null;action=null; } }catch(err){ GM_logError("autoForestryBuilding","runId="+runId+" step="+step,"",err); } } function autoDonkey(runId, step) { try{ if (bot.checkRun("autoDonkey", runId)) { var help, action=null, listeningEvent=null; if (!step) { step=1; } bot.setAction("autoDonkey (" + step + ")"); switch (step) { case 1: { // go to farm 1 if (unsafeWindow.farm == 1) { autoDonkey(runId, step + 1); } else { listeningEvent="gameFarmOpened"; action=function(){ GM_logInfo("autoDonkey","runId="+runId+" step="+step,"","Goto Farm 1"); click($("speedlink_farm1")); }; } break; } case 2: { // open donkey if ($("globalbox").style.display == "block" || $("box_donkeydialog").style.display == "block") { autoDonkey(runId, step + 1); } else { listeningEvent = "gameDonkeyResponse"; action = function() { GM_logInfo("autoDonkey","runId="+runId+" step="+step,"","Donkey: Opening"); click($("farm_inner_waltraud")); }; } break; } case 3: { // exit GM_logInfo("autoDonkey","runId="+runId+" step="+step,"","Donkey: Exiting"); if ($("box_donkeydialog").style.display == "block") { // Donkey gain dailog autoZoneFinish(runId, $("box_donkeydialogsubmit").getElementsByTagName("button")[0]); } else if ($("globalbox").style.display == "block") { // Donkey already visited today autoZoneFinish(runId, $("globalbox_button1")); } else if ($("buybox_donkey").style.display == "block") { // Donkey not bought autoZoneFinish(runId, $("buybox_donkey").getElementsByClassName("close")[0]); } else { autoZoneFinish(runId); } break;} } if (listeningEvent) { document.addEventListener(listeningEvent, function(listeningEvent, runId, step){ return function() { document.removeEventListener(listeningEvent, arguments.callee, false); window.setTimeout(autoDonkey, settings.getPause(), runId, step+1); }; } (listeningEvent, runId, step), false); } if (action) { action(); } help=null; listeningEvent=null; action=null; } }catch(err){ GM_logError("autoDonkey","runId="+runId+" step="+step,"",err); } } function autoLottery(runId,step){ try{ if(bot.checkRun("autoLottery",runId)){ var help,action=null,listeningEvent=null; if(!step){ step=1; } bot.setAction("autoLottery ("+step+")"); switch(step){ case 1:{ // go to city 2 if(unsafeWindow.city==2){ autoLottery(runId,step+1); }else{ listeningEvent="gameCity2"; action=function(){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Goto City 2"); click($top("speedlink_city2")); }; } break;} case 2:{ // open lottery if($("lotterycontainer").style.display=="block"){ autoLottery(runId,step+1); }else{ listeningEvent="gameLotteryOpen"; action=function(){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Lottery: Opening"); click($("cityzone_2_8")); }; } break;} case 3:{ // Daily lot: get lot if(($("lotterycontainer").style.display=="block") && ($("dailylotleft").style.display!="none")){ listeningEvent="gameLotteryGotDailyLot"; action=function(){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Lottery: Getting daily lot"); click($("dailylot")); }; }else{ autoLottery(runId,6); // exit } break;} case 4:{ // Daily lot: got lot if($("currentlot").style.display=="block"){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Lottery: Got daily lot"); var lotid=$("currentlot").style.backgroundImage.match(/lotback_(\d*).jpg/i)[1]; //GM_log("lottery currentlot id:"+lotid + ":"); if(settings.get("account","lotteryDailyLot") && (lotid==null?false:(!(unsafeData.lotteryCollectForPrize["total"]&&unsafeData.lotteryCollectForPrize["total"][lotid])?false:(unsafeData.lotteryCollectForPrize["total"][lotid]>=(unsafeWindow.lotrack[lotid]?unsafeWindow.lotrack[lotid]:0))))){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Lottery: Saving lot"); click($("prizeslotkeeplot")); window.setTimeout(autoLottery,settings.getPause(),runId,6); // exit }else{ listeningEvent="gameLotteryGotPrize"; action=function(){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Lottery: Getting prizes"); click($("prizeslotgetprize")); }; window.setTimeout(autoLottery,settings.getPause(),runId,step+2); } } break;} case 5:{ // Daily lot: got prize if($("globalbox").style.display=="block"){ click($("globalbox_button1")); window.setTimeout(autoLottery,settings.getPause(),runId,step+1); }else{ autoLottery(runId,step+1); } break;} case 6:{ // exit if($("lotterycontainer").style.display=="block"){ GM_logInfo("autoLottery","runId="+runId+" step="+step,"","Lottery: Exiting"); autoZoneFinish(runId,$("lotteryhead").getElementsByClassName("link")[0]); }else{ autoZoneFinish(runId); } break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoLottery,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } help=null;listeningEvent=null;action=null; } }catch(err){ GM_logError("autoLottery","runId="+runId+" step="+step,"",err); } } /* quest-bot needs review function checkQuest(){ if(DEVMODE_FUNCTION){GM_log("Begin checkQuest");} var doQuest=true; var questNr=parseInt(unsafeData.questData["farm"]["1"]["nr"],10); if(unsafeData.questData["farm"]["1"]["state"]==2){ var iId,iType; for(var i=0;i(unsafeData.prodMinRackInit[iType][iId]+unsafeData.QUESTS["farm"]["1"][questNr][0][i][1])); //doQuest=doQuest&&unsafeData.prodStock[iType][iId]&&(unsafeData.prodStock[iType][iId]>(unsafeData.prodMinRack[iType][iId]+(unsafeData.prodMinRackSettings["valMinRackQuest"]?0:unsafeData.QUESTS["farm"]["1"][questNr][0][i][1]))); //GM_log("checkQuest iId:"+iId+" doQuest:"+doQuest); if(!doQuest) break; } iId=null; } if(DEVMODE_FUNCTION){GM_log("End checkQuest doQuest:"+doQuest);} return doQuest; } function autoActivateQuest(){ if(DEVMODE_FUNCTION){GM_log("Begin autoActivateQuest"); } if(!busy){ GM_log("BUSY NOT SET: autoActivateQuest"); return false;} var questNr=unsafeData.questData["farm"]["1"]["nr"]; logBubble.add("Looking for Quest:"+questNr); if(!checkQuest()){ logBubble.add("Exiting to low number of product available",5,"red"); window.setTimeout(autoZoneFinish,settings.getPause()); }else if((unsafeData.questData["farm"]["1"]["state"]==0 || unsafeWindow.city==1) && $("errorboxcity").style.display=="block"){ logBubble.add("Exiting no Quest found to accept or finish",5,"red"); click($("errorboxfootercity").firstElementChild); window.setTimeout(autoZoneFinish,settings.getPause()); }else if(unsafeWindow.city!=1){ document.addEventListener("gameCity1",function(){ document.removeEventListener("gameCity1",arguments.callee,false); logBubble.add("Arrived in city 1"); window.setTimeout(autoActivateQuest,settings.getPause()); },false); logBubble.add("Goto City 1"); click($top("citylineitem1")); }else if(unsafeData.questData["farm"]["1"]["state"]>0 && unsafeWindow.city==1 && $("questboxcity").style.display!="block"){ //open quest box logBubble.add("Open Quest "+questNr); if(DEVMODE){ GM_log("Open Quest "+questNr); } unsafeWindow.fillQuestBox(questNr); window.setTimeout(autoActivateQuest,settings.getPause()); }else if(valQuestActivate && valQuestActivateUntilNr>=questNr && unsafeWindow.city==1 && $("questboxcity").style.display=="block" && unsafeData.questData["farm"]["1"]["state"]==1){ //accept quest if(DEVMODE){ GM_log("Accept Quest "+questNr); } document.addEventListener("gameQuestAccepted",function(){//todo this does n't work document.removeEventListener("gameQuestAccepted",arguments.callee,false); logBubble.add("Accepted Quest "+questNr); autoZoneFinish(); },false); click($("questboxfootercity").firstElementChild); }else if(valQuestSolving && valQuestSolvingUntilNr>=questNr && unsafeWindow.city==1 && $("questboxcity").style.display=="block" && unsafeData.questData["farm"]["1"]["state"]==2){ //finish quest if(DEVMODE){ GM_log("Finish Quest "+questNr); } document.addEventListener("gameQuestFinished",function(){ //todo this does n't work document.removeEventListener("gameQuestFinished",arguments.callee,false); logBubble.add("Finished Quest "+questNr); autoZoneFinish(); },false); click($("questboxfootercity").firstElementChild); }else{ logBubble.add("Exiting quest unknown combination",10,"red"); autoZoneFinish(); } if(DEVMODE_FUNCTION){GM_log("End autoActivateQuest");} } function checkLodgeQuest(){ if(DEVMODE_FUNCTION){GM_log("Begin checkLodgeQuest");} //LQUESTS["campaign"]["nr"][[[type,id,amount]],waittime,points,[[type,tekst]]] var doQuest=false; var campaignNr="1"; var lquestNr=unsafeData.questData["lodge"][campaignNr]["nr"]; if(unsafeData.questData["lodge"][campaignNr]["time"]<=now){ //if(DEVMODE_FUNCTION){GM_log("Mid checkLodgeQuest doQuest:"+doQuest+" time:"+(now-unsafeData.questData["lodge"][campaignNr]["time"]));} var iId,iType; for(var i=0;i0&&iAdd>0); GM_log("checkLodgeQuest iId:"+iId+" doQuest:"+doQuest+" iAdd:"+iAdd); } iId=null;iType=null;iAdd=null; }else{ doQuest=false; } if(DEVMODE_FUNCTION){GM_log("End checkLodgeQuest doQuest:"+doQuest);} return doQuest; } function autoActivateLodgeQuest(didGive){ if(DEVMODE_FUNCTION){GM_log("Begin autoActivateLodgeQuest");} //if(!busy){ GM_log("BUSY NOT SET: autoActivateQuest"); return false;} if(didGive===undefined){didGive=false;} var campaignNr="1"; var lquestNr=unsafeData.questData["lodge"][campaignNr]["nr"]; if(!didGive){ logBubble.add("Looking for Campaign:"+campaignNr+" Lodge Quest:"+lquestNr); } if(unsafeData.questData["lodge"][campaignNr]["time"]>now){ logBubble.add("Exiting you stil have to wait some more",5,"red"); window.setTimeout(autoZoneFinish,settings.getPause(),$("forestry_questlist_close")); }else if(!checkLodgeQuest()){ logBubble.add("Exiting to low number of product available",5,"red"); window.setTimeout(autoZoneFinish,settings.getPause(),$("forestry_questlist_close")); }else if(unsafeWindow.city!=2){ document.addEventListener("gameCity2",function(){ document.removeEventListener("gameCity2",arguments.callee,false); logBubble.add("Arrived in city 2"); window.setTimeout(autoActivateLodgeQuest,settings.getPause(),true); },false); logBubble.add("Goto City 2"); click($top("citylineitem2")); }else if(unsafeWindow.city==2 && unsafeData.questData["lodge"][campaignNr]["time"]<=now && $("forestry_questlist_container").style.display!="block"){ //open quest box document.addEventListener("gameOpenCampaign",function(){ document.removeEventListener("gameOpenCampaign",arguments.callee,false); logBubble.add("Opened Lodge Quest"); window.setTimeout(autoActivateLodgeQuest,settings.getPause(),true); },false); click($("cityzone_2_9")); //unsafeWindow.initCampaigns(); }else if(unsafeWindow.city==2 && unsafeData.questData["lodge"][campaignNr]["time"]<=now && $("forestry_questlist_container").style.display=="block"){ //quest box is open var iId,iType,iAdd; for(var i=0;i0){ //GM_log("Add in iStock:"+iStock+" iAdd:"+iAdd); logBubble.add("Add #"+iAdd+" of "+unsafeData.prodName[iType][iId]); $("globalcommitbox").addEventListener("DOMAttrModified",function(iAdd){ return function(){ logBubble.add("Add in #"+iAdd+" of "+unsafeData.prodName[iType][iId]); $("globalcommitbox").removeEventListener("DOMAttrModified",arguments.callee,false); $("forestry_questentry_value").value=iAdd; click($("globalcommitboxfooter").firstElementChild); document.addEventListener("gameOpenCampaign",function(){ document.removeEventListener("gameOpenCampaign",arguments.callee,false); window.setTimeout(autoActivateLodgeQuest,settings.getPause(),true); },false); }; }(iAdd),false); click($("forestry_quest_entry"+campaignNr+"_"+lquestNr+"_"+(iType+1)+"_"+iId)); break; } } iId=null;iType=null;iAdd=null; } if(DEVMODE_FUNCTION){GM_log("End autoActivateLodgeQuest");} } */ function autoFarmersmarket(runId){ try{ if(!settings.get("account","botUseFarmersmarket")){ GM_logInfo("autoFarmersmarket","runId="+runId,"","FARMERSMARKET BOT OFF"); }else if(bot.checkRun("autoFarmersmarket",runId)){ bot.setAction("autoFarmersmarket"); var zoneNrS=getReadyZone("farmersmarket"); if(zoneNrS==null){ GM_logInfo("autoFarmersmarket","runId="+runId,"readyZone="+implode(unsafeData.readyZone,"autoFarmersmarket/readyZone"),"No ready zone"); autoZoneFinish(runId); }else{ handled.set(zoneNrS); try{ unsafeWindow.jsTimeStamp=unsafeWindow.Zeit.Client - unsafeWindow.Zeit.Verschiebung; }catch(err){} autoFarmersmarketBuilding(runId,1); // if(unsafeData.readyZone[handled.zoneNrS][2]){ // switch(handled.zoneBuildingTyp){ // case 4: // break;} // }else{ // GM_log("autoFarmersmarket: data not ready\nreadyZone[handled.zoneNrS]="+implode(unsafeData.readyZone[handled.zoneNrS])); // autoZoneFinish(runId); // TODO else // } } } GM_logInfo("autoFarmersmarket","runId="+runId,"handled.zoneNrF="+handled.zoneNrF,"End",1); }catch(err){ GM_logError("autoFarmersmarket","runId="+runId,"",err); autoZoneFinish(runId); } } function autoFarmersmarketBuilding(runId, step, field){ try{ // GM_log("autoFarmersmarketBuilding runId="+runId+" step="+step+" handled.zoneNrS="+handled.zoneNrS); if(settings.get("account","botUseFarmersmarket")&&bot.checkRun("autoFarmersmarketBuilding",runId)){ bot.setAction("autoFarmersmarketBuilding ("+step+")"); var help,help2,action=null,listeningEvent=null; switch(step){ case 1:{ // check required products if((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)&&(help=unsafeData.readyZone[handled.zoneNrS])&&help[2]&&((help[1]=="r")||(help[1]=="e"))){ help=unsafeData.prodRequire[0][zoneList[handled.zoneNrL][0][0]] if(typeof help=="object"){ for(var i=0;i exit } break;} case 3:{ // open farmersmarket building if((help=unsafeData.readyZone[handled.zoneNrS])&&help[2]&&(((help[1]=="r")&&((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)||(!settings.get("account","disableCropFields"))))||((help[1]=="e")&&(zoneList[handled.zoneNrL][0][0]!=PRODSTOP)))){ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Opening"); //TODO text help=/-(\d)$/.exec(handled.zoneNrF)[1]; // determine which building to work on if($("farmersmarket_pos"+help+"_inner").style.display != "block"){ action=function(){ click($("farmersmarket_pos"+help+"_click")); }; listeningEvent="gameFarmersmarketOpened"+help; // }else if("wrong building is opened"){ // GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","autoFarmersmarketBuilding: This is not the right building. Bailing out.") // autoFarmersmarketBuilding(runId,9); // finish (and start over) }else{ autoFarmersmarketBuilding(runId,step+1); } }else{ autoFarmersmarketBuilding(runId,9); // -> exit } break;} case 4:{ // harvest help=unsafeData.readyZone[handled.zoneNrS]; if((unsafeData.readyZone[handled.zoneNrS][1]=="r")&&((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)||(!settings.get("account","disableCropFields")))){ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Cropping"); //TODO text switch(handled.zoneBuildingTyp){ case 1:{ // TODO manual crop if((help=$("flowerarea_buttons"))&&(help=help.querySelector(".flowerarea_modus_harvest_all"))){ action=function(){ click(help); }; listeningEvent="gameFarmersmarketCropped"; }else{ autoFarmersmarketBuilding(runId,9); // -> exit } break;} case 4:{ if(help=$("nursery_slot_item" + handled.slot)){ action=function(){ click(help); }; listeningEvent="gameFarmersmarketCropped"; }else{ autoFarmersmarketBuilding(runId,9); // -> exit } break;} } }else{ autoFarmersmarketBuilding(runId,step+1); } break;} case 5:{ // init production help=unsafeData.readyZone[handled.zoneNrS]; if(zoneList[handled.zoneNrL][0][0]==PRODSTOP){ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","No production selected."); //TODO text autoFarmersmarketBuilding(runId,9); // -> exit }else if(help[1]=="e"){ switch(handled.zoneBuildingTyp){ case 1:{ // select flower // confirm cropping result if((help=$("globalbox")) && (help.style.display == "block")){ if(help=$("globalbox_button1")){ click(help); } } // select flower GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Initializing planting ("+zoneList[handled.zoneNrL][0][0]+")"); //TODO text if(unsafeWindow.racksort&&(unsafeWindow.racksort!=30)&&(unsafeWindow.racksort!=31)&&(unsafeWindow.racksort!=32)&&(unsafeWindow.racksort!=33)){ // non-flower-rack opened GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Switching rack"); //TODO text step--; action=function(){ click($("rackcat30")); }; listeningEvent="gameUpdateRack"; }else if(!(unsafeData.prodStock[0][zoneList[handled.zoneNrL][0][0]]&&unsafeData.prodStock[0][zoneList[handled.zoneNrL][0][0]]>0)){ // product is missing // this is correct set, even if rack is updating GM_logWarning("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Flower is not in rack"); //TODO text zoneList[handled.zoneNrL].unshift(DEFAULT_ZONELIST_ITEM.clone()); updateQueueBox(handled.zoneNrS); autoFarmersmarketBuilding(runId,9); // -> exit }else if(unsafeWindow.selected==zoneList[handled.zoneNrL][0][0]){ // Correct product selected // calculate time of next cropping // here its not important if rack is updating var time=NEVER; var NowServer=unsafeWindow.Zeit.Server; var tempZoneProductionData=unsafeData.zones.getProduction(handled.zoneNrS); for(var iType=0;iType0){ time=Math.min(time,tempZoneProductionData[0][iType][iProd][i][2]-NowServer); } } } } } time=Math.max(time,0); if(time<=settings.get("account","seedWaitForCrop")){ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Waiting for crop in "+getTimeStr(time)); zoneWaiting[handled.zoneNrF]=now+time; window.setTimeout(function(){ //TIMEOUT for(var fz in zoneWaiting){ if(!zoneWaiting.hasOwnProperty(fz)){continue;} if(zoneWaiting[fz]<=now){ delete zoneWaiting[fz]; } } checkReadyZone(); },(1000*time)+settings.getPause()); autoFarmersmarketBuilding(runId,9); // -> exit }else if(calcEmptyProductPositions(zoneList[handled.zoneNrL][0][0],handled.zoneNrF)>0){ autoFarmersmarketBuilding(runId,step+1,1); }else{ autoFarmersmarketBuilding(runId,9); // -> exit } }else{ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Wrong plant selected"); var nextRack=null; var allRacks=[30,31,32,33]; for(var i=allRacks.length-1;i>-1;i--){ if($("rackswitch"+allRacks[i])){ if(allRacks[i]==unsafeWindow.racksort){ nextRack=allRacks[(i+1)%allRacks.length]; break; } }else{ allRacks.splice(i,1); } } if(help=$("rackitem"+zoneList[handled.zoneNrL][0][0])){ if(unsafeWindow.updateRackBusy){ // Rack not loaded GM_logWarning("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Rack not loaded"); step--; listeningEvent="gameUpdateRack"; }else if(help.style.display!="none"){ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Seed found"); click(help); // rackitem found window.setTimeout(autoFarmersmarketBuilding,settings.getPause(),runId,step); }else if(unsafeWindow.racksort!=nextRack){ // call next rack GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Switching to next rack ("+nextRack+")"); step--; action=function(){ click($("rackswitch"+nextRack)); }; listeningEvent="gameUpdateRack"; }else{ // should not happen GM_logWarning("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Invisible non-empty rackitem and only 1 rack"); autoFarmersmarketBuilding(runId,9); // -> exit } }else if(unsafeWindow.racksort!=nextRack){ // rackamount>0 but no rackitem // = 2nd, 3rd or 4th rack was not loaded yet GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Switching to next rack ("+nextRack+")(rackitem not found)"); step--; action=function(){ click($("rackswitch"+nextRack)); }; listeningEvent="gameUpdateRack"; // unsafeWindow.updateRack((1+parseInt(unsafeWindow._currRack,10))%unsafeWindow.userracks); // call next rack }else{// rackamount>0 but no rackitem and 1 rack // should not happen because thats "product is missing" (1.case) GM_logWarning("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","No rackitem but rackamount and only 1 rack"); autoFarmersmarketBuilding(runId,9); // -> exit } } break;} case 4:{ // open slot GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Opening slot"); //TODO text if(help=$("nursery_slot_item" + handled.slot)){ action=function(){ click(help); }; listeningEvent="gameFarmersmarketSlotOpened"; }else{ autoFarmersmarketBuilding(runId,9); // -> exit } break;} } }else{ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"","Zone not empty."); //TODO text autoFarmersmarketBuilding(runId,9); // -> exit } break;} case 6:{ switch(handled.zoneBuildingTyp){ case 1:{ if((help=$("farmersmarket_pos1_inner"))&&(help=help.querySelector(".flowerarea_button_autoplant"))){ // premium planting action=function(){ click(help); }; listeningEvent="gameFarmersmarketDialogStart"; }else{ // non-premium planting unsafeWindow.flowerarea_modus="plant"; if(unsafeWindow.farmersmarket_data.flower_area){ for(var i=field;i<=unsafeData.BUILDING_SIZE["fl1"];i++){ if(!unsafeWindow.farmersmarket_data.flower_area[i]) { action = function(){ help=$("flowerarea_tile"+i); mouseover(help); click(help); mouseout(help); } window.setTimeout(autoFarmersmarketBuilding,settings.getPause(true),runId,step,i+1); break; } } } if(action==null){ autoFarmersmarketBuilding(runId,8,1); } } break;} case 4:{ // click production item if((help=$("nursery_production_box")) && (help.style.display == "block")){ if((help=help.querySelector('div[onclick*="dialogNursery(\'production_commit\', '+handled.slot+', '+zoneList[handled.zoneNrL][0][0]+')"]')) && (!help.className.match("nursery_production_select_item_block"))){ // link is visible, can be clicked on action=function(){ click(help); }; listeningEvent="gameFarmersmarketDialogCommit"; }else if(help=$("nursery_production_navi").querySelector(".nursery_production_navi_next")){ action=function(){ click(help); }; step--; listeningEvent="gameFarmersmarketSlotOpened"; }else{ autoFarmersmarketBuilding(runId,9); // -> exit } }else{ autoFarmersmarketBuilding(runId,9); // -> exit } break;} } break;} case 7:{ // commit if((help=$("globalbox")) && (help.style.display == "block")){ if(help=$("globalbox_button1")){ GM_logInfo("autoFarmersmarketBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Start production"); //TODO text action=function(){ click(help); }; listeningEvent="gameFarmersmarketStarted"; setNextQueueItem(handled.zoneNrS); }else{ autoFarmersmarketBuilding(runId,9); // -> exit } }else{ autoFarmersmarketBuilding(runId,9); // -> exit } break;} case 8:{ switch(handled.zoneBuildingTyp){ case 1:{ if((help=$("farmersmarket_pos1_inner"))&&(help=help.querySelector(".flowerarea_modus_water_all"))){ // premium watering action=function(){ click(help); }; listeningEvent="gameFarmersmarketWatered"; }else{ // non-premium watering unsafeWindow.flowerarea_modus="water"; if(unsafeWindow.farmersmarket_data.flower_area){ for(var i=field;i<=unsafeData.BUILDING_SIZE["fl1"];i++){ if((unsafeWindow.farmersmarket_data.flower_area[i])&&(unsafeWindow.farmersmarket_data.flower_area[i].water_remain<0)){ action = function(){ help=$("flowerarea_tile"+i); mouseover(help); click(help); mouseout(help); } window.setTimeout(autoFarmersmarketBuilding,settings.getPause(true),runId,step,i+1); break; } } } if(action==null){ autoFarmersmarketBuilding(runId,step+1); } } break;} case 4:{ autoFarmersmarketBuilding(runId,9); // -> exit break;} } break;} case 9:{ var zoneNrS,zoneNrL,help,next=false; if(unsafeData.zones.isMultiSlot(handled.zoneNrF)){ for(var slot=1;slot<=3;slot++){ zoneNrS=handled.zoneNrF+"."+slot; if((help=unsafeData.readyZone[zoneNrS])&&help[2]){ zoneNrL=getZoneListId(zoneNrS); if(((help[1]=="r")&&((zoneList[zoneNrL][0][0]!=PRODSTOP)||!settings.get("account","disableCropFields")))||((help[1]=="e")&&(zoneList[zoneNrL][0][0]!=PRODSTOP))){ next=true; handled.set(zoneNrS); break; } } } } if(next){ autoFarmersmarketBuilding(runId,1); }else{ help=/-(\d)$/.exec(handled.zoneNrF)[1]; autoZoneFinish(runId,$("farmersmarket_pos"+help+"_inner").querySelector(".big_close")); } break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoFarmersmarketBuilding,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } help=null;listeningEvent=null;action=null; } }catch(err){ GM_logError("autoFarmersmarketBuilding","runId="+runId+" step="+step,"",err); } } function autoFoodworld(runId){ try{ if(!settings.get("account","botUseFoodworld")){ GM_logInfo("autoFoodworld","runId="+runId,"","BOT OFF"); }else if(bot.checkRun("autoFoodworld",runId)){ bot.setAction("autoFoodworld"); var zoneNrS=getReadyZone("foodworld"); if(zoneNrS==null){ GM_logInfo("autoFoodworld","runId="+runId,"readyZone="+implode(unsafeData.readyZone,"autoFoodworld/readyZone"),"No ready zone"); // TODO text autoZoneFinish(runId); }else{ handled.set(zoneNrS); try{ unsafeWindow.jsTimeStamp=unsafeWindow.Zeit.Client - unsafeWindow.Zeit.Verschiebung; }catch(err){} if(unsafeData.readyZone[handled.zoneNrS][2]){ switch(handled.zoneBuildingTyp){ case 4: autoFoodworldBuilding(runId,1); break; } }else{ GM_logInfo("autoFoodworld","runId="+runId,"handled="+implode(handled,"autoFoodworld/handled")+" readyZone[handled.zoneNrS]="+implode(unsafeData.readyZone[handled.zoneNrS],"autoFoodworld/readyZone"),"Data not ready"); autoZoneFinish(runId); // TODO else } } } GM_logInfo("autoFoodworld","runId="+runId,"handled.zoneNrF="+handled.zoneNrF,"End",1); }catch(err){ GM_logError("autoFoodworld","runId="+runId,"",err); autoZoneFinish(runId); } } function autoFoodworldBuilding(runId, step){ try{ if(settings.get("account","botUseFoodworld")&&bot.checkRun("autoFoodworldBuilding",runId)){ bot.setAction("autoFoodworldBuilding ("+step+")"); var help,help2,action=null,listeningEvent=null; switch(step){ case 1:{ // check required products if((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)&&(help=unsafeData.readyZone[handled.zoneNrS])&&help[2]&&((help[1]=="r")||(help[1]=="e"))){ help2=true; help=unsafeData.prodRequire[0][zoneList[handled.zoneNrL][0][0]] if(typeof help=="object"){ for(var i=0;i exit } break;} case 3:{ // open foodworld building if((help=unsafeData.readyZone[handled.zoneNrS])&&help[2]&&(((help[1]=="r")&&((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)||(!settings.get("account","disableCropFields"))))||((help[1]=="e")&&(zoneList[handled.zoneNrL][0][0]!=PRODSTOP)))){ GM_logInfo("autoFoodworldBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Opening"); //TODO text help=/-(\d)$/.exec(handled.zoneNrF)[1]; // determine which building to work on if($("food_buildinginner").style.display != "block"){ action=function(){ click($("food_pos"+help)); }; listeningEvent="gameFoodworldOpened"+help; }else if(help != /building_inner(\d)_\d/.exec($("food_buildinginner").className)[1]){ GM_logInfo("autoFoodworldBuilding","runId="+runId+" step="+step,"","autoFoodworldBuilding: This is not the right building. Bailing out.") autoFoodworldBuilding(runId,7); // finish (and start over) }else{ autoFoodworldBuilding(runId,step+1); } }else{ autoFoodworldBuilding(runId,7); // -> exit } break;} case 4:{ // harvest help=unsafeData.readyZone[handled.zoneNrS]; if((unsafeData.readyZone[handled.zoneNrS][1]=="r")&&((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)||(!settings.get("account","disableCropFields")))){ GM_logInfo("autoFoodworldBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Cropping"); //TODO text if((help=$("food_slot" + handled.slot + "_ready")) && (help.style.display=="block")){ action=function(){ click(help); }; listeningEvent="gameFoodworldCropped"; }else{ autoFoodworldBuilding(runId,7); // -> exit } }else{ autoFoodworldBuilding(runId,step+1); } break;} case 5:{ // open slot help=unsafeData.readyZone[handled.zoneNrS]; if((zoneList[handled.zoneNrL][0][0]!=PRODSTOP)&&(help[1]=="e")){ GM_logInfo("autoFoodworldBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Opening slot"); //TODO text if((help=$("food_slot" + handled.slot + "_ready")) && (help.style.display=="none")){ action=function(){ click($("food_slot" + handled.slot)); }; listeningEvent="gameFoodworldSlotOpened"; }else{ autoFoodworldBuilding(runId,7); // -> exit } }else{ GM_logInfo("autoFoodworldBuilding","runId="+runId+" step="+step,"","Could not find the empty slot to click on."); autoFoodworldBuilding(runId,7); } break;} case 6:{ // click production item if((help=$("food_buildinginner_select")) && (help.style.display == "block")){ if((help=$("foodworld_bld_select_prod" + zoneList[handled.zoneNrL][0][0])) && (help.className == "link")){ // link is visible, can be clicked on GM_logInfo("autoFoodworldBuilding","runId="+runId+" step="+step,"",handled.zoneNrF.capitalize()+" automat
Start production"); //TODO text action=function(){ click(help); }; listeningEvent="gameFoodworldStarted"; setNextQueueItem(handled.zoneNrS); }else if((help=$("food_buildinginner_select_down")) && (help.style.display == "block")){ action=function(){ click(help); }; step--; listeningEvent="gameFoodworldSlotOpened"; }else{ autoFoodworldBuilding(runId,7); // -> exit } }else{ autoFoodworldBuilding(runId,7); // -> exit } break;} case 7:{ var zoneNrS,zoneNrL,help,next=false; for(var slot=1;slot<=3;slot++){ zoneNrS=handled.zoneNrF+"."+slot; if((help=unsafeData.readyZone[zoneNrS])&&help[2]){ zoneNrL=getZoneListId(zoneNrS); if(((help[1]=="r")&&((zoneList[zoneNrL][0][0]!=PRODSTOP)||!settings.get("account","disableCropFields")))||((help[1]=="e")&&(zoneList[zoneNrL][0][0]!=PRODSTOP))){ next=true; handled.set(zoneNrS); break; } } } if(next){ autoFoodworldBuilding(runId,1); }else{ autoZoneFinish(runId,$("food_buildinginner_close")); } break;} } if(listeningEvent){ document.addEventListener(listeningEvent,function(listeningEvent,runId,step){ return function(){ document.removeEventListener(listeningEvent,arguments.callee,false); window.setTimeout(autoFoodworldBuilding,settings.getPause(),runId,step+1); }; }(listeningEvent,runId,step),false); } if(action){ action(); } help=null;listeningEvent=null;action=null; } }catch(err){ GM_logError("autoFoodworldBuilding","runId="+runId+" step="+step,"",err); } } function checkFarmi(mode){ try{ GM_logInfo("checkFarmi","mode="+mode,"","Begin",1); var farmiNr=null; var farmiAmount=0; var farmiAcceptRemove=new Array(); for(var i in unsafeWindow.farmisinfo[0]){ if(!unsafeWindow.farmisinfo[0].hasOwnProperty(i)){ continue; } if(settings.get("account","farmiReject") && !unsafeWindow.farmisinfo[0][i]["sold"] && unsafeWindow.farmisinfo[0][i]["costQuotient"] < settings.get("account","farmiRejectUntilNr")){ if(farmiNr==null){ farmiNr=i; GM_logInfo("checkFarmi","mode="+mode,"farmiNr="+farmiNr,"farmiReject",0); } farmiAmount++; }else if(settings.get("account","farmiAccept") && !unsafeWindow.farmisinfo[0][i]["sold"] && unsafeWindow.farmisinfo[0][i]["costQuotient"]>=settings.get("account","farmiAcceptAboveNr") && !unsafeWindow.farmisinfo[0][i]["missing"] && ((settings.get("account","farmiAcceptBelowMinValue")&&!unsafeWindow.farmisinfo[0][i]["belowMinRackInit"]) || !unsafeWindow.farmisinfo[0][i]["belowMinRack"])){ if(farmiNr==null){ farmiNr=i; GM_logInfo("checkFarmi","mode="+mode,"farmiNr="+farmiNr,"farmiAccept",0); } farmiAmount++; }else if(settings.get("account","farmiAccept") && settings.get("account","farmiRemoveMissing") && !unsafeWindow.farmisinfo[0][i]["sold"] && unsafeWindow.farmisinfo[0][i]["costQuotient"]>=settings.get("account","farmiAcceptAboveNr") && unsafeWindow.farmisinfo[0][i]["missing"]){ farmiAcceptRemove.push([i,unsafeWindow.farmisinfo[0][i]["price"]-unsafeWindow.farmisinfo[0][i]["marketValue"]]); } } if(settings.get("account","farmiRemoveMissing") && farmiAcceptRemove.length > settings.get("account","farmiRemoveMissingAboveNr")){ farmiAmount += (farmiAcceptRemove.length-settings.get("account","farmiRemoveMissingAboveNr")); farmiAcceptRemove.sort(function(a,b){return (parseInt(b[1],10)-parseInt(a[1],10));}); farmiAcceptRemove.splice(0,settings.get("account","farmiRemoveMissingAboveNr")); farmiAcceptRemove.reverse(); GM_logInfo("checkFarmi","mode="+mode,"farmiNr="+farmiNr+" farmiAcceptRemove="+implode(farmiAcceptRemove,"checkFarmi/farmiAcceptRemove"),"farmiAcceptedRemove",0); if(farmiNr==null){farmiNr = farmiAcceptRemove[0][0];} } GM_logInfo("checkFarmi","mode="+mode,"","End",1); switch (mode){ case 2: return [farmiAmount,farmiNr,farmiAcceptRemove]; break; case 1: if(farmiNr!=null){ botArbiter.add("farmi"); } break; case 0: default: return (farmiNr!=null); break; } }catch(err){ GM_logError("checkFarmi","mode="+mode,"",err); } } function autoFarmi(){ try{ GM_logInfo("autoFarmi","","","Begin",1); if(!bot.isBusy()){ GM_logInfo("autoFarmi","","","BUSY NOT SET"); return false; } GM_logInfo("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Begin for Farmi"); var help=checkFarmi(2); var farmiNr=help[1]; var farmiAmount=help[0]; var farmiAcceptRemove = help[2]; GM_logInfo("autoFarmi","","farmiAmount="+farmiAmount+" farmiNr="+farmiNr,"Begin"); if(farmiAmount>0){ if(unsafeWindow.farm!=1){ // change farm document.addEventListener("gameFarmOpened",function(){ document.removeEventListener("gameFarmOpened",arguments.callee,false); GM_logInfo("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Arrived in farm"); //TODO text GM_logInfo("autoFarmi","","","Arrived in farm",1); autoFarmi(); },false); GM_logInfo("autoFarmi","","","Change farm to 1",0); GM_logInfo("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Change farm to 1"); click($("speedlink_farm1")); // click($("farmlinks").getElementsByClassName("link")[0]); }else if(unsafeWindow.farm==1){ var doFarmiInterval=window.setInterval(function(farmiNr,farmiAmount){ try{ if($("cart").style.display=="block"){ try { window.clearInterval(doFarmiInterval); doFarmiInterval=null; } catch (err){} if(farmiAmount>=1){ document.addEventListener("gameFarmiResponse",function(){ document.removeEventListener("gameFarmiResponse",arguments.callee,false); window.setTimeout(function(){ GM_logInfo("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Do next Farmi"); autoFarmi(); },3000); },false); if(settings.get("account","farmiReject") && !unsafeWindow.farmisinfo[0][farmiNr]["sold"] && unsafeWindow.farmisinfo[0][farmiNr]["costQuotient"] < settings.get("account","farmiRejectUntilNr")){ GM_logInfo("autoFarmi","","farmiNr="+farmiNr,"farmiReject",0); unsafeWindow.handleFarmi(farmiNr,2); unsafeWindow.farmisinfo[0][farmiNr]["sold"]=1; }else if(settings.get("account","farmiAccept") && !unsafeWindow.farmisinfo[0][farmiNr]["sold"] && unsafeWindow.farmisinfo[0][farmiNr]["costQuotient"]>=settings.get("account","farmiAcceptAboveNr") && !unsafeWindow.farmisinfo[0][farmiNr]["missing"] && ((settings.get("account","farmiAcceptBelowMinValue")&&!unsafeWindow.farmisinfo[0][farmiNr]["belowMinRackInit"]) || !unsafeWindow.farmisinfo[0][farmiNr]["belowMinRack"])){ GM_logInfo("autoFarmi","","farmiNr="+farmiNr,"farmiAccept",0); unsafeWindow.handleFarmi(farmiNr,1); unsafeWindow.farmisinfo[0][farmiNr]["sold"]=1; }else if(settings.get("account","farmiAccept") && settings.get("account","farmiRemoveMissing") && !unsafeWindow.farmisinfo[0][farmiNr]["sold"] && unsafeWindow.farmisinfo[0][farmiNr]["costQuotient"]>=settings.get("account","farmiAcceptAboveNr") && unsafeWindow.farmisinfo[0][farmiNr]["missing"]){ GM_logInfo("autoFarmi","","farmiNr="+farmiNr,"farmiAcceptedRemove",0); unsafeWindow.handleFarmi(farmiNr,2); unsafeWindow.farmisinfo[0][farmiNr]["sold"]=1; }else{ GM_logInfo("autoFarmi","","farmiNr="+farmiNr,"valFarmi Null"); } } } GM_logInfo("autoFarmi","","farmiNr="+farmiNr,"Click Farmi",0); GM_logInfo("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Click Farmi:"+farmiNr); click($("kunde_"+farmiNr)); }catch(err){ GM_logError("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"",err);} },settings.getPause(true),farmiNr,farmiAmount); }else{ GM_logWarning("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Exiting farmi. unknown combination"); bot.end(); } }else{ GM_logInfo("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,"Exiting farmi. no farmi"); bot.end(); } }catch(err){ GM_logError("autoFarmi","","farmiNr="+farmiNr+" farmiAmount="+farmiAmount,err); } } function doGameSessionEnds(){ //NOTICE: Use only in combination with botArbiter.add("sessionEnds"); click($("divSessionEnd")); } function doGameOtherAccReady(){ //NOTICE: Use only in combination with botArbiter.add("otherAccReady"); click($("linkOtherAccReady")); } function drawButtons(){ if(!$("divAutomatButtonOverview")){ newdiv=createElement("div",{"id":"divAutomatButtonOverview","class":"link beraterButtonIcon hoverBgGreen","mouseOverText":getText("automat_buttonOverview")},$("divBeraterButtons")); createElement("img",{"class":"link","src":IMAGES["gear"],"style":"position:relative;top:3px;left:0;width:28px;height:28px;"},newdiv); newdiv.addEventListener("click",function(){ unsafeWindow.buildInfoPanel("automatOverview"); },false); } } function drawZoneListTable(currZoneType){ try{ var newtable=createElement("table",{style:"",border:"1",cellspacing:"0",style:"margin-bottom:10px;"}); newtable.addEventListener("mouseout",function(event){ for(var y=0;y1){ if(0"+getZoneName(0,zones[i],zones[i],null,false,false,true,false).replace(/,/g,"
")); } if(currZoneType=="1"){ newtd=createElement("td",{align:"center","rowspan":2},newtr); } newtr=createElement("tr",{"style":"line-height:18px;"},newtable); createElement("td",{"style":"text-align:left;border-top:none;"},newtr,getText("automat_titleQueue")); for(var lz in zoneList){ if(!zoneList.hasOwnProperty(lz)){ continue; } if(lz==0 || lz=="windmill"){ continue; } var extendedList=extendedListReg.exec(lz); if((!extendedList && currZoneType!=getZoneType(lz)) || (extendedList && currZoneType!=1)) continue; newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"nowrap":"","style":"width:50px;text-align:right;","class":"link","lz":lz}, newtr, getZoneName(0,lz,lz,null,false,true,true,false)); // !!extendedList? // getText("automat_titleGeneral").replace(" "," ")+" "+extendedList[1] // :getText("automat_titleQueue")+" "+((isNaN(Number(lz))?lz:(Math.ceil(lz/6)+"."+getGarden(lz)))) newtd.addEventListener("mouseover",function(event){ var zoneNrL=this.getAttribute("lz"); var content=createElement("div"); drawQueueListSmall(zoneNrL, zoneNrL, content); createElement("div",{"style":"margin:4px 0px 4px 0px;width:100%;height:0px;border-bottom:1px solid black;"},content); createElement("div",{"class":"queueTitle"},content,getText("automat_queueshow")); toolTip.show(event, content.innerHTML); content=null; },false); newtd.addEventListener("click",function(){ try{ var zoneNrL=this.getAttribute("lz"); switch(getBuildingTyp(zoneNrL)){ case 1: if(settings.get("account","useQueueList")){ redrawQueueBox(zoneNrL, zoneNrL, $("divQueueBoxInner")); }else{ drawQueueChooseItemBox(zoneNrL, zoneNrL, 0, $("divChooseBoxInner")); } break; case 2: drawStableChooseFeedBox(zoneNrL, zoneNrL, $("divChooseBoxInner")); break; case 3: if(settings.get("account","useQueueList")){ drawQueueBox(zoneNrL,zoneNrL,$("divChooseBoxInner")); }else{ drawFactoryChooseItemBox(zoneNrL,zoneNrL,$("divChooseBoxInner")); } break; case "windmill": case 4: redrawQueueBox(zoneNrL, zoneNrL, $("divQueueBoxInner")); break; } }catch(err){GM_logError("drawZoneListTable/table1/td.click","","zoneNrL="+zoneNrL,err);} },false); for(var i=0;i-1;i--){ tr=createElement("tr",{"class":"hoverBgCc9 borderBottom1dashedGrey"},table); createElement("td",{},tr,CHANGELOG[i][0]); createElement("td",{},tr,CHANGELOG[i][1]); td=createElement("td",{},tr); div=createElement("ul",{},td); for(var j=0;j=1;i--){ // Zonetype-Buttons if(mode["filterType"].search(i+",")==-1){ createElement("div",{"filter":i+",","class":"link fieldlinkitem"+i,"mouseOverText":getText("automat_title_on_type"+i)},newdiv1); }else{ createElement("div",{"filter":i+",","class":"link fieldlinkitemactivate"+i,"mouseOverText":getText("automat_title_off_type"+i)},newdiv1); } } newdiv=createElement("div",{style:"overflow-y:auto;overflow-x:hidden;width:100%;height:"+($("infoPanelInner").clientHeight-35)+"px;"},$("infoPanelInner")); newtable=createElement("table",{"class":"border1",style:"width:100%;"},newdiv); var newtr,newtd,zoneNrS; // collect all handled zones var zones=new Array(); for(var i in unsafeData.ALL_SLOTS){ if(!unsafeData.ALL_SLOTS.hasOwnProperty(i)){ continue; } if(unsafeData.zones.getBlock(i)){ continue; } if(unsafeData.ALL_SLOTS[i]=="farm"){ if(mode["filterZone"].search(unsafeData.ALL_SLOTS[i]+Math.ceil(parseInt(i,10)/6))!=-1){ zones.push([unsafeData.ALL_SLOTS[i]+Math.ceil(parseInt(i,10)/6),i]); } }else{ if(mode["filterZone"].search(unsafeData.ALL_SLOTS[i])!=-1){ zones.push([unsafeData.ALL_SLOTS[i],i]); } } } // GM_log("ALL_SLOTS:\n"+print_r(unsafeData.ALL_SLOTS,"",true,"\n")); // GM_log("zones:\n"+print_r(zones,"",true,"\n")); // build table var old=null; for(var i=0;i set to default (Grain,Carrots) emergencyPlants=[1,17]; }else{ // remove duplicates for(var v=0;v"+getText("automat_help_3")[0]+"
"+getText("automat_help_3")[1]+""); },false); inp=createElement("img",{"src":IMAGES["help"],"style":"margin-left:3px;height:14px;width:14px;"},newtd); inp.addEventListener("mouseover",function(event){ toolTip.show(event,"
"+getText("automat_help_9")[0]+"
"+getText("automat_help_9")[1]+"
"); },false); newtd=createElement("td",{"style":"width:120px;"},newtr); inp=createElement("button",{id:"inputDeleteAllQueueData","class":"link hoverBgCc9",style:"display:block;width:110px;margin:5px;padding:1px;"},newtd,getText("automat_set12a")); inp.addEventListener("click",function(){ this.disabled=true; zoneList={}; zoneSettings={}; zoneToList={}; for(var fz in unsafeData.ALL_SLOTS){ if(!unsafeData.ALL_SLOTS.hasOwnProperty(fz)){ continue; } zoneList[fz]=(fz=="windmill"?DEFAULT_ZONELIST_MILL_ARRAY.clone():DEFAULT_ZONELIST_ITEM_ARRAY.clone()); zoneSettings[fz]={"repeat":false,"shuffle":false}; zoneToList[fz]=fz; reFillQueueBox(fz,fz,0); } GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList",implode(zoneList,"gameInfoPanelOpen/options/zoneList")); GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneSettings",implode(zoneSettings,"gameInfoPanelOpen/options/zoneSettings")); GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneToList",implode(zoneToList,"gameInfoPanelOpen/options/zoneToList")); alert(getText("automat_set12b")); this.disabled=false; },false); newtr=createElement("tr",{style:"line-height:18px;"},newtable); newtd=createElement("td",{align:"center"},newtr); inp=createElement("input",{"class":"link",type:"checkbox",checked:settings.get("account","showQueueTime")},newtd); inp.addEventListener("click",function(){ settings.set("account","showQueueTime",this.checked) for(var i=0;i"+getText("automat_help_9")[0]+"
"+getText("automat_help_9")[1]+""); },false); newtd=createElement("td",{"style":"width:120px;"},newtr); inp=createElement("button",{"class":"link hoverBgCc9",style:"display:block;width:110px;margin:5px;padding:1px;"},newtd,getText("automat_set18a")); inp.addEventListener("click",function(){ this.disabled=true; zoneList["windmill"]=DEFAULT_ZONELIST_MILL_ARRAY; zoneSettings["windmill"]={"shuffle":false,"lack":0,"detail":new Array()}; autoMillStorage=new Array(); reFillQueueBox("windmill","windmill",0); GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList",implode(zoneList,"gameInfoPanelOpen/options/zoneList")); GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneSettings",implode(zoneSettings,"gameInfoPanelOpen/options/zoneSettings")); GM_setValue2(COUNTRY+"_"+SERVER+"_"+USERNAME+"_autoMillStorage",implode(autoMillStorage,"gameInfoPanelOpen/options/autoMillStorage")); alert(getText("automat_set18b")); this.disabled=false; },false); newtr=createElement("tr",{"style":"line-height:18px;","set":"account_powerUpActivate"},newtable); newtd=createElement("td",{"align":"center","style":"max-width:120px;"},newtr); inp=createElement("input",{"class":"link","type":"checkbox","checked":settings.get("account","powerUpActivate")},newtd); inp.addEventListener("click",function(){ settings.set("account","powerUpActivate",this.checked); buildInfoPanelOptionsDisabling(); botArbiter.check(); },false); newtd=createElement("td",{colspan:"2"},newtr,getText("automat_settings_powerUpActivate")); // *********** FOODWORLD *********************************** newtr=createElement("tr",{"style":"background-color:#b69162;"},newtable); createElement("th",{"colspan":"3"},newtr,getText("foodworld")); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center","width":"40"},newtr); inp=createElement("input",{"class":"link","type":"checkbox","checked":settings.get("account","botUseFoodworld")},newtd); inp.addEventListener("click",function(){ settings.set("account","botUseFoodworld",this.checked); buildInfoPanelOptionsDisabling(); botArbiter.check(); },false); newtd=createElement("td",{"colspan":"2"},newtr,getText("automat_settings_botUse")); // *********** FORESTRY *********************************** newtr=createElement("tr",{"style":"background-color:#b69162;"},newtable); createElement("th",{"colspan":"3"},newtr,getText("forestry")); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center","width":"40"},newtr); inp=createElement("input",{"class":"link","type":"checkbox","checked":settings.get("account","botUseForestry")},newtd); inp.addEventListener("click",function(){ settings.set("account","botUseForestry",this.checked); buildInfoPanelOptionsDisabling(); botArbiter.check(); },false); newtd=createElement("td",{"colspan":"2"},newtr,getText("automat_settings_botUse")); // *********** MEGAFIELD *************************************** newtr=createElement("tr",{"style":"background-color:#b69162;"},newtable); createElement("th",{"colspan":"3"},newtr,getText("megafield")); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center","width":"40"},newtr); inp=createElement("input",{"class":"link","type":"checkbox","checked":settings.get("account","botUseMegafield")},newtd); inp.addEventListener("click",function(){ settings.set("account","botUseMegafield",this.checked); buildInfoPanelOptionsDisabling(); botArbiter.check(); },false); newtd=createElement("td",{"colspan":"2"},newtr,getText("automat_settings_botUse")); // *********** GENERAL ***************************************** newtr=createElement("tr",{"style":"background-color:#b69162;"},newtable); createElement("th",{colspan:"3"},newtr,getText("automat_general")); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("input",{"id":"settings_pauseShortMin","value":settings.get("country","pauseShort")[0],"size":"5px","style":"text-align:center;background-color:transparent;"},newtd); inp.addEventListener("change",function(){ var val=settings.get("country","pauseShort"); val[0]=Math.max(0,Math.min(parseInt(this.value,10),val[1])); this.value=val[0]; settings.set("country","pauseShort",val); },false); createElement("span","",newtd,"ms"); createElement("td",{},newtr,getText("automat_settings_pauseShortMin")); newtd=createElement("td",{"rowspan":"2","style":"width:120px;"},newtr); inp=createElement("button",{"class":"link hoverBgCc9","style":"display:block;width:110px;margin:5px;padding:1px;"},newtd,getText("automat_setToDefault")); inp.addEventListener("click",function(){ var help=settings.reset("country","pauseShort"); $("settings_pauseShortMin").value=help[0]; $("settings_pauseShortMax").value=help[1]; },false); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("input",{"id":"settings_pauseShortMax","value":settings.get("country","pauseShort")[1],"size":"5px","style":"text-align:center;background-color:transparent;"},newtd); inp.addEventListener("change",function(){ var val=settings.get("country","pauseShort"); val[1]=Math.max(0,Math.max(parseInt(this.value,10),val[0])); this.value=val[1]; settings.set("country","pauseShort",val); },false); createElement("span","",newtd,"ms"); createElement("td",{},newtr,getText("automat_settings_pauseShortMax")); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("input",{"id":"settings_pauseMin","value":settings.get("country","pause")[0],"size":"5px","style":"text-align:center;background-color:transparent;"},newtd); inp.addEventListener("change",function(){ var val=settings.get("country","pause"); val[0]=Math.max(0,Math.min(parseInt(this.value,10),val[1])); this.value=val[0]; settings.set("country","pause",val); },false); createElement("span","",newtd,"ms"); createElement("td",{},newtr,getText("automat_settings_pauseMin")); newtd=createElement("td",{"rowspan":"2","style":"width:120px;"},newtr); inp=createElement("button",{"class":"link hoverBgCc9","style":"display:block;width:110px;margin:5px;padding:1px;"},newtd,getText("automat_setToDefault")); inp.addEventListener("click",function(){ var help=settings.reset("country","pause"); $("settings_pauseMin").value=help[0]; $("settings_pauseMax").value=help[1]; },false); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("input",{"id":"settings_pauseMax",value:settings.get("country","pause")[1],"size":"5px","style":"text-align:center;background-color:transparent;"},newtd); inp.addEventListener("change",function(){ var val=settings.get("country","pause"); val[1]=Math.max(0,Math.max(parseInt(this.value,10),val[0])); this.value=val[1]; settings.set("country","pause",val); },false); createElement("span","",newtd,"ms"); createElement("td",{},newtr,getText("automat_settings_pauseMax")); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("input",{"id":"settings_maxDurationBotRun","value":settings.get("country","maxDurationBotRun"),"size":"5px","style":"text-align:center;background-color:transparent;"},newtd); inp.addEventListener("change",function(){ var help=parseInt(this.value,10); if (isNaN(help)){ this.value=""; }else{ if(help<0){ help*=-1; } this.value=help; settings.set("country","maxDurationBotRun",help); } },false); createElement("span","",newtd,"s"); createElement("td",{},newtr,getText("automat_settings_maxDurationBotRun")); newtd=createElement("td",{"style":"width:120px;"},newtr); inp=createElement("button",{"class":"link hoverBgCc9","style":"display:block;width:110px;margin:5px;padding:1px;"},newtd,getText("automat_setToDefault")); inp.addEventListener("click",function(){ $("settings_maxDurationBotRun").value=settings.reset("country","maxDurationBotRun"); },false); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("input",{"id":"settings_maxDurationBotStep","value":settings.get("country","maxDurationBotStep"),"size":"5px","style":"text-align:center;background-color:transparent;"},newtd); inp.addEventListener("change",function(){ var help=parseInt(this.value,10); if (isNaN(help)){ this.value=""; }else{ if(help<0){ help*=-1; } this.value=help; settings.set("country","maxDurationBotStep",help); } },false); createElement("span","",newtd,"s"); createElement("td",{},newtr,getText("automat_settings_maxDurationBotStep")); newtd=createElement("td",{"style":"width:120px;"},newtr); inp=createElement("button",{"class":"link hoverBgCc9","style":"display:block;width:110px;margin:5px;padding:1px;"},newtd,getText("automat_setToDefault")); inp.addEventListener("click",function(){ $("settings_maxDurationBotStep").value=settings.reset("country","maxDurationBotStep"); },false); newtr=createElement("tr",{"style":"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); inp=createElement("select",{"id":"input_botErrorBehaviour","class":"link"},newtd); createElement("option",{"value":"reload"},inp,getText("automat_settings_pageReload")); createElement("option",{"value":"restart"},inp,getText("automat_settings_botRestart")); inp.value=settings.get("country","botErrorBehaviour"); inp.addEventListener("change",function(){ settings.set("country","botErrorBehaviour",this.value) },false); newtd=createElement("td",{"colspan":"2"},newtr,getText("automat_settings_botErrorBehaviour")); // ***** newtr=createElement("tr",{"style":"background-color:#b69162;"},newtable); createElement("th",{colspan:"3"},newtr,getText("automat_development")); newtr=createElement("tr",{style:"line-height:18px;"},newtable); newtd=createElement("td",{"align":"center"},newtr); newinput=createElement("input",{"id":"inputDevmode","type":"checkbox","class":"link","checked":DEVMODE},newtd); newinput.addEventListener("click",function(){GM_setValue2("devmode",DEVMODE=this.checked);},false); createElement("td",{},newtr,"Developer Mode"); createElement("td",{},newtr); newtr=createElement("tr",{},newtable); newtd=createElement("td",{"align":"center"},newtr); newinput=createElement("input",{"id":"inputDevmodeFunctions","type":"checkbox","class":"link","checked":DEVMODE_FUNCTION},newtd); newinput.addEventListener("click",function(){GM_setValue2("devmode_function",DEVMODE_FUNCTION=this.checked);},false); createElement("td",{},newtr,"Developer Function"); createElement("td",{},newtr,"Show function calls"); buildInfoPanelOptionsDisabling(); newdiv=null;newtable=null;newtr=null;newtd=null;inp=null; }catch(err){GM_logError("buildInfoPanelOptions","","",err);} } function buildInfoPanelOptionsDisabling(){ try{ var set,disabled,help,help2; help=$("infoPanelR").querySelectorAll("[set]"); for(var i=help.length-1;i>=0;i--){ if(set=help[i].getAttribute("set").split("_")){ disabled=!settings.checkRequire(set[0],set[1]); if(help[i].disabled!=disabled){ help[i].disabled=disabled; help[i].style.opacity=(disabled?"0.6":"1"); } } help2=help[i].querySelectorAll("input"); for(var j=help2.length-1;j>=0;j--){ if(help2[j].disabled!=disabled){ help2[j].disabled=disabled; } } } help=null; }catch(err){GM_logError("buildInfoPanelOptionsDisabling","","",err);} } function buildInfoPanelZonePairing(){ try{ var container,newdiv; newdiv=$("infoPanelNaviAutomatZonePairing"); newdiv.classList.remove("naviItem"); newdiv.classList.add("naviItemActive"); container=$("infoPanelR"); // count zones var slotCount=new Object(); var zoneType; for(var i in unsafeData.ALL_SLOTS){ if(!unsafeData.ALL_SLOTS.hasOwnProperty(i)){ continue; } if(unsafeData.zones.getBlock(i)){ continue; } zoneType=getZoneType(i); if(!slotCount[zoneType]){ slotCount[zoneType]=0; } slotCount[zoneType]++; } for(var i in slotCount){ if(!slotCount.hasOwnProperty(i)){ continue; } if((i==1)||(slotCount[i]>1)){ newdiv=createElement("div",{"style":"font-weight:bold;"},container,isNaN(i)?getText(i):unsafeWindow.buildinginfos[0][i][10]); newdiv.appendChild(drawZoneListTable(i)); } } container=null;newdiv=null; }catch(err){GM_logError("buildInfoPanelZonePairing","","",err);} } function buildInfoPanelDebugInfo(){ try{ newdiv=$("infoPanelNaviAutomatDebugInfo"); newdiv.classList.remove("naviItem"); newdiv.classList.add("naviItemActive"); container=$("infoPanelR"); newdiv=createElement("TEXTAREA", {"id":"debugbox","style":"width:99%;height:99%;"},container); newdiv.innerHTML +="scriptversion:"+VERSION + ";\n"; newdiv.innerHTML +="neededVersionBerater:"+neededVersionBerater + ";\n"; newdiv.innerHTML +="neededVersionFunctionFile:"+neededVersionFunctionFile + ";\n"; newdiv.innerHTML +="zoneSettings:"+implode(zoneSettings,"Debug/zoneSettings") + ";\n"; newdiv.innerHTML +="zoneList:"+implode(zoneList,"Debug/zoneList") + ";\n"; newdiv.innerHTML +="zoneToList:"+implode(zoneToList,"Debug/zoneToList") + ";\n"; newdiv.innerHTML +="autoMillStorage:"+implode(autoMillStorage,"Debug/autoMillStorage") + ";\n"; newdiv.innerHTML +="emergencyPlants:"+implode(emergencyPlants,"Debug/emergencyPlants") + ";\n"; newdiv.innerHTML +="bot.isActive():"+bot.isActive()+ ";\n"; /* quest-bot needs review newdiv.innerHTML +="valQuestActivate:"+valQuestActivate+ ";\n"; newdiv.innerHTML +="valQuestActivateUntilNr:"+valQuestActivateUntilNr+ ";\n"; newdiv.innerHTML +="valQuestSolving:"+valQuestSolving+ ";\n"; newdiv.innerHTML +="valQuestSolvingUntilNr:"+valQuestSolvingUntilNr+ ";\n"; newdiv.innerHTML +="valLodgeQuestSolving:"+valLodgeQuestSolving+ ";\n"; */ newdiv.innerHTML +="devMode:"+DEVMODE+";\n"; container=null;newdiv=null; }catch(err){GM_logError("buildInfoPanelDebugInfo","","",err);} } // *************************************************************************************************** function do_main(){ try{ GM_logInfo("do_main","","","Automat started",1); // ************************************************** // Changes: // .... // GM_setValue2("changedata",1); // // ************************************************** // Show changelog of new version var err_trace="Changelog of new version"; var container, newdiv; if(CHANGELOG[CHANGELOG.length-1][0]!=GM_getValue("automatChangelogShownVersion","")){ container=createElement("div"); createElement("div",{},container,getText("automat_confirmChangelogVersion").replace("%1%",CHANGELOG[CHANGELOG.length-1][0])); newdiv=createElement("ul",{},container); for(var i=0;i=unsafeData.questData["farm"]["1"]["nr"]){ botArbiter.add("quest"); } },false); document.addEventListener("gameQuestSolvable",function(){ if(DEVMODE){ logBubble.add("event found:gameQuestSolvable: "+valQuestSolving); } if(unsafeData.questData["farm"]["1"]["state"]==2 && valQuestSolving && valQuestSolvingUntilNr>=unsafeData.questData["farm"]["1"]["nr"] && checkQuest()){ botArbiter.add("quest"); } },false); */ err_trace="loading"; ////-------------------------------------------------------------------------------------------------------------------------------- //[zoneNrF][QueNr][0]=product number, [1]=number to grow, [2]=number grown in loop modus, [3]=Behaviour (Field (default), Rack, Time(//TODO)), [4]=mode (1 time (default), repeat) //[zoneNrF][mill][0]=product number, [1]=number to grow, [2]=number grown in loop modus, [3]=Min([4]), [4]=Array([X]=Max recipes for product X) zoneList=explode(GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList"),"settings/zoneList",{}); if((typeof zoneList!="object")||(zoneList instanceof Array)){ zoneList={}; } // check consistence var bChanged=false; for(var fz in zoneList){ if(!zoneList.hasOwnProperty(fz)){ continue; } if(!(zoneList[fz] instanceof Array)){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+")","(zoneList) delete not array"); delete zoneList[fz]; bChanged=true; continue; } if(extendedListReg.test(fz)){ continue; } if(!unsafeData.ALL_SLOTS[fz]){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+")","(zoneList) delete bad queue"); delete zoneList[fz]; bChanged=true; continue; } if(unsafeData.zones.getBlock(fz)){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+")","(zoneList) delete blocked queue"); delete zoneList[fz]; bChanged=true; continue; } } // check completeness for(var fz in unsafeData.ALL_SLOTS){ if(!unsafeData.ALL_SLOTS.hasOwnProperty(fz)){ continue; } if(unsafeData.zones.getBlock(fz)){ continue; } if(!zoneList[fz]){ createZoneList(fz); } } if(bChanged){ GM_setValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList",implode(zoneList,"settings/zoneList")); } zoneSettings=explode(GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneSettings"),"settings/zoneSettings",{}); if((typeof zoneSettings!="object")||(zoneSettings instanceof Array)){ zoneSettings={}; } zoneToList=explode(GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneToList"),"settings/zoneToList",{}); if((typeof zoneToList!="object")||(zoneToList instanceof Array)){ zoneToList={}; } // check consistence var bChanged=false; for(var fz in zoneToList){ if(!zoneToList.hasOwnProperty(fz)){ continue; } if(!unsafeData.ALL_SLOTS[fz]){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+") zoneToList[fz]="+zoneToList[fz]+"("+getZoneType(zoneToList[fz])+")","(zoneToList) delete bad zone"); delete zoneToList[fz]; bChanged=true; continue; } if((!extendedListReg.test(zoneToList[fz]))&&(!unsafeData.ALL_SLOTS[zoneToList[fz]])){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+") zoneToList[fz]="+zoneToList[fz]+"("+getZoneType(zoneToList[fz])+")","(zoneToList) delete bad queue"); delete zoneToList[fz]; bChanged=true; continue; } if(unsafeData.zones.getBlock(fz)){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+") zoneToList[fz]="+zoneToList[fz]+"("+getZoneType(zoneToList[fz])+")","(zoneToList) delete blocked zone"); delete zoneToList[fz]; bChanged=true; continue; } if(getZoneType(fz)!=getZoneType(zoneToList[fz])){ GM_logInfo("do_main","","fz="+fz+"("+getZoneType(fz)+") zoneToList[fz]="+zoneToList[fz]+"("+getZoneType(zoneToList[fz])+")","(zoneToList) delete bad pairing"); delete zoneToList[fz]; bChanged=true; continue; } } if(bChanged){ GM_setValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneToList",implode(zoneToList,"settings/zoneToList")); } // check completeness for(var fz in unsafeData.ALL_SLOTS){ if(!unsafeData.ALL_SLOTS.hasOwnProperty(fz)){ continue; } if(unsafeData.zones.getBlock(fz)){ continue; } if(!zoneSettings[fz]){ zoneSettings[fz]={"repeat":false,"shuffle":false}; } if(!zoneToList[fz]){ setZoneListId(fz,fz); } } zoneList.sortObj(); zoneSettings.sortObj(); // TODO performance? "Error: Script terminated by timeout" zoneToList.sortObj(); if(settings.get("account","botUseWindmill")&&(unsafeWindow.currentuserlevel<8)){ settings.set("account","botUseWindmill",false); } emergencyPlants=explode(GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_emergencyPlants","[1,17]"),"settings/emergencyPlants",[1,17]); // Grain,Carrots //autoMillStorage: {[rId][0]=number bought, [1]=total number in zoneList[getZoneListId("windmill")], [2]=max number of recipes on products global Math.min([3][pId]), [3][pId]=max number of recipes for this products per products autoMillStorage=explode(GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_autoMillStorage","[]"),"settings/autoMillStorage",[]); modeOverViewFarms=explode(GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_modeOverViewFarms"),"settings/modeOverViewFarms",null); if(null==modeOverViewFarms){ modeOverViewFarms=[,true,true,true]; GM_setValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_modeOverViewFarms",implode(modeOverViewFarms,"settings/modeOverViewFarms")); } /* quest-bot needs review valQuestActivate=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valQuestActivate", false); valQuestActivateUntilNr=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valQuestActivateUntilNr", 0); if(valQuestActivateUntilNr < unsafeData.questData["farm"]["1"]["nr"]) valQuestActivate=false; valQuestSolving =GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valQuestSolving", false); valQuestSolvingUntilNr =GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valQuestSolvingUntilNr", 0); if(valQuestSolvingUntilNr < unsafeData.questData["farm"]["1"]["nr"]) valQuestSolving=false; valLodgeQuestSolving=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valLodgeQuestSolving", false); // TODO add valLodgeQuestSolving limits */ if(unsafeWindow.premium==1 || parseInt(top.document.getElementById("levelnum").innerHTML,10)<10){ settings.set("account","autoFeed",false); } //make generic queue Box err_trace="generic queue Box"; newdiv=createElement("div",{id:"divQueueBox",style:"position:absolute;top:240px;left:170px;width:380px;padding:2.5% 3%;background-color:#b8a789;z-index:102;display:none;"},$("garten_komplett")); createElement("img",{"src":GFX+"guild/help_back.jpg",style:"position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;"},newdiv); var newimg=createElement("img",{id:"divQueueBoxClose","class":"link queueBoxClose",style:"position:absolute;right:2px;top:2px;","title":getText("automat_QueClose"),"src":GFX+"close.jpg"},newdiv); newimg.addEventListener("click",function(event){if(this.id==event.target.id){ this.parentNode.style.display="none"; if($("divChooseBox").style.display="block" && $("divChooseBoxInner").getAttribute("zoneNrF")==$("divQueueBoxInner").getAttribute("zoneNrF")) click($("divChooseBoxClose")); $("divQueueBoxInner").setAttribute("zoneNrF",""); $("divQueueBoxInner").setAttribute("zoneNrL",""); $("divQueueBoxInner").innerHTML=""; }},false); createElement("div",{id:"divQueueBoxInner",style:""},newdiv); //make chooseBox err_trace="chooseBox"; newdiv=createElement("div",{id:"divChooseBox",style:"position:absolute;top:240px;left:170px;width:380px;padding:2.5% 3%;background-color:#b8a789;z-index:103;display:none;"},$("garten_komplett")); createElement("img",{"src":GFX+"guild/help_back.jpg",style:"position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;"},newdiv); var newimg=createElement("img",{id:"divChooseBoxClose","class":"link queueBoxClose",style:"position:absolute;right:2px;top:2px;","title":getText("automat_QueClose"),"src":GFX+"close.jpg"},newdiv); newimg.addEventListener("click",function(event){if(this.id==event.target.id){ this.parentNode.style.display="none"; $("divChooseBoxInner").setAttribute("zoneNrF",""); $("divChooseBoxInner").setAttribute("zoneNrL",""); $("divChooseBoxInner").innerHTML=""; }},false); createElement("div",{id:"divChooseBoxInner",style:""},newdiv); newdiv=null;newimg=null; GM_addStyle( ".rotate90 {-webkit-transform: rotate(90deg);-moz-transform: rotate(90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}\n"+ ".rotate180 {-webkit-transform: rotate(180deg);-moz-transform: rotate(180deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2)}\n"+ ".rotate270 {-webkit-transform: rotate(270deg);-moz-transform: rotate(270deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}"+ "#buildinginfo0, #buildinginfo1, #buildinginfo2, #buildinginfo3, #buildinginfo4, #buildinginfo5, #buildinginfo6 {top:52px; !important;}\n"+ ".divZoneIcon {position:absolute;bottom:0;right:5px;z-index:3;border:2px solid black;border-radius:10px;background-color:#000000;}\n"+ "#divAutomatIconContainer {position:absolute;top:125px;left:1001px;width:76px;margin:2px 0px;}\n"+ ".divWindmillIcon {position:relative;float:left;height:26px;width:26px;border:2px solid black;border-radius:10px;background-color:#CBAD85;margin:2px;padding:2px;}\n"+ ".divForestryIcon {position:relative;float:left;height:25px;width:25px;border:2px solid black;border-radius:10px;background-color:#FFFFFF;margin:2px;padding:2.5px;}\n"+ ".divFoodworldIcon {position:relative;float:left;height:25px;width:25px;border:2px solid black;border-radius:10px;background-color:#FFFFFF;margin:2px;padding:2.5px;}\n"+ ".fmm"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_windmill_26"]+") no-repeat scroll 0 0 transparent;height:24px;width:26px;position:absolute;}\n"+ ".fm"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_windmill_52"]+") no-repeat scroll 0 0 transparent;height:49px;width:52px;position:absolute;}\n"+ ".v"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_30"]+") no-repeat scroll 0 0 transparent;height:30px;width:30px;!IMPORTANT}\n"+ ".kp"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_15"]+") no-repeat scroll 0 0 transparent;height:15px;width:15px;!IMPORTANT}\n"+ ".f_symbol"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_25"]+") no-repeat scroll 0 0 transparent;height:25px;width:25px;!IMPORTANT}\n"+ ".f_m_symbol"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_15"]+") no-repeat scroll 0 0 transparent;height:15px;width:15px;!IMPORTANT}\n"+ ".pointstar {background:url('"+GFX+"points.gif') no-repeat scroll 2 2 transparent;height:15px;width:15px;}\n"+ ".tableTd1 {width:40%;display:table-cell;padding:0px 10px 0px 0px;white-space:nowrap;}\n"+ ".tableTd2 {width:60%;display:table-cell;padding:0px 10px 0px 0px;white-space:nowrap;}\n"+ ".tableSeperater {display:table-cell;padding:2px 0px 2px 0px;max-height:2px;}\n"+ ".tableSepBorder {border-top:1px solid black;max-height:1px;width:100%;}\n"+ ".divChooseFeedTime {float:right;color:black;font-weight:bold;}\n"+ ".divChooseFeed {float:left;margin:2px;width:280px;}\n"+ ".divChooseFeed div{float:left;}\n"+ ".divChooseFeedIcon {border-radius:10px;border:2px solid grey;}\n"+ ".divChooseFeedAmount {float:left;border:1px solid black;}\n"+ ".divChooseFeedAmount div{float:left;height:17px;border-left:1px solid grey;}\n"+ ".divChooseFeedAmount div:hover{background-color:red!important;}\n"+ ".divChooseFeedButton{float:right;text-align:center;margin-left:1px;width:25px;border:1px solid black;}\n"+ ".divChooseFeedButton:hover{color:black;background-color:blue;}\n"+ ".divChooseItem {float:left;margin:5px;border-radius:10px;border:2px solid grey;}\n"+ ".divChooseItem:hover {border:2px solid red;}\n"+ ".divMillChooseItem {float:left;position:relative;margin:5px;width:52px;height:52px;border-radius:7px;}\n"+ ".divMillChooseItem:hover {background-color:red;}\n"+ ".divMillChooseItemNumber {position:absolute;right:0px;bottom:0px;margin:3px;color:black;font-weight:bold;font-size:16px;}\n"+ ".divQueueItemListTitle {float:left;display:block;font-weight:bold;padding:0px 2px 1px 2px;}\n"+ ".divQueueItemListTitle2 {float:right;display:block;font-weight:bold;padding:0px 2px 1px 2px;}\n"+ ".divQueueItemListHeader {margin-bottom:3px;display:inline-block;}\n"+ ".divQueueItemListSelect {float:right;position:relative;display:block;font-weight:bold;padding:0px 2px 1px 2px;margin-bottom:5px;}\n"+ ".divQueueItemListBox {position:relative;display:block;border:1px solid black;margin:5px;min-height:45px;}\n"+ ".divQueueItemListChooseItem {position:relative;display:inline-block;margin:3px 5px 13px 5px;border-radius:10px;border:2px solid grey;}\n"+ ".divQueueItemListNumber {position:absolute;right:0px;bottom:-16px;font-weight:bold;font-size:12px;}\n"+ ".divQueueItemListFooter {position:relative;display:block;height:40px;}\n"+ ".divItem {float:left;margin:2px;border-radius:10px;border:2px solid grey;}\n"+ ".queueTitle {display:inline-block;font-weight:bold;padding:0px 2px 1px 2px;}\n"+ ".queueTime {float:right;display:block;font-weight:bold;padding:0px 2px 1px 2px;}\n"+ ".queueBoxerButton {float:left;display:inline-block;left:0px;height:"+(row7+2)+"px;display:block;padding:0px 2px 0px 1px;border-right:1px solid black;}\n"+ ".queueBoxerQueueBox {float:left;display:inline-block;white-space:nowrap;left:27px;overflow:hidden;}\n"+ ".queueItemBox {text-align:center;display:inline-block;position:relative;width:"+(queueItemBoxWidth-1)+"px;border-right:1px solid black;height:100%;}\n"+ ".queueButtonScrollLeft {float:left;display:block;margin-left:29px;background:url("+IMAGES["arrowleft"]+") no-repeat scroll left top transparent;height:17px;width:25px;}\n"+ ".queueButtonScrollRight {float:right;display:block;margin-right:3px;background:url("+IMAGES["arrowright"]+") no-repeat scroll left top transparent;height:17px;width:25px;}\n"+ ".queueBoxerButton .queueButtonScrollLeft {float:none;position:relative;margin:2px 1px 0px 0px;}\n"+ ".queueBoxerButton .queueButtonScrollRight {float:none;position:relative;margin:2px 1px 0px 0px;}\n"+ ".queueButtonRepeat,.queueButtonShuffle, .queueButtonRotate, .queueButtonAdd, .queueButtonAddAll, .queueButtonCopy{display:block;width:22px;height:16px;border:1px solid #6C441E;border-radius:5px;margin:2px 1px 0px 0px;background:#FFFFFF}\n"+ ".queueButtonRepeat {background: #FFFFFF no-repeat 2px 0px;}\n"+ ".queueButtonShuffle {background: #FFFFFF no-repeat 2px 0px;}\n"+ ".queueButtonRotate {background: #FFFFFF no-repeat 3px 0px;}\n"+ ".queueButtonAdd {background: url("+IMAGES["plus"]+") #FFFFFF no-repeat 4px 1px;}\n"+ ".queueButtonCopy {background: url("+IMAGES["copy"]+") #FFFFFF no-repeat 3px 2px;}\n"+ ".queueItemProduct {left:"+(col2-2)+"px;top:"+(row1)+"px;position:relative;border:2px solid grey;border-radius:10px;margin-left:2px;}\n"+ ".windmillItemProduct {left:"+(col2-2)+"px;top:"+(row1)+"px;position:relative;border:2px solid grey;border-radius:10px;margin-left:2px;background-color:#CBAD85;width:26px;height:24px;padding:3px 2px 3px 2px;}\n"+ ".forestryItemProduct {left:"+(col2-2)+"px;top:"+(row1)+"px;position:relative;border:2px solid grey;border-radius:10px;margin-left:2px;background-color:#FFFFFF;width:25px;height:25px;padding:2.5px;}\n"+ ".queueItemInput1, .queueItemInput2, .queueItemInput3{position:absolute;height:11px;background-color:transparent;color:black;text-align:right;}\n"+ ".queueItemInput1 {top:"+row3+"px;}\n"+ ".queueItemInput2 {top:"+row4+"px;}\n"+ ".queueItemInput3 {top:"+row6+"px;}\n"+ ".queueItemInputWidth1 {width:"+(col4-col1-2)+"px;left:"+col1+"px;}\n"+ ".queueItemInputWidth2 {width:"+(col4-col2-2)+"px;left:"+col2+"px;}\n"+ ".queueButtonMin {left:0px;background:url("+IMAGES["minus"]+") no-repeat 0px 0px #FFFFFF;} \n"+ ".queueButtonPlus {right:0px;background:url("+IMAGES["plus"]+") no-repeat 0px 0px #FFFFFF;} \n"+ ".queueItemButton {border:1px solid #6C441E;position:absolute;width:13px;height:13px;}\n"+ ".queueItemPlusButton {top:"+row1+"px;left:"+col1+"px;background:url("+IMAGES["plus"]+") no-repeat 0px 0px #FFFFFF;}\n"+ ".queueItemMinButton {top:"+row2+"px;left:"+col1+"px;background:url("+IMAGES["minus"]+") no-repeat 0px 0px #FFFFFF;}\n"+ ".queueItemUpButton {top:"+row5+"px;left:"+col1+"px;background:url("+IMAGES["singleArrowUp"]+") no-repeat 3px 2px #FFFFFF;}\n"+ ".queueItemDownButton {top:"+row5+"px;left:"+col3+"px;background:url("+IMAGES["singleArrowDown"]+") no-repeat 5px 2px #FFFFFF;}\n"+ ".queueItemBehaviourButton {top:"+row5+"px;left:"+col2+"px;background:no-repeat -1px -1px #FFFFFF;}\n"+ ".queueItemModeButton {top:"+row6+"px;left:"+col1+"px;background:no-repeat 0px 0px #FFFFFF;}\n"+ ".queueItemAddButton, .queueItemDeleteButton {display:block;position:absolute;width:15px;height:15px;}\n"+ ".queueItemAddButton {top:"+row3+"px;left:"+col1+"px;}\n"+ ".queueItemDeleteButton {top:"+row4+"px;left:"+col1+"px;}\n"+ ".queueItemText {text-align:center;vertical-align:middle;position:absolute;width:"+(col4-col2)+"px;color:black;font-family:Verdana,sans-serif}\n"+ ".queueItemTextInf {top:"+(row3-7)+"px;left:"+(col2)+"px;font-size:20px;font-weight:normal;}\n"+ ".queueItemTextStop {top:"+(row3)+"px;left:"+(col2-2)+"px;font-size:12px;font-weight:bold;}\n"+ ".queueItemTime {position:absolute;width:100%;overflow:hidden;text-align:center;border-top:1px solid black;margin:0px 1px;width:"+(queueItemBoxWidth-3)+"px;}\n"+ ".queueItemTime {top:"+(row7+2)+"px;}\n"+ ".hoverBgPurple:hover{background-color:#ff00ff!important;}\n"+ ".hoverBgWhite:hover{background-color:#ffffff!important;}\n"+ ".queueBoxSpacer {float:left;display:block;width:100%;padding:2px 0px 2px 0px;}\n"+ ".queueBox {z-index:5;position:absolute;text-align:center;display:none;background-color: #b8a789;padding: 0px 0px 3px 0px;position:absolute;border:2px solid black;border-radius:10px;color:black;}\n"+ ".queueBoxerGeneral {width:100%;overflow:hidden;overflow-y:auto;border-top:1px solid black;border-bottom:1px solid black}\n"+ ".queueBoxerGeneral {max-height:280px;}\n"+ ".queueBoxClose {float:right;top:3px;width:15px;height:15px;margin-right:1px;padding:2px 2px 2px 2px;}\n"+ ".fieldlinks {height:25px;right:0;position:absolute;top:0;}\n"+ ".fieldlinkitem1,.fieldlinkitem2,.fieldlinkitem3,.fieldlinkitemactivate1,.fieldlinkitemactivate2,.fieldlinkitemactivate3{float:right;color:#FFFFFF;font-size:16px;font-weight:bold;height:29px;margin-left:5px;padding-top:2px;text-align:center;height:34px;width:54px;}\n"+ ".fieldlinkitem1{background:url("+IMAGES["zone_off_1"]+") no-repeat scroll 2px 0px transparent;}\n"+ ".fieldlinkitemactivate1{background:url("+IMAGES["zone_on_1"]+") no-repeat scroll left top transparent;}\n"+ ".fieldlinkitem2{background:url("+IMAGES["zone_off_2"]+") no-repeat scroll 2px 0px transparent;}\n"+ ".fieldlinkitemactivate2{background:url("+IMAGES["zone_on_2"]+") no-repeat scroll left top transparent;}\n"+ ".fieldlinkitem3 {background:url("+IMAGES["zone_off_3"]+") no-repeat scroll 2px 0px transparent;}\n"+ ".fieldlinkitemactivate3{background:url("+IMAGES["zone_on_3"]+") no-repeat scroll left top transparent;}\n"+ ".lineZoneItem {border-radius:3px;margin:1px 0px 1px 1px;display:inline-block;height:15px;overflow:hidden;}\n"+ ".lineZoneItem:hover {background-color:red;}\n"+ ".lineZoneTypeB1 {background-color:#800000}\n"+ ".lineZoneTypeB2 {background-color:#808080}\n"+ ".lineZoneTypeB3 {background-color:#808000}\n"+ ".lineZoneTypeBmill {background-color:#DEDE16}\n"+ ".lineZoneTypeL1 {background-color:#993300}\n"+ ".lineZoneTypeL2 {background-color:#C0C0C0}\n"+ ".lineZoneTypeL3 {background-color:#B08000}\n"+ ".lineZoneTypeLmill {background-color:#C8C814}\n"+ "#lineZonemill {height:28px;}\n"+ ".lineZone {display:block;white-space:nowrap;text-align:left;height:17px;width:100%;background-color:#333300;}\n"+ ".ernte13 {position:absolute;top:98px;left:145px;width:30px;height:30px;border:2px solid black;border-radius:10px;}\n"+ ".ernte14 {position:absolute;top:98px;left:210px;width:30px;height:30px;border:2px solid black;border-radius:10px;}\n"+ ".ernte15 {position:absolute;top:98px;left:415px;width:30px;height:30px;border:2px solid black;border-radius:10px;}\n"+ ".ernte16 {position:absolute;top:98px;left:480px;width:30px;height:30px;border:2px solid black;border-radius:10px;}\n"+ ".r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8, .r9, .r10, .r11, .r12, .r13, .r14, .r15, .r16, .r17, .r18, .r19, .r20, .r21 {background:url("+IMAGES["powerups"]+") no-repeat scroll left top transparent;height: 30px;width: 30px;position:relative;}\n"+ ".r2, .r7, .r8, .r9, .r10, .r11, .r12, .r13, .r19, .r20 {background-position:0px -0.5px;}\n"+ ".r3, .r5, .r15, .r18 {background-position:-31px -0.5px;}\n"+ ".r1, .r4, .r6, .r14, .r16, .r17, .r21 {background-position:-61px -0.5px;}\n"+ "" ); //const row1=2;const row2=21;const row3=38;const row4=55;const row5=72;const row6=89;const row7=108; //const col1=2;const col2=21;const col3=40;const col4=55; // createElement("div",{"id":"divAutomatIconContainer"},$("divGame").children[0]); drawButtons(); err_trace="listener gameFieldOpened"; document.addEventListener("gameFieldOpened",function(){ // field open try{ if(settings.get("account","autoPlant")&&(!$("autoplantbutton"))){ //autoFarmPlant button if((unsafeWindow.premium!=1)||(unsafeWindow.currentuserlevel 0){ if(!$("cropWeed"+product)){ newspan=createElement("div",{id:"cropWeed"+product,"class":"link ernte"+product+ " v"+product},$("gardenmaincontainer")); newspan.addEventListener("click",function(){ try{ if(this.getAttribute("run")=="false"){ this.setAttribute("run",true); bot.deactivate(); var product=this.getAttribute("product"); GM_logInfo("showCropWeed","","","Autoclear: "+unsafeData.prodName[0][product],5,"#880808"); this.style.border="2px solid red"; autoCropUndefined(explode(this.getAttribute("velds"),"showCropWeed/click/velds"), product); }else{ this.setAttribute("run",false); this.style.border=""; GM_logInfo("showCropWeed","","","Exiting Autoclear: stopping",5,"#880808"); } }catch(err){GM_logError("showCropWeed Icon Click ","","",err);} },false); newspan.addEventListener("mouseover",function(event){ var product=this.getAttribute("product"); var amount=explode(this.getAttribute("velds"),"showCropWeed/mouseover/velds").length; toolTip.show(event,getText("automat_removeAllWeed").replace("%PROD%",unsafeData.prodName[0][product]).replace("%TCOST%",moneyFormat(amount*CROPCOST[product])).replace("%AMOUNT%",amount).replace("%COST%",moneyFormat(CROPCOST[product]))); },false); }else{ newspan=$("cropWeed"+product); } newspan.style.border=""; newspan.setAttribute("run",false); newspan.setAttribute("product",product); newspan.setAttribute("velds",implode(velds[product],"showCropWeed/velds")); }else if($("cropWeed"+product)){ removeElement($("cropWeed"+product)); } } newspan=null;prods=null;product=null; $("gardenclearer").style.display="none"; }catch(err){GM_logError("showCropWeed ","","",err);} } function autoCropUndefined(felds,product){ GM_logInfo("autoCropUndefined","felds="+implode(felds,"autoCropUndefined/felds")+" product="+product,"handled.zoneNr="+handled.zoneNr,"Begin",1); if(unsafeData.money < CROPCOST[product]){ GM_logInfo("autoCropUndefined","felds="+implode(felds,"autoCropUndefined/felds")+" product="+product,"handled.zoneNr="+handled.zoneNr,"Exiting Autoclear: not enough money",5,"#880808"); showCropWeed(); }else if($("cropWeed"+product).getAttribute("run")=="true" && felds.length > 0){ GM_logInfo("autoCropUndefined","felds="+implode(felds,"autoCropUndefined/felds")+" product="+product,"handled.zoneNr="+handled.zoneNr,"Autoclear: "+ felds.length +"x "+unsafeData.prodName[0][product],5,"#880808"); if(unsafeWindow.garten_prod[felds[0]]==product){ //unsafeWindow.raeumeFeld(handled.zoneNr,felds[0]); $("globalbox").addEventListener("DOMAttrModified",function(){ if(this.style.display=="block"){ document.addEventListener("gameFieldDemolish",function(felds,product){ return function(){ try{ document.removeEventListener("gameFieldDemolish",arguments.callee,false); felds.shift(); $("cropWeed"+product).setAttribute("velds",implode(felds,"autoCropUndefined/velds")); if($("fundpopup").style.display=="block"){ click($("fundpopup").firstElementChild); var cell; GM_logInfo("autoCropUndefined","felds="+implode(felds,"autoCropUndefined/felds")+" product="+product,"handled.zoneNr="+handled.zoneNr,"Found Money: "+((cell=$("fundpopupbetrag"))?cell.innerHTML:""),10,"green"); cell=null; } toolTip.adjust($("cropWeed"+product)); window.setTimeout(autoCropUndefined,settings.getPause(),felds,product); }catch(err){GM_logError("autoCropUndefined/gameFieldDemolish","felds="+felds+" product="+product,"",err);} } }(felds,product),false); click($("globalbox").getElementsByClassName("link")[0]); this.removeEventListener("DOMAttrModified",arguments.callee,false); } },false); click($("f"+felds[0])); } }else if(felds.length<=0){ felds=null;product=null; GM_logInfo("autoCropUndefined","felds="+implode(felds,"autoCropUndefined/felds")+" product="+product,"handled.zoneNr="+handled.zoneNr,"Exiting Autoclear: Done",5,"#880808"); showCropWeed(); }else{ showCropWeed(); } } err_trace="listener gameOpenStable"; document.addEventListener("gameOpenStable",function(){ // stable open try{ if(settings.get("account","autoFeed")){ //autoFarmStable button var zoneNrF=getFarmZone(unsafeWindow.currentposition); var v=getZoneType(zoneNrF); for(var w=0;w=0;i--){ zoneNrF=unsafeData.ALL_ZONES["farm"][i]; if((!unsafeData.zones.getBlock(zoneNrF))&&(getBuildingTyp(zoneNrF)!=0)){ farmNR=Math.floor((unsafeData.ALL_ZONES["farm"][i]-1)/6)+1; zoneNr=zoneNrF-6*(farmNR-1); drawAutomatIcon(zoneNrF,zoneNrF+(unsafeData.zones.isMultiSlot(zoneNrF)?".1":""),$("farm"+farmNR+"_pos"+zoneNr),""); } } }catch(err){GM_logError("drawFarmIcons","","",err);} } document.addEventListener("gameFarmLoaded",drawFarmIcons,false); function updateFarmIcons(){ try{ var zoneNrF; for(var i=unsafeData.ALL_ZONES["farm"].length-1;i>=0;i--){ zoneNrF=unsafeData.ALL_ZONES["farm"][i]; if((!unsafeData.zones.getBlock(zoneNrF))&&(getBuildingTyp(zoneNrF)!=0)){ updateQueueBox(zoneNrF+(unsafeData.zones.isMultiSlot(zoneNrF)?".1":"")); } } }catch(err){GM_logError("updateFarmIcons","","",err);} } document.addEventListener("gameFarmOpened",updateFarmIcons,false); drawFarmIcons(); err_trace="devMode"; function viewDev(mode){ // GM_log("viewDev: " + mode); if(mode!=""){ viewDevMode=explode(GM_getValue("viewDevMode",implode(["",""],"viewDev/viewDevMode"),"viewDev/viewDevMode",["",""])); viewDevMode=viewDevMode.slice(0,1); viewDevMode.unshift(mode); GM_setValue2("viewDevMode",implode(viewDevMode,"viewDev/viewDevMode")); }else{ viewDevMode=["",""]; GM_setValue2("viewDevMode",implode(["",""],"viewDev/viewDevMode")); try{ window.clearInterval(autoDevRefresh); autoDevRefresh=null; }catch(err){ autoDevRefresh=null; } } showDevMode(); } function showDevMode(){ for(var i=0;i" + print_r(eval(viewDevMode[i])); break; case "": $("divPrintArray"+i).style.display="none"; $("divPrintArray"+i).innerHTML=""; break; default: $("divPrintArray"+i).style.display="block"; $("divPrintArray"+i).innerHTML=viewDevMode[i]+"
" + print_r(eval("unsafeWindow."+viewDevMode[i])); // GM_log("unsafeWindow."+viewDevMode[i]+"="+implode(eval("unsafeWindow."+viewDevMode[i]))); break; } } if(!autoDevRefresh){ autoDevRefresh=window.setInterval(function (){ showDevMode(); },1000); } } if(DEVMODE){ newdiv=createElement("div",{id:"divPrintArray0",style:"height:100%;padding:4px;margin-bottom:30px;color:black;background-color:black;top:10px;float:left;border:1px solid red;"}); ALL.insertBefore(newdiv,$("uptoolbar")); newdiv=createElement("div",{id:"divPrintArray1",style:"height:100%;padding:4px;margin-bottom:30px;color:black;background-color:black;top:10px;float:right;border:1px solid red;"}); ALL.insertBefore(newdiv,$("uptoolbar")); GM_registerMenuCommand("View none", function(){viewDev("");}); //GM_registerMenuCommand("Refresh", function(){devRefresh("manual");}); //GM_registerMenuCommand("Auto Refresh", function(){devRefresh("auto");}); MenuCommand.sort(); for(i in MenuCommand){ if(!MenuCommand.hasOwnProperty(i)){ continue; } GM_registerMenuCommand("View "+MenuCommand[i], function(i){return function(){viewDev(MenuCommand[i]);};}(i)); } document.getElementsByTagName("body")[0].style.overflow="auto"; var autoDevRefresh=null; var viewDevMode=explode(GM_getValue("viewDevMode",implode(["",""],"do_main/viewDevMode")),"do_main/viewDevMode",["",""]); showDevMode(); } document.addEventListener("gameReallocateBuilding",function(){ GM_logInfo("gameReallocateBuilding","","","Begin",1); try{ var building1=unsafeData.reallocateBuildingSet[0]; var building2=unsafeData.reallocateBuildingSet[1]; var zoneL1 = getZoneListId(building1); var zoneL2 = getZoneListId(building2); GM_logInfo("gameReallocateBuilding","","building1="+building1+" building2="+building2,"",0); var help; help=zoneList[zoneL1].clone(); zoneList[zoneL1]=zoneList[zoneL2].clone(); zoneList[zoneL2]=help; GM_setValueCache(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneList",implode(zoneList,"gameReallocateBuilding/zoneList")); help=zoneSettings[zoneL1].clone(); zoneSettings[zoneL1]=zoneSettings[zoneL2].clone(); zoneSettings[zoneL2]=help; GM_setValueCache(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneSettings",implode(zoneSettings,"gameReallocateBuilding/zoneSettings")); help=zoneToList[building1].clone(); zoneToList[building1]=zoneToList[building2].clone(); zoneToList[building2]=help; GM_setValueCache(COUNTRY+"_"+SERVER+"_"+USERNAME+"_zoneToList",implode(zoneToList,"gameReallocateBuilding/zoneToList")); // GM_log("End Automat gameReallocateBuilding: " + building1 + " : " + building2); }catch(err){GM_logError("gameReallocateBuilding ","","",err);} GM_logInfo("gameReallocateBuilding","","","End",1); },false); document.addEventListener("gameUpdateRack",function(){ // reCalculateWindmill(); },false); // get dealer items document.addEventListener("gameUpdateFormuladealerRack",function(){ // Bought a recipe try{ var help=new Object(); for(var v=0; v<$("formuladealerrackinner").childNodes.length;v++){ if($("formuladealerrackinner").childNodes[v].childNodes.length > 0){ rId=parseInt($("formuladealerrackinner").childNodes[v].childNodes[0].getAttribute("class").replace("fmm",""),10); rNum=parseInt($("formuladealerrackinner").childNodes[v].childNodes[1].innerHTML,10); if(!!rId && !!rNum) help[rId]=[rNum,0,NEVER]; } } autoMillStorage=help.clone(); help=null; reFillQueueBox("windmill","windmill",0); }catch(err){GM_logError("eventListener:gameUpdateFormuladealerRack ","","",err);} },false); document.addEventListener("gameOpenWindmill",function(){ // Windmill try{ // var help=new Object(); // for(var v=0; v<$("windmillformula").childNodes.length;v++){ // if($("windmillformula").childNodes[v].childNodes.length > 0){ // rId=parseInt($("windmillformula").childNodes[v].childNodes[0].getAttribute("class").replace("fm",""),10); // rNum=parseInt($("windmillformula").childNodes[v].childNodes[1].innerHTML,10); // if(!!rId && !!rNum) help[rId]=[rNum,0,NEVER]; // } // } // autoMillStorage=help.clone(); // help=null; for(var slot=1;slot<=2;slot++){ var zoneNrS="windmill."+slot; if(!unsafeData.zones.getBlock(zoneNrS)){ drawAutomatIcon(zoneNrS,zoneNrS,$("windmill_slot"+slot),"top:135px;"); } } reFillQueueBox("windmill","windmill",0); }catch(err){GM_logError("eventListener:gameOpenWindmill ","","",err);} },false); // Farmersmarket err_trace="listener gameFarmersmarketOpened"; document.addEventListener("gameFarmersmarketOpened",function(){ try{ // Automat icons for(var v=1;v<=6;v++){ if(!unsafeData.zones.getBlock("farmersmarket-"+v)){ drawAutomatIcon("farmersmarket-"+v,"farmersmarket-"+v+(unsafeData.zones.isMultiSlot("farmersmarket-"+v)?".1":""),$("farmersmarket_pos"+v),"position:absolute;right:0;bottom:0;"); } } }catch(err){GM_logError("eventListener:gameFarmersmarketOpened ","","",err);} },false); //Bot Start-Stop-Button err_trace="Start-Stop-Button"; newdiv=createElement("div",{"id":"divAutomatButtonBot","class":"link beraterButtonIcon hoverBgGreen"},$("divBeraterButtons")); createElement("img",{"class":"rotating","src":IMAGES["gearFlat"],"style":"position:relative;top:2px;left:0;width:26px;height:26px;"},newdiv); newdiv.addEventListener("click",function(){ if(bot.isActive()){ bot.deactivate(); }else{ bot.activate(); } },false); newdiv=createElement("div",{"id":"divBotInfo","class":"link blackbox","style":"position:fixed;bottom:0px;left:0px;z-index:999;"},ALL); newdiv.addEventListener("mouseover",function(event){ toolTip.show(event,"Click to break Automat business"); },false); newdiv.addEventListener("click",bot.end,false); bot.init(); newdiv=createElement("div",{"id":"divCloseWindowLayer","class":"link ","style":"opacity:0.7;position:absolute;top:20px;z-index:101;display:none;background:black;height:84px;left:210px;width:770px;"},$("headercontainer")); newdiv=createElement("div",{"id":"divCloseWindow","class":"link blackbox","style":"width:250px;display:none;text-align:center;padding:10px;border-radius:5px 5px 5px 5px;position:relative;z-index:101;top:30px;left:470px;"},$("headercontainer")); newdiv.addEventListener("mouseover",function(event){ toolTip.show(event,"Restart closing timer"); },false); newdiv.addEventListener("click",function(){ stopCloseWindowTimer(); },false); /* link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"botArbiter.check"); link.addEventListener("click",function(){botArbiter.check();},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"autoForestryCrop"); link.addEventListener("click",function(){autoForestryCrop(1);},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"test 3"); link.addEventListener("click",function(){GM_log("test :" +reSortQueue(4,false));},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),getText("options")); link.addEventListener("click",function(){ document.addEventListener("nodeInsertedInfoPanelLAutomat",function(){ click($("infoPanelLAutomat")); document.removeEventListener("nodeInsertedInfoPanelLAutomat",arguments.callee,false); },false); click($("berateroptionen")); },false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),getText("automat_titleQueue")); link.addEventListener("click",function(){ document.addEventListener("nodeInsertedInfoPanelLAutomat",function(){ click($("infoPanelZoneList")); document.removeEventListener("nodeInsertedInfoPanelLAutomat",arguments.callee,false); },false); click($("berateroptionen")); },false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"test"); link.addEventListener("click",function(){ click($("multiframe").contentDocument.getElementsByClassName("link2")[0].firstElementChild); },false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"Q active"); link.addEventListener("click",function(){raiseEvent("gameQuestNewAvailable");},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"Q solve"); link.addEventListener("click",function(){raiseEvent("gameQuestSolvable");},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"PowerUp"); link.addEventListener("click",function(){botArbiter.add("activatePowerUp");},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"DailyLot"); link.addEventListener("click",function(){raiseEvent("gameLotteryDailyLotAvailable");},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"Windmill"); link.addEventListener("click",function(){raiseEvent("gameWindmillReady");},false); link=createElement("button",{type:"button","class":"link2",style:"margin-left:3px;border:2px solid red;"},$("divBeraterButtons"),"Zone Ready"); link.addEventListener("click",function(){raiseEvent("gameZoneReady");},false); */ document.addEventListener("gameSessionEnds",function(){ botArbiter.add("sessionEnds"); },false); document.addEventListener("gameLotteryDailyLotAvailable",function(){ if(settings.get("account","botUseLottery")&&settings.get("account","lotteryActivate")){ botArbiter.add("lottery"); } },false); document.addEventListener("gameOtherAccReady",function(){ botArbiter.add("otherAccReady"); },false); document.addEventListener("gameFarmiNew",function(){ if(settings.get("account","botUseFarmi")){ checkFarmi(1); } },false); document.addEventListener("gameFarmOpened",function(){ if(settings.get("account","botUseFarmi")){ checkFarmi(1); } },false); } catch(err){GM_logError("do_main","","err_trace="+err_trace,err);} } function do_hilfe(){ GM_addStyle( ".queueButtonAddAll {display:inline-block;width:22px;height:16px;border:1px solid #6C441E;border-radius:5px;margin:0px 1px 0px 1px;}\n"+ ".queueButtonAddAll {background: url("+IMAGES["reload_all"]+") #FFFFFF no-repeat 1px -1px;width:28px;}\n"+ ".kp"+PRODSTOP+" {background:url("+IMAGES["PRODSTOP_15"]+") no-repeat scroll 0 0 transparent;height:15px;width:15px;!IMPORTANT}" ); var newdiv=createElement("div",{},$("helpmenuLinks")); var newa=createElement("a",{"class":"list_header","href":"#"},newdiv,getText("automat")); newa.addEventListener("click",function(){ try{ var div,help,i=0; var container=$("helpbody"); container.innerHTML=""; div=createElement("div",{"class":"tnormal"},container); createElement("b",{},div,getText("automat")); while(help=getText("automat_help_"+(i++))){ div=createElement("div",{"class":"tmenu"},container); if(help[0]){ createElement("b",{},div,help[0]); } if(help[1]){ createElement("p",{},div,help[1]); } } container=null;div=null; }catch(err){GM_logError("help.click","","",err);} },false); newdiv=null;newa=null; } function manageVariables(){ // 1: historic data - not reproducible! // 2: collectable data, temporary data // 3: options, settings const variableInfo = { "GLOBAL":{"automatChangedata":["Data version",1], "automatChangelogShownVersion":["",3], "devmode":["Developer mode",3], "devmode_function":["Developer mode",3], "settings":["Settings",3]}, "COUNTRY":{"automatChangedata":["Data version",1], "settings":["Settings",3]}, "SERVER":{"automatChangedata":["Data version",1], "settings":["Settings",3]}, "USER":{"automatChangedata":["Data version",1], "autoMillStorage":["Mill data",3], "emergencyPlants":["Emergency plants",3], "lotteryCollectForPrize":["Lottery collection data",3], "raisedEvents":["Stack of raised event",2], "settings":["Settings",3], "valDevRefresh":["Developer",2], "valQuestActivate":["Option",3], "valQuestActivateUntilNr":["Option",3], "valQuestSolving":["Option",3], "valQuestSolvingUntilNr":["Option",3], "viewDevMode":["Option",3], "modeOverViewFarms":["Selection Automat-overview",3], "zoneList":["Zone automat settings",3], "zoneSettings":["Zone modes",3], "zoneToList":["Zone pairing",3]} }; function buildManageVariables(){ var container=$("divManageVariablesInner"); container.innerHTML=""; var containerPart = createElement("div",{"style":"height:10%;"},container); createElement("div",{"style":"font-weight:bold;"},containerPart,"Variable Management "+getText("automat")); var newinput=createElement("select",{"class":"link"},containerPart); createElement("option",{"value":"GLOBAL"},newinput,"GLOBAL"); createElement("option",{"value":"ALL"},newinput,"ALL"); createElement("option",{"value":"UNKNOWN"},newinput,"UNKNOWN"); createElement("option",{"value":"USELESS"},newinput,"USELESS"); newinput.addEventListener("click",function(){ buildExportTable(this.value); },false); var variables = {}; variables["GLOBAL"] = []; var help = cloneInto(GM_listValues(), unsafeWindow); help.sort(); var help2; for(var v=0;v0){ if(variables.length>10){ str += "\n..." } if(confirm(str)){ for (var v=0;v0){ prompt("Copy this string to a text-file", implode(variables,"buildManageVariables/variables")); } else { alert("Nothing selected"); } },false); newinput=createElement("button",{"class":"link","style":"margin-left:20px;"},containerPart,"Import storage string"); newinput.addEventListener("click",function(){ var data = prompt("Enter storage string"); if(data){ try{ data = explode(data,"buildImportTable/storageString"); buildImportTable(data); }catch(err){ alert("Sorry. Can't read the entered string.\n"+err); } } },false); newinput=createElement("button",{"class":"link","style":"margin-left:20px;"},containerPart,"Import OLD storage string"); newinput.addEventListener("click",function(){ var data = prompt("Enter storage string"); var user = prompt("Enter prefix like 'de_7_Johnny_' if needed"); if(data){ try{ data=data.split("::"); for(var v=0;vb[1])-(a[1]b[0])-(a[0]100){ help[v][4] = help[v][4].substr(0,97)+"..."; } } newtr=createElement("tr",{},newtable); newtd = createElement("td",{},newtr); createElement("input",{"type":"checkbox","class":"link","checked":false},newtd); createElement("td",{},newtr,help[v][0]); createElement("td",{},newtr,help[v][1]); createElement("td",{},newtr,help[v][3]); if(variableInfo[help[v][2]][help[v][1]]){ createElement("td",{},newtr,variableInfo[help[v][2]][help[v][1]][0]); createElement("td",{},newtr,[,"historic data - not reproducible!","collectable data","options, settings","temporary data","useless, old data"][variableInfo[help[v][2]][help[v][1]][1]]); } else { createElement("td",{},newtr,"unknown"); createElement("td",{},newtr,""); } createElement("td",{},newtr,help[v][4]); } container=null;newtable=null;newtr=null;newtd=null; } buildExportTable("GLOBAL"); function buildImportTable(data){ var container=$("divManageVariablesInner"); container.children[1].innerHTML = ""; var newinput=createElement("button",{"class":"link"},container.children[1],"SAVE !"); newinput.addEventListener("click",function(){ var container=$("divManageVariablesInner"); var rows = container.children[1].getElementsByTagName("tr"); var variables = []; var acc, varname; for (var v=0;v100){ createElement("td",{},newtr,data[v][3].substr(0,97)+"..."); } else { createElement("td",{},newtr,data[v][3]); } } container=null;newtable=null;newtr=null;newtd=null;newinput=null; } container=null;containerPart=null;newselect=null; newdiv=null;newinput=null; } if($("divManageVariables")){ return false; } var newdiv=createElement("div",{"id":"divManageVariables","mode":"","style":"position:fixed;top:0;left:0;width:100%;height:100%;background-color:#b8a789;z-index:1000;display:block;"},ALL); createElement("img",{"src":GFX+"guild/help_back.jpg","style":"position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;"},newdiv); createElement("div",{"id":"divManageVariablesInner","class":"tnormal","style":"position:absolute;top:6%;left:5%;width:90%;height:88%;overflow:auto;"},newdiv); var newimg=createElement("img",{"id":"infoPanelClose","class":"link","src":GFX+"close.jpg","style":"position:absolute;top:8px;right:8px;width:20px;height:20px;"},newdiv); newimg.addEventListener("click",function(){ removeElement(this.parentNode); },false); newdiv = null;newimg=null; buildManageVariables(); } function do_login(){ var cell = $("divBeraterButtons"); if(cell){ cell=createElement("div",{"class":"link beraterButtonIcon hoverBgBlue","mouseOverText":getText("manageVariables")+" ("+getText("automat")+")"},cell); createElement("img",{"src":IMAGES["floppyDisk"],"style":"position:relative;top:3px;left:3px;;width:24px;height:24px;"},cell); cell.addEventListener("click",manageVariables,false); } cell=null; } function do_relogin(time){ var newdiv=$("automatDoRelogin"); if(document.getElementsByTagName("div").length>10){ if(newdiv){ removeElement(newdiv); } }else{ if(time>0){ if(!newdiv){ newdiv=createElement("div",{"id":"automatDoRelogin","class":"alertbubble tbig link"},document.body); } newdiv.innerHTML="Relogin in "+getTimeStr(time); newdiv=null; window.setTimeout(do_relogin,1000,--time); }else if(GAMEPAGES[top.unsafeData.COUNTRY]){ location.href="http://www."+GAMEPAGES[top.unsafeData.COUNTRY]; } } newdiv=null; } function start_script(){ try{ COUNTRY=top.unsafeData.COUNTRY; LANGUAGE=top.unsafeData.LANGUAGE; PAGE=location.pathname.replace(/^\//,"").replace(/\.php.*$/,""); // ************************************************** // ChangeData Global // -->> add var to delete also to resetVariables var err_trace="ChangeData Global"; var help,help2; try{ var changedata = GM_getValue("automatChangedata",0); switch(changedata){ case 0:{ help=cloneInto(GM_listValues(), unsafeWindow); for(var v=help.length-1;v>=0;v--){ if(help2=/^([a-z]{2})(_.*)$/.exec(help[v])){ GM_setValue(help2[1].toUpperCase()+help2[2],GM_getValue(help[v])); GM_deleteValue(help[v]); } } } } if(changedata<1){ GM_setValue("automatChangedata",1); } }catch(err){GM_logError("changedata global","","",err);} // ************************************************** // ChangeData Country err_trace="ChangeData Country"; try{ var changedata = GM_getValue(COUNTRY+"_automatChangedata",0); switch(changedata){ case 0:{ help=settings.get("country","pauseShort"); if(help2=GM_getValue(COUNTRY+"_tmin")){ help[0]=help2; GM_deleteValue(COUNTRY+"_tmin"); } if(help2=GM_getValue(COUNTRY+"_tmax")){ help[1]=help2; GM_deleteValue(COUNTRY+"_tmax"); } settings.set("country","pauseShort",help); help=settings.get("country","pause"); if(help2=GM_getValue(COUNTRY+"_tmin2")){ help[0]=help2; GM_deleteValue(COUNTRY+"_tmin2"); } if(help2=GM_getValue(COUNTRY+"_tmax2")){ help[1]=help2; GM_deleteValue(COUNTRY+"_tmax2"); } settings.set("country","pause",help); } } if(changedata<1){ GM_setValue(COUNTRY+"_automatChangedata",1); } }catch(err){GM_logError("changedata country","","",err);} // ************************************************** // Multilingual err_trace="text"; text=top.unsafeData.text; if(undefined===text["de"]["automat"]){ text["de"]["automat"] = "Automat"; text["de"]["automat_planting"] = "Pflanze..."; text["de"]["automat_waiting"] = "Warte..."; text["de"]["automat_watering"] = "Gieße..."; text["de"]["automat_feeding"] = "Füttere..."; text["de"]["automat_automatPlanting"] = "Pflanz-Automat"; text["de"]["automat_automatFeeding"] = "Futter-Automat"; text["de"]["automat_automatFactory"] = "Fabrik-Automat"; text["de"]["automat_automatMegafield"]="Güterhof-Automat"; text["de"]["automat_automatWindmill"] = "Mühlen-Automat"; text["de"]["automat_botStart"] = "Automat-Bot starten"; text["de"]["automat_botStop"] = "Automat-Bot stoppen"; text["de"]["automat_settings_botErrorBehaviour"] = "Verhalten des Automaten im Fall eines Fehlers"; text["de"]["automat_settings_pageReload"] = "Neu Laden der Seite"; text["de"]["automat_settings_botRestart"] = "Neu Starten des Bots"; text["de"]["automat_zonePairing"] = "Zone pairing"; text["de"]["automat_debugInfo"] = "Debug Info"; text["de"]["automat_windmill"] = "windmill"; text["de"]["automat_timing"] = "Timing"; text["de"]["automat_general"] = "General"; text["de"]["automat_development"] = "Development"; text["de"]["automat_arrivedInFarm"] = "Farm erreicht"; text["de"]["automat_changeToFarmX"] = "Gehe nach Farm %1%"; text["de"]["automat_changingToX"] = "Gehe nach %1%"; text["de"]["automat_closingFieldContainer"] = "Schließe Acker"; text["de"]["automat_closingFactoryContainer"] = "Schließe Fabrik"; text["de"]["automat_closingStableContainer"] = "Schließe Stall"; text["de"]["automat_openingZoneX"] = "Öffne Zone %1%"; text["de"]["automat_zoneXIsOpened"] = "Zone %1% ist geöffnet"; text["de"]["automat_confirmChangelogVersion"]="Du hast eine neue Version des Automat-Scriptes installiert.
Die Version %1% beinhaltet folgende Änderungen:"; text["de"]["automat_maximumStockCapacityReached"]="Maximale Lagerkapazität wird erreicht werden."; text["de"]["automat_nothingToCrop"]="Nichts zum Ernten."; text["de"]["automat_cropWaitingInX"]="Warte auf Ernten in %1%."; text["de"]["automat_plantingAtX"]="Pflanze auf %1%."; text["de"]["automat_plantingNoFreeField"]="Kein freies Feld zum Pflanzen."; text["de"]["automat_plantingSetX"]="Wähle Pflanze \"%1%\"."; text["de"]["automat_queueItemAmountDecreased"]="Queue-Eintrag Anzahl verringert."; text["de"]["automat_queueItemDeleted"]="Queue-Eintrag gelöscht."; text["de"]["automat_responseWaiting"]="Warte auf Antwort."; text["de"]["automat_stopAdding"]="Füge \"Stop\" in Queue ein."; text["de"]["automat_tourStarting"]="Starte Tour."; text["de"]["automat_vehicleNotKnown"]="Kein Fahrzeug bekannt."; text["de"]["automat_vehicleXNotAvailable"]="Fahrzeug \"%1%\" nicht verfügbar."; text["de"]["automat_vehicleXBuying"]="Kaufe Fahrzeug \"%1%\"."; text["de"]["automat_vehicleXSelected"]="Fahrzeug ist ausgewählt."; text["de"]["automat_shouldUpdateAdviser"] = "Du solltest das Berater-Script aktualisieren!
Der Automat wird nicht ordnungsgemäß arbeiten."; text["de"]["automat_settings_autoPlant"] = "Soll der Pflanz-Automat angezeigt werden?"; text["de"]["automat_settings_autoWater"] = "Sollen die Äcker gegossen werden?"; text["de"]["automat_settings_autoFeed"] = "Soll der Futter-Automat angezeigt werden?"; text["de"]["automat_settings_botUse"] = "Verwende Bot"; text["de"]["automat_settings_disableCropFields"]="Block the cropping of sleeping fields."; text["de"]["automat_settings_pauseShortMin"] = "Minimale Klickzeit der Automaten"; text["de"]["automat_settings_pauseShortMax"] = "Maximale Klickzeit der Automaten"; text["de"]["automat_settings_pauseMin"] = "Minimale Wartezeiten der Automaten"; text["de"]["automat_settings_pauseMax"] = "Maximale Wartezeiten der Automaten"; text["de"]["automat_settings_maxDurationBotRun"] = "Maximale Laufzeit des Automaten"; text["de"]["automat_settings_maxDurationBotStep"] = "Maximale Laufzeit eines Schrittes des Automaten"; text["de"]["automat_setToDefault"] = "Standard setzen"; text["de"]["automat_settings_seedWaitForCrop"] = "Das Pflanzen wartet, falls innerhalb dieser Zeit geerntet werden kann."; text["de"]["automat_emergencyPlants"] = "Notfall-Pflanzen. Diese werden zuerst genommen, falls die benötigte Pflanze nicht verfügbar oder passend ist."; text["de"]["automat_settings_useQueueList"] = "Benutze Queue-Listen für die Äcker"; text["de"]["automat_set12a"] = "Lösche \n alle zone Queue\n Daten"; text["de"]["automat_set12b"] = "Gelöscht."; text["de"]["automat_settings_showQueueTime"] = "Zeige berechnete Zeiten in der Queue-Liste."; text["de"]["automat_set18a"] = "Lösche alle Daten der Mühlen-Queue"; text["de"]["automat_set18b"] = "Löschen erfolgreich"; text["de"]["automat_settings_powerUpActivate"] = "Aktiviere Produkt-Powerups"; text["de"]["automat_settings_lotteryActivate"] = "Aktiviere das tägliche Lotterie-Los"; text["de"]["automat_settings_lotteryDailyLot"] = "Behalte das tägliche Lotterie-Los"; text["de"]["automat_settings_questActivate"] = "Aktiviere den Quest to quest:"; text["de"]["automat_settings_questSolving"] = "Erfülle den Quest to quest:"; text["de"]["automat_settings_farmiReject"] = "Auto-Ablehnung Farmi unter"; text["de"]["automat_settings_farmiAccept"] = "Auto-Annahme Farmi über"; text["de"]["automat_settings_farmiAcceptBelowMinValue"] = "Nimm Farmi an, der ein Produkt verlangt unter minimalem Lagerbestand"; text["de"]["automat_settings_farmiRemoveMissing"] = "Entferne Farmi mit fehlenden Produkten und wenigstem Gewinn. Schwelle:"; text["de"]["automat_fields"] = "Äcker"; text["de"]["automat_titleGeneral"] = "Allgemein-Queue"; text["de"]["automat_titleQueue"] = "Queue"; text["de"]["automat_QueCopyTextHeader"] = "Kopiere Queue"; text["de"]["automat_QueCopyTextHeaderFrom"] = "Kopiere von:"; text["de"]["automat_QueCopyTextHeaderTo"] = "Kopiere nach:"; text["de"]["automat_QueAddText"] = "Eine weitere Pflanze an die Liste anhängen"; //Add product text["de"]["automat_QueAddAboveText"] = "Eine weitere Pflanze in die Liste schieben"; text["de"]["automat_QueDeleteText"] = "Diese Pflanze löschen"; text["de"]["automat_QueClose"] = "Menü schließen"; text["de"]["automat_QueCloseAll"] = "Alle geöffneten Queue-Fenster schließen"; text["de"]["automat_QueMin"] = "Weniger"; text["de"]["automat_QuePlus"] = "Mehr"; text["de"]["automat_QueBehaviourF"] = "Klick um in den Lager-Modus zu schalten"; text["de"]["automat_QueBehaviourR"] = "Klick um in den Felder-Modus zu schalten"; text["de"]["automat_QueUpButton"] = "Früher"; text["de"]["automat_QueDownButton"] = "Später"; text["de"]["automat_buttonTimeLine"] = "Zeige Felder-Zeitverlauf"; text["de"]["automat_buttonOverview"] = "Zeige Automaten-Übersicht"; text["de"]["automat_repeat_on"] = "Wiederholung AN"; text["de"]["automat_repeat_off"] = "Wiederholung AUS"; text["de"]["automat_shuffle_on"] = "Zufall AN"; text["de"]["automat_shuffle_off"] = "Zufall AUS"; text["de"]["automat_rotate"] = "Rotieren"; text["de"]["automat_stop"] = "STOPP"; text["de"]["automat_week"] = "Wochen"; text["de"]["automat_inftext"] = "Läuft ohne Ende"; text["de"]["automat_removeAllWeed"] = "Entferne alle %AMOUNT% %PROD%
Stück = %COST%
Total = %TCOST%"; text["de"]["automat_usedFarmFieldsReadyAt"] = "Benutzte Felder sind fertig um:"; text["de"]["automat_CloseWindowTimer"] = "Schließe Fenster in %1%"; text["de"]["automat_CloseWindowTimerClick"] = "Klick um Timer zurückzusetzen"; //%PRODNAME% = product name, %FLDFROM% = field nr from, %FLDTO% = field nr until, text["de"]["automat_QueDoWork"] = "Zone wird vom Bot bearbeitet"; text["de"]["automat_QueDontWork"] = "Zone wird vom Bot ignoriert"; text["de"]["automat_QueueStoped"] = "Diese %PRODNAME% werden nicht gepflanzt, da vorher gestoppt wird."; text["de"]["automat_QueStop0"] = "Das automatische Pflanzen wird gestoppt."; text["de"]["automat_QueStop1"] = "Nach Pflanzen von %FLDFROM% Feld wird gestoppt."; text["de"]["automat_QueStopX"] = "Nach Pflanzen von %FLDFROM% Feldern wird gestoppt."; text["de"]["automat_QueRepeat"] = "(Wiederholung)"; text["de"]["automat_QueShuffle"] = "(Zufall)"; text["de"]["automat_QueRepeatShuffle"] = "(Zufallswiederholung)"; text["de"]["automat_QueFieldInRow1"] = "(Nr. %FLDFROM%)"; text["de"]["automat_QueFieldInRowX"] = "(Nr. %FLDFROM% bis %FLDTO%)"; text["de"]["automat_QueRoundDoneR"] = "These fields %PRODNAME% are already cultured and will be skiped"; text["de"]["automat_QueRoundDone1"] = "%PRODNAME% ist diese Runde bereits gepflanzt
und wird erneut geplanzt."; text["de"]["automat_QueRoundDoneX"] = "%PRODNAME% sind diese Runde bereits gepflanzt
und werden erneut geplanzt."; text["de"]["automat_QueFieldMake"] = "Total:"; text["de"]["automat_QueFieldToGo"] = "Noch:"; text["de"]["automat_QueRoundMake"] = "Jede Runde:"; text["de"]["automat_QueRoundMade"] = "Erledigt:"; text["de"]["automat_QueRoundToGo"] = "Noch:"; text["de"]["automat_QueUses"] = "Benutzt:"; text["de"]["automat_QueGives"] = "Ertrag:"; text["de"]["automat_QueFutter"] = "Zeitersparnis:"; text["de"]["automat_QueTimeThis"] = "Wachstumszeit:"; text["de"]["automat_QueTimeToGo"] = "Verbleibende Wachstumszeit:"; text["de"]["automat_QueTimeReady"] = "Fertig um:"; text["de"]["automat_QueTimeFirstReady"] = "Erstes fertig:"; text["de"]["automat_QueTimeNextReady"] = "Nächstes fertig:"; text["de"]["automat_QueTimeRound"] = "Durchschnitt jede Runde:"; text["de"]["automat_QueRackMode"]="(Regal Modus)"; text["de"]["automat_queueshow"]="Klick zum Ändern der Queue"; text["de"]["automat_zoneXWaiting"]="Zone \"%1%\" wartet"; //For the Mill //%PRODNAME% = product name, %FLDFROM% = field nr from, %FLDTO% = field nr until, text["de"]["automat_MillQueue"] = "Mühlen-Queue"; text["de"]["automat_MillDoWork"] = "Windmühle wird automatisch bearbeitet."; text["de"]["automat_MillDontWork"] = "Windmühle wird ignoriert. Manuelle Bedienung."; text["de"]["automat_MillClearAddAll"] = "Lösche Windmühlen-Queue und nehme dann alle Rezepte auf"; text["de"]["automat_MillShuffle"] = "(Zufallsmodus)"; text["de"]["automat_MillInRow1"] = "(Nr. %FLDFROM%)"; text["de"]["automat_MillInRowX"] = "(Nr. %FLDFROM% bis %FLDTO%)"; text["de"]["automat_MillTimeTotal"] = "Total Backzeit:"; text["de"]["automat_MillTimeReady"] = "Fertig:"; text["de"]["automat_MillStoped"] = "Es ist ein Stopp in der Liste. %PRODNAME% wird nicht gebacken."; text["de"]["automat_MillStop0"] = "Der automatische Prozess wird gestoppt."; text["de"]["automat_MillStop1"] = "Nach %FLDFROM% Rezept wird der automatische Prozess gestoppt."; text["de"]["automat_MillStopX"] = "Nach %FLDFROM% Rezepten wird der automatische Prozess gestoppt."; try{ text["de"]["automat_MillTimeThis"] = top.window.wrappedJSObject.windmill_bakeingtime; text["de"]["automat_MillPowerUpText_0"] = top.window.wrappedJSObject.powerup_bonustext1; text["de"]["automat_MillPowerUpText_1"] = top.window.wrappedJSObject.powerup_bonustext2; text["de"]["automat_MillPowerUpText_2"] = top.window.wrappedJSObject.powerup_bonustext3; text["de"]["automat_MillIngredients"] = top.window.wrappedJSObject.windmill_zutaten; }catch(err){GM_logError("text mill","","",err);} text["de"]["automat_number"] = "Anzahl"; text["de"]["automat_lack"] = "Fehlend"; text["de"]["automat_MillRecipesBought"] = "Total gekaufte Rezepte: "; text["de"]["automat_MillRecipesUsed"] = "Total benutzte Rezepte: "; text["de"]["automat_MillRecipesBake"] = "Max zu backende Rezepte: "; //title text["de"]["automat_title_on_general"] = "Zeige nur Allgemein-Queue
+Strg: Zeige Allgemein-Queue"; text["de"]["automat_title_off_general"] = "Zeige nur Allgemein-Queue
+Strg: Verstecke Allgemein-Queue"; text["de"]["automat_title_on_farm1"] = "Zeige nur 1. Farm
+Strg: Zeige 1. Farm"; text["de"]["automat_title_off_farm1"] = "Zeige nur 1. Farm
+Strg: Verstecke 1. Farm"; text["de"]["automat_title_on_farm2"] = "Zeige nur 2. Farm
+Strg: Zeige 2. Farm"; text["de"]["automat_title_off_farm2"] = "Zeige nur 2. Farm
+Strg: Verstecke 2. Farm"; text["de"]["automat_title_on_farm3"] = "Zeige nur 3. Farm
+Strg: Zeige 3. Farm"; text["de"]["automat_title_off_farm3"] = "Zeige nur 3. Farm
+Strg: Verstecke 3. Farm"; text["de"]["automat_title_on_farm4"] = "Zeige nur 4. Farm
+Strg: Zeige 4. Farm"; text["de"]["automat_title_off_farm4"] = "Zeige nur 4. Farm
+Strg: Verstecke 4. Farm"; text["de"]["automat_title_on_farmersmarket"] = "Zeige nur Bauernmarkt
+Strg: Zeige Bauernmarkt"; text["de"]["automat_title_off_farmersmarket"] = "Zeige nur Bauernmarkt
+Strg: Verstecke Bauernmarkt"; text["de"]["automat_title_on_megafield"] = "Zeige nur Güterhof
+Strg: Zeige Güterhof"; text["de"]["automat_title_off_megafield"] = "Zeige nur Güterhof
+Strg: Verstecke Güterhof"; text["de"]["automat_title_on_city"] = "Zeige nur Stadt
+Strg: Zeige Stadt"; text["de"]["automat_title_off_city"] = "Zeige nur Stadt
+Strg: Verstecke Stadt"; text["de"]["automat_title_on_forestry"] = "Zeige nur Baumerei
+Strg: Zeige Baumerei"; text["de"]["automat_title_off_forestry"] = "Zeige nur Baumerei
+Strg: Verstecke Baumerei"; text["de"]["automat_title_on_foodworld"] = "Zeige nur Picknickarea
+Strg: Zeige Picknickarea"; text["de"]["automat_title_off_foodworld"] = "Zeige nur Picknickarea
+Strg: Verstecke Picknickarea"; text["de"]["automat_title_on_type1"] = "Zeige nur Äcker
+Strg: Zeige Äcker"; text["de"]["automat_title_off_type1"] = "Zeige nur Äcker
+Strg: Verstecke Äcker"; text["de"]["automat_title_on_type2"] = "Zeige nur Ställe
+Strg: Zeige Ställe"; text["de"]["automat_title_off_type2"] = "Zeige nur Ställe
+Strg: Verstecke Ställe"; text["de"]["automat_title_on_type3"] = "Zeige nur Fabriken
+Strg: Zeige Fabriken"; text["de"]["automat_title_off_type3"] = "Zeige nur Fabriken
+Strg: Verstecke Fabriken"; text["de"]["automat_title_on_all"] = "Show all farm queues"; text["de"]["automat_title_off_all"] = "Hide all farm queues"; //help text["de"]["automat_help_0"] = [,"This script can be used to add automation to the cultivation process."]; text["de"]["automat_help_1"] = ["How it works","If you click the \""+text["de"]["automat_botStart"]+"\" button at the bottom of the page the automation process will be started.
You even can continue gaming as long as nothing is ready. Then the bot begins to simulate the clicks a user does. During that period you shouldn't interact."]; text["de"]["automat_help_2"] = ["Field","At the bottom of every zone an icon is displayed. If the icon shows
 
the automation process is stopped or will be stopped at the next culture moment. There will not be any culturing for this garden until you select an other product. When a product icon is displayed this product is cultured next at the field."]; text["de"]["automat_help_3"] = ["Queue","If in the option menu of the Automat the queue checkbox is checked, clicking the product culturing icon of a zone will display a queue where multiple products can be queued. If the background of a queue item is red this item will not be cultered because a production stop item is added somewhere before in the list."]; text["de"]["automat_help_4"] = ["Repeat","Enabling the \"Repeat\" check box will enable the \"loop\" feature of the queue."]; text["de"]["automat_help_5"] = ["Shuffle","Enabling the \"Shuffle\" check box will randomly culture a product from the list."]; text["de"]["automat_help_6"] = ["Stables","At the bottom of every zone with a stable an icon is displayed. If the icon shows
 
the automation process is stopped or will be stopped at the next culture moment. When a product is displayed this product will be used to feed the stable. Click this icon to choose the feed amount through the slider or change the feed product by selecting the product."]; text["de"]["automat_help_7"] = ["Factories","At the bottom of every zone with a factory an icon is displayed. If the icon shows
 
the automation process is stopped or will be stopped at the next culture moment. When a product is displayed this will be the produced product of this factory."]; text["de"]["automat_help_8"] = [text["de"]["automat_zonePairing"],"In the \""+text["de"]["automat_zonePairing"]+"\" menu of the Automat the radio-buttons controle the pairing of the zones. Also the general queue is extended to allow multiple general queues."]; text["de"]["automat_help_9"] = ["Windmill","The windmill queue works the same as the zone queue but instead of products recipes are baked.
As extra the mill queue has a
 
button which can be used to clear and refill the queue with all available recipes that were bought and where there are enough ingredients in the rack to bake them.
If the background of a queue item is yellow then there are not enough products to bake all these recipes.

Note: For first time user that have already bought recipes. Go to the miller or the trading lady screen so the bought recipes can be stored into the system."]; } if(undefined===text["en"]["automat"]){ text["en"]["automat"] = "Automaton"; text["en"]["automat_planting"] = "Planting..."; text["en"]["automat_waiting"] = "Waiting..."; text["en"]["automat_watering"] = "Watering..."; text["en"]["automat_feeding"] = "Feeding..."; text["en"]["automat_automatPlanting"] = "Seeding machine"; text["en"]["automat_automatFeeding"] = "Feeding machine"; text["en"]["automat_automatFactory"] = "Factory machine"; text["en"]["automat_automatMegafield"] = "Megafield machine"; text["en"]["automat_automatWindmill"] = "Mill machine"; text["en"]["automat_botStart"] = "Start Automaton-Bot"; text["en"]["automat_botStop"] = "Stop Automaton-Bot"; text["en"]["automat_settings_botErrorBehaviour"] = "Behaviour of Automaton in case of errors"; text["en"]["automat_settings_pageReload"] = "Reload of page"; text["en"]["automat_settings_botRestart"] = "Restart bot"; text["en"]["automat_zonePairing"] = "Zone pairing"; text["en"]["automat_debugInfo"] = "Debug Info"; text["en"]["automat_windmill"] = "windmill"; text["en"]["automat_timing"] = "Timing"; text["en"]["automat_general"] = "General"; text["en"]["automat_development"] = "Development"; text["en"]["automat_arrivedInFarm"] = "Arrived in farm"; text["en"]["automat_changeToFarmX"] = "Going to farm %1%"; text["en"]["automat_changingToX"] = "Going to %1%"; text["en"]["automat_closingFieldContainer"] = "Closing field"; text["en"]["automat_closingFactoryContainer"] = "Closing factory"; text["en"]["automat_closingStableContainer"] = "Closing stable"; text["en"]["automat_openingZoneX"] = "Opening zone %1%"; text["en"]["automat_zoneXIsOpened"] = "Zone %1% is opened"; text["en"]["automat_confirmChangelogVersion"]="You have installed a new version of the Automaton script.
The version %1% contains the following changes:"; text["en"]["automat_maximumStockCapacityReached"]="Maximum stock capacity will be reached."; text["en"]["automat_nothingToCrop"]="Nothing to crop."; text["en"]["automat_cropWaitingInX"]="Waiting for crop in %1%."; text["en"]["automat_plantingAtX"]="Planting at %1%."; text["en"]["automat_plantingNoFreeField"]="No free field to plant."; text["en"]["automat_plantingSetX"]="Setting plant \"%1%\"."; text["en"]["automat_queueItemAmountDecreased"]="Queue item amount decreased.."; text["en"]["automat_queueItemDeleted"]="Queue item deleted."; text["en"]["automat_responseWaiting"]="Waiting for response."; text["en"]["automat_stopAdding"]="Adding stop to queue."; text["en"]["automat_tourStarting"]="Starting tour."; text["en"]["automat_vehicleNotKnown"]="No vehicle known."; text["en"]["automat_vehicleXNotAvailable"]="Vehicle \"%1%\" not available."; text["en"]["automat_vehicleXBuying"]="Buying vehicle \"%1%\"."; text["en"]["automat_vehicleXSelected"]="Vehicle \"%1%\" is selected."; text["en"]["automat_msgUpdate"] = "There is a new script version of the automaton. Install?"; text["en"]["automat_shouldUpdateAdviser"] = "You should update the script of the Adviser!
The Automaton will not run properly."; text["en"]["automat_settings_autoPlant"] = "Shall the planting machine be displayed?"; text["en"]["automat_settings_autoWater"] = "Shall the fields be watered?"; text["en"]["automat_settings_autoFeed"] = "Shall the feeding machine be displayed?"; text["en"]["automat_settings_botUse"] = "Use bot"; text["en"]["automat_settings_disableCropFields"]="Block the cropping of sleeping fields."; text["en"]["automat_settings_pauseShortMin"] = "Minimal clicking delay of the automaton"; text["en"]["automat_settings_pauseShortMax"] = "Maximal clicking delay of the automaton"; text["en"]["automat_settings_pauseMin"] = "Minimal waiting delay of the automaton"; text["en"]["automat_settings_pauseMax"] = "Maximal waiting delay of the automaton"; text["en"]["automat_settings_maxDurationBotRun"] = "Maximal running time of the automaton"; text["en"]["automat_settings_maxDurationBotStep"] = "Maximal running time for a step of the automaton"; text["en"]["automat_setToDefault"] = "Set to default"; text["en"]["automat_settings_seedWaitForCrop"] = "Wait planting if next cropping time is less than"; text["en"]["automat_emergencyPlants"] = "Emergency Plants. They are taken first if the needed plant is not available or fitting."; text["en"]["automat_settings_useQueueList"] = "Use queue for the fields."; text["en"]["automat_set12a"] = "Delete \n all zone queue\n data"; text["en"]["automat_set12b"] = "Delete Completed."; text["en"]["automat_settings_showQueueTime"] = "Show calculated product ready time in the queue."; text["en"]["automat_set18a"] = "Delete all mill queue data"; text["en"]["automat_set18b"] = "Delete Completed"; text["en"]["automat_settings_powerUpActivate"] = "Activate powerups for products"; text["en"]["automat_settings_lotteryActivate"] = "Activate the daily lottery automatically"; text["en"]["automat_settings_lotteryDailyLot"] = "Choose to keep the daily lot"; text["en"]["automat_settings_questActivate"] = "Activate the Quest automatically to quest:"; text["en"]["automat_settings_questSolving"] = "Solve the Quest automatically to quest:"; text["en"]["automat_settings_farmiReject"] = "Auto reject farmi below:"; text["en"]["automat_settings_farmiAccept"] = "Auto accept farmi above:"; text["en"]["automat_settings_farmiAcceptBelowMinValue"] = "Accept a farmi with an product item that is below the minimal product amount in the rack."; text["en"]["automat_settings_farmiRemoveMissing"] = "Remove a farmi with missing products and the lowest yield. Threshold:"; text["en"]["automat_fields"] = "Fields"; text["en"]["automat_titleGeneral"] = "General queue"; text["en"]["automat_titleQueue"] = "Queue"; text["en"]["automat_QueCopyTextHeader"] = "Copy queue"; text["en"]["automat_QueCopyTextHeaderFrom"] = "Copy from:"; text["en"]["automat_QueCopyTextHeaderTo"] = "Copy to:"; text["en"]["automat_QueAddText"] = "Click to add a product to the list."; //Add product text["en"]["automat_QueAddAboveText"] = "Click to add a product to the list before this product"; text["en"]["automat_QueDeleteText"] = "Delete this product from the list."; text["en"]["automat_QueClose"] = "Close this menu"; text["en"]["automat_QueCloseAll"] = "Close all open Queue windows."; text["en"]["automat_QueMin"] = "Lower value"; text["en"]["automat_QuePlus"] = "Increase value"; text["en"]["automat_QueBehaviourF"] = "Click to switch to rack-mode"; text["en"]["automat_QueBehaviourR"] = "Click to switch to field-mode"; text["en"]["automat_QueUpButton"] = "Move Up"; text["en"]["automat_QueDownButton"] = "Move Down"; text["en"]["automat_buttonTimeLine"] = "Show field timelines"; text["en"]["automat_buttonOverview"] = "Show overview of automatons"; text["en"]["automat_repeat_on"] = "Repeat list is ON, press to turn off repeat."; text["en"]["automat_repeat_off"] = "Repeat list is OFF, press to turn on repeat."; text["en"]["automat_shuffle_on"] = "Shuffle list is ON, press to turn off shuffle."; text["en"]["automat_shuffle_off"] = "Shuffle list is OFF, press to turn on shuffle."; text["en"]["automat_rotate"] = "Rotate: place first entry after the last entry"; text["en"]["automat_stop"] = "STOP"; text["en"]["automat_week"] = "week"; text["en"]["automat_inftext"] = "Runs indefinitely"; text["en"]["automat_removeAllWeed"] = "Remove all %AMOUNT% %PROD%
a piece = %COST%
total = %TCOST%"; text["en"]["automat_usedFarmFieldsReadyAt"] = "Used farm fields are ready at:"; text["en"]["automat_CloseWindowTimer"] = "Closing screen in %1%"; text["en"]["automat_CloseWindowTimerClick"] = "Click to reset timer"; //%PRODNAME% = product name, %FLDFROM% = field nr from, %FLDTO% = field nr until, text["en"]["automat_QueDoWork"] = "Zone is done by bot"; text["en"]["automat_QueDontWork"] = "Zone is ignored by bot"; text["en"]["automat_QueueStoped"] = "A culture stop is detected these %PRODNAME% will not be cultured."; text["en"]["automat_QueStop0"] = "The automatic culturing process will be stopped"; text["en"]["automat_QueStop1"] = "After culturing %FLDFROM% field the automatic process will be stopped."; text["en"]["automat_QueStopX"] = "After culturing %FLDFROM% fields the automatic process will be stopped."; text["en"]["automat_QueRepeat"] = "(Repeat mode)"; text["en"]["automat_QueShuffle"] = "(Shuffle mode)"; text["en"]["automat_QueRepeatShuffle"] = "(Shuffle repeat mode)"; text["en"]["automat_QueFieldInRow1"] = "(Nr. %FLDFROM%)"; text["en"]["automat_QueFieldInRowX"] = "(Nr. %FLDFROM% to %FLDTO%)"; text["en"]["automat_QueRoundDoneR"] = "These fields %PRODNAME% are already cultured and will be skipped"; text["en"]["automat_QueRoundDone1"] = "This field %PRODNAME% s already cultured in this turn,
next turn it will be cultured again."; text["en"]["automat_QueRoundDoneX"] = "These fields %PRODNAME% are already cultured in this turn,
next turn they will be cultured again."; text["en"]["automat_QueFieldMake"] = "Total:"; text["en"]["automat_QueFieldToGo"] = "To go:"; text["en"]["automat_QueRoundMake"] = "Each turn: "; text["en"]["automat_QueRoundMade"] = "Made:"; text["en"]["automat_QueRoundToGo"] = "To do:"; text["en"]["automat_QueUses"] = "Uses:"; text["en"]["automat_QueGives"] = "Yield:"; text["en"]["automat_QueFutter"] = "Time discount:"; text["en"]["automat_QueTimeThis"] = "Production time:"; text["en"]["automat_QueTimeToGo"] = "Culture time to go:"; text["en"]["automat_QueTimeReady"] = "Ready at:"; text["en"]["automat_QueTimeFirstReady"] = "First is ready at:"; text["en"]["automat_QueTimeNextReady"] = "Next is ready at:"; text["en"]["automat_QueTimeRound"] = "Average each turn:"; text["en"]["automat_QueRackMode"]="(Rack mode)"; text["en"]["automat_queueshow"]="Click to edit the queue"; text["en"]["automat_zoneXWaiting"]="Zone \"%1%\" is waiting"; //For the Mill //%PRODNAME% = product name, %FLDFROM% = field nr from, %FLDTO% = field nr until, text["en"]["automat_MillQueue"] = "Mill Queue"; text["en"]["automat_MillDoWork"] = "The windmill is automatically maintained."; text["en"]["automat_MillDontWork"] = "The windmill is ignored. Manual maintenance is required."; text["en"]["automat_MillClearAddAll"] = "Clear mill list then add all recipes"; text["en"]["automat_MillShuffle"] = "(Shuffle mode)"; text["en"]["automat_MillInRow1"] = "(Nr. %FLDFROM%)"; text["en"]["automat_MillInRowX"] = "(Nr. %FLDFROM% to %FLDTO%)"; text["en"]["automat_MillTimeTotal"] = "Total baking time:"; text["en"]["automat_MillTimeReady"] = "Ready:"; text["en"]["automat_MillStoped"] = "There is a stop added to the queue this %PRODNAME% will not be baked"; text["en"]["automat_MillStop0"] = "The automatic baking process will be stopped"; text["en"]["automat_MillStop1"] = "After %FLDFROM% recipe the automatic baking process will be stopped."; text["en"]["automat_MillStopX"] = "After %FLDFROM% recipes the automatic baking process will be stopped."; try{ text["en"]["automat_MillTimeThis"] = top.window.wrappedJSObject.windmill_bakeingtime; text["en"]["automat_MillPowerUpText_0"] = top.window.wrappedJSObject.powerup_bonustext1; text["en"]["automat_MillPowerUpText_1"] = top.window.wrappedJSObject.powerup_bonustext2; text["en"]["automat_MillPowerUpText_2"] = top.window.wrappedJSObject.powerup_bonustext3; text["en"]["automat_MillIngredients"] = top.window.wrappedJSObject.windmill_zutaten; }catch(err){GM_logError("text mill","","",err);} text["en"]["automat_number"] = "Number"; text["en"]["automat_lack"] = "Lack"; text["en"]["automat_MillRecipesBought"] = "Total recipes bought: "; text["en"]["automat_MillRecipesUsed"] = "Total recipes used: "; text["en"]["automat_MillRecipesBake"] = "Max recipes to bake: "; //title text["en"]["automat_title_on_general"] = "Show general queue only
+Ctrl: Show general queue"; text["en"]["automat_title_off_general"] = "Show general queue only
+Ctrl: Hide general queue"; text["en"]["automat_title_on_farm1"] = "Show first farm only
+Ctrl: Show first farm"; text["en"]["automat_title_off_farm1"] = "Show first farm only
+Ctrl: Hide first farm"; text["en"]["automat_title_on_farm2"] = "Show second farm only
+Ctrl: Show second farm"; text["en"]["automat_title_off_farm2"] = "Show second farm only
+Ctrl: Hide second farm"; text["en"]["automat_title_on_farm3"] = "Show third farm only
+Ctrl: Show third farm"; text["en"]["automat_title_off_farm3"] = "Show third farm only
+Ctrl: Hide third farm"; text["en"]["automat_title_on_farm4"] = "Show fourth farm only
+Ctrl: Show fourth farm"; text["en"]["automat_title_off_farm4"] = "Show fourth farm only
+Ctrl: Hide fourth farm"; text["en"]["automat_title_on_farmersmarket"] = "Show farmersmarket only
+Ctrl: Show farmersmarket"; text["en"]["automat_title_off_farmersmarket"] = "Show farmersmarket only
+Ctrl: Hide farmersmarket"; text["en"]["automat_title_on_megafield"] = "Show megafield only
+Ctrl: Show megafield"; text["en"]["automat_title_off_megafield"] = "Show megafield only
+Ctrl: Hide megafield"; text["en"]["automat_title_on_city"] = "Show city only
+Ctrl: Show city"; text["en"]["automat_title_off_city"] = "Show city only
+Ctrl: Hide city"; text["en"]["automat_title_on_forestry"] = "Show forestry only
+Ctrl: Show forestry"; text["en"]["automat_title_off_forestry"] = "Show forestry only
+Ctrl: Hide forestry"; text["en"]["automat_title_on_foodworld"] = "Show picnic area only
+Ctrl: Show picnic area"; text["en"]["automat_title_off_foodworld"] = "Show picnic area only
+Ctrl: Hide picnic area"; text["en"]["automat_title_on_type1"] = "Show fields only
+Ctrl: Show fields"; text["en"]["automat_title_off_type1"] = "Show fields only
+Ctrl: Hide fields"; text["en"]["automat_title_on_type2"] = "Show stables only
+Ctrl: Show stables"; text["en"]["automat_title_off_type2"] = "Show stables only
+Ctrl: Hide stables"; text["en"]["automat_title_on_type3"] = "Show factories only
+Ctrl: Show factories"; text["en"]["automat_title_off_type3"] = "Show factories only
+Ctrl: Hide factories"; text["en"]["automat_title_on_all"] = "Show all farm queues"; text["en"]["automat_title_off_all"] = "Hide all farm queues"; //help text["en"]["automat_help_0"] = [,"This script can be used to add automation to the cultivation process."]; text["en"]["automat_help_1"] = ["How it works","If you click the \""+text["en"]["automat_botStart"]+"\" button at the bottom of the page the automation process will be started.
You even can continue gaming as long as nothing is ready. Then the bot begins to simulate the clicks a user does. During that period you shouldn't interact."]; text["en"]["automat_help_2"] = ["Field","At the bottom of every zone an icon is displayed. If the icon shows
 
the automation process is stopped or will be stopped at the next culture moment. There will not be any culturing for this garden until you select an other product. When a product icon is displayed this product is cultured next at the field."]; text["en"]["automat_help_3"] = ["Queue","If in the option menu of the Automat the queue checkbox is checked, clicking the product culturing icon of a zone will display a queue where multiple products can be queued. If the background of a queue item is red this item will not be cultered because a production stop item is added somewhere before in the list."]; text["en"]["automat_help_4"] = ["Repeat","Enabling the \"Repeat\" check box will enable the \"loop\" feature of the queue."]; text["en"]["automat_help_5"] = ["Shuffle","Enabling the \"Shuffle\" check box will randomly culture a product from the list."]; text["en"]["automat_help_6"] = ["Stables","At the bottom of every zone with a stable an icon is displayed. If the icon shows
 
the automation process is stopped or will be stopped at the next culture moment. When a product is displayed this product will be used to feed the stable. Click this icon to choose the feed amount through the slider or change the feed product by selecting the product."]; text["en"]["automat_help_7"] = ["Factories","At the bottom of every zone with a factory an icon is displayed. If the icon shows
 
the automation process is stopped or will be stopped at the next culture moment. When a product is displayed this will be the produced product of this factory."]; text["en"]["automat_help_8"] = [text["en"]["automat_zonePairing"],"In the \""+text["en"]["automat_zonePairing"]+"\" menu of the Automat the radio-buttons controle the pairing of the zones. Also the general queue is extended to allow multiple general queues."]; text["en"]["automat_help_9"] = ["Windmill","The windmill queue works the same as the zone queue but instead of products recipes are baked.
As extra the mill queue has a
 
button which can be used to clear and refill the queue with all available recipes that were bought and where there are enough ingredients in the rack to bake them.
If the background of a queue item is yellow then there are not enough products to bake all these recipes.

Note: For first time user that have already bought recipes. Go to the miller or the trading lady screen so the bought recipes can be stored into the system."]; } delimThou=top.unsafeData.delimThou; regDelimThou=new RegExp(top.unsafeData.regDelimThou,"g"); delimDeci=top.unsafeData.delimDeci; regDelimDeci=new RegExp(top.unsafeData.regDelimDeci); window.setInterval(function (){ now=Math.floor((new Date()).getTime()/1000); },1000); GM_registerMenuCommand(getText("automat")+" Update", function(){ location.href=GM_Source; }); GM_registerMenuCommand(getText("automat")+" "+getText("scriptHomepage"), function(){ window.open(GM_Home); }); // Version check err_trace="Version check"; if((!unsafeData.beraterVersion)||(compareVersions(neededVersionBerater,unsafeData.beraterVersion)>0)){ alert2(getText("automat_shouldUpdateAdviser"),getText("ok")); } var loc=new RegExp("s(\\d+)\\."+GAMEPAGES[COUNTRY].replace(/\./g,"\\."),"i").exec(location.hostname); if(loc){ SERVER=loc[1]; USERNAME=unsafeData.username.slice(); settings.init(); // ************************************************** // ChangeData Server err_trace="ChangeData Server"; try{ var changedata = GM_getValue(COUNTRY+"_"+SERVER+"_automatChangedata",0); switch(changedata){ case 0:{ if(help=GM_getValue(COUNTRY+"_"+SERVER+"_valBot")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_valBot"); settings.set("server","botActive",help); } } } if(changedata<1){ GM_setValue(COUNTRY+"_"+SERVER+"_automatChangedata",1); } }catch(err){GM_logError("changedata server","","",err);} // ************************************************** // ChangeData User err_trace="ChangeData Server"; try{ var changedata = GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_automatChangedata",0); switch(changedata){ case 0:{ if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valAutoPflanz")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valAutoPflanz"); settings.set("account","autoPlant",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valAutoFutter")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valAutoFutter"); settings.set("account","autoFeed",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valUseQueueList")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valUseQueueList"); settings.set("account","useQueueList",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valSeedWaitForCrop")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valSeedWaitForCrop"); settings.set("account","seedWaitForCrop",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valDisableCropFields")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valDisableCropFields"); settings.set("account","disableCropFields",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valShowQueueTime")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valShowQueueTime"); settings.set("account","showQueueTime",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valPowerUpActivate")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valPowerUpActivate"); settings.set("account","powerUpActivate",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valLotteryActivate")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valLotteryActivate"); settings.set("account","lotteryActivate",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valLotteryDailyLot")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valLotteryDailyLot"); settings.set("account","lotteryDailyLot",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiReject")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiReject"); settings.set("account","farmiReject",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiRejectUntilNr")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiRejectUntilNr"); settings.set("account","farmiRejectUntilNr",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiAccept")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiAccept"); settings.set("account","farmiAccept",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiAcceptAboveNr")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiAcceptAboveNr"); settings.set("account","farmiAcceptAboveNr",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiAcceptBelowMinValue")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiAcceptBelowMinValue"); settings.set("account","farmiAcceptBelowMinValue",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiRemoveMissing")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiRemoveMissing"); settings.set("account","farmiRemoveMissing",help); } if(help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiRemoveMissingAboveNr")){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valFarmiRemoveMissingAboveNr"); settings.set("account","farmiRemoveMissingAboveNr",help); } if((help=GM_getValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valUseBot"))&&(help=explode(help,"changedata country/valUseBot"))){ GM_deleteValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_valUseBot"); for(var i in help){ if(!help.hasOwnProperty(i)){ continue; } settings.set("account","botUse"+i.toTitleCase(),!!help[i]); } } } } if(changedata<1){ GM_setValue(COUNTRY+"_"+SERVER+"_"+USERNAME+"_automatChangedata",1); } }catch(err){GM_logError("changedata user","","",err);} // ************************************************** switch (PAGE){ //case "dbfehler": //case "wartung": break; case "main": do_main();break; case "hilfe": do_hilfe();break; } } else { settings.init(); do_login(); } GM_logInfo("start_script","","Page="+location.href,"Userscript \"MyFreeFarm Automat\" has started"); unsafeData.automatStarted=automatStarted=true; }catch(err){GM_logError("start_script","","err_trace="+err_trace,err);} }; window.addEventListener("load",function(){ if(self==top){ do_relogin(60); } if(unsafeData.beraterDone){ start_script(); }else{ document.addEventListener("beraterDone",function(){ start_script(); document.removeEventListener("beraterDone",arguments.callee,false); },false); } },false);