Neverwinter gateway - Professions Robot

Automatically selects professions for empty slots

目前为 2015-05-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Neverwinter gateway - Professions Robot
  3. // @description Automatically selects professions for empty slots
  4. // @namespace https://greasyfork.org/scripts/7061-neverwinter-gateway-professions-robot/
  5. // @include http://gateway*.playneverwinter.com/*
  6. // @include https://gateway*.playneverwinter.com/*
  7. // @include http://gateway.*.perfectworld.eu/*
  8. // @include https://gateway.*.perfectworld.eu/*
  9. // @originalAuthor Mustex/Bunta
  10. // @modifiedBy NW gateway Professions Bot Developers & Contributors
  11.  
  12. /*
  13. === NW Gateway Professions Bot Developers
  14. - Bluep, Numberb, mac-nw, Phr33d0m, BigRedBrent,
  15. - Noonereally, Glowing Crystalline Entity, WloBeb
  16.  
  17. === NW Gateway Professions Bot Contributors
  18. - Kakoura, Nametaken, rotten_mind, Frankescript, dlebedynskyi,
  19. - breadguy
  20. */
  21.  
  22. // @version 1.10.06.06
  23. // @license http://creativecommons.org/licenses/by-nc-sa/3.0/us/
  24. // @grant GM_getValue
  25. // @grant GM_setValue
  26. // @grant GM_listValues
  27. // @grant GM_deleteValue
  28. // ==/UserScript==
  29.  
  30. /* RELEASE NOTES
  31. 1.10.06.06
  32. + Swordcoast run auto reset fixed(reset changed to week day based)
  33. 1.10.06.04
  34. + added Skip 25 (noted as @Kakouras favour ;) )
  35. + added SCA automation, runs SCA can set by time, ToDo, callback for rolls
  36. + panel has now info for SCA runs done, 4 times per day
  37. + banker is not default on
  38. + reload intervalls now 4 hours(for SCA completion and stability)
  39. 1.10.06.03
  40. Ninja Release
  41. + reset for settins excluding user/passw.
  42. + added exception for bandit clues
  43. + leadership is good now
  44. - added counter for "undefine" & "Epic button" -error (temporal solution to see count) also button to console.log
  45. - added "Epic button enabled" -bug recovery (test)
  46. - added Black Ice refining lvl 4 - 5
  47. - FIX non-EN task filter
  48. - added "Vendor Gathered" + Tradebag, Gold treshold is 2
  49. - added "Unstable potions" Vendor list
  50. - added "Noonereallys" way fetch character names
  51. - added "Auto level 20", skip profession after lvl20 reached -option
  52. - added "Leadership lvl 3" -check
  53. 1.10.06.01
  54. - MOD6
  55. 1.10.05.03
  56. - MOD6 profession check
  57. - mining claim 10/1000
  58. - Inv. sell. check 10 slot free
  59. - version number
  60. 1.10.5.02
  61. - training assets FIX, works properly with different languages
  62. 1.10.5.01
  63. - added error trap for "undefined error"
  64. - Jewelcrafting tasklist 20 - 25
  65. - Leadership_XP mining_claims limit up 1000
  66. 1.10.5
  67. - Mod6 additions
  68. - Vendor list updated
  69. 1.10.5PreMod6.04
  70. - Leadership task updates
  71. 1.10.5PreMod6.03
  72. - exclude list update
  73. 1.10.5PreMod6.02
  74. - added task selection if specific item not in inventory "Mining claim" by WloBep
  75. - added loop counter to prevent infinite loop when "Start task" -bugged
  76. 1.10.5.1
  77. - tasklist edited
  78. - some other changes by user "Glowing Crystalline Entity"
  79. 1.10.5
  80. - Mod6 professions added
  81. - added Empowered Aquaregia
  82. - ZAX FIX
  83. 1.10.4
  84. - profession sell filter update
  85. 1.10.3
  86. - HOTFIX, setting save reverted to old to preven unwated settings wipe.
  87. 1.10.2
  88. - added "check currencies" for buy resources
  89. - added "Gathering" task
  90. 1.10.2RC1 for Greasyfork
  91. - UI improvement
  92. - removed "Save Task" & "Clear Task" buttons, on current build they do nothing
  93. - replaced JAVA string search(partially) for better multilingual support(tooltip translation not included)
  94. - reverted tasklist order to old(cosmetic change)
  95. - Replaced defaultTasklist with tasklist
  96. - Clear saved settings before re-saving
  97. - Added leadership asset auto buy
  98. - Improvements for AD transfer and reports to console log
  99. - added missing asset names
  100. - Added "Leadership XP" use second tasklist
  101. - Added "Gateway_Reward" collection
  102. - Added vendoring Rank 3 enchantments and runestones to UI
  103. - Added "Vendor all Altar Node skill kits" to UI
  104. - Edited vendoring rank 1 and rank 2 enchantments
  105. 1.10.1
  106. - Patern undefined bug fix
  107. 1.10.0 - Release Candidate
  108. - Vendor exclude filter has now higher "Safeguards" (it still might need added some unbound items eg. Glyphs, potions, etc)
  109. - Added vendor safeguards
  110. - Separated autovendor and profession items vendor
  111. - SCA daily reward collection by cycling through all configured characters (leaving SCA page will cancel the collection)
  112. - Multi URL support for testing
  113. - Support for gatewaytest, RU gateway (gateway.nw.ru.perfectworld.eu) and regular gateway
  114. 1.05.0.1k
  115. - RC2 for ver. 1.0.05.2
  116. - Added vendoring to UI
  117. - Added vendoring "safety" setting what check item is "unbound"
  118. - Code clearing
  119. 1.05.0.1j
  120. - RC1 for ver. 1.05.0.2
  121. - Rebuild sell items selection method making it more comprehensive
  122. - Vendoring function now use array to vendor item objects
  123. - Updated vendoring list
  124. - Sell all runestones and enchantments rank 1 & rank 2
  125. - Limit, altars 80, skill kits 50, healing potions T 1 - 3 10
  126. - Re-edited warning "Tooltip"- selecting "what skill kit character not need" when selling
  127. - Merged back the split of the pause function
  128. - Added a parameter to specify pause/unpause/toggle (defaults to toggle as in original behavior)
  129. - Tasklist updates
  130. BETA 1.05.0.1i
  131. - Edited "sell items" list
  132. - Edited/added WARNING´s on tooltip
  133. BETA 1.05.0.1h
  134. - Added "sell skill kits", works same as "open_rewards" (experimental, inventory cleaning needs more specific "sell filter" and event what trigger "sell")
  135. - Changed switching character and completing character task logic, trying prevent wrong task execution after switch
  136. - Refined "save settings" function
  137. - WinterEvent tasklist got new additions
  138. 1.05.01G
  139. - Github release
  140. 1.05.0.1f
  141. - Minor tasklist updates
  142. - Added button "open all(99)", opens rewardchest
  143. - Fixed "open rewardchest" disconnect issues(need furter testing, RM)
  144. - Fixed unnecessary ZEX visit´s
  145. -
  146. 1.05.0.1e
  147. - Info page updates for non-compatible browser/XXXmonkey
  148. 1.05.0.1d
  149. - WinterEvent tasks added
  150. - Added AD transfer automation
  151. - Settings Panel UI: Increased size and implemented two columns for options to minimize vertical length. Also implemented new radio and button styles.
  152. 1.05.0.1c
  153. - UI feature: Limit the gateway popup notification messages that appear at the top of the screen to a max of 2 notifications. The oldest (first) notification will always be removed when reaching the limit.
  154. 1.05.0.1b
  155. - Added Reward Chest Opening Option
  156. - Added All button when selling from inventory
  157. - Added condition check for profession slot input val > 0 when processing tasks
  158. 1.05.0.1 (v1, mod 5)
  159. - Started with bluep's edits (https://greasyfork.org/en/forum/discussion/270/x)
  160. - Edited back in leadership asset priority (https://greasyfork.org/en/forum/discussion/comment/7213/#Comment_7213)
  161. - Edited in Jewelcrafting for Mod5 (https://greasyfork.org/en/forum/discussion/comment/6930/#Comment_6930)
  162. - Modified the default leadership tasks to prioritize AD generation (feel free to rever)
  163. /* End Bunta's Edits?
  164. 1.0.0.3
  165. - Fix some gem trading tasks not being filtered correctly
  166. - Add check for gateway disconnected
  167. 1.0.0.2
  168. - Fix leadership tasks not creating assets correctly
  169. - Add option to save task lists per character (experimental)
  170. 1.0.0.1
  171. - Rewrite script using client.dataModel methods to massively improve reliability and performance (thanks Msc)
  172. - AD refining will now only attempt to refine if you are able to collect diamonds
  173. - Change task lists to use exact task names so no ambiguity exists (no longer requires excluderare option)
  174. - Asset resources are now trained as needed (only for required slots)
  175. 0.3.0.5
  176. - Fix resources not buying correctly in all cases
  177. - Fix pause button state saving correctly in firefox
  178. 0.3.0.4
  179. - Add page timeout reloading functions outside of main function (thanks Kreese and Frabtik)
  180. - Add check to ensure tasks are being started for the correct character
  181. - Alter next run resolve function to use delay parameter to allow for unique delay timers to be used in certain cases
  182. 0.3.0.3
  183. - Fix ingredient task selection to correctly iterate through all ingredient tasks
  184. - Alter character selection to pick only exact character name matches
  185. - Update leadership tasks
  186. 0.3.0.2
  187. - Exclude alchemy from rare task exclusions due to Aqua Regia (thanks Eversor)
  188. - Reduce GM_setValue calls to avoid tampermonkey failing to save settings (thanks miah)
  189. 0.3.0.1
  190. - Altered mutichar selector to be faster (thanks miah)
  191. - Updated rare tasks selector (thanks Traktor)
  192. - Add option to refine AD during character switching (thanks Eversor)
  193. - Added some level 20 gather tasks
  194. - Increased supply buying to 100 units
  195. 0.3.0.0
  196. - Added Multi-Character support
  197. - Added function to clear all saved settings for script
  198. - Remove disable sound functionality (now configurable in gateway)
  199. 0.2.0.1.8
  200. - Added pause button to allow easy on/off switching
  201. 0.2.0.1.7
  202. - Added option to enable/disable filling optional asset slots
  203. - Added batch potions tasks to be skipped in ingredient selection
  204. - Added timer to reload page if stuck loading for too long
  205. - Added option to disable page sounds
  206. - Updated license to by-nc-sa
  207. 0.2.0.1.6
  208. - Add configurable option for excluding rare tasks
  209. 0.2.0.1.5
  210. - Add ability to specify specific level for tasks and configure same named artificing resource tasks to request correct level of task
  211. - Remove purchase notification that never times out
  212. 0.2.0.1.4
  213. - Added functionality to purchase required resources from gateway shop
  214. 0.2.0.1.3
  215. - Add Artificing and Weaponsmithing to Robot
  216. (Artificing will not work properly yet as all three tiers of gather and craft tasks have the same task name)
  217. 0.2.0.1.2
  218. - Update reload process
  219. - Fix optional asset selector with gateway update
  220. 0.2.0.1.1
  221. - Simplify asset selection after they fixed bug in previous gateway update
  222. - Update level 20 leadership tasks
  223. - Update with changes in Mustex's script (version 15)
  224. * Added a secondary timer that will reload the gateway every few hours. This should help with disconnects from the server
  225. * Implemented tooltips for settings panel
  226. 0.1.9.1.15
  227. - Repeat task reordering for +2 armor
  228. 0.1.9.1.14
  229. - Fix selection of assets after gateway update
  230. - Skip intensive gather tasks added after gateway update
  231. 0.1.9.1.13
  232. - Change ordering of tasks and ingredient checks
  233. The purpose of this is to allow crafting of +4 armors if you have +2 ingredients in your inv but to not create them if you don't.
  234. Creating the ingredients for them is less efficient than crafting ingredients for pants but is more efficient if you already have the ingredients from earlier tasks.
  235. 0.1.9.1.12
  236. - Optimise crafting tasks for highest exp/min gains due to ingredient requirements
  237. 0.1.9.1.11
  238. - Add extra craft tasks for when residuum runs out
  239. 0.1.9.1.10
  240. - Only allow rare tasks to be selected for Leadership
  241. This avoids craft loops where higher quality rare crafts require ingredients with the same name
  242. 0.1.9.1.9
  243. - Alter craft tasks to favour armor to optimise inventory space
  244. 0.1.9.1.8
  245. - Fix script restart bug when no tasks found
  246. 0.1.9.1.7
  247. - Update search string for Potions (After the task names for elxiirs have been changed)
  248. - Remove logon error skips to avoid logons sometimes failing on first load (ensure logon details are correct!)
  249. 0.1.9.1.6
  250. - Update tasks for all professions
  251. - Update ingredient search lists for all professions
  252. 0.1.9.1.5
  253. - Fix regular expression used in potion ingredient search
  254. 0.1.9.1.4
  255. - Alter default timeouts (makes script a lot more stable and less prone to errors)
  256. - Remove unused variable
  257. - Add extra logging for task ingredient searches
  258. 0.1.9.1.3
  259. - Fix bug with required resource checks getting stuck on non craftable resources
  260. 0.1.9.1.2
  261. - Added method to check for required task ingredients and choose tasks to create them
  262. Method is currently hard coded to specify certain search strings for ingredient types
  263. Currently working for all Alchemy tasks
  264. There is a current problem that if you have the required potion ingredient but it is in your belt slots
  265. the task is uncraftable but the ingredients show as available and it will not craft a new one
  266. 0.1.9.1
  267. - Update with changes in Mustex's script (version 12)
  268. * Added tasks for Platesmithing, Leatherworking, Tailoring
  269. * Added detection for the gateway being down
  270. 0.1.8.3.8
  271. - Update asset selection to avoid using coloured assets in junk slots for leadership
  272. 0.1.8.3.7
  273. - Update leadership tasks table due to task reward/duration alterations
  274. 0.1.8.3.6
  275. - Add option to enable/disable automation process
  276. - Update alchemy tasks some more
  277. 0.1.8.3.5
  278. - Add ability to select from multiple tasks with same name (eg Alchemical Research)
  279. - Add craft options for alchemy potions (need to be manually switched since they use the same ingredients)
  280. 0.1.8.3.4
  281. - Add alchemy tasks up to level 20
  282. 0.1.8.3.3
  283. - Change task slot selection to be user configurable options in settings window
  284. - Add level 1 alchemical research
  285. 0.1.8.3.2
  286. - Added ability to specify how many tasks of each profession to train multiple professions at once
  287. - Updated mailsmithing level 0 tasks
  288. 0.1.8.3.1
  289. - Changed asset selection to only update Junk assets
  290. - Leadership asset selection for bronze tier picks lowest asset first
  291. - Modified Leadership tasks
  292. 0.1.8.3
  293. - Tweaked Leadership tasks grid
  294. - Added task grid for Alchemy (Partial)
  295. 0.1.8.2
  296. - onsave handlers for settings are now called before the settings values are saved
  297. - Added onsave handler for console to enable/disable using the window console
  298. 0.1.8.1
  299. - Added checking for errors (using the window title) and will navigate back to the main login page if autologin is enabled
  300. 0.1.8
  301. - Added popup for altering settings
  302. - Settings are saved to script cache
  303. - Added mailsmithing tasks to task grid
  304. 0.1.7
  305. - Added lower level leadership tasks to grid
  306. - Added hiring tasks to leadership task
  307. - Uses saved values to determine which profession type to level (Defaults to Leadership, currently no way to change it)
  308. 0.1.5
  309. - Is now able to recover from missing assets
  310. - Uses a configurable grid to determine what the next task is to complete
  311. 0.1.0
  312. - Is now able to select some hard coded leadership tasks
  313. - Can now collect from any completed slot
  314. */
  315.  
  316. // Make sure it's running on the main page, no frames
  317. if (window.self !== window.top) {
  318. throw "";
  319. }
  320. var current_Gateway = _select_Gateway(); // edited by RottenMind
  321. // Set global console variables
  322. var fouxConsole = {log: function () {
  323. }, info: function () {
  324. }, error: function () {
  325. }, warn: function () {
  326. }};
  327. var console = unsafeWindow.console || fouxConsole;
  328. var chardelay = 0;
  329. var chardiamonds = {};
  330. var definedTask = {};
  331. var startedTask = {}; // stores information about previous (character, taskname, and counter) and currently started task
  332. startedTask["lastTaskChar"] = "";
  333. startedTask["lastTaskName"] = "";
  334. startedTask["lastTaskCount"] = 0;
  335. // Page Reloading function
  336. // Every second the page is idle or loading is tracked
  337. var loading_reset = false; // Enables a periodic reload if this is toggled on by the Auto Reload check box on the settings panel
  338. var s_paused = false; // extend the paused setting to the Page Reloading function
  339.  
  340. // RottenMind (start), multi Url support
  341. function _select_Gateway() { // Check for Gateway used to
  342. if (window.location.href.indexOf("gatewaytest") > -1) { // detect gatewaytest Url
  343. console.log("GatewayTEST detected");
  344. return "http://gatewaytest.playneverwinter.com";
  345. }
  346. else if (window.location.href.indexOf("nw.ru.perfectworld") > -1) {
  347. console.log("GatewayRU detected");
  348. return "http://gateway.nw.ru.perfectworld.eu";
  349. }
  350. else { // must go somewhere
  351. console.log("Gateway detected");
  352. return "http://gateway.playneverwinter.com";
  353. }
  354. }
  355. // RottenMind (END)
  356.  
  357. (function () {
  358. var $ = unsafeWindow.$;
  359.  
  360. //MAC-NW
  361. $.fn.waitUntilExists = function (handler, shouldRunHandlerOnce, isChild) {
  362. var found = 'found';
  363. var $this = $(this.selector);
  364. var $elements = $this.not(function () {
  365. return $(this).data(found);
  366. }).each(handler).data(found, true);
  367. if (!isChild) {
  368. (window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] = window.setInterval(function () {
  369. $this.waitUntilExists(handler, shouldRunHandlerOnce, true);
  370. }, 500);
  371. } else if (shouldRunHandlerOnce && $elements.length) {
  372. window.clearInterval(window.waitUntilExists_Intervals[this.selector]);
  373. }
  374. return $this;
  375. }
  376. // MAC-NW - Wait for tooltip to come up so we can alter the list
  377. $('.tooltip-menu button').waitUntilExists(function () {
  378. // Tooltip has open menu itemtooltip
  379. if ($('button.tooltip-menu button[data-url-silent^="/inventory/item-open"]') && !$('.tooltip-menu div.tooltip-openall').length && !$('.tooltip-menu button[data-url-silent^="/inventory/item-open"]').hasClass('disabled'))
  380. try {
  381. var thisItem = eval("client.dataModel.model." + $('.tooltip-menu button[data-url-silent^="/inventory/item-open"]').attr('data-url-silent').split("=")[1]);
  382. if (thisItem.count > 1) {
  383. if (thisItem.count >= 99)
  384. thisItem.count = 99;
  385. var openAllClick = "for (i = 1; i <= " + thisItem.count + "; i++){ window.setTimeout(function () {client.sendCommand('GatewayInventory_OpenRewardPack', '" + thisItem.uid + "');}, 500); }";
  386. $('div.tooltip-menu').append('<div class="input-field button menu tooltip-openall"><div class="input-bg-left"></div><div class="input-bg-mid"></div><div class="input-bg-right"></div>\
  387. <button class="&nbsp;" onclick="' + openAllClick + '">Open All (' + thisItem.count + ')</button></div>');
  388. //$('a.nav-dungeons').trigger('click'); window.setTimeout(function(){ $('a.nav-inventory').trigger('click'); },2000);
  389. }
  390. } catch (e) {
  391. console.log("ERROR: Did not succeed to add open all tooltip.");
  392. }
  393. });
  394.  
  395. $('.vendor-quantity-block span.attention').waitUntilExists(function () {
  396. if ($('.vendor-quantity-block span.attention span').length)
  397. $('.vendor-quantity-block span.attention').replaceWith('<div class="input-field button"><div class="input-bg-left"></div><div class="input-bg-mid"></div><div class="input-bg-right"></div><button onclick="$(\'input[name=inventorySellQty]\').val(\'' + $(".vendor-quantity-block span.attention span").text() + '\');">All (' + $(".vendor-quantity-block span.attention span").text() + ')</button></div>');
  398. });
  399.  
  400. $('div.notification div.messages li').waitUntilExists(function () {
  401. if ($("div.notification div.messages li").length > 2)
  402. $("div.notification div.messages li").eq(0).remove();
  403. });
  404.  
  405. // Always disable SCA tutorial if its active
  406. $('#help-dimmer.help-cont.whenTutorialActive').waitUntilExists(function () {
  407. client.toggleHelp();
  408. });
  409.  
  410. //MAC-NW
  411.  
  412. var state_loading = 0; // If "Page Loading" takes longer than 30 seconds, reload page (maybe a javascript error)
  413. var state_loading_time = 30; // default of 30 seconds
  414. var state_idle = 0; // If the page is idle for longer than 60 seconds, reload page (maybe a javascript error)
  415. var state_idle_time = 120; // default of 120 seconds
  416. var reload_hours = [2, 6, 10, 14, 18, 22, 23]; // logout and reload every three hours - 2:29 - 6:29 - 10:29 - 14:29 - 18:29 - 22:29 - 23:29
  417. var last_location = ""; // variable to track reference to page URL
  418. var reload_timer = setInterval(function () {
  419. if (!s_paused) {
  420. if (startedTask["lastTaskCount"] >= 20) {
  421. unsafeWindow.location.href = current_Gateway;
  422. return;
  423. }
  424. if (loading_reset) {
  425. var loading_date = new Date();
  426. var loading_sec = Number(loading_date.getSeconds());
  427. var loading_min = Number(loading_date.getMinutes());
  428. var loading_hour = Number(loading_date.getHours());
  429. if (reload_hours.indexOf(loading_hour) >= 0 && loading_min == 29 && loading_sec < 2) {
  430. console.log("Auto Reload");
  431. unsafeWindow.location.href = current_Gateway; // edited by RottenMind
  432. return;
  433. }
  434. }
  435.  
  436. // check for errors
  437. if ($("title").text().match(/Error/) || $("div.modal-content h3").text().match(/Disconnected/)) {
  438. console.log("Error detected - relogging");
  439. unsafeWindow.location.href = current_Gateway; // edited by RottenMind
  440. return;
  441. }
  442.  
  443. if ($("div.loading-image:visible").length) {
  444. last_location = location.href;
  445. state_idle = 0;
  446. if (state_loading >= state_loading_time) {
  447. console.log("Page Loading too long");
  448. state_loading = 0;
  449. location.reload(true);
  450. }
  451. else {
  452. state_loading++;
  453. console.log("Page Loading ...", state_loading + "s");
  454. }
  455. }
  456. // TODO: Add check for gateway disconnected
  457. //<div class="modal-content" id="modal_content"><h3>Disconnected from Gateway</h3><p>You have been disconnected.</p><button type="button" class="modal-button" onclick="window.location.reload(true);">Close</button>
  458.  
  459.  
  460. /* Can't use idle check with dataModel methods
  461. else if (location.href == last_location) {
  462. state_loading = 0;
  463. if (state_idle >= state_idle_time) {
  464. console.log("Page Idle too long");
  465. state_idle = 0;
  466. unsafeWindow.location.href = current_Gateway ; // edited by RottenMind
  467. }
  468. else {
  469. state_idle++;
  470. // comment out to avoid console spam
  471. //console.log("Page Idle ...", state_idle + "s");
  472. }
  473. }
  474. */
  475. else {
  476. last_location = location.href;
  477. state_loading = 0;
  478. state_idle = 0;
  479. }
  480. }
  481. }, 1000);
  482. })();
  483.  
  484. (function () {
  485.  
  486. /**
  487. * Add a string of CSS to the main page
  488. *
  489. * @param {String} cssString The CSS to add to the main page
  490. */
  491. function AddCss(cssString) {
  492. var head = document.getElementsByTagName('head')[0];
  493. if (!head)
  494. return;
  495. var newCss = document.createElement('style');
  496. newCss.type = "text/css";
  497. newCss.innerHTML = cssString;
  498. head.appendChild(newCss);
  499. }
  500. function countLeadingSpaces(str) {
  501. return str.match(/^(\s*)/)[1].length;
  502. }
  503.  
  504. var image_pause = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAY" +
  505. "AAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2" +
  506. "ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG" +
  507. "8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNR" +
  508. "NYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMBy" +
  509. "H/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAI" +
  510. "Cd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOE" +
  511. "AuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dX" +
  512. "Lh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJ" +
  513. "iYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PE" +
  514. "WhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJh" +
  515. "GLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+" +
  516. "AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlT" +
  517. "Ksz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKm" +
  518. "Av1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIB" +
  519. "BKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3" +
  520. "GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7E" +
  521. "irAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJy" +
  522. "KTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksq" +
  523. "Zs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZl" +
  524. "mDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5" +
  525. "Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVV" +
  526. "gqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU" +
  527. "2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2" +
  528. "KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVx" +
  529. "rqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri" +
  530. "6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxb" +
  531. "zwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppS" +
  532. "TbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo" +
  533. "5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8" +
  534. "Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLK" +
  535. "cRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p" +
  536. "7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc" +
  537. "+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+H" +
  538. "p8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw" +
  539. "34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8Yu" +
  540. "ZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIh" +
  541. "OOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hC" +
  542. "epkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa" +
  543. "7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZL" +
  544. "Vy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wt" +
  545. "VCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZt" +
  546. "Jm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkV" +
  547. "PRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvtt" +
  548. "Xa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fc" +
  549. "J3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5Sv" +
  550. "NUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2" +
  551. "+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3d" +
  552. "vfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/c" +
  553. "GhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0Z" +
  554. "jRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0" +
  555. "Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgA" +
  556. "ABdvkl/FRgAAAZ9JREFUeNqU0z+LE2EQBvDfvsuZ3IkoFzSJiuCfeAkWFmJnkz5wjVjlK4i" +
  557. "tnR9BrP0E4uewE/bQwKko2CjR88+BuSMhycbm3RjjNk41z7szz8w8O5Motzqu4iwW+Ir3+L" +
  558. "YemKzh07iLGziJPL4HjPAKz3FcRnAJD3AKXzBb+b7ABhr4jscYQhoDzuBhrDQsIU9iNz9j7" +
  559. "G28wLQg6OMyhrVaLd3Z2dFoNBwdHdna2tJut9XrdZPJJIzH4xHOo4rXAU3cjJXTfr8vyzJZ" +
  560. "lul2u3q9nizL7O3t2d3dLbr+jFvYDuiggjlMp9Nl3/P53Gw2W+IVfxZFbgecw7SYOc/zZUK" +
  561. "e5//gNU22QxRu4f9tgSTE5ThRkIQQ/kifJJIk+QuvJKc4DHizOsLm5uYyoVKpqFarS7zipx" +
  562. "jjXUF5P4o5bDabodVqgcFgIE1TnU4H7O/vOzg4yHEBL/G0IGjgUVzXX1GXMsvjIm3E+B/FI" +
  563. "o3wEXfi7zkuRFoVLBYKeIJPZcd0EfdwLc5ZaLMR/bd4Fm+l9BoLu44rsd0FDuM5f1gP/D0A" +
  564. "BNp57TyT3+MAAAAASUVORK5CYII=";
  565. var image_play = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYA" +
  566. "AAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2Z" +
  567. "pbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8" +
  568. "igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRN" +
  569. "YAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH" +
  570. "/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAIC" +
  571. "d+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEA" +
  572. "uyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXL" +
  573. "h4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJi" +
  574. "YuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEW" +
  575. "hkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhG" +
  576. "Lc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+A" +
  577. "XuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTK" +
  578. "sz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmA" +
  579. "v1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBB" +
  580. "KLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3G" +
  581. "oRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7Ei" +
  582. "rAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyK" +
  583. "TqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZ" +
  584. "s0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlm" +
  585. "DJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5O" +
  586. "l9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVg" +
  587. "qtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2" +
  588. "epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2K" +
  589. "ruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxr" +
  590. "qpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6" +
  591. "qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbz" +
  592. "wdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppST" +
  593. "bmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5" +
  594. "WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8W" +
  595. "uw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKc" +
  596. "RpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7" +
  597. "ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+" +
  598. "9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp" +
  599. "8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw3" +
  600. "4MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZ" +
  601. "lnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhO" +
  602. "OJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCe" +
  603. "pkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7" +
  604. "OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLV" +
  605. "y0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtV" +
  606. "CuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJ" +
  607. "m6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVP" +
  608. "RU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttX" +
  609. "a1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ" +
  610. "3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvN" +
  611. "UyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+" +
  612. "UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dv" +
  613. "fN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cG" +
  614. "hYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0Zj" +
  615. "RoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0K" +
  616. "f7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAA" +
  617. "Bdvkl/FRgAAAYZJREFUeNqk08+KklEYBvDf9+lIEYZDZQ0OIrQZahEuBoLuQqiWIl5BG2k5" +
  618. "W5dzA15AF9EFJOiiRRNkSIw4lTAfCQNmzrToOIkc2nRW5z3n/fe8z/Mm4mcfD3EfCb5hhC/" +
  619. "bjsmWXcJLPMJNLMP7DhY4wRt8jyWo4hVu4Qyrjf8rpKGjJY7xCXLB4TZeB/ssBCaRTn+ggG" +
  620. "d4h4s0fDRQxAy5arWq0+nEZpMiQx7P1w938SRUzkGWZbrdrsFgoFarxZJ8xWPspzgIuH+tP" +
  621. "ZbLpfl8rl6vG41GWq3WdpLLAOUgxb0QfI05Sf7CT9NUr9fT7/dVKpXNmSxRSv3nSQOn+UDV" +
  622. "H86urq9Wq5V2u+3w8NBkMrFB6w7O80EcFyHJCgqFgmKxaDgcajQaxuNxrPBPnORC8IOgvgx" +
  623. "puVw2nU41m01ZlsUGuIf3eJtsCOko0DjbEFgsuBQYOMJs7bjABzzFndDVZUTKe8E+xmlsmX" +
  624. "bxIsC5sZ5J6GiBj/9aptg67wafc3yOrfPvAQDwi2sWVdJBsgAAAABJRU5ErkJggg==";
  625. var image_prefs = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQC" +
  626. "AMAAAAoLQ9TAAAAllBMVEUAGQASEhIfHx8fJy8pKSk2NjZBQUFJR0ZQUE9RUVFSUlJNX3No" +
  627. "aGhsaWdramlycG1meY98fHx+fn5wgpV0iqKKh4R4jaR9jJx8kad9kad/mbONmaWEnrmEnrq" +
  628. "koZy3t7fIx8bKyMHT0c3S0dDU09DV1NPP1t3W1dXY2Njb2tfe29bf3tzj4uHr6+js6+r39/" +
  629. "f5+PgAAABrL3yvAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTA" +
  630. "QCanBgAAAAHdElNRQfWBRoFKh31UQ8DAAAAgUlEQVQY022OxxLCMAwFRSc4BEIPJZQQ08v+" +
  631. "/8+RsTExDDpIe3ijfSJ/hx9g62Dt4GaAI+8YT0t27+BxxvvE/no5pYT10lGFrE34Ja40W3g" +
  632. "1oMGmW7YZ6hnCYexKTPVkXivuvWe1Cz1aKqPNI3N0slI2TNYZiARJX30qERc7wBPKC4WRDz" +
  633. "WdWHfmAAAAAElFTkSuQmCC";
  634. var image_close = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQC" +
  635. "AQAAAC1+jfqAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfW" +
  636. "BRkTNhxuPxLkAAAAHXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBUaGUgR0lNUO9kJW4AAAE" +
  637. "KSURBVCjPhdGxSgNBFAXQMzpgYWwsLEQUDBJBQgqFIChZEPR7/DA/QCGQTgQtJE1ENoWohY" +
  638. "UgbGKQyFjErNv52nObe19wqGWg7z0l5YVgVdOu+wUt507tqIVQ4Zodp861ooELe15M5KFI6" +
  639. "Zfr9u25MIj6Jl4cmSIPBWrq2o5cufO4aOJDYSozNTa2pK4t03PtwUdMKRRykAmW0dTRcyNX" +
  640. "pBQpI8GJDTR050zkNzK0bMMZLvUNZ8yCfy6Wvbc1NVyi4dloXjqWvds6uvp41pFmpVOKJWd" +
  641. "6bgwxkmTMIotWKpwrfBkZl7uMonUHf5wSlV2+fUZrjnXdzrmyy7djD8GWTW9e51z557o1Tz" +
  642. "85FH/WkOkaHQAAAABJRU5ErkJggg==";
  643.  
  644.  
  645. // Setup global closure variables
  646. var $ = unsafeWindow.jQuery;
  647. var timerHandle = 0;
  648. var dfdNextRun = $.Deferred();
  649. var charcurrent = 0; // current character counter
  650. var chartimers = {};
  651. var settingwipe = false; // Use to wipe stored settings
  652. var delay = {
  653. SHORT: 1000,
  654. MEDIUM: 5000,
  655. LONG: 30000,
  656. MINS: 300000,
  657. DEFAULT: 10000, // default delay
  658. TIMEOUT: 60000, // delay for cycle processing timeout
  659. };
  660. var failedProf = [];
  661. var taskSlots = [];
  662. var slotsByProf = {};
  663. var charNameList = []; // better place
  664.  
  665. /*
  666. * Tasklist can be modified to configure the training you want to perform.
  667. * The configurable options window sets how many profession slots you want to use for each profession.
  668. * The level array below for each professions specifies the tasks you want to learn at each crafting level.
  669. * Each craft slot will pick the first task that meets requirements.
  670. * See http://pastebin.com/VaGntEha for Task Name Map.
  671. * Updated list, see http://pastebin.com/inR0Hwv0
  672. * Tools,
  673. * Tasknames extraction, https://greasyfork.org/en/scripts/7977-nw-profession-names
  674. * Inventory listing, https://greasyfork.org/en/scripts/8506-nw-inventory-names
  675. * Some names above do not match, use below code to check:
  676. * var tasks = client.dataModel.model.craftinglist['craft_' + profname].entries.filter(function(entry) { return entry.def && entry.def.displayname == taskname; }); tasks[0].def.name;
  677. */
  678.  
  679. definedTask["Leadership"] = {
  680. // modded to prioritize RAD production, added low level task for speeding up levelling up
  681. taskListName: "Leadership",
  682. taskName: "Leadership",
  683. level: {
  684. 0: ["Leadership_Tier0_Intro_1"],
  685. 1: ["Leadership_Tier0_Intro_5", "Leadership_Tier0_Intro_4", "Leadership_Tier0_Intro_3", "Leadership_Tier0_Intro_2"],
  686. 2: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  687. 3: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  688. 4: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  689. 5: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  690. 6: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  691. 7: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  692. 8: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  693. 9: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore"],
  694. // Begin prioritizing "Battle Undead"
  695. 10: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore"],
  696. 11: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore"],
  697. 12: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore"],
  698. // Add "protect diamonds rare" and the patrol quest as a backup
  699. 13: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier3_13_Patrol", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore"],
  700. 14: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier3_13_Patrol", "Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore"],
  701. 15: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier1_4r_Gatherdiamonds", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier1_4_Protect", "Leadership_Tier3_15r_Raidtreasury", "Leadership_Tier1_5_Explore"],
  702. // Production mode: Spellplague + Battle Undead
  703. 16: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol","Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier3_16_Fight", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_15r_Raidtreasury", "Leadership_Tier1_5_Explore"],
  704. 17: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol","Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier3_16_Fight", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_15r_Raidtreasury", "Leadership_Tier1_5_Explore"],
  705. 18: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol","Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier3_16_Fight", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_15r_Raidtreasury", "Leadership_Tier1_5_Explore"],
  706. 19: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_13_Patrol","Leadership_Tier2_12_Taxes", "Leadership_Tier2_10r_Seekmaps", "Leadership_Tier2_9_Chart", "Leadership_Tier3_16_Fight", "Leadership_Tier2_8r_Givehome", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_15r_Raidtreasury", "Leadership_Tier1_5_Explore"],
  707.  
  708. 20: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_20r_Master2",
  709. "Leadership_Tier3_20r_Master1","Leadership_Tier3_20r_Master3","Leadership_Tier3_20_Destroy",
  710. "Leadership_Tier2_12_Taxes", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_16_Fight",
  711. "Leadership_Tier2_10_Battle", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  712.  
  713. 21: ["Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier3_20r_Master2",
  714. "Leadership_Tier3_20r_Master1","Leadership_Tier3_20r_Master3","Leadership_Tier3_20_Destroy", "Leadership_Tier4_21_Protectmagic",
  715. "Leadership_Tier2_12_Taxes", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_16_Fight",
  716. "Leadership_Tier2_10_Battle", "Leadership_Tier2_9_Chart","Leadership_Tier1_5_Explore"],
  717.  
  718. 22: ["Leadership_Tier4_22r_Capturebandithq", "Leadership_Tier3_13r_Protectdiamonds",
  719. "Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1",
  720. "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier4_21_Protectmagic",
  721. "Leadership_Tier2_12_Taxes", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_16_Fight",
  722. "Leadership_Tier2_10_Battle", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  723.  
  724. 23: ["Leadership_Tier4_22r_Capturebandithq", "Leadership_Tier3_13r_Protectdiamonds",
  725. "Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1","Leadership_Tier3_20r_Master3",
  726. "Leadership_Tier3_20_Destroy", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_12_Taxes",
  727. "Leadership_Tier4_21_Protectmagic","Leadership_Tier3_13_Patrol","Leadership_Tier3_16_Fight",
  728. "Leadership_Tier2_10_Battle", "Leadership_Tier2_9_Chart","Leadership_Tier1_5_Explore"],
  729.  
  730. 24: ["Leadership_Tier4_22r_Capturebandithq", "Leadership_Tier3_13r_Protectdiamonds",
  731. "Leadership_Tier4_24r_Killdragon","Leadership_Tier3_20r_Master2","Leadership_Tier3_20r_Master1",
  732. "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier2_12_Taxes",
  733. "Leadership_Tier4_21_Protectmagic","Leadership_Tier3_13_Patrol","Leadership_Tier3_16_Fight",
  734. "Leadership_Tier2_10_Battle", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  735.  
  736. 25: ["Leadership_Tier4_25r_Huntexperiment","Leadership_Tier4_22r_Capturebandithq",
  737. "Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier4_24r_Killdragon",
  738. "Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1","Leadership_Tier3_20r_Master3",
  739. "Leadership_Tier3_20_Destroy","Leadership_Tier2_12_Taxes", "Leadership_Tier4_25_Battleelementalcultists",
  740. "Leadership_Tier4_21_Protectmagic", "Leadership_Tier3_13_Patrol","Leadership_Tier3_16_Fight",
  741. "Leadership_Tier2_10_Battle", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  742.  
  743. /*
  744.  
  745. "Leadership_Tier1_2_Guardduty" 0/2 -> 0
  746. "Leadership_Tier1_4_Protect" 100/2 -> 50
  747. "Leadership_Tier2_8_Protect" 200/6 -> 33.33
  748. "Leadership_Tier2_10_Battle" 400/6 -> 66.66
  749. "Leadership_Tier3_16_Fight" 400/6 -> 66.66
  750.  
  751. "Leadership_Tier3_18_Resell", 3x "Leadership_Tier2_8_Protect" 1000/26 -> 38.46
  752. "Leadership_Tier3_18_Resell" 400/8 -> 50
  753. "Leadership_Tier2_8_Protect" 200/6 -> 33.33
  754.  
  755. "Leadership_Tier2_12_Taxes", "Leadership_Tier2_9_Chart", 3x "Leadership_Tier1_5_Explore" 800/16 -> 50
  756. "Leadership_Tier2_12_Taxes", "Leadership_Tier2_9_Chart" 800/10 -> 80
  757. "Leadership_Tier2_12_Taxes" 800/8 -> 100
  758. "Leadership_Tier2_9_Chart" 0/2 -> 0
  759. "Leadership_Tier1_5_Explore" 0/2 -> 0
  760.  
  761. 2x "Leadership_Tier2_12_Taxes", Leadership_Tier2_10r_Seekmaps 1600/22 -> 72.72
  762. "Leadership_Tier2_12_Taxes" 800/8 -> 100
  763. "Leadership_Tier2_10r_Seekmaps" 0/6 -> 0 (2x District Maps) (1x optional)
  764.  
  765. "Leadership_Tier2_12_Taxes", Leadership_Tier2_9_Chart, Leadership_Tier1_6r_Protectsurvey 800/18 -> 44.44
  766. "Leadership_Tier2_12_Taxes", Leadership_Tier2_9_Chart 800/16 -> 50
  767. Leadership_Tier2_12_Taxes" 800/8 -> 100
  768. "Leadership_Tier2_9_Chart" 0/2 -> 0
  769. Leadership_Tier1_6r_Protectsurvey 0/8 -> 0 (3x Local Map)
  770.  
  771. Leadership_Tier3_17_Deliver, 3x Leadership_Tier3_13_Patrol 1200/20 -> 60
  772. "Leadership_Tier3_17_Deliver" 1200/8 -> 150 (No, because we can get a purple chest if we use this with Leadership_Tier3_20r_Master3)
  773. Leadership_Tier3_13_Patrol 0/4 -> 0
  774.  
  775. // Has an asset slot... so marginally better if you have better people....
  776. "Leadership_Tier1_4r_Gatherdiamonds" 400/8 -> 50 (1x optional)
  777.  
  778. Leadership_Tier3_13r_Protectdiamonds, 1x Leadership_Tier3_13_Patrol 1600/16 -> 100
  779. Leadership_Tier3_13r_Protectdiamonds 1600/12 -> 133.33
  780. Leadership_Tier3_13_Patrol 0/4 -> 0
  781.  
  782. Leadership_Tier2_8r_Givehome 800/12 -> 66.66 (Barrel of Goods)
  783.  
  784. "Leadership_Tier3_15r_Raidtreasury" 400/8 -> 50 (1x optional) (blue chest)
  785. Leadership_Tier3_14_Assemble 0/4 -> 0
  786.  
  787. Leadership_Tier3_19r_Siegekeep, 3x Leadership_Tier3_19_Acquire 1600/48 -> 33.33 (1x optional) (purple chest)
  788. Leadership_Tier3_19r_Siegekeep 1600/12 -> 133.33 (1x optional) (purple chest)
  789. Leadership_Tier3_19_Acquire 0/12 -> 0
  790.  
  791. Leadership_Tier3_20r_Master1, 1x Leadership_Tier3_14_Assemble, 3x Build Shelters 1600/52 -> 30.77
  792. Leadership_Tier3_20r_Master1, 1x Leadership_Tier3_14_Assemble 1600/16 -> 100
  793. Leadership_Tier3_20r_Master1 1600/12 -> 133.33
  794. Leadership_Tier3_14_Assemble 0/4 -> 0
  795. Build Shelters (L16) 0/12 -> 0
  796.  
  797. Leadership_Tier3_20r_Master2, 1x Leadership_Tier3_19_Acquire, 3x Build Shelters 1600/60 -> 26.66
  798. Leadership_Tier3_20r_Master2, 1x Leadership_Tier3_19_Acquire, 1600/24 -> 66.66
  799. Leadership_Tier3_20r_Master2 1600/12 -> 133.33
  800. Leadership_Tier3_19_Acquire 0/12 -> 0
  801. Build Shelters (L16) 0/12 -> 0
  802.  
  803. Leadership_Tier3_20r_Master3, 1x Leadership_Tier3_13_Patrol, 3x Build Shelters 1600/52 -> 30.77
  804. Leadership_Tier3_20r_Master3 1x Leadership_Tier3_13_Patrol 1600/16 -> 100
  805. Leadership_Tier3_20r_Master3 1600/12 -> 133.33
  806. Leadership_Tier3_13_Patrol 0/4 -> 0
  807. Build Shelters (L16) 0/12 -> 0
  808.  
  809. Leadership_Tier3_20_Destroy 1600/12 -> 133.33
  810.  
  811. Leadership_Tier3_16r_Buildshelters 12hr -> purple chest, Mark of Gratitude
  812. 15 Refugees
  813.  
  814.  
  815. /professions-tasks/Leadership/Leadership_Tier3_15_Rescue 0/8 -> 8
  816. /professions-tasks/Leadership/Leadership_Tier2_8r_Helpneedy
  817.  
  818. /professions-tasks/Leadership/Leadership_Tier2_11r_Escortgoods 400/12 -> 33.33 (2x Bill Of Sale)
  819.  
  820.  
  821. */
  822.  
  823.  
  824. /*
  825. 0: ["Leadership_Tier0_Intro_1"],
  826. 1: ["Leadership_Tier0_Intro_5", "Leadership_Tier0_Intro_4", "Leadership_Tier0_Intro_3", "Leadership_Tier0_Intro_2"],
  827. 2: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  828. 3: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  829. 4: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  830. 5: ["Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  831. 6: ["Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  832. 7: ["Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  833. 8: ["Leadership_Tier1_4_Protect", "Leadership_Tier1_5_Explore", "Leadership_Tier1_2_Guardduty"],
  834. 9: ["Leadership_Tier1_4_Protect", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  835. // Begin prioritizing "Battle Undead"
  836. 10: ["Leadership_Tier2_10_Battle", "Leadership_Tier1_4_Protect", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  837. 11: ["Leadership_Tier2_10_Battle", "Leadership_Tier1_4_Protect", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  838. 12: ["Leadership_Tier2_10_Battle", "Leadership_Tier1_4_Protect", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  839. // Add "protect diamonds rare" and the patrol quest as a backup
  840. 13: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4_Protect", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  841. 14: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4_Protect", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  842. 15: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_10_Battle", "Leadership_Tier1_4_Protect", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  843. // AD Production mode: Spellplague + Battle Undead
  844. 16: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  845. 17: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_17_Deliver", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  846. 18: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_17_Deliver", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  847. 19: ["Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier3_17_Deliver", "Leadership_Tier2_12_Taxes", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  848. // 20
  849. 20: ["Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  850. 21: ["Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  851. 22: ["Leadership_Tier4_22r_Capturebandithq","Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  852. 23: ["Leadership_Tier4_22r_Capturebandithq","Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  853. 24: ["Leadership_Tier4_22r_Capturebandithq","Leadership_Tier4_24r_Killdragon","Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  854. 25: ["Leadership_Tier4_25r_Huntexperiment","Leadership_Tier4_22r_Capturebandithq","Leadership_Tier4_24r_Killdragon","Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds","Leadership_Tier4_25_Battleelementalcultists", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  855. */
  856.  
  857. },
  858. };
  859.  
  860. definedTask["Leadership XP"] = {
  861. taskListName: "Leadership_XP",
  862. taskName: "Leadership",
  863. level: {
  864.  
  865. /* Info here isn't reflected in list below as yet.
  866. Leadership_Tier1_Feedtheneedy Exp5/0.166 -> 30
  867. Leadership_Tier1_2_Training Exp80/4 -> 20
  868. Leadership_Tier1_2_Guardduty Exp40/2 -> 20
  869. Leadership_Tier1_4_Protect Exp40/2 -> 20
  870. Leadership_Tier1_5_Explore Exp40/2 -> 20
  871. Leadership_Tier2_7_Training Exp160/8 -> 20
  872. Leadership_Tier2_7_Raid Exp80/4 -> 20
  873. Leadership_Tier2_9_Chart Exp80/2 -> 40
  874. Leadership_Tier2_9_Chart, 3x Leadership_Tier1_5_Explore Exp200/8 -> 25
  875. Leadership_Tier3_13_Training Exp240/8 -> 30
  876. Leadership_Tier3_13_Patrol Exp120/4 -> 30
  877. Leadership_Tier3_14_Assemble Exp120/4 -> 30
  878. */
  879.  
  880.  
  881. 0: ["Leadership_Tier0_Intro_1"],
  882. 1: ["Leadership_Tier0_Intro_5", "Leadership_Tier0_Intro_4", "Leadership_Tier0_Intro_3", "Leadership_Tier0_Intro_2"],
  883. 2: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  884. 3: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  885. 4: ["Leadership_Tier1_Feedtheneedy", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty", "Leadership_Tier1_2_Training"],
  886. 5: ["Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  887. 6: ["Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  888. 7: ["Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  889. 8: ["Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  890. 9: ["Leadership_Tier1_5_Explore", "Leadership_Tier2_9_Chart", "Leadership_Tier1_4_Protect"],
  891. 10: ["Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  892. 11: ["Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  893. 12: ["Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier1_2_Guardduty"],
  894. 13: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  895. 14: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  896. 15: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  897. 16: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  898. 17: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  899. 18: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  900. 19: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier3_13_Training", "Leadership_Tier1_5_Explore", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  901. 20: ["Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart","Leadership_Tier1_5_Explore", "Leadership_Tier3_13_Training", "Leadership_Tier1_4_Protect", "Leadership_Tier2_7_Training"],
  902. // 20: ["Leadership_Tier3_13_Patrol","Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier3_20r_Master2", "Leadership_Tier3_20r_Master1", "Leadership_Tier3_20r_Master3", "Leadership_Tier3_20_Destroy", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol"],
  903. 21: ["Leadership_Tier4_21_Protectmagic","Leadership_Tier4_21_Training","Leadership_Tier2_9_Chart","Leadership_Tier1_5_Explore","Leadership_Tier3_13_Patrol"],
  904. 22: ["Leadership_Tier4_22_Guardclerics","Leadership_Tier4_21_Training","Leadership_Tier2_9_Chart","Leadership_Tier1_5_Explore","Leadership_Tier3_13_Patrol"],
  905. 23: ["Leadership_Tier4_21_Protectmagic","Leadership_Tier4_22_Guardclerics","Leadership_Tier4_21_Protectmagic","Leadership_Tier4_21_Training","Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  906. 24: ["Leadership_Tier4_24_Wizardsseneschal","Leadership_Tier4_22_Guardclerics","Leadership_Tier4_21_Protectmagic","Leadership_Tier4_21_Training","Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  907. 25: ["Leadership_Tier4_25r_Huntexperiment", "Leadership_Tier4_21_Protectmagic", "Leadership_Tier4_24_Wizardsseneschal","Leadership_Tier4_22_Guardclerics","Leadership_Tier4_22_Guardclerics","Leadership_Tier4_25_Battleelementalcultists", "Leadership_Tier3_20_Destroy", "Leadership_Tier3_13r_Protectdiamonds", "Leadership_Tier2_12_Taxes", "Leadership_Tier3_16_Fight", "Leadership_Tier2_10_Battle", "Leadership_Tier3_13_Patrol", "Leadership_Tier2_9_Chart", "Leadership_Tier1_5_Explore"],
  908. },
  909. };
  910.  
  911. definedTask["Winter Event"] = {
  912. taskListName: "WinterEvent",
  913. taskName: "WinterEvent",
  914. level: {
  915. /*
  916. 0:["Event_Winter_Tier1_Heros_Feast, Event_Winter_Tier1_Lightwine, Event_Winter_Tier1_Sparkliest_Gem"],
  917. 1:["Event_Winter_Tier1_Heros_Feast, Event_Winter_Tier1_Lightwine, Event_Winter_Tier1_Sparkliest_Gem"],
  918. 2:["Event_Winter_Tier1_Heros_Feast, Event_Winter_Tier1_Lightwine, Event_Winter_Tier1_Sparkliest_Gem"],
  919. 3:["Event_Winter_Tier1_Heros_Feast, Event_Winter_Tier1_Lightwine, Event_Winter_Tier1_Sparkliest_Gem"],
  920. */
  921.  
  922. 0: ["Event_Winter_Tier0_Intro"],
  923. 1: ["Event_Winter_Tier1_Rankup", /*"Event_Winter_Tier1_Shiny_Lure",*/"Event_Winter_Tier1_Refine", "Event_Winter_Tier1_Gather"],
  924. 2: ["Event_Winter_Tier1_Rankup_2", /*"Event_Winter_Tier1_Fishingpole_Blue","Event_Winter_Tier1_Shiny_Lure_Mass",*/"Event_Winter_Tier1_Refine_2", "Event_Winter_Tier1_Gather_2"],
  925. 3: [/*"Event_Winter_Tier1_Heros_Feast","Event_Winter_Tier1_Lightwine","Event_Winter_Tier1_Sparkliest_Gem","Event_Winter_Tier1_Mesmerizing_Lure",*/"Event_Winter_Tier1_Gather_3"],
  926. },
  927. };
  928.  
  929. definedTask["Siege Event"] = {
  930. taskListName: "Event_Siege",
  931. taskName: "Event_Siege",
  932. level: {
  933. 0:["Event_Siege_Tier0_Intro"], // Hire a Siege Master
  934. 1:["Event_Siege_Tier1_Donate_Majorinjury", "Event_Siege_Tier1_Donate_Injury", "Event_Siege_Tier1_Donate_Resources_T3", "Event_Siege_Tier1_Donate_Resources_T2"],
  935. /*
  936. 0: ["Event_Siege_Tier0_Intro"], // Hire a Siege Master
  937. //1:["Event_Siege_Tier1_Donate_Minorinjury"], // Create Defense Supplies from Minor Injury Kits
  938. //1:["Event_Siege_Tier1_Donate_Injury"], // Create Defense Supplies from Injury Kits
  939. //1:["Event_Siege_Tier1_Donate_Majorinjury"], // Create Defense Supplies from Major Injury Kits
  940. //1:["Event_Siege_Tier1_Donate_Altar_10"], // Create Defense Supplies from 10 Portable Altars
  941. //1:["Event_Siege_Tier1_Donate_Altar_50"], // Create Defense Supplies from 50 Portable Altars
  942. //1:["Event_Siege_Tier1_Donate_Resources_T2"], // Create Defense Supplies from Tier 2 crafting resources
  943. //1:["Event_Siege_Tier1_Donate_Resources_T3"], // Create Defense Supplies from Tier 3 crafting resources
  944. 1: ["Event_Siege_Tier1_Donate_Resources_T3", "Event_Siege_Tier1_Donate_Resources_T2", "Event_Siege_Tier1_Donate_Minorinjury", "Event_Siege_Tier1_Donate_Injury", "Event_Siege_Tier1_Donate_Majorinjury", "Event_Siege_Tier1_Donate_Altar_10"],
  945. */
  946. },
  947. };
  948.  
  949. definedTask["Black Ice Shaping"] = {
  950. taskListName: "BlackIce",
  951. taskName: "BlackIce",
  952. level: {
  953. 1: ["Blackice_Tier1_Process_Blackice"],
  954. 2: ["Blackice_Tier1_Process_Blackice"],
  955. 3: ["Blackice_Tier1_Process_Blackice"],
  956. 4: ["Blackice_Tier1_Process_Blackice"],
  957. 5: ["Blackice_Tier1_Process_Blackice"],
  958.  
  959. /*
  960. 1:["Forge Hammerstone Pick","Gather Raw Black Ice","Truesilver Pick Grip","Process Raw Black Ice","Upgrade Chillwright","Hire an additional Chillwright"],
  961. 2:["Forge Hammerstone Pick","Gather Raw Black Ice","Truesilver Pick Grip","Process Raw Black Ice","Upgrade Chillwright","Hire an additional Chillwright"],
  962. 3:["Forge Hammerstone Pick","Gather Raw Black Ice","Truesilver Pick Grip","Process Raw Black Ice","Upgrade Chillwright","Hire an additional Chillwright"],
  963. */
  964. },
  965. };
  966.  
  967. definedTask["Jewelcrafting"] = {
  968. taskListName: "Jewelcrafting",
  969. taskName: "Jewelcrafting",
  970. level: {
  971. // Gather Mithral Ore and Exotic Pelts (14): Jewelcrafting_Tier3_Gather_Basic,
  972. // Semi-Precious Gem and Tough Leather Strip Crafting (7): Jewelcrafting_Tier2_Refine_Basic,
  973. // Gather High Quality Iron Ore and Tough Pelts (7): Jewelcrafting_Tier2_Gather_Basic,
  974. // Craft Raw Gems and Simple Leather Strips (1): Jewelcrafting_Tier1_Refine_Basic,
  975. // Gather Iron Ore and Simple Pelts (1): Jewelcrafting_Tier1_Gather_Basic
  976. // 0:["Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  977.  
  978. 0: ["Jewelcrafting_Tier0_Intro"],
  979. 1: ["Jewelcrafting_Tier1_Waist_Offense_1", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  980. 2: ["Jewelcrafting_Tier1_Waist_Offense_1", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  981. 3: ["Jewelcrafting_Tier1_Neck_Offense_1", "Jewelcrafting_Tier1_Waist_Offense_1", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  982. 4: ["Jewelcrafting_Tier1_Neck_Offense_1", "Jewelcrafting_Tier1_Waist_Misc_1", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  983. 5: ["Jewelcrafting_Tier1_Neck_Offense_1", "Jewelcrafting_Tier1_Waist_Misc_1", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  984. 6: ["Jewelcrafting_Tier1_Neck_Misc_1", "Jewelcrafting_Tier1_Waist_Misc_1", "Jewelcrafting_Tier1_Refine_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  985. 7: ["Jewelcrafting_Tier2_Waist_Offense_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  986. 8: ["Jewelcrafting_Tier2_Waist_Offense_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  987. 9: ["Jewelcrafting_Tier2_Neck_Offense_2", "Jewelcrafting_Tier2_Waist_Offense_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  988. 10: ["Jewelcrafting_Tier2_Waist_Misc_2", "Jewelcrafting_Tier2_Neck_Offense_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  989. 11: ["Jewelcrafting_Tier2_Waist_Misc_2", "Jewelcrafting_Tier2_Neck_Offense_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  990. 12: ["Jewelcrafting_Tier2_Waist_Misc_2", "Jewelcrafting_Tier2_Neck_Offense_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  991. 13: ["Jewelcrafting_Tier2_Neck_Misc_2", "Jewelcrafting_Tier2_Waist_Misc_2", "Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  992. 14: ["Jewelcrafting_Tier3_Waist_Offense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  993. 15: ["Jewelcrafting_Tier3_Waist_Offense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  994. 16: ["Jewelcrafting_Tier3_Neck_Offense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  995. 17: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  996. 18: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  997. 19: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  998. 20: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  999. 21: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  1000. 22: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  1001. 23: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  1002. 24: ["Jewelcrafting_Tier3_Neck_Defense_3", "Jewelcrafting_Tier3_Waist_Defense_3", "Jewelcrafting_Tier3_Refine_Basic", "Jewelcrafting_Tier3_Gather_Basic", "Jewelcrafting_Tier2_Gather_Basic", "Jewelcrafting_Tier1_Gather_Basic"],
  1003. 25: ["Jewelcrafting_Tier2_Refine_Basic", "Jewelcrafting_Tier1_Refine_Basic"],
  1004.  
  1005. /*
  1006.  
  1007. Jewelcrafting_Tier3_Gather_Basic 60/30 -> 2
  1008. Jewelcrafting_Tier3_Gather_Basic_Mass 800/480 -> 1.66
  1009.  
  1010. 10%
  1011. 60/(30/1.1) -> 2.2
  1012. 800/(480/1.1) -> 1.833
  1013.  
  1014. 25%:
  1015. 60/(30/1.25) -> 2.5
  1016. 800/(480/1.25) -> 2.0833
  1017.  
  1018. */
  1019.  
  1020.  
  1021.  
  1022. },
  1023. };
  1024.  
  1025. definedTask["Mailsmithing"] = {
  1026. taskListName: "Mailsmithing",
  1027. taskName: "Armorsmithing_Med",
  1028. level: {
  1029. // Med_Armorsmithing_Tier3_Scale_Pants (15)
  1030. // Med_Armorsmithing_Tier3_Scale_Shirt (14)
  1031. // 0:["Med_Armorsmithing_Tier3_Scale_Pants", "Med_Armorsmithing_Tier3_Scale_Shirt", "Med_Armorsmithing_Tier2_Scale_Pants_1_Set2", "Med_Armorsmithing_Tier2_Scale_Shirt", "Med_Armorsmithing_Tier1_Scale_Gloves_1", "Med_Armorsmithing_Tier1_Scale_Armor_1", "Med_Armorsmithing_Tier1_Scale_Shirt_1"],
  1032.  
  1033. 0: ["Med_Armorsmithing_Tier0_Intro"],
  1034. 1: ["Med_Armorsmithing_Tier1_Gather_Basic"],
  1035. 2: ["Med_Armorsmithing_Tier1_Chain_Armor_1", "Med_Armorsmithing_Tier1_Chain_Pants_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1036. 3: ["Med_Armorsmithing_Tier1_Chain_Armor_1", "Med_Armorsmithing_Tier1_Chain_Boots_Set_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1037. 4: ["Med_Armorsmithing_Tier1_Chain_Armor_1", "Med_Armorsmithing_Tier1_Chain_Boots_Set_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1038. 5: ["Med_Armorsmithing_Tier1_Chain_Armor_Set_1", "Med_Armorsmithing_Tier1_Chain_Boots_Set_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1039. 6: ["Med_Armorsmithing_Tier1_Chain_Armor_Set_1", "Med_Armorsmithing_Tier1_Chain_Boots_Set_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1040. 7: ["Med_Armorsmithing_Tier1_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt","Med_Armorsmithing_Tier1_Gather_Basic","Med_Armorsmithing_Tier1_Gather_Basic"],
  1041. 8: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_1", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt","Med_Armorsmithing_Tier1_Gather_Basic"],
  1042. 9: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_1", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt","Med_Armorsmithing_Tier1_Gather_Basic"],
  1043. 10: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_1", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt_2","Med_Armorsmithing_Tier1_Gather_Basic","Med_Armorsmithing_Tier1_Gather_Basic"],
  1044. 11: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_2", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt_2", "Med_Armorsmithing_Tier2_Chain_Pants_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1045. 12: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_2", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt_2", "Med_Armorsmithing_Tier2_Chain_Pants_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1046. 13: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_2", "Med_Armorsmithing_Tier2_Chain_Boots_Set_1", "Med_Armorsmithing_Tier2_Chain_Shirt_2", "Med_Armorsmithing_Tier2_Chain_Pants_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1047. 14: ["Med_Armorsmithing_Tier2_Chain_Armor_Set_1", "Med_Armorsmithing_Tier2_Chain_Pants_2", "Med_Armorsmithing_Tier3_Chain_Shirt", "Med_Armorsmithing_Tier3_Chain_Boots_Set_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1048. 15: ["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Boots_Set_1","Med_Armorsmithing_Tier1_Gather_Basic"],
  1049. 16: ["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1050. 17: ["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1051. 18: ["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1052. 19: ["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1053. 20: ["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1054. 21 :["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1055. 22 :["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1056. 23 :["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1057. 24 :["Med_Armorsmithing_Tier3_Chain_Armor_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants2", "Med_Armorsmithing_Tier3_Chain_Shirt2", "Med_Armorsmithing_Tier3_Chain_Helm_Set_1", "Med_Armorsmithing_Tier3_Chain_Pants","Med_Armorsmithing_Tier1_Gather_Basic"],
  1058. 25 :["Med_Armorsmithing_Tier2_Refine_Basic"],
  1059. //20: ["Med_Armorsmithing_Tier2_Refine_Basic"],
  1060. //19:["Chain Armor +4","Fancy Chain Pants","Fancy Chain Shirt","Chain Helm +4","Ornate Chain Pants","Upgrade Blacksmith","Upgrade Prospector","Hire an additional Prospector"],
  1061. //20:["Forge Steel Rings and Scales"],
  1062.  
  1063. },
  1064. };
  1065.  
  1066. definedTask["Platesmithing"] = {
  1067. taskListName: "Platesmithing",
  1068. taskName: "Armorsmithing_Heavy",
  1069. level: {
  1070. 0: ["Hvy_Armorsmithing_Tier0_Intro"],
  1071. 1: ["Hvy_Armorsmithing_Tier1_Plate_Boots_1", "Hvy_Armorsmithing_Tier1_Plate_Shirt_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1072. 2: ["Hvy_Armorsmithing_Tier1_Plate_Armor_1", "Hvy_Armorsmithing_Tier1_Plate_Pants_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1073. 3: ["Hvy_Armorsmithing_Tier1_Plate_Armor_1", "Hvy_Armorsmithing_Tier1_Plate_Boots_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1074. 4: ["Hvy_Armorsmithing_Tier1_Plate_Armor_1", "Hvy_Armorsmithing_Tier1_Plate_Boots_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1075. 5: ["Hvy_Armorsmithing_Tier1_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier1_Plate_Boots_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1076. 6: ["Hvy_Armorsmithing_Tier1_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier1_Plate_Boots_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1077. 7: ["Hvy_Armorsmithing_Tier1_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt", "Hvy_Armorsmithing_Tier2_Shield_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1078. 8: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_1", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1079. 9: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_1", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1080. 10: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_1", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt_2","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1081. 11: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_2", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt_2", "Hvy_Armorsmithing_Tier2_Plate_Pants_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1082. 12: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_2", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt_2", "Hvy_Armorsmithing_Tier2_Plate_Pants_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1083. 13: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_2", "Hvy_Armorsmithing_Tier2_Plate_Boots_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Shirt_2", "Hvy_Armorsmithing_Tier2_Plate_Pants_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1084. 14: ["Hvy_Armorsmithing_Tier2_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier2_Plate_Pants_2", "Hvy_Armorsmithing_Tier3_Plate_Shirt", "Hvy_Armorsmithing_Tier3_Plate_Boots_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1085. 15: ["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Boots_Set_1","Hvy_Armorsmithing_Tier1_Gather_Basic","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1086. 16: ["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1087. 17: ["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1088. 18: ["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1089. 19: ["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1090. 20: ["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1091. 21 :["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1092. 22 :["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1093. 23 :["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1094. 24 :["Hvy_Armorsmithing_Tier3_Plate_Armor_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants2", "Hvy_Armorsmithing_Tier3_Plate_Shirt2", "Hvy_Armorsmithing_Tier3_Plate_Helm_Set_1", "Hvy_Armorsmithing_Tier3_Plate_Pants","Hvy_Armorsmithing_Tier1_Gather_Basic"],
  1095. 25 :["Hvy_Armorsmithing_Tier2_Refine_Basic"],
  1096. //20: ["Hvy_Armorsmithing_Tier2_Refine_Basic"],
  1097. //19:["Plate Armor +4","Fancy Plate Pants","Fancy Plate Shirt","Plate Helm +4","Ornate Plate Pants","Upgrade Armorer","Upgrade Miner","Hire an additional Miner"],
  1098. //20:["Forge Steel Plates"],
  1099. },
  1100. };
  1101.  
  1102. definedTask["Leatherworking"] = {
  1103. taskListName: "Leatherworking",
  1104. taskName: "Leatherworking",
  1105. level: {
  1106. /* No Residuum:
  1107. 0:["Leatherworking_Tier0_Intro_1"],
  1108. // 1:["Leatherworking_Tier1_Darkleather_Boots_1"],
  1109. 1:["Leatherworking_Tier1_Hide_Boots_1"],
  1110. // 1:["Leatherworking_Tier1_Leather_Boots_1"],
  1111. // 1:["Leatherworking_Tier1_Leather_Shirt_1_Set2"],
  1112. // 2:["Leatherworking_Tier1_Darkleather_Armor_1"],
  1113. 2:["Leatherworking_Tier1_Hide_Armor_1"],
  1114. // 2:["Leatherworking_Tier1_Leather_Armor_1"],
  1115. // 2:["Leatherworking_Tier1_Leather_Pants_1"],
  1116. // 2:["Leatherworking_Tier1_Leather_Pants_1_Set2"],
  1117. // 3:["Leatherworking_Tier1_Darkleather_Gloves_1"],
  1118. 3:["Leatherworking_Tier1_Hide_Gloves_1"],
  1119. 4:["Leatherworking_Tier1_Hide_Gloves_1"],
  1120. 5:["Leatherworking_Tier1_Hide_Gloves_1"],
  1121. 6:["Leatherworking_Tier1_Hide_Gloves_1"],
  1122. // 3:["Leatherworking_Tier1_Leather_Gloves_1"],
  1123. 7:["Leatherworking_Tier2_Leather_Shirt"],
  1124. // 7:["Leatherworking_Tier2_Leather_Shirt_Set2"],
  1125. 8:["Leatherworking_Tier2_Leather_Pants_1"],
  1126. 9:["Leatherworking_Tier2_Leather_Pants_1"],
  1127. 10:["Leatherworking_Tier2_Leather_Pants_1"],
  1128. 11:["Leatherworking_Tier2_Leather_Pants_1"],
  1129. 12:["Leatherworking_Tier2_Leather_Pants_1"],
  1130. 13:["Leatherworking_Tier2_Leather_Pants_1"],
  1131. // 8:["Leatherworking_Tier2_Leather_Pants_1_Set2"],
  1132. 14:["Leatherworking_Tier3_Leather_Shirt"],
  1133. // 14:["Leatherworking_Tier3_Leather_Shirt_Set2"],
  1134. 15:["Leatherworking_Tier3_Leather_Pants"],
  1135. 16:["Leatherworking_Tier3_Leather_Pants"],
  1136. 17:["Leatherworking_Tier3_Leather_Pants"],
  1137. 18:["Leatherworking_Tier3_Leather_Pants"],
  1138. 19:["Leatherworking_Tier3_Leather_Pants"],
  1139. 20:["Leatherworking_Tier3_Leather_Pants"],
  1140. // 15:["Leatherworking_Tier3_Leather_Pants_Set2"],
  1141. */
  1142.  
  1143. 0: ["Leatherworking_Tier0_Intro_1"],
  1144. 1: ["Leatherworking_Tier1_Leather_Boots_1", "Leatherworking_Tier1_Leather_Shirt_1","Leatherworking_Tier1_Gather_Basic"],
  1145. 2: ["Leatherworking_Tier1_Leather_Armor_1", "Leatherworking_Tier1_Leather_Pants_1","Leatherworking_Tier1_Gather_Basic"],
  1146. 3: ["Leatherworking_Tier1_Leather_Armor_1", "Leatherworking_Tier1_Leather_Boots_Set_1","Leatherworking_Tier1_Gather_Basic"],
  1147. 4: ["Leatherworking_Tier1_Leather_Armor_1", "Leatherworking_Tier1_Leather_Boots_Set_1","Leatherworking_Tier1_Gather_Basic"],
  1148. 5: ["Leatherworking_Tier1_Leather_Armor_Set_1", "Leatherworking_Tier1_Leather_Boots_Set_1","Leatherworking_Tier1_Gather_Basic"],
  1149. 6: ["Leatherworking_Tier1_Leather_Armor_Set_1", "Leatherworking_Tier1_Leather_Boots_Set_1","Leatherworking_Tier1_Gather_Basic"],
  1150. 7: ["Leatherworking_Tier1_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt","Leatherworking_Tier1_Gather_Basic"],
  1151. 8: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_1", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt","Leatherworking_Tier1_Gather_Basic"],
  1152. 9: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_1", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt","Leatherworking_Tier1_Gather_Basic"],
  1153. 10: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_1", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt_2","Leatherworking_Tier1_Gather_Basic"],
  1154. 11: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_2", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt_2", "Leatherworking_Tier2_Leather_Pants_1","Leatherworking_Tier1_Gather_Basic"],
  1155. 12: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_2", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt_2", "Leatherworking_Tier2_Leather_Pants_1","Leatherworking_Tier1_Gather_Basic"],
  1156. 13: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_2", "Leatherworking_Tier2_Leather_Boots_Set_1", "Leatherworking_Tier2_Leather_Shirt_2", "Leatherworking_Tier2_Leather_Pants_1","Leatherworking_Tier1_Gather_Basic"],
  1157. 14: ["Leatherworking_Tier2_Leather_Armor_Set_1", "Leatherworking_Tier2_Leather_Pants_2", "Ornate Leatherworking_Tier1_Leather_Shirt_1", "Leatherworking_Tier3_Leather_Boots_Set_1","Leatherworking_Tier1_Gather_Basic"],
  1158. 15: ["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Boots_Set_1","Leatherworking_Tier1_Gather_Basic"],
  1159. 16: ["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1160. 17: ["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1161. 18: ["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1162. 19: ["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1163. 20: ["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1164. 21 :["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1165. 22 :["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1166. 23 :["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1167. 24 :["Leatherworking_Tier3_Leather_Armor_Set_1", "Leatherworking_Tier3_Leather_Pants2", "Leatherworking_Tier3_Leather_Shirt2", "Leatherworking_Tier3_Leather_Helm_Set_1", "Leatherworking_Tier3_Leather_Pants","Leatherworking_Tier1_Gather_Basic"],
  1168. 25 :["Leatherworking_Tier2_Refine_Basic"],
  1169. //20: ["Leatherworking_Tier2_Refine_Basic"],
  1170. //19:["Leather Armor +4","Fancy Leather Pants","Fancy Leather Shirt","Leather Helm +4","Ornate Leather Pants","Upgrade Tanner","Upgrade Skinner","Hire an additional Skinner"],
  1171. //20:["Cure Tough Pelts"],
  1172. },
  1173. };
  1174.  
  1175. definedTask["Tailoring"] = {
  1176. taskListName: "Tailoring",
  1177. taskName: "Tailoring",
  1178. level: {
  1179. // power
  1180. // 0:["Tailoring_Tier3_Cloth_Pants", "Tailoring_Tier3_Cloth_Shirt", "Tailoring_Tier2_Cloth_Pants_1", "Tailoring_Tier2_Cloth_Shirt", "Tailoring_Tier1_Cloth_Gloves_1", "Tailoring_Tier1_Cloth_Armor_1", "Tailoring_Tier1_Cloth_Boots_1"],
  1181. // critical strike
  1182. // 0:["Tailoring_Tier3_Cloth_Pants_Set2", "Tailoring_Tier3_Cloth_Shirt_Set2", "Tailoring_Tier2_Cloth_Pants_1_Set2", "Tailoring_Tier2_Cloth_Shirt_Set2", "Tailoring_Tier1_Cloth_Gloves_1", "Tailoring_Tier1_Cloth_Gloves_1", "Tailoring_Tier1_Cloth_Shirt_1_Set2"],
  1183.  
  1184. 0: ["Tailoring_Tier0_Intro"],
  1185. 1: [ "Tailoring_Tier1_Cloth_Shirt_1","Tailoring_Tier1_Cloth_Boots_1","Tailoring_Tier1_Gather_Basic"],
  1186. 2: ["Tailoring_Tier1_Cloth_Armor_1", "Tailoring_Tier1_Cloth_Pants_1","Tailoring_Tier1_Gather_Basic"],
  1187. 3: ["Tailoring_Tier1_Cloth_Armor_1", "Tailoring_Tier1_Cloth_Shirt_1", "Tailoring_Tier1_Cloth_Boots_Set_1","Tailoring_Tier1_Gather_Basic"],
  1188. 4: ["Tailoring_Tier1_Cloth_Armor_1", "Tailoring_Tier1_Cloth_Shirt_1", "Tailoring_Tier1_Cloth_Shirt_1", "Tailoring_Tier1_Cloth_Boots_Set_1","Tailoring_Tier1_Gather_Basic"],
  1189. 5: ["Tailoring_Tier1_Cloth_Armor_Set_1", "Tailoring_Tier1_Cloth_Shirt_1", "Tailoring_Tier1_Cloth_Boots_Set_1","Tailoring_Tier1_Gather_Basic"],
  1190. 6: ["Tailoring_Tier1_Cloth_Armor_Set_1", "Tailoring_Tier1_Cloth_Shirt_1", "Tailoring_Tier1_Cloth_Boots_Set_1","Tailoring_Tier1_Gather_Basic"],
  1191. 7: ["Tailoring_Tier1_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt","Tailoring_Tier1_Gather_Basic","Tailoring_Tier1_Gather_Basic"],
  1192. 8: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_1", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt","Tailoring_Tier1_Gather_Basic"],
  1193. 9: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_1", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt","Tailoring_Tier1_Gather_Basic"],
  1194. 10: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_1", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt_2","Tailoring_Tier1_Gather_Basic"],
  1195. 11: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_2", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt_2", "Tailoring_Tier2_Cloth_Pants_1","Tailoring_Tier1_Gather_Basic"],
  1196. 12: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_2", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt_2", "Tailoring_Tier2_Cloth_Pants_1","Tailoring_Tier1_Gather_Basic"],
  1197. 13: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_2", "Tailoring_Tier2_Cloth_Boots_Set_1", "Tailoring_Tier2_Cloth_Shirt_2", "Tailoring_Tier2_Cloth_Pants_1","Tailoring_Tier1_Gather_Basic"],
  1198. 14: ["Tailoring_Tier2_Cloth_Armor_Set_1", "Tailoring_Tier2_Cloth_Pants_2", "Tailoring_Tier3_Cloth_Shirt", "Tailoring_Tier3_Cloth_Boots_Set_1","Tailoring_Tier1_Gather_Basic"],
  1199. 15: ["Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Boots_Set_1","Tailoring_Tier1_Gather_Basic"],
  1200. 16: ["Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1","Tailoring_Tier1_Gather_Basic"],
  1201. 17: ["Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1","Tailoring_Tier1_Gather_Basic"],
  1202. 18: ["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1203. 19: ["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1204. 20: ["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1205. 21 :["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1206. 22 :["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1207. 23 :["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1208. 24 :["Tailoring_Tier3_Cloth_Armor_Set_3", "Tailoring_Tier3_Cloth_Armor_Set_2","Tailoring_Tier3_Cloth_Pants2", "Tailoring_Tier3_Cloth_Armor_Set_1", "Tailoring_Tier3_Cloth_Pants2_Set2", "Tailoring_Tier3_Cloth_Shirt2", "Tailoring_Tier3_Cloth_Helm_Set_1", "Tailoring_Tier3_Cloth_Pants","Tailoring_Tier1_Gather_Basic"],
  1209. 25 :["Tailoring_Tier2_Refine_Basic"],
  1210. //20: ["Tailoring_Tier2_Refine_Basic"],
  1211. },
  1212. };
  1213.  
  1214. definedTask["Artificing"] = {
  1215. taskListName: "Artificing",
  1216. taskName: "Artificing",
  1217. level: {
  1218. 0: ["Artificing_Tier0_Intro_1"],
  1219. 1: ["Artificing_Tier1_Pactblade_Convergence_1", "Artificing_Tier1_Symbol_Virtuous_1", "Artificing_Tier1_Gather_Basic"],
  1220. 2: ["Artificing_Tier1_Pactblade_Convergence_1", "Artificing_Tier1_Icon_Virtuous_1", "Artificing_Tier1_Gather_Basic"],
  1221. 3: ["Artificing_Tier1_Pactblade_Convergence_1", "Artificing_Tier1_Icon_Virtuous_1", "Artificing_Tier1_Gather_Basic"],
  1222. 4: ["Artificing_Tier1_Pactblade_Convergence_2", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier1_Gather_Basic"],
  1223. 5: ["Artificing_Tier1_Pactblade_Convergence_2", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier1_Gather_Basic"],
  1224. 6: ["Artificing_Tier1_Pactblade_Convergence_2", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier1_Gather_Basic"],
  1225. 7: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1226. 8: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1227. 9: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1228. 10: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1229. 11: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1230. 12: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1231. 13: ["Artificing_Tier2_Pactblade_Temptation_3", "Artificing_Tier1_Icon_Virtuous_2", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1232. 14: ["Artificing_Tier3_Pactblade_Temptation_4", "Artificing_Tier3_Icon_Virtuous_4", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1233. 15: ["Artificing_Tier3_Pactblade_Temptation_4", "Artificing_Tier3_Icon_Virtuous_4", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1234. 16: ["Artificing_Tier3_Pactblade_Temptation_4", "Artificing_Tier3_Icon_Virtuous_4", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1235. 17: ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1236. 18: ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1237. 19: ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1238. 20: ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1239. 21 : ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1240. 22 : ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1241. 23 : ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1242. 24 : ["Artificing_Tier3_Pactblade_Temptation_5", "Artificing_Tier3_Icon_Virtuous_5", "Artificing_Tier3_Refine_Basic", "Artificing_Tier2_Refine_Basic", "Artificing_Tier1_Gather_Basic"],
  1243. 25 :["Artificing_Tier2_Refine_Basic"],
  1244. //20: ["Artificing_Tier2_Refine_Basic"],
  1245. //19:["Virtuous Icon +5","Upgrade Engraver","Upgrade Carver","Hire an additional Carver"],
  1246. //20:["7:Craft Ornamental metal and Carved Wood"],
  1247. },
  1248. };
  1249.  
  1250. definedTask["Weaponsmithing_Axe"] = {
  1251. taskListName: "Weaponsmithing_Axe",
  1252. taskName: "Weaponsmithing",
  1253. level: {
  1254. 0: ["Weaponsmithing_Tier0_Intro"],
  1255.  
  1256. /* No use of Residuum:
  1257. 1: ["Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass", "Weaponsmithing_Tier1_Gather_Basic"],
  1258. */
  1259. // We don't have axes until level 2
  1260. 1: ["Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1261. 2: ["Weaponsmithing_Tier1_Greataxe_1", "Weaponsmithing_Tier1_Battleaxe_1", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1262. 3: ["Weaponsmithing_Tier1_Greataxe_1", "Weaponsmithing_Tier1_Battleaxe_1", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1263. 4: ["Weaponsmithing_Tier1_Greataxe_1", "Weaponsmithing_Tier1_Battleaxe_1", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1264. 5: ["Weaponsmithing_Tier1_Greataxe_2", "Weaponsmithing_Tier1_Battleaxe_2", "Weaponsmithing_Tier1_Gather_Basic"],
  1265. 6: ["Weaponsmithing_Tier1_Greataxe_2", "Weaponsmithing_Tier1_Battleaxe_2", "Weaponsmithing_Tier1_Gather_Basic"],
  1266. // Just make resources at the new resource level -- they'll be used at higher levels
  1267. // (even though the swords at this level seem more efficient -- they require lower level swords, which we haven't made and don't have inventory space for)
  1268. // (we'll make 24 sets (of 2 each) "refined" resources in 16 hours (with no speed bonuses), which will be used by levels 8 and 9 alone
  1269. 7: ["Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1270. 8: ["Weaponsmithing_Tier2_Greataxe_3", "Weaponsmithing_Tier2_Battleaxe_3", "Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1271. 9: ["Weaponsmithing_Tier2_Greataxe_3", "Weaponsmithing_Tier2_Battleaxe_3", "Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1272. 10: ["Weaponsmithing_Tier2_Greataxe_3", "Weaponsmithing_Tier2_Battleaxe_3", "Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1273. 11: ["Weaponsmithing_Tier2_Greataxe_3", "Weaponsmithing_Tier2_Battleaxe_3", "Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1274. 12: ["Weaponsmithing_Tier2_Greataxe_3", "Weaponsmithing_Tier2_Battleaxe_3", "Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1275. 13: ["Weaponsmithing_Tier2_Greataxe_3", "Weaponsmithing_Tier2_Battleaxe_3", "Weaponsmithing_Tier2_Refine_Basic", "Weaponsmithing_Tier2_Gather_Basic"],
  1276. // (we'll make 160 sets (of 2 each) "refined" resources in 133.33 hours (5.55 days) (with no speed bonuses)
  1277. 14: ["Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1278. 15: ["Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1279. 16: ["Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1280. 17: ["Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1281. // If we have Fundamental Fire or Ice, we get a bit more exp by using it (and both options are not dependancies of anything else, unlike lower levels)
  1282. 18: ["Weaponsmithing_Tier3_Greataxe_Set_2", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_Set_2", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1283. 19: ["Weaponsmithing_Tier3_Greataxe_Set_2", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_Set_2", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1284. 20 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1285. 21 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1286. 22 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1287. 23 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1288. 24 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic", "Weaponsmithing_Tier3_Gather_Basic"],
  1289. 25 :["Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1290. // 20: ["Weaponsmithing_Tier3_Gather_Basic_Mass"], // We want Gather here, because the raw materials can be used in other profs
  1291. // If we actually want experience at level 20, these would be the tasks:
  1292. //20: ["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1293. },
  1294. };
  1295.  
  1296. definedTask["Weaponsmithing_Bow"] = {
  1297. taskListName: "Weaponsmithing_Bow",
  1298. taskName: "Weaponsmithing",
  1299. level: {
  1300. 1: ["Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1301. 2: ["Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1302. 3: ["Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1303. 4: ["Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1"],
  1304. 5: ["Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1305. 6: ["Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1306. 7: ["Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1307. 8: ["Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1308. 9: ["Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1309. 10: ["Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1310. 11: ["Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1311. 12: ["Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier1_Longbow_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1312. 14: ["Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1313. 15: ["Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1314. 16: ["Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1315. // If we have Desert Rose, we get a bit more exp by using it (and both options are not dependancies of anything else, unlike lower levels)
  1316. 17: ["Weaponsmithing_Tier3_Longbow_Set_2", "Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1317. 18: ["Weaponsmithing_Tier3_Longbow_Set_2", "Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1318. 19: ["Weaponsmithing_Tier3_Longbow_Set_2", "Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier2_Longbow_3", "Weaponsmithing_Tier1_Longbow_2", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1319. 20 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1320. 21 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1321. 22 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1322. 23 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1323. 24 :["Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greataxe_4", "Weaponsmithing_Tier3_Battleaxe_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1324. 25 :["Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1325. // 20: ["Weaponsmithing_Tier3_Gather_Basic_Mass"], // We want Gather here, because the raw materials can be used in other profs
  1326. // If we actually want experience at level 20, these would be the tasks:
  1327. //20: ["Weaponsmithing_Tier3_Longbow_Set_3", "Weaponsmithing_Tier3_Greatsword_Set_3", "Weaponsmithing_Tier3_Longsword_Set_3", "Weaponsmithing_Tier3_Dagger_Set_3", "Weaponsmithing_Tier3_Blades_Set_3", "Weaponsmithing_Tier3_Longbow_4", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1328. },
  1329. };
  1330.  
  1331. definedTask["Weaponsmithing_Dagger"] = {
  1332. taskListName: "Weaponsmithing_Dagger",
  1333. taskName: "Weaponsmithing",
  1334. level: {
  1335. 0: ["Weaponsmithing_Tier0_Intro"],
  1336. 1: ["Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1337. 2: ["Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1338. 3: ["Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1339. 4: ["Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1340. 5: ["Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1341. 6: ["Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1342. 7: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1343. 8: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1344. 9: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1345. 10: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1346. 11: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1347. 12: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1348. 13: ["Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1349. 14: ["Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1350. 15: ["Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1351. 16: ["Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1352. // If we have Fundamental Ice, we get a bit more exp by using it (and both options are not dependancies of anything else, unlike lower levels)
  1353. 17: ["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1354. 18: ["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1355. 19: ["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1356. 20 :["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1357. 21 :["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1358. 22 :["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1359. 23 :["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1360. 24 :["Weaponsmithing_Tier3_Dagger_Set_2", "Weaponsmithing_Tier3_Dagger_4", "Weaponsmithing_Tier2_Dagger_3", "Weaponsmithing_Tier1_Dagger_2", "Weaponsmithing_Tier1_Dagger_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1361. 25 :["Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1362. },
  1363. };
  1364.  
  1365. definedTask["Weaponsmithing_Greatsword"] = {
  1366. taskListName: "Weaponsmithing_Greatsword",
  1367. taskName: "Weaponsmithing",
  1368. level: {
  1369. 0: ["Weaponsmithing_Tier0_Intro"],
  1370. 1: ["Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1371. 2: ["Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1372. 3: ["Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1373. 4: ["Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1374. 5: ["Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1375. 6: ["Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1376. 7: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1377. 8: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1378. 9: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1379. 10: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1380. 11: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1381. 12: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1382. 13: ["Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1383. 14: ["Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1384. 15: ["Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1385. 16: ["Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1386. // If we have Fundamental Ice, we get a bit more exp by using it (and both options are not dependancies of anything else, unlike lower levels)
  1387. 17: ["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1388. 18: ["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1389. 19: ["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1390. 20 :["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1391. 21 :["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1392. 22 :["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1393. 23 :["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1394. 24 :["Weaponsmithing_Tier3_Greatsword_Set_2", "Weaponsmithing_Tier3_Greatsword_4", "Weaponsmithing_Tier2_Greatsword_3", "Weaponsmithing_Tier1_Greatsword_2", "Weaponsmithing_Tier1_Greatsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1395. 25 :["Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1396. },
  1397. };
  1398.  
  1399. definedTask["Weaponsmithing_Longsword"] = {
  1400. taskListName: "Weaponsmithing_Longsword",
  1401. taskName: "Weaponsmithing",
  1402. level: {
  1403. 0: ["Weaponsmithing_Tier0_Intro"],
  1404. 1: ["Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1405. 2: ["Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1406. 3: ["Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1407. 4: ["Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1408. 5: ["Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1409. 6: ["Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier1_Gather_Basic"],
  1410. 7: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1411. 8: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1412. 9: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1413. 10: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1414. 11: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1415. 12: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1416. 13: ["Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier2_Refine_Basic_Mass", "Weaponsmithing_Tier2_Gather_Basic_Mass"],
  1417. 14: ["Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1418. 15: ["Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1419. 16: ["Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1420. // If we have Fundamental Ice, we get a bit more exp by using it (and both options are not dependancies of anything else, unlike lower levels)
  1421. 17: ["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1422. 18: ["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1423. 19: ["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1424. 20 :["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1425. 21 :["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1426. 22 :["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1427. 23 :["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1428. 24 :["Weaponsmithing_Tier3_Longsword_Set_2", "Weaponsmithing_Tier3_Longsword_4", "Weaponsmithing_Tier2_Longsword_3", "Weaponsmithing_Tier1_Longsword_2", "Weaponsmithing_Tier1_Longsword_1", "Weaponsmithing_Tier3_Refine_Basic_Mass", "Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1429. 25 :["Weaponsmithing_Tier3_Gather_Basic_Mass"],
  1430. },
  1431. };
  1432.  
  1433. /*
  1434. "Weaponsmithing_Tier1_Refine_Basic" 7/15 -> 0.4666
  1435. Weaponsmithing_Tier1_Refine_Basic_Mass 50/360 (6h) -> 0.1388
  1436. "Weaponsmithing_Tier1_Gather_Basic" 8/15 -> 0.5333
  1437. Weaponsmithing_Tier1_Gather_Basic_Mass 50/360 (6h) -> 0.1388
  1438.  
  1439. "Weaponsmithing_Tier2_Refine_Basic" 12/20 -> 0.6
  1440. Weaponsmithing_Tier2_Refine_Basic_Mass 200/420 (7h) -> 0.48
  1441. "Weaponsmithing_Tier2_Gather_Basic" 13/20 -> 0.65
  1442. Weaponsmithing_Tier2_Gather_Basic_Mass 200/420 (7h) -> 0.48
  1443.  
  1444. "Weaponsmithing_Tier3_Refine_Basic" 30/25 -> 1.2
  1445. Weaponsmithing_Tier3_Refine_Basic_Mass 800/480 (8h) -> 1.66
  1446. "Weaponsmithing_Tier3_Gather_Basic" 30/25 -> 1.2
  1447. Weaponsmithing_Tier3_Gather_Basic_Mass 800/480 (8h) -> 1.66
  1448.  
  1449. time / (1 + speedBonus)
  1450.  
  1451. 360 / (1 + speedBonus) == 93.75
  1452. -> 265% bonus
  1453.  
  1454. 420 / (1 + speedBonus) == 333.3
  1455. -> 26% bonus
  1456.  
  1457. 25%:
  1458. 480 / 1.25 == 384 => 800/384 == 2.0833
  1459.  
  1460. 40%:
  1461. 480 / (1.4) == 342.86 => 800/342.84 == 2.33
  1462.  
  1463. 50%:
  1464. 480 / 1.5 == 320 => 2.5
  1465.  
  1466. 100%:
  1467. 480 / 2 == 240 => 800/240 == 3.33
  1468.  
  1469.  
  1470. */
  1471.  
  1472.  
  1473.  
  1474. definedTask["Alchemy"] = {
  1475. taskListName: "Alchemy",
  1476. taskName: "Alchemy",
  1477. level: {
  1478. 0: ["Alchemy_Tier0_Intro_1"],
  1479. 1: ["Alchemy_Tier1_Experiment_Rank2", "Alchemy_Tier1_Experimentation_Rank1"],
  1480. 2: ["Alchemy_Tier1_Experiment_Rank3", "Alchemy_Tier1_Experimentation_Rank2"],
  1481. 3: ["Alchemy_Tier1_Experiment_Rank4", "Alchemy_Tier1_Experimentation_Rank3"],
  1482. 4: ["Alchemy_Tier1_Experiment_Rank5", "Alchemy_Tier1_Experimentation_Rank4"],
  1483. 5: ["Alchemy_Tier1_Experiment_Rank6", "Alchemy_Tier1_Experimentation_Rank5"],
  1484. 6: ["Alchemy_Tier1_Experiment_Rank7", "Alchemy_Tier1_Experimentation_Rank6"],
  1485. 7: ["Alchemy_Tier2_Experiment_Rank08", "Alchemy_Tier2_Experimentation_Rank07"],
  1486. 8: ["Alchemy_Tier2_Experiment_Rank09", "Alchemy_Tier2_Experimentation_Rank08"],
  1487. 9: ["Alchemy_Tier2_Experiment_Rank10", "Alchemy_Tier2_Experimentation_Rank09"],
  1488. 10: ["Alchemy_Tier2_Experiment_Rank11", "Alchemy_Tier2_Experimentation_Rank10"],
  1489. 11: ["Alchemy_Tier2_Experiment_Rank12", "Alchemy_Tier2_Experimentation_Rank11"],
  1490. 12: ["Alchemy_Tier2_Experiment_Rank13", "Alchemy_Tier2_Experimentation_Rank12"],
  1491. 13: ["Alchemy_Tier2_Experiment_Rank14", "Alchemy_Tier2_Experimentation_Rank13"],
  1492. 14: ["Alchemy_Tier3_Experiment_Rank15", "Alchemy_Tier3_Experimentation_Rank14"],
  1493. 15: ["Alchemy_Tier3_Experiment_Rank16", "Alchemy_Tier3_Experimentation_Rank15"],
  1494. 16: ["Alchemy_Tier3_Experiment_Rank17", "Alchemy_Tier3_Experimentation_Rank16"],
  1495. 17: ["Alchemy_Tier3_Experiment_Rank18", "Alchemy_Tier3_Experimentation_Rank17"],
  1496. 18: ["Alchemy_Tier3_Experiment_Rank19", "Alchemy_Tier3_Experimentation_Rank18"],
  1497. 19: ["Alchemy_Tier3_Experiment_Rank20", "Alchemy_Tier3_Experimentation_Rank19"],
  1498. //20: ["Alchemy_Tier3_Protection_Potion_Major", "Alchemy_Tier2_Aquaregia", "Alchemy_Tier3_Refine_Basic", "Alchemy_Tier3_Gather_Components"], //disable for mod6
  1499. 20 : ["Alchemy_Tier3_Experiment_Rank21", "Alchemy_Tier3_Experimentation_Rank20"], // Enable for mod6
  1500. 21 : ["Alchemy_Tier4_Experiment_Rank22", "Alchemy_Tier4_Experimentation_Rank21"],
  1501. 22 : ["Alchemy_Tier4_Experiment_Rank23", "Alchemy_Tier4_Experimentation_Rank22"], //,"Alchemy_Tier4_Aquaregia_2"],
  1502. 23 : ["Alchemy_Tier4_Experiment_Rank24", "Alchemy_Tier4_Experimentation_Rank23"],
  1503. 24 : ["Alchemy_Tier4_Experiment_Rank25", "Alchemy_Tier4_Experimentation_Rank24"],
  1504. 25 : ["Alchemy_Tier4_Experimentation_Rank25","Alchemy_Tier4_Create_Elemental_Unified","Alchemy_Tier4_Create_Elemental_Aggregate","Alchemy_Tier4_Aquaregia_2"], //"Alchemy_Tier2_Aquaregia", "Alchemy_Tier3_Refine_Basic","Alchemy_Tier4_Potency_Potion_Superior", "Alchemy_Tier4_Protection_Potion_Superior"],
  1505. },
  1506. };
  1507.  
  1508. // Load Settings
  1509. var settingnames = [
  1510. {name: 'paused', title: 'Pause Script', def: false, type: 'checkbox', tooltip: 'Disable All Automation'},
  1511. {name: 'debug', title: 'Enable Debug', def: true, type: 'checkbox', tooltip: 'Enable all debug output to console', onsave: function (newValue, oldValue) {
  1512. console = newValue ? unsafeWindow.console || fouxConsole : fouxConsole;
  1513. }},
  1514. {name: 'optionals', title: 'Fill Optional Assets', def: true, type: 'checkbox', tooltip: 'Enable to include selecting the optional assets of tasks'},
  1515. {name: 'autopurchase', title: 'Auto Purchase Resources', def: true, type: 'checkbox', tooltip: 'Automatically purchase required resources from gateway shop (100 at a time)'},
  1516. {name: 'trainassets', title: 'Train Assets', def: true, type: 'checkbox', tooltip: 'Enable training/upgrading of asset worker resources'},
  1517. //{name: 'refinead', title: 'Refine AD', def: true, type: 'checkbox', tooltip: 'Enable refining of AD on character switch'},
  1518. {name: 'openrewards', title: 'Open Reward Chests', def: false, type: 'checkbox', tooltip: 'Enable opeing of leadership chests on character switch'}, //MAC-NW
  1519. {name: 'dailySCA', title: 'Daily SCA roll', def: true, type: 'checkbox', tooltip: 'Runs daily SCA rolls when no task is near to finish'}, //MAC-NW
  1520. {name: 'autoreload', title: 'Auto Reload', def: true, type: 'checkbox', tooltip: 'Enabling this will reload the gateway periodically. (Ensure Auto Login is enabled)'},
  1521. {name: 'autovendor_junk', title: 'Vendor junk..', def: false, type: 'checkbox', tooltip: 'Vendor all (currently) winterfest fireworks+lanterns'}, //MAC-NW
  1522. {name: 'autovendor_kits_altars_limit', title: 'Maintain Altar Node Kit Stacks', def: false, type: 'checkbox', tooltip: 'Limit skill kits stacks to 50/Altars80, vendor kits unusable by class, remove all if player has one bag or full bags'}, // edited by RottenMind
  1523. {name: 'autovendor_kits_altars_all', title: 'Vendor All Altar Node Kit Stacks', def: false, type: 'checkbox', tooltip: 'Sell ALL skill kits Altars.'}, // RottenMind
  1524. {name: 'autovendor_profresults', title: 'Vendor Prof Crafted & Gathered Items', def: true, type: 'checkbox', tooltip: 'Vendor off Tier 1 to 5 items produced and reused for leveling crafting & Gathered professions items.'},
  1525. {name: 'autovendor_pots1', title: 'Vendor minor potions (lvl 1)', def: false, type: 'checkbox', tooltip: 'Vendor all minor potions (lvl 1) found in player bags'}, //MAC-NW
  1526. {name: 'autovendor_pots2', title: 'Vendor lesser potions (lvl 15)', def: false, type: 'checkbox', tooltip: 'Vendor all lesser potions (lvl 15) found in player bags'}, //MAC-NW
  1527. {name: 'autovendor_pots3', title: 'Vendor potions (lvl 30)', def: false, type: 'checkbox', tooltip: 'Vendor all potions (lvl 30) found in player bags'}, //MAC-NW
  1528. {name: 'autovendor_pots4', title: 'Vendor greater potions (lvl 45)', def: false, type: 'checkbox', tooltip: 'Vendor all greater potions (lvl 45) found in player bags'}, //MAC-NW
  1529. //{name: 'autovendor_rank1', title: 'Auto Vendor enchants & runes Rank 1', def: false, type: 'checkbox', tooltip: 'Vendor all Rank 1 enchantments & runestones found in player bags'}, //MAC-NW
  1530. {name: 'autovendor_rank2', title: 'Vendor enchants & runes Rank 1-2', def: false, type: 'checkbox', tooltip: 'Vendor all Rank 2 enchantments & runestones found in player bags'}, //MAC-NW
  1531. {name: 'autovendor_rank3', title: 'Vendor enchants & runes Rank 3', def: false, type: 'checkbox', tooltip: 'Vendor all Rank 3 enchantments & runestones found in player bags'}, // edited by RottenMind
  1532. {name: 'level_20_skip', title: 'Skip level 20', def: false, type: 'checkbox', tooltip: 'All level 20 profession slots are skipped NOT Leadership'},
  1533. {name: 'purchasePorridge', title: 'Purchase Porridge', def: true, type: 'checkbox', tooltip: 'Purchase Porridge to Advance Leadership Rank'},
  1534. {name: 'level_25_skip', title: 'Skip level 25', def: false, type: 'checkbox', tooltip: 'All level 25 profession slots are skipped NOT Leadership, supersedes skip 20'},
  1535. {name: 'easy_start', title: 'Automatic Banker', def: false, type: 'checkbox', tooltip: 'Get Banker first character etc. works best after reset, turn off if need other character.', border: true},
  1536. {name: 'nw_username', title: 'Neverwinter Username', def: '', type: 'text', tooltip: ''},
  1537. {name: 'nw_password', title: 'Neverwinter Password', def: '', type: 'password', tooltip: ''},
  1538. // MAC-NW AD Consolidation
  1539. {name: 'autoexchange', title: 'Consolidate AD via ZEX', def: false, type: 'checkbox', tooltip: 'Automatically attempt to post, cancel and withdraw AD via ZEX and consolidate to designated character', border: true},
  1540. {name: 'bankchar', title: 'Character Name of Banker', def: '', type: 'text', tooltip: 'Enter name of the character to hold account AD'},
  1541. {name: 'banktransmin', title: 'Min AD for Transfer', def: '5000', type: 'text', tooltip: 'Enter minimum AD limit for it to be cosidered for transfer off a character'},
  1542. {name: 'bankcharmin', title: 'Min Character balance', def: '600', type: 'text', tooltip: 'Enter the amount of AD to always keep available on characters'},
  1543. {name: 'banktransrate', title: 'AD per Zen Rate (in zen)', def: '300', type: 'text', tooltip: 'Enter default rate to use for transfering through ZEX'},
  1544. {name: 'charcount', title: 'Enter number of characters to use (Save and Apply to update settings form)', def: '1', type: 'text', tooltip: 'Enter number of characters to use (Save and Apply to update settings form)', border: true},
  1545. // MAC-NW
  1546. ];
  1547.  
  1548. // Load local settings cache (unsecured)
  1549. var settings = {};
  1550. for (var i = 0; i < settingnames.length; i++) {
  1551. // Ignore label types
  1552. if (settingnames[i].type === 'label') {
  1553. continue;
  1554. }
  1555. settings[settingnames[i].name] = GM_getValue(settingnames[i].name, settingnames[i].def);
  1556. // call the onsave for the setting if it exists
  1557. if (typeof (settingnames[i].onsave) === "function") {
  1558. console.log("Calling 'onsave' for", settingnames[i].name);
  1559. settingnames[i].onsave(settings[settingnames[i].name], settings[settingnames[i].name]);
  1560. }
  1561. }
  1562.  
  1563. if (settings["charcount"] < 1) {
  1564. settings["charcount"] = 1;
  1565. }
  1566. if (settings["charcount"] > 99) {
  1567. settings["charcount"] = 99;
  1568. }
  1569.  
  1570. // Profession priority list by order
  1571. var tasklist = [
  1572. definedTask["Winter Event"],
  1573. definedTask["Siege Event"],
  1574. definedTask["Black Ice Shaping"],
  1575. definedTask["Alchemy"],
  1576. definedTask["Weaponsmithing_Axe"],
  1577. /*definedTask["Weaponsmithing_Bow"],
  1578. definedTask["Weaponsmithing_Dagger"],
  1579. definedTask["Weaponsmithing_Greatsword"],
  1580. definedTask["Weaponsmithing_Longsword"],*/
  1581. definedTask["Artificing"],
  1582. definedTask["Jewelcrafting"],
  1583. definedTask["Mailsmithing"],
  1584. definedTask["Platesmithing"],
  1585. definedTask["Leatherworking"],
  1586. definedTask["Tailoring"],
  1587. definedTask["Leadership"],
  1588. definedTask["Leadership XP"],
  1589. ];
  1590.  
  1591. var charSettings = [];
  1592.  
  1593. for (var i = 0; i < settings["charcount"]; i++) {
  1594. charSettings.push({name: 'nw_charname' + i, title: 'Character', def: 'Character ' + (i + 1), type: 'text', tooltip: 'Characters Name,(set first character name to Character 1 for Automatic char.name fill.'});
  1595. charSettings.push({name: 'WinterEvent' + i, title: 'WinterEvent', def: '0', type: 'text', tooltip: 'Number of slots to assign to WinterEvent'});
  1596. charSettings.push({name: 'Leadership' + i, title: 'Leadership', def: '9', type: 'text', tooltip: 'Number of slots to assign to Leadership'});
  1597. charSettings.push({name: 'Event_Siege' + i, title: 'Siege Event', def: '0', type: 'text', tooltip: 'Number of slots to assign to Siege Event'});
  1598. charSettings.push({name: 'BlackIce' + i, title: 'Black Ice Shaping', def: '0', type: 'text', tooltip: 'Number of slots to assign to BIS'});
  1599. charSettings.push({name: 'Alchemy' + i, title: 'Alchemy', def: '0', type: 'text', tooltip: 'Number of slots to assign to Alchemy'});
  1600. charSettings.push({name: 'Weaponsmithing_Axe' + i, title: 'Weaponsmithing/Axes', def: '0', type: 'text', tooltip: 'Number of slots to assign to Weaponsmithing/Axes'});
  1601. /*charSettings.push({name: 'Weaponsmithing_Dagger' + i, title: 'Weaponsmithing/Daggers', def: '0', type: 'text', tooltip: 'Number of slots to assign to Weaponsmithing/Daggers'});
  1602. charSettings.push({name: 'Weaponsmithing_Bow' + i, title: 'Weaponsmithing/Bows', def: '0', type: 'text', tooltip: 'Number of slots to assign to Weaponsmithing/Bows -- choose one of these for every two Daggers/Greatswords/Longswords/Blades (or choose axes)'});
  1603. charSettings.push({name: 'Weaponsmithing_Greatsword' + i, title: 'Weaponsmithing/Greatswords', def: '0', type: 'text', tooltip: 'Number of slots to assign to Weaponsmithing/Greatswords'});
  1604. charSettings.push({name: 'Weaponsmithing_Longsword' + i, title: 'Weaponsmithing/Longswords', def: '0', type: 'text', tooltip: 'Number of slots to assign to Weaponsmithing/Longswords'});*/
  1605. charSettings.push({name: 'Artificing' + i, title: 'Artificing', def: '0', type: 'text', tooltip: 'Number of slots to assign to Artificing'});
  1606. charSettings.push({name: 'Jewelcrafting' + i, title: 'Jewelcrafting', def: '0', type: 'text', tooltip: 'Number of slots to assign to Jewelcrafting'});
  1607. charSettings.push({name: 'Mailsmithing' + i, title: 'Mailsmithing', def: '0', type: 'text', tooltip: 'Number of slots to assign to Mailsmithing'});
  1608. charSettings.push({name: 'Platesmithing' + i, title: 'Platesmithing', def: '0', type: 'text', tooltip: 'Number of slots to assign to Platesmithing'});
  1609. charSettings.push({name: 'Leatherworking' + i, title: 'Leatherworking', def: '0', type: 'text', tooltip: 'Number of slots to assign to Leatherworking'});
  1610. charSettings.push({name: 'Tailoring' + i, title: 'Tailoring', def: '0', type: 'text', tooltip: 'Number of slots to assign to Tailoring'});
  1611. charSettings.push({name: 'Leadership_XP' + i, title: 'Leadership XP', def: '0', type: 'text', tooltip: 'Number of slots to assign to Leadership focused on XP'});
  1612. }
  1613.  
  1614. for (var i = 0; i < charSettings.length; i++) {
  1615. settings[charSettings[i].name] = GM_getValue(charSettings[i].name, charSettings[i].def);
  1616. }
  1617.  
  1618. function setTaskSlots() {
  1619. // The task list associated with each slot
  1620. taskSlots = [];
  1621. // The total slots for each profession, across task lists
  1622. slotsByProf = {};
  1623. for (var i = 0; i < tasklist.length; i++) slotsByProf[tasklist[i].taskName] = 0;
  1624.  
  1625. for (var i = 0; i < tasklist.length; i++) {
  1626. slotsByProf[tasklist[i].taskName] += parseInt(settings[tasklist[i].taskListName]);
  1627. for (var j = 0; j < settings[tasklist[i].taskListName]; j++) {
  1628. taskSlots.push(tasklist[i].taskListName);
  1629. }
  1630. }
  1631.  
  1632. }
  1633.  
  1634. // Page Settings
  1635. var PAGES = Object.freeze({
  1636. LOGIN: {name: "Login", path: "div#login"},
  1637. GUARD: {name: "Account Guard", path: "div#page-accountguard"},
  1638. });
  1639.  
  1640. /**
  1641. * Uses the page settings to determine which page is currently displayed
  1642. */
  1643. function GetCurrentPage() {
  1644. for(var __kk in PAGES) {
  1645. if (!PAGES.hasOwnProperty(__kk)) continue;
  1646. var page = PAGES[__kk];
  1647. if ($(page["path"]).filter(":visible").length) {
  1648. return page;
  1649. }
  1650. }
  1651. }
  1652.  
  1653. /**
  1654. * Logs in to gateway
  1655. * No client.dataModel exists at this stage
  1656. */
  1657. function page_LOGIN() {
  1658. //if (!$("form > p.error:visible").length && settings["autologin"]) {
  1659. // No previous log in error - attempt to log in
  1660. console.log("Setting username");
  1661. $("input#user").val(settings["nw_username"]);
  1662. console.log("Setting password");
  1663. $("input#pass").val(settings["nw_password"]);
  1664. console.log("Clicking Login Button");
  1665. $("div#login > input").click();
  1666. //}
  1667. dfdNextRun.resolve(delay.LONG);
  1668. }
  1669.  
  1670. /**
  1671. * Action to perform on account guard page
  1672. */
  1673. function page_GUARD() {
  1674. // Do nothing on the guard screen
  1675. dfdNextRun.resolve(delay.LONG);
  1676. }
  1677.  
  1678. /**
  1679. * Collects rewards for tasks or starts new tasks
  1680. * Function is called once per new task and returns true if an action is created
  1681. * If no action is started function returns false to switch characters
  1682. */
  1683. function processCharacter() {
  1684. // Switch to professions page to show task progression
  1685. unsafeWindow.location.hash = "#char(" + encodeURI(unsafeWindow.client.getCurrentCharAtName()) + ")/professions";
  1686.  
  1687. // Collect rewards for completed tasks and restart
  1688. if (unsafeWindow.client.dataModel.model.ent.main.itemassignments.complete) {
  1689. unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments.forEach(function (entry) {
  1690. if (entry.hascompletedetails) {
  1691. unsafeWindow.client.professionTaskCollectRewards(entry.uassignmentid);
  1692. }
  1693. });
  1694. dfdNextRun.resolve();
  1695. return true;
  1696. }
  1697.  
  1698. // Check for available slots and start new task
  1699. if (unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments.filter(function (entry) {
  1700. return (!entry.islockedslot && !entry.uassignmentid);
  1701. }).length) {
  1702. // Go through the professions to assign tasks until specified slots filled
  1703. for (var i = 0; i < tasklist.length; i++) {
  1704. var prof = tasklist[i]
  1705. if (settings[prof.taskListName] > 0) { //MAC-NW
  1706.  
  1707. /*
  1708. entry.slotindex
  1709.  
  1710. entry: Object
  1711. category: "Leadership"
  1712. categoryicon: "Crafting_Profession_Leadership"
  1713. displayname: "Hire a Mercenary"
  1714. hascompletedetails: 0
  1715. hdef: "@ItemAssignmentDef[Leadership_Tier1_2_Recruit]"
  1716. icon: "Crafting_Follower_Leader_Generic_T1_01"
  1717. isabortable: 1
  1718. islockedslot: 0
  1719. rewards: null
  1720. sfinishearlycost: 32976
  1721. slotindex: 1
  1722. uassignmentid: 1617
  1723. ufinishdate: "Mon, 23 Feb 2015 22:00:48 GMT"
  1724. utimestarted: "Mon, 23 Feb 2015 04:00:48 GMT"
  1725.  
  1726. unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments: Array[9]
  1727. 0: Object
  1728. category: "None"
  1729. categoryicon: ""
  1730. displayname: ""
  1731. hascompletedetails: 0
  1732. hdef: ""
  1733. icon: ""
  1734. isabortable: 0
  1735. islockedslot: 0
  1736. sfinishearlycost: -1
  1737. slotindex: 0
  1738. uassignmentid: 0
  1739. ufinishdate: "Sat, 01 Jan 2000 00:00:00 GMT"
  1740. utimestarted: "Sat, 01 Jan 2000 00:00:00 GMT"
  1741. __proto__: Object
  1742. 1: Object
  1743. category: "Leadership"
  1744. categoryicon: "Crafting_Profession_Leadership"
  1745. displayname: "Battle Undead"
  1746. hascompletedetails: 0
  1747. hdef: "@ItemAssignmentDef[Leadership_Tier2_10_Battle]"
  1748. icon: "Icons_Pets_Manatarms_01"
  1749. isabortable: 1
  1750. islockedslot: 0
  1751. rewards: null
  1752. sfinishearlycost: 21504
  1753. slotindex: 1
  1754. uassignmentid: 7908
  1755. ufinishdate: "Thu, 05 Mar 2015 06:45:20 GMT"
  1756. utimestarted: "Thu, 05 Mar 2015 01:02:29 GMT"
  1757. __proto__: Object
  1758.  
  1759. */
  1760.  
  1761.  
  1762. if (failedProf.length > 0 && failedProf.indexOf(prof.taskListName) > -1) {
  1763. continue;
  1764. }
  1765.  
  1766. // Check level
  1767. var level = unsafeWindow.client.dataModel.model.ent.main.itemassignmentcategories.categories.filter(function (entry) {
  1768. return entry.name == prof.taskName; //
  1769. })[0].currentrank;
  1770. var list = prof.level[level];
  1771. var tmpLevel = level;
  1772. while (typeof list === "undefined" && tmpLevel > 0) {
  1773. list = prof.level[--tmpLevel];
  1774. }
  1775. if (typeof list === "undefined") {
  1776. continue;
  1777. }
  1778.  
  1779. var currentTasksByTaskList = unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments.filter(function (entry) {
  1780. // return entry.category == tasklist[i].taskName && list.indexOf(entry.hdef.match(/^@ItemAssignmentDef\[([^\]]*)\]$/)[1]) > -1;
  1781. return entry.category === prof.taskName && taskSlots[entry.slotindex] === prof.taskListName;
  1782. });
  1783. var currentTasksByProf = unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments.filter(function (entry) {
  1784. return entry.category === prof.taskName;
  1785. });
  1786. var currentOpenSlots = unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments.filter(function (entry) {
  1787. return entry.category === "None";
  1788. });
  1789. if (taskSlots[currentOpenSlots[0].slotindex] === prof.taskListName ||
  1790. (currentTasksByTaskList.length < settings[prof.taskListName] &&
  1791. currentTasksByProf.length < slotsByProf[prof.taskName])) {
  1792. unsafeWindow.client.professionFetchTaskList('craft_' + tasklist[i].taskName);
  1793. window.setTimeout(function () {
  1794. // todo: How do we propegate the return value of this up the stack?
  1795. createNextTask(prof, level, list, 0);
  1796. }, delay.SHORT);
  1797. return true;
  1798. }
  1799. } //MAC-NW
  1800. }
  1801. console.log("All task counts assigned");
  1802. }
  1803. else {
  1804. console.log("No available task slots");
  1805. }
  1806.  
  1807. // TODO: Add code to get next task finish time
  1808. chartimers[charcurrent] = getNextFinishedTask();
  1809.  
  1810. // Add diamond count
  1811. chardiamonds[charcurrent] = unsafeWindow.client.dataModel.model.ent.main.currencies.diamonds;
  1812. console.log(settings["nw_charname" + charcurrent] + "'s", "Astral Diamonds:", chardiamonds[charcurrent]);
  1813. return false;
  1814. }
  1815.  
  1816. /**
  1817. * Switch to a character's swordcoast adventures and collect the daily reward
  1818. */
  1819. function processSwordCoastDailies(_charStartIndex) {
  1820. var _accountName = unsafeWindow.client.dataModel.model.loginInfo.publicaccountname;
  1821. var _charIndex = (!_charStartIndex || parseInt(_charStartIndex) > (charSettings.length + 1) || parseInt(_charStartIndex) < 0)
  1822. ? 0 : parseInt(_charStartIndex);
  1823. var _fullCharName = settings["nw_charname" + _charIndex] + '@' + _accountName;
  1824. var _hasLoginDaily = 0;
  1825. var _isLastChar = false;
  1826. var _scaHashMatch = /\/adventures$/;
  1827. if (!settings["paused"])
  1828. PauseSettings("pause");
  1829.  
  1830. // Switch to professions page to show task progression
  1831. if (!_scaHashMatch.test(unsafeWindow.location.hash)) {
  1832. return;
  1833. } else if (unsafeWindow.location.hash != "#char(" + encodeURI(_fullCharName) + ")/adventures") {
  1834. unsafeWindow.location.hash = "#char(" + encodeURI(_fullCharName) + ")/adventures";
  1835. }
  1836.  
  1837. if (settings["nw_charname" + (_charIndex + 1)] === undefined)
  1838. _isLastChar = true;
  1839.  
  1840. WaitForState("").done(function () {
  1841. try {
  1842. _hasLoginDaily = client.dataModel.model.gatewaygamedata.dailies.left.logins;
  1843. } catch (e) {
  1844. // TODO: Use callback function
  1845. window.setTimeout(function () {
  1846. processSwordCoastDailies(_charIndex);
  1847. }, delay.SHORT);
  1848. return;
  1849. }
  1850.  
  1851. console.log("Checking SCA Dialy for", _fullCharName, "...");
  1852.  
  1853. // Do SCA daily dice roll if the button comes up
  1854. WaitForState(".daily-dice-intro").done(function () {
  1855. $(".daily-dice-intro button").trigger('click');
  1856. WaitForState(".daily-awards-button").done(function () {
  1857. $(".daily-awards-button button").trigger('click');
  1858. });
  1859. });
  1860.  
  1861. // If Dice roll dialog is non existant
  1862. WaitForNotState(".modal-window.daily-dice").done(function () {
  1863. if (_isLastChar) {
  1864. window.setTimeout(function () {
  1865. PauseSettings("unpause");
  1866. }, 3000);
  1867. } else {
  1868. window.setTimeout(function () {
  1869. processSwordCoastDailies(_charIndex + 1);
  1870. }, 3000);
  1871. }
  1872. });
  1873. });
  1874. }
  1875.  
  1876. /**
  1877. * Finds the task finishing next & returns the date or NULL otherwise
  1878. *
  1879. * @return {Date} / {null}
  1880. */
  1881. function getNextFinishedTask() {
  1882. var tmpNext, next = null;
  1883. unsafeWindow.client.dataModel.model.ent.main.itemassignments.assignments.forEach(function (entry) {
  1884. if (entry.uassignmentid) {
  1885. tmpNext = new Date(entry.ufinishdate);
  1886. if (!next || tmpNext < next) {
  1887. next = tmpNext;
  1888. }
  1889. }
  1890. });
  1891. if (next) {
  1892. console.log("Next finished task at " + next.toLocaleString());
  1893. } else {
  1894. console.log("No next finishing date found!!");
  1895. }
  1896. return next;
  1897. }
  1898.  
  1899. /**
  1900. * Recursive approach to finding the next task to assign to an open slot.
  1901. *
  1902. * @param {Array} prof The tasklist for the profession being used
  1903. * @param {int} level The level of the list of tasks (either max level of character's profession, or max defined in the lists above)
  1904. * @param {Array} list The possible list of tasks to start
  1905. * @param {int} i The current task number being attempted
  1906. */
  1907. function createNextTask(prof, level, list, i) {
  1908.  
  1909. // TODO: Use callback function
  1910. if (!unsafeWindow.client.dataModel.model.craftinglist || unsafeWindow.client.dataModel.model.craftinglist === null || !unsafeWindow.client.dataModel.model.craftinglist['craft_' + prof.taskName] || unsafeWindow.client.dataModel.model.craftinglist['craft_' + prof.taskName] === null) {
  1911. console.log('Task list not loaded for:', prof.taskName);
  1912. window.setTimeout(function () {
  1913. // todo: How do we propegate the return value of this up the stack?
  1914. createNextTask(prof, level, list, i);
  1915. }, delay.SHORT);
  1916. return false;
  1917. }
  1918. /*// Check level
  1919. var level = unsafeWindow.client.dataModel.model.ent.main.itemassignmentcategories.categories.filter(function (entry) {
  1920. return entry.name == prof.taskName;
  1921. })[0].currentrank;
  1922. var list = prof.level[level];
  1923. if (list.length <= i) {
  1924. console.log("Nothing Found");
  1925. switchChar();*/
  1926. if (list.length <= i) {
  1927. console.log("No more possible tasks at this level to try to start", i);
  1928. console.log("task list: ", list);
  1929. failedProf.push(prof.taskListName);
  1930. dfdNextRun.resolve(delay.SHORT);
  1931. return false;
  1932. }
  1933.  
  1934. console.log(prof.taskName, "is level", level);
  1935. console.log("createNextTask", list.length, i);
  1936.  
  1937. var taskName = list[i];
  1938. console.log("Searching for task:", taskName);
  1939.  
  1940. // Search for task to start
  1941. var task = searchForTask(taskName, prof.taskName, level);
  1942.  
  1943. /** TODO: Use this code once below can be replaced properly
  1944. if (task === null) {
  1945. console.log("Skipping task selection to purchase resources");
  1946. dfdNextRun.resolve();
  1947. }
  1948. else if (task) {
  1949. startTask(task);
  1950. dfdNextRun.resolve();
  1951. }
  1952. else {
  1953. console.log('Finding next task');
  1954. createNextTask(prof, i+1);
  1955. }
  1956. **/
  1957.  
  1958.  
  1959. // Finish createNextTask function
  1960. if (task === null) {
  1961. console.log("Skipping task selection to purchase resources");
  1962. dfdNextRun.resolve();
  1963. return true;
  1964. }
  1965. if (task) {
  1966. startedTask["currTaskName"] = task.def.name;
  1967. task = '/professions-tasks/' + prof.taskName + '/' + task.def.name;
  1968. console.log('Task Found');
  1969. unsafeWindow.location.hash = unsafeWindow.location.hash.replace(/\)\/.+/, ')' + task);
  1970. WaitForState("div.page-professions-taskdetails").done(function () {
  1971. // Click all buttons and select an item to use in the slot
  1972. var def = $.Deferred();
  1973. var buttonList = $('.taskdetails-assets:eq(1)').find("button");
  1974. if (buttonList.length && settings["optionals"]) {
  1975. SelectItemFor(buttonList, 0, def, prof);
  1976. }
  1977. else {
  1978. def.resolve();
  1979. }
  1980. def.done(function () {
  1981. // All items are populated
  1982. console.log("Items Populated");
  1983. // Click the Start Task Button
  1984. //Get the start task button if it is enabled
  1985. var enabledButton = $(".footer-professions-taskdetails .button.epic:not('.disabled') button");
  1986. if (enabledButton.length) {
  1987. console.log("Clicking Start Task Button");
  1988. enabledButton.trigger('click');
  1989. WaitForState("").done(function () {
  1990. // Done
  1991. dfdNextRun.resolve(delay.SHORT);
  1992. });
  1993. if (startedTask["lastTaskChar"] == startedTask["currTaskChar"] && startedTask["lastTaskName"] == startedTask["currTaskName"]) {
  1994. startedTask["lastTaskCount"]++;
  1995. console.log("Task " + startedTask["lastTaskName"] + " started " + startedTask["lastTaskCount"] + " time");
  1996. } else {
  1997. startedTask["lastTaskChar"] = startedTask["currTaskChar"];
  1998. startedTask["lastTaskName"] = startedTask["currTaskName"];
  1999. startedTask["lastTaskCount"] = 1;
  2000. }
  2001. if (startedTask["lastTaskCount"] >= 15) {
  2002. console.log("LOOP FAILURE x [", Epic_button_error() , "] times, skip to next task!!!");
  2003. $(".footer-professions-taskdetails .button button.resetWindow").trigger('click');
  2004. WaitForState("").done(function () {
  2005. createNextTask(prof, level, list, i + 1); // try create forced next task to resolve gateway bug
  2006.  
  2007. });
  2008. }
  2009. return true;
  2010. }
  2011. else { // Button not enabled, something required was probably missing
  2012. // Go back
  2013. $(".footer-professions-taskdetails .button button.resetWindow").trigger('click');
  2014. WaitForState("").done(function () {
  2015. // continue with the next one
  2016. console.log('Finding next task');
  2017. // todo: How do we propegate the return value of this up the stack?
  2018. createNextTask(prof, level, list, i + 1);
  2019. });
  2020. }
  2021. });
  2022. });
  2023. }
  2024. else {
  2025. console.log('Finding next task');
  2026. return createNextTask(prof, level, list, i + 1)
  2027. }
  2028. }
  2029.  
  2030. /**
  2031. * Checks task being started for requirements and initiates beginning task if found
  2032. *
  2033. * @param {string} taskname The name of the task being started
  2034. * @param {string} profname The name of the profession being used
  2035. * @param {Deferred} dfd Deferred object to process on return
  2036. */
  2037. function searchForTask(taskname, profname, professionLevel) {
  2038. // Return first object that matches exact craft name
  2039. // skip task if proff.level20
  2040. if (settings['level_20_skip'] && profname != 'Leadership' && professionLevel > 19) {
  2041. console.log(profname, "is level", professionLevel,"skipping.");
  2042. return false;
  2043. }if (settings['level_25_skip'] && profname != 'Leadership' && professionLevel > 24) {
  2044. console.log(profname, "is level", professionLevel,"skipping.");
  2045. return false;
  2046. }
  2047. // edited by WloBeb - start Patrol the Mines task only if char has less than 7 Mining Claims if XP prifile limit 100 claims
  2048. var resource_limit = 10;
  2049. if (settings['Leadership_XP'] > 0) {
  2050. var resource_limit = 1000;}
  2051. if (taskname == "Leadership_Tier3_13_Patrol" && countResource("Crafting_Resource_Mining_Claim") >= resource_limit ) {
  2052. console.log("Too many Mining Claims: skiping");
  2053. return false;
  2054. }
  2055. if (taskname == "Leadership_Tier4_21_Protectmagic" && countResource("Crafting_Resource_Clues_Bandit_Hq") >= resource_limit ) {
  2056. console.log("Too many Clues: skiping");
  2057. return false;
  2058. }
  2059.  
  2060. var thisTask = unsafeWindow.client.dataModel.model.craftinglist['craft_' + profname].entries.filter(function (entry) {
  2061. return entry.def && entry.def.name == taskname;
  2062. })[0];
  2063.  
  2064. // If no task is returned we either have three of this task already, the task is a rare that doesn't exist currently, or we have the name wrong in tasklist
  2065. if (!thisTask) {
  2066. console.log('Could not find task for:', taskname);
  2067. return false;
  2068. }
  2069.  
  2070. // start task if requirements are met
  2071. try {
  2072. if (!thisTask.failedrequirementsreasons.length) {
  2073. return thisTask;
  2074. }
  2075. } catch (e) {
  2076. Array_undefine_error();
  2077. unsafeWindow.location.href = current_Gateway;
  2078. }
  2079.  
  2080. // Too high level
  2081. if (thisTask.failslevelrequirements) {
  2082. console.log("Task level is too high:", taskname);
  2083. return false;
  2084. }
  2085.  
  2086. var searchItem = null;
  2087. var searchAsset = false;
  2088.  
  2089. // Check for and buy missing armor & weapon leadership assets
  2090. if (thisTask.failsresourcesrequirements && profname == "Leadership" && settings["autopurchase"]) {
  2091. var failedAssets = thisTask.required.filter(function (entry) {
  2092. return !entry.fillsrequirements;
  2093. });
  2094. var failedArmor = failedAssets.filter(function (entry) {
  2095. return entry.categories.indexOf("Armor") >= 0;
  2096. });
  2097. var failedWeapon = failedAssets.filter(function (entry) {
  2098. return entry.categories.indexOf("Weapon") >= 0;
  2099. });
  2100. if (failedArmor.length || failedWeapon.length) {
  2101. var _buyResult = false;
  2102. var _charGold = unsafeWindow.client.dataModel.model.ent.main.currencies.gold;
  2103. var _charSilver = unsafeWindow.client.dataModel.model.ent.main.currencies.silver;
  2104. var _charCopper = unsafeWindow.client.dataModel.model.ent.main.currencies.copper;
  2105. var _charCopperTotal = _charCopper + (_charSilver*100) + (_charGold*10000);
  2106.  
  2107. // Buy Leadership Armor Asset
  2108. if (failedArmor.length && _charCopperTotal >= 10000) {
  2109. console.log("Buying leadership asset:", failedArmor[0].icon);
  2110. _buyResult = buyTaskAsset(18);
  2111. unsafeWindow.client.professionFetchTaskList("craft_Leadership");
  2112. }
  2113. // Buy Leadership Infantry Weapon Asset
  2114. else if (failedWeapon.length && _charCopperTotal >= 5000) {
  2115. console.log("Buying leadership asset:", failedWeapon[0].icon);
  2116. _buyResult = buyTaskAsset(4);
  2117. unsafeWindow.client.professionFetchTaskList("craft_Leadership");
  2118. }
  2119. if (_buyResult === false)
  2120. return false;
  2121. else
  2122. return null;
  2123. }
  2124. }
  2125.  
  2126. // Missing assets or ingredients
  2127. if (thisTask.failsresourcesrequirements) {
  2128. var failedAssets = thisTask.required.filter(function (entry) {
  2129. return !entry.fillsrequirements;
  2130. });
  2131.  
  2132. // Missing required assets
  2133. if (failedAssets.length) {
  2134. var failedCrafter = failedAssets.filter(function (entry) {
  2135. return entry.icon.indexOf("Follower") >= 0;
  2136. });
  2137.  
  2138. // Train Assets
  2139. if (failedCrafter.length && settings["trainassets"]) {
  2140. if (profname == 'Leadership'&& professionLevel < 3){
  2141. console.log(profname, "level is [" + professionLevel + "], cant train workers.");
  2142. return false;
  2143. } else {
  2144. console.log("Found required asset:", failedCrafter[0].icon);
  2145. searchItem = failedCrafter[0].icon;
  2146. searchAsset = true;
  2147. }
  2148. } else {
  2149. // TODO: Automatically purchase item assets from shop
  2150. console.log("Not enough assets for task:", taskname);
  2151. return false;
  2152. }
  2153. }
  2154. // Check for craftable ingredients items and purchasable profession resources (from vendor)
  2155. else {
  2156. var failedResources = thisTask.consumables.filter(function (entry) {
  2157. return entry.required && !entry.fillsrequirements;
  2158. });
  2159.  
  2160. // Check first required ingredient only
  2161. // If it fails to buy or craft task cannot be completed anyway
  2162. // If it succeeds script will search for tasks anew
  2163. var itemName = failedResources[0].hdef.match(/\[(\w+)\]/)[1];
  2164.  
  2165. // Buy purchasable resources if auto-purchase setting is enabled
  2166. if (settings["autopurchase"] && itemName.match(/^Crafting_Resource_(Charcoal|Rocksalt|Spool_Thread|Porridge|Solvent|Brimstone|Coal|Moonseasalt|Quicksilver|Spool_Threadsilk)$/)) {
  2167. // returns null if successful (task will try again) and false if unsuccessful (task will be skipped)
  2168. return buyResource(itemName);
  2169. }
  2170. // Matched profession auto-purchase item found but auto-purchase is not enabled
  2171. else if (!settings["autopurchase"] && itemName.match(/^Crafting_Resource_(Charcoal|Rocksalt|Spool_Thread|Porridge|Solvent|Brimstone|Coal|Moonseasalt|Quicksilver|Spool_Threadsilk)$/)) {
  2172. console.log("Purchasable resource required:",itemName,"for task:", taskname,". Recommend enabling Auto Purchase Resources.");
  2173. return false;
  2174. }
  2175. // craftable ingredient set to search for
  2176. else {
  2177. console.log("Found required ingredient:", itemName);
  2178. searchItem = itemName;
  2179. }
  2180. }
  2181. }
  2182.  
  2183.  
  2184. // either no craftable items/assets found or other task requirements are not met
  2185. // Skip crafting ingredient tasks for Leadership
  2186. if (searchItem === null || !searchItem.length || (profname == 'Leadership' && !searchAsset && !searchItem.match(/Crafting_Asset_Craftsman/))) {
  2187. console.log("Failed to resolve item requirements for task:", taskname);
  2188. return false;
  2189. }
  2190.  
  2191. // Generate list of available tasks to search ingredients/assets from
  2192. console.log("Searching ingredient tasks for:", profname);
  2193. var taskList = unsafeWindow.client.dataModel.model.craftinglist['craft_' + profname].entries.filter(function (entry) {
  2194. // remove header lines first to avoid null def
  2195. if (entry.isheader) {
  2196. return false;
  2197. }
  2198.  
  2199. // Too high level
  2200. if (entry.failslevelrequirements) {
  2201. return false;
  2202. }
  2203.  
  2204. // Rewards do not contain item we want to make
  2205. if (searchAsset) {
  2206. if (entry.def.icon != searchItem || !entry.def.name.match(/Recruit/) || entry.def.requiredrank > 14) {
  2207. return false;
  2208. }
  2209. }
  2210. else {
  2211. if (!(entry.rewards.some(function (itm) {
  2212. try {
  2213. return itm.hdef.match(/\[(\w+)\]/)[1] == searchItem;
  2214. } catch (e) {
  2215. }
  2216. }))) {
  2217. return false;
  2218. }
  2219. }
  2220.  
  2221. // Skip Mass/Trading/looping Transmute -tasks
  2222. if (entry.def.name.match(/(_Mass|_Transmute_|_Create_|(_Gather|_Refine)_Special)/)) {
  2223. return false;
  2224. }
  2225.  
  2226. return true;
  2227. });
  2228.  
  2229. if (!taskList.length) {
  2230. console.log("No ingredient tasks found for:", taskname, searchItem);
  2231. return false;
  2232. }
  2233.  
  2234. // Use more efficient Empowered task for Aqua Vitae/ Aqua Regia if available.
  2235. if (searchItem == "Crafting_Resource_Aquavitae" && taskList.length > 1) {
  2236. taskList.shift();
  2237. }
  2238. if (searchItem == "Crafting_Resource_Aquaregia" && taskList.length > 1) {
  2239. taskList.shift();
  2240. }
  2241. // Should really only be one result now but lets iterate through anyway.
  2242. for (var i = 0; i < taskList.length; i++) {
  2243. console.log("Attempting search for ingredient task:", taskList[i].def.name);
  2244. var task = searchForTask(taskList[i].def.name, profname, professionLevel);
  2245. if (task === null || task) {
  2246. return task;
  2247. }
  2248. }
  2249. return false;
  2250. }
  2251.  
  2252. /** --------- MAC-NW : Unused old function
  2253. * Fills resource slots and begins a profession task
  2254. *
  2255. * @param {string} taskDetail The craftindetail object for the task to be started
  2256. function startTask(taskDetail) {
  2257. return;
  2258.  
  2259. unsafeWindow.client.professionFetchTaskDetail(taskDetail.def.name);
  2260. //client.dataModel.addDefaultResources();
  2261. client.professionStartAssignment(taskDetail.def.name);
  2262. }*/
  2263.  
  2264. /**
  2265. * Selects the highest level asset for the i'th button in the list. Uses an iterative approach
  2266. * in order to apply a sufficient delay after the asset is assigned
  2267. *
  2268. * @param {Array} The list of buttons to use to click and assign assets for
  2269. * @param {int} i The current iteration number. Will select assets for the i'th button
  2270. * @param {Deferred} jQuery Deferred object to resolve when all of the assets have been assigned
  2271. */
  2272. function SelectItemFor(buttonListIn, i, def, prof) {
  2273. buttonListIn[i].click();
  2274. WaitForState("").done(function () {
  2275.  
  2276. var $assets = $("div.modal-item-list a").has("img[src*='_Resource_'],img[src*='_Assets_'],img[src*='_Tools_'],img[src*='_Tool_'],img[src*='_Jewelersloupe_'],img[src*='_Bezelpusher_']"); //edited by RottenMind
  2277. var $persons = $("div.modal-item-list a").has("img[src*='_Follower_']");
  2278. var quality = [".Special", ".Gold", ".Silver", ".Bronze"];
  2279. var ic, $it;
  2280.  
  2281. var clicked = false;
  2282.  
  2283. // Try to avoid using up higher rank assets needlessly
  2284. if (prof.taskName === "Leadership") {
  2285. var mercenarys = $('div.modal-item-list a.Bronze img[src*="Crafting_Follower_Leader_Generic_T1_01"]').parent().parent();
  2286. var guards = $('div.modal-item-list a.Bronze img[src*="Crafting_Follower_Leader_Guard_T2_01"]').parent().parent();
  2287. var footmen = $('div.modal-item-list a.Bronze img[src*="Crafting_Follower_Leader_Private_T2_01"]').parent().parent();
  2288.  
  2289. if (mercenarys.length) {
  2290. clicked = true;
  2291. mercenarys[0].click();
  2292. }
  2293. else if (guards.length) {
  2294. clicked = true;
  2295. guards[0].click();
  2296. }
  2297. else if (footmen.length) {
  2298. clicked = true;
  2299. footmen[0].click();
  2300. }
  2301. }
  2302.  
  2303. // check resources & assets for best quality, in descending order
  2304. for (ic in quality) {
  2305. $it = $assets.filter(quality[ic]);
  2306. if ($it.length) {
  2307. $it[0].click();
  2308. clicked = true;
  2309. break;
  2310. }
  2311. }
  2312.  
  2313. // if no asset was selected, check for persons for best speed, in descending order
  2314. if (!clicked) {
  2315. for (ic in quality) {
  2316. $it = $persons.filter(quality[ic]);
  2317. if ($it.length) {
  2318. $it[0].click();
  2319. clicked = true;
  2320. break;
  2321. }
  2322. }
  2323. }
  2324.  
  2325. // if nothing was found at all, return immediately (skip other optional slots)
  2326. if (!clicked) {
  2327. $("button.close-button").trigger('click');
  2328. console.log("Nothing more to click..");
  2329. WaitForState("").done(function () {
  2330. // Let main loop continue
  2331. def.resolve();
  2332. });
  2333. }
  2334.  
  2335. console.log("Clicked item");
  2336. WaitForState("").done(function () {
  2337. // Get the new set of select buttons created since the other ones are removed when the asset loads
  2338. var buttonList = $('.taskdetails-assets:eq(1)').find("button");
  2339. if (i < buttonList.length - 1) {
  2340. SelectItemFor(buttonList, i + 1, def, prof);
  2341. }
  2342. else {
  2343. // Let main loop continue
  2344. def.resolve();
  2345. }
  2346. });
  2347. });
  2348. }
  2349.  
  2350. /* ################# original
  2351. function SelectItemFor(buttonListIn, i, def, prof) {
  2352. buttonListIn[i].click();
  2353. WaitForState("").done(function() {
  2354. var specialItems = $("div.modal-item-list a.Special");
  2355. var goldItems = $("div.modal-item-list a.Gold");
  2356. var silverItems = $("div.modal-item-list a.Silver");
  2357. var bronzeItems = $("div.modal-item-list a.Bronze");
  2358. var clicked = false;
  2359. // Try to avoid using up higher rank assets needlessly
  2360. if (prof.taskName === "Leadership") {
  2361. var mercenarys = $("div.modal-item-list a.Bronze:contains('Mercenary')");
  2362. var guards = $("div.modal-item-list a.Bronze:contains('Guard')");
  2363. var footmen = $("div.modal-item-list a.Bronze:contains('Footman')");
  2364. if (mercenarys.length) { clicked = true; mercenarys[0].click(); }
  2365. else if (guards.length) { clicked = true; guards[0].click(); }
  2366. else if (footmen.length) { clicked = true; footmen[0].click(); }
  2367. }
  2368. // TODO: add remaining professions in the same way for bronze tier assets.
  2369. if (!clicked) {
  2370. // Click the highest slot
  2371. if (specialItems.length) { specialItems[0].click(); }
  2372. else if (goldItems.length) { goldItems[0].click(); }
  2373. else if (silverItems.length) { silverItems[0].click(); }
  2374. else if (bronzeItems.length) { bronzeItems[0].click(); }
  2375. else { $("button.close-button").click(); }
  2376. }
  2377. console.log("Clicked item");
  2378. WaitForState("").done(function() {
  2379. // Get the new set of select buttons created since the other ones are removed when the asset loads
  2380. var buttonList = $("h3:contains('Optional Assets:')").closest("div").find("button");
  2381. if (i < buttonList.length - 1) {
  2382. SelectItemFor(buttonList, i+1, def, prof);
  2383. }
  2384. else {
  2385. // Let main loop continue
  2386. def.resolve();
  2387. }
  2388. });
  2389. });
  2390. }
  2391. */
  2392.  
  2393. /**
  2394. * Will buy a given purchasable resource
  2395. *
  2396. * @param {String} item The data-tt-item id of the Resource to purchase
  2397. */
  2398. function buyResource(item) {
  2399. if (!settings['purchasePorridge'] && item == "Crafting_Resource_Porridge") {
  2400. return false;
  2401. }
  2402. var _resourceID = {
  2403. Crafting_Resource_Charcoal: 0,
  2404. Crafting_Resource_Rocksalt: 1,
  2405. Crafting_Resource_Spool_Thread: 2,
  2406. Crafting_Resource_Porridge: 3,
  2407. Crafting_Resource_Solvent: 4,
  2408. Crafting_Resource_Brimstone: 5,
  2409. Crafting_Resource_Coal: 6,
  2410. Crafting_Resource_Moonseasalt: 7,
  2411. Crafting_Resource_Quicksilver: 8,
  2412. Crafting_Resource_Spool_Threadsilk: 9,
  2413. };
  2414. var _resourceCost = {
  2415. Crafting_Resource_Charcoal: 30,
  2416. Crafting_Resource_Rocksalt: 30,
  2417. Crafting_Resource_Spool_Thread: 30,
  2418. Crafting_Resource_Porridge: 30,
  2419. Crafting_Resource_Solvent: 20,
  2420. Crafting_Resource_Brimstone: 100,
  2421. Crafting_Resource_Coal: 500,
  2422. Crafting_Resource_Moonseasalt: 500,
  2423. Crafting_Resource_Quicksilver: 500,
  2424. Crafting_Resource_Spool_Threadsilk: 500,
  2425. };
  2426. var _charGold = unsafeWindow.client.dataModel.model.ent.main.currencies.gold;
  2427. var _charSilver = unsafeWindow.client.dataModel.model.ent.main.currencies.silver;
  2428. var _charCopper = unsafeWindow.client.dataModel.model.ent.main.currencies.copper;
  2429. var _charCopperTotal = _charCopper + (_charSilver*100) + (_charGold*10000);
  2430. var _resourcePurchasable = Math.floor(_charCopperTotal/_resourceCost[item]);
  2431. // Limit resource purchase to 50 quantity
  2432. var _purchaseCount = (_resourcePurchasable >= 50) ? 50 : _resourcePurchasable;
  2433.  
  2434. if (_purchaseCount < 1) {
  2435. // Not enough gold for 1 resource
  2436. console.log("Purchasing profession resources failed for:",item);
  2437. return false;
  2438. } else {
  2439. // Make purchase
  2440. console.log("Purchasing profession resources:", _purchaseCount + "x",item, ". Total copper available:",_charCopperTotal,". Spending ",(_purchaseCount*_resourceCost[item]),"copper.");
  2441. unsafeWindow.client.sendCommand("GatewayVendor_PurchaseVendorItem", {vendor: 'Nw_Gateway_Professions_Merchant', store: 'Store_Crafting_Resources', idx: _resourceID[item], count: _purchaseCount});
  2442. WaitForState("button.closeNotification").done(function () {
  2443. $("button.closeNotification").trigger('click');
  2444. });
  2445. return null;
  2446. }
  2447. }
  2448.  
  2449. /** DRAFT
  2450. * Will buy a missing leadership assets
  2451. *
  2452. * @param {String} item reference from assetID
  2453. */
  2454. function buyTaskAsset(_itemNo) {
  2455. var _returnHast = unsafeWindow.location.hash;
  2456. unsafeWindow.location.hash = unsafeWindow.location.hash.replace(/\)\/.+/, ')/professions/vendor');
  2457. WaitForState("").done(function () {
  2458. if ($('span.alert-red button[data-url-silent="/professions/vendor/Store_Crafting_Assets/' + _itemNo + '"]').length) {
  2459. return false;
  2460. } else if ($('button[data-url-silent="/professions/vendor/Store_Crafting_Assets/' + _itemNo + '"]').length)
  2461. {
  2462. $('button[data-url-silent="/professions/vendor/Store_Crafting_Assets/' + _itemNo + '"]').trigger('click');
  2463. WaitForState(".modal-confirm button").done(function () {
  2464. $('.modal-confirm button').eq(1).trigger('click');
  2465. unsafeWindow.location.hash = _returnHast;
  2466. return null;
  2467. });
  2468. }
  2469. });
  2470. }
  2471.  
  2472.  
  2473. // Function used to check exchange data model and post calculated AD/Zen for transfer if all requirements are met
  2474. function postZexOffer() {
  2475. // Make sure the exchange data is loaded to model
  2476. if (unsafeWindow.client.dataModel.model.exchangeaccountdata) {
  2477. // Check that there is atleast 1 free zex order slot
  2478. if (unsafeWindow.client.dataModel.model.exchangeaccountdata.openorders.length < 5) {
  2479. // Place the order
  2480. var exchangeDiamonds = parseInt(unsafeWindow.client.dataModel.model.exchangeaccountdata.readytoclaimescrow);
  2481. var charDiamonds = parseInt(unsafeWindow.client.dataModel.model.ent.main.currencies.diamonds);
  2482. var ZenRate = parseInt(settings["banktransrate"]);
  2483. var ZenQty = Math.floor((charDiamonds + exchangeDiamonds - parseInt(settings["bankcharmin"])) / ZenRate);
  2484. ZenQty = (ZenQty > 5000) ? 5000 : ZenQty;
  2485. console.log("Posting Zex buy listing for " + ZenQty + " ZEN at the rate of " + ZenRate + " AD/ZEN. AD remainder: " + charDiamonds + " - " + (ZenRate * ZenQty) + " = " + (charDiamonds - (ZenRate * ZenQty)));
  2486. unsafeWindow.client.createBuyOrder(ZenQty, ZenRate);
  2487.  
  2488. } else {
  2489. console.log("Zen Max Listings Reached (5). Skipping Zex Posting..");
  2490. }
  2491. } else {
  2492. console.log("Zen Exchange data did not load in time for transfer. Skipping Zex Posting..");
  2493. }
  2494. }
  2495.  
  2496. // Function used to check exchange data model and withdraw listed orders that use the settings zen transfer rate
  2497. function withdrawZexOffer() {
  2498. // Make sure the exchange data is loaded to model
  2499. if (unsafeWindow.client.dataModel.model.exchangeaccountdata) {
  2500. if (unsafeWindow.client.dataModel.model.exchangeaccountdata.openorders.length >= 1) {
  2501.  
  2502. var charDiamonds = parseInt(unsafeWindow.client.dataModel.model.ent.main.currencies.diamonds);
  2503. var ZenRate = parseInt(settings["banktransrate"]);
  2504.  
  2505. // cycle through the zex listings
  2506. unsafeWindow.client.dataModel.model.exchangeaccountdata.openorders.forEach(function (item) {
  2507. // find any buy orders in the list with our set zen rate
  2508. if (parseInt(item.price) == ZenRate && item.ordertype == "Buy") {
  2509. // cancel/withdraw the order
  2510. client.withdrawOrder(item.orderid);
  2511. console.log("Withdrawing Zex listing for " + item.quantity + " ZEN at the rate of " + item.price + " . Total value in AD: " + item.totaltc);
  2512. }
  2513. });
  2514.  
  2515. } else {
  2516. console.log("No listings found on Zex. Skipping Zex Withrdaw..");
  2517. }
  2518. } else {
  2519. console.log("Zen Exchange data did not load in time for transfer. Skipping Zex Withrdaw..");
  2520. }
  2521. }
  2522.  
  2523. // MAC-NW
  2524.  
  2525. function vendorItemsLimited(_items) {
  2526. var _charGold = unsafeWindow.client.dataModel.model.ent.main.currencies.gold;
  2527. var _pbags = client.dataModel.model.ent.main.inventory.playerbags;
  2528. var _pbags_crafting = client.dataModel.model.ent.main.inventory.tradebag; //tradebag
  2529. var _delay = 400;
  2530. var _sellCount = 0;
  2531. var _classType = unsafeWindow.client.dataModel.model.ent.main.classtype;
  2532. var _bagCount = unsafeWindow.client.dataModel.model.ent.main.inventory.playerbags.length;
  2533. var _bagUsed = 0;
  2534. var _bagUnused = 0;
  2535. var _tmpBag1 = [];
  2536. var _tmpBag2 = [];
  2537. //var _tmpBag = [];
  2538. var _profitems = [];
  2539.  
  2540. // Pattern for items to leave out of auto vendoring (safeguard)
  2541. var _excludeItems = /(Charcoal|Rocksalt|Spool_Thread|Porridge|Solvent|Brimstone|Coal|Moonseasalt|Quicksilver|Spool_Threadsilk|Clues_Bandit_Hq|Clothscraps_T4|Clothbolt_T4|Potion_Potency|Potion_Protection|Taffeta|Crafting_Asset|Craftsman|Aqua|Vitriol|Residuum|Shard|Crystal|District_Map|Local_Map|Bill_Of_Sale|Refugee|Asset_Tool|Tool|Gemfood|Gem_Upgrade_Resource|Crafting_Resource_Elemental|Elemental|Artifact|Hoard|Coffer|Fuse|Ward|Preservation|Armor_Enhancement|Weapon_Enhancement|T[5-9]_Enchantment|T[5-9]_Runestones|T10_Enchantment|T10_Runestones|4c_Personal|Item_Potion_Companion_Xp|Gateway_Rewardpack|Consumable_Id_Scroll|Dungeon_Delve_Key)/; // edited by RottenMind 08.03.2015
  2542.  
  2543. if (settings["autovendor_profresults"]) {
  2544. /** Profession leveling result item cleanup logic for T1-4 crafted results
  2545. * Created by RM on 14.1.2015.
  2546. * List contains crafted_items, based "Mustex/Bunta NW robot 1.05.0.1L crafting list, can be used making list for items what are "Auto_Vendored".
  2547. * Items on list must be checked and tested.
  2548. */
  2549. /*#1, Tier3, end list, sell allways all, "TierX" is here "TX" !!*/
  2550. /*_profitems[_profitems.length] = {
  2551. pattern : /^Crafted_(Jewelcrafting_Waist_Offense_3|Jewelcrafting_Neck_Defense_3|Jewelcrafting_Waist_Defense_3|Hvy_Armorsmithing_Pants_3|Med_Armorsmithing_Chain_Shirt_3|Leatherworking_Shirt_3|Hvy_Armorsmithing_Shirt_3|Leatherworking_Pants_3|Med_Armorsmithing_Chain_Pants_3|Med_Armorsmithing_T3_Chain_Armor_Set_1|Med_Armorsmithing_T3_Chain_Pants2|Med_Armorsmithing_T3_Chain_Shirt2|Med_Armorsmithing_T3_Chain_Helm_Set_1|Med_Armorsmithing_T3_Chain_Pants|Med_Armorsmithing_T3_Chain_Boots_Set_1|Hvy_Armorsmithing_T3_Plate_Armor_Set_1|Hvy_Armorsmithing_T3_Plate_Pants2|Hvy_Armorsmithing_T3_Plate_Shirt2|Hvy_Armorsmithing_T3_Plate_Helm_Set_1|Hvy_Armorsmithing_T3_Plate_Boots_Set_1|Leatherworking_T3_Leather_Armor_Set_1|Leatherworking_T3_Leather_Pants2|Leatherworking_T3_Leather_Shirt2|Leatherworking_T3_Leather_Helm_Set_1|Leatherworking_T3_Leather_Boots_Set_1|Tailoring_T3_Cloth_Armor_Set_3|Tailoring_T3_Cloth_Armor_Set_2|Tailoring_T3_Cloth_Armor_Set_1|Tailoring_T3_Cloth_Pants2_Set2|Tailoring_T3_Cloth_Shirt2|Tailoring_T3_Cloth_Helm_Set_1|Artificing_T3_Pactblade_Temptation_5|Artificing_T3_Icon_Virtuous_5|Weaponsmithing_T3_Dagger_4)$/,
  2552. limit : 0,
  2553. count : 0
  2554. };*/ // moved to selljunk filter, RottenMind
  2555. /*#2, Tier2 - tier3 mixed, upgrade, sell if inventory full, "TierX" is here "TX" */
  2556. _profitems[_profitems.length] = {
  2557. pattern : /^Crafted_(Jewelcrafting_Neck_Misc_2|Jewelcrafting_Waist_Misc_2|Med_Armorsmithing_T3_Chain_Pants|Hvy_Armorsmithing_Pants_3|Med_Armorsmithing_Chain_Shirt_3|Leatherworking_Shirt_3|Hvy_Armorsmithing_Shirt_3|Leatherworking_Pants_3|Med_Armorsmithing_Chain_Pants_3||Med_Armorsmithing_T3_Chain_Shirt|Hvy_Armorsmithing_T3_Plate_Pants|Hvy_Armorsmithing_T3_Plate_Shirt|Leatherworking_T3_Leather_Pants|Leatherworking_T3_Leather_Shirt|Tailoring_Shirt_3|Tailoring_T3_Cloth_Shirt|Tailoring_T3_Cloth_Shirt_Set2|Tailoring_T3_Cloth_Pants|Tailoring_Shirt_3_Set2|Tailoring_Pants_3_Set2|Tailoring_Pants_3|Artificing_T3_Pactblade_Temptation_4|Artificing_T3_Icon_Virtuous_4|Weaponsmithing_T2_Dagger_3|Weaponsmithing_T2_Dagger_3|Weaponsmithing_T3_Greataxe_4|Weaponsmithing_T3_Battleaxe_4|Weaponsmithing_T3_Greataxe_Set_2|Weaponsmithing_T3_Battleaxe_Set_2)$/,
  2558. limit: 0,
  2559. count: 0
  2560. };
  2561. /*#3, Tier2, upgrade, sell if inventory full, "TierX" is here "TX" */
  2562. _profitems[_profitems.length] = {
  2563. pattern: /^Crafted_(Jewelcrafting_Neck_Offense_2|Jewelcrafting_Waist_Offense_2|Tailoring_T2_Cloth_Shirt|T2_Cloth_Armor_Set_2|Med_Armorsmithing_T2_Chain_Armor_Set_1|Med_Armorsmithing_T2_Chain_Pants_2|Med_Armorsmithing_T2_Chain_Boots_Set_1|Med_Armorsmithing_T2_Chain_Shirt_2|Med_Armorsmithing_T2_Chain_Pants_1|Med_Armorsmithing_T2_Chain_Shirt|Hvy_Armorsmithing_T2_Plate_Armor_Set_1|Hvy_Armorsmithing_T2_Plate_Pants_2|Crafted_Tailoring_Pants_2|Tailoring_T2_Cloth_Armor_Set_1|Crafted_Tailoring_Shirt_2 |Hvy_Armorsmithing_T2_Plate_Boots_Set_1|Hvy_Armorsmithing_T2_Plate_Shirt_2|Med_Armorsmithing_Chain_Pants_2|Hvy_Armorsmithing_T2_Plate_Pants_1|Hvy_Armorsmithing_T2_Shield_Set_1|Hvy_Armorsmithing_T2_Plate_Shirt|Leatherworking_T2_Leather_Shirt|Leatherworking_T2_Leather_Boots_Set_1|Leatherworking_T2_Leather_Shirt_2|Leatherworking_T2_Leather_Pants_1|Leatherworking_T2_Leather_Armor_Set_1|Leatherworking_T2_Leather_Pants_2|Leatherworking_Shirt_3_Set2|Tailoring_T2_Cloth_Armor_Set_1|Tailoring_Pants_2|Tailoring_T2_Cloth_Pants|Tailoring_T2_Cloth_Pants_2|Tailoring_T2_Cloth_Boots_Set_1|Tailoring_T2_Cloth_Shirt_2|Tailoring_T2_Cloth_Pants_1|Artificing_T2_Pactblade_Temptation_3|Artificing_T1_Icon_Virtuous_2|Weaponsmithing_T2_Dagger_2|Weaponsmithing_T2_Greataxe_3|Weaponsmithing_T2_Battleaxe_3)$/,
  2564. limit: 0,
  2565. count: 0
  2566. };
  2567. /*#4, Tier1, upgrade, sell if inventory full, "TierX" is here "TX" */
  2568. _profitems[_profitems.length] = {
  2569. pattern: /^Crafted_(Jewelcrafting_Neck_Misc_1|Jewelcrafting_Waist_Misc_1|Tailoring_Cloth_Shirt_1_Set2|Med_Armorsmithing_T1_Chain_Armor_Set_1|Med_Armorsmithing_T1_Chain_Boots_Set_1|Hvy_Armorsmithing_Plate_Armor_1|Hvy_Armorsmithing_T1_Plate_Armor_Set_1|Hvy_Armorsmithing_T1_Plate_Boots_Set_1|Leatherworking_T1_Leather_Boots_Set_1|Leatherworking_T1_Leather_Boots_Set_1|Leatherworking_T1_Leather_Armor_Set_1|Tailoring_T1_Cloth_Armor_1|Tailoring_Cloth_Armor_1|Tailoring_T1_Cloth_Pants_1|Tailoring_T1_Cloth_Boots_Set_1|Artificing_T1_Pactblade_Convergence_2|Artificing_T1_Icon_Virtuous_2|Weaponsmithing_T1_Dagger_1|Weaponsmithing_T2_Greataxe_2|Weaponsmithing_T2_Battleaxe_2)$/,
  2570. limit: 0,
  2571. count: 0
  2572. };
  2573. /*#5, Tier0, upgrade, sell if inventory full, taskilist "Tier1" is here "empty" or "_" must replace (_T1_|_)*/
  2574. _profitems[_profitems.length] = {
  2575. pattern: /^Crafted_(Jewelcrafting_Waist_Offense_1|Jewelcrafting_Neck_Offense_1|Tailoring_Cloth_Pants_1|Med_Armorsmithing_Chain_Boots_1|Med_Armorsmithing_Chain_Shirt_1|Med_Armorsmithing_Chain_Armor_1|Med_Armorsmithing_Chain_Pants_1|Hvy_Armorsmithing_Plate_Boots_1|Hvy_Armorsmithing_Plate_Shirt_1|Hvy_Armorsmithing_Shield_1|Leatherworking_Tier0_Intro_1|Leatherworking_Leather_Boots_1|Leatherworking_Leather_Shirt_1|Tailoring_T1_Cloth_Shirt_Set2|Leatherworking_Leather_Armor_1|Leatherworking_Leather_Pants_1|Tailoring_Cloth_Boots_1|Tailoring_Cloth_Shirt_1|Artificing_T1_Pactblade_Convergence_1|Artificing_Icon_Virtuous_1|Artificing_Symbol_Virtuous_1|Weaponsmithing_Dagger_1|Weaponsmithing_T1_Greatsword_1|Weaponsmithing_T1_Longbow_1|Weaponsmithing_T1_Greataxe_1|Weaponsmithing_T1_Battleaxe_1)$/,
  2576. limit: 0,
  2577. count: 0
  2578. };
  2579. }
  2580. $.each(_pbags, function (bi, bag) {
  2581. bag.slots.forEach(function (slot) {
  2582. // Match unused slots
  2583. if (slot === null || !slot || slot === undefined) {
  2584. _bagUnused++;
  2585. }
  2586. // Match items to exclude from auto vendoring, dont add to _tmpBag: Exclude pattern list - bound - Epic Quality - Blue Quality
  2587. else if (_excludeItems.test(slot.name) || slot.bound || slot.rarity == "Special" || slot.rarity == "Gold") {
  2588. _bagUsed++;
  2589. }
  2590. // Match everything else
  2591. else {
  2592. if (settings["autovendor_profresults"]) {
  2593. for (i = 0; i < _profitems.length; i++) {
  2594. if (_profitems[i].pattern.test(slot.name))
  2595. _profitems[i].count++;
  2596. }
  2597. }
  2598. _tmpBag1[_tmpBag1.length] = slot;
  2599. _bagUsed++;
  2600. }
  2601. });
  2602. });
  2603. if (settings["autovendor_profresults"] && _charGold < 2) { // this "gold" threshold must be global var and adjustable by users
  2604. // $.each(_pbags_crafting, function (bi, bag) {
  2605. _pbags_crafting.forEach(function (slot) {
  2606. // Match unused slots
  2607. if (slot === null || !slot || slot === undefined) {
  2608. // _bagUnused++;
  2609. }
  2610. // Match items to exclude from auto vendoring, dont add to _tmpBag: Exclude pattern list - bound - Epic Quality - Blue Quality - Green Quality(might cause problems)
  2611. else if (_excludeItems.test(slot.name) || slot.bound || slot.rarity == "Special" || slot.rarity == "Gold" || slot.rarity == "Silver") {
  2612. // _bagUsed++;
  2613. }
  2614. // Match everything else
  2615. else {
  2616. if (settings["autovendor_profresults"]) {
  2617. for (i = 0; i < _profitems.length; i++) {
  2618. if (_profitems[i].pattern.test(slot.name))
  2619. _profitems[i].count++;
  2620. }
  2621. }
  2622. _tmpBag2[_tmpBag2.length] = slot;
  2623. // _bagUsed++;
  2624. console.log(slot.name); // tradebag debug msg
  2625. }
  2626. });
  2627. // });
  2628. }
  2629. var _tmpBag = _tmpBag1.concat(_tmpBag2);
  2630.  
  2631. if (settings["autovendor_profresults"]) {
  2632. _tmpBag.forEach(function (slot) {
  2633. for (i = 0; i < _profitems.length; i++) { // edited by RottenMind
  2634. if (slot && _profitems[i].pattern.test(slot.name) && Inventory_bagspace() <= 9) { // !slot.bound && _profitems[i].count > 3 &&, edited by RottenMind
  2635. var vendor = {
  2636. vendor: "Nw_Gateway_Professions_Merchant"
  2637. };
  2638. vendor.id = slot.uid;
  2639. vendor.count = 1;
  2640. console.log('Selling', vendor.count, slot.name, 'to vendor.');
  2641. window.setTimeout(function () {
  2642. client.sendCommand('GatewayVendor_SellItemToVendor', vendor);
  2643. }, _delay);
  2644. _profitems[i].count--;
  2645. break;
  2646. }
  2647. }
  2648. });
  2649. }
  2650.  
  2651. _tmpBag.forEach(function (slot) {
  2652. for (i = 0; i < _items.length; i++) {
  2653. var _Limit = (parseInt(_items[i].limit) > 99) ? 99 : _items[i].limit;
  2654. if (slot && _items[i].pattern.test(slot.name) && !slot.bound) {
  2655. // Node Kits vendor logic for restricted bag space
  2656. if (settings["autovendor_kits_altars_limit"] && /^Item_Consumable_Skill/.test(slot.name)) {
  2657. if (_bagCount < 2 || _bagUnused < 6 ||
  2658. (slot.name == "Item_Consumable_Skill_Dungeoneering" && (_classType == "Player_Guardian" || _classType == "Player_Greatweapon")) ||
  2659. (slot.name == "Item_Consumable_Skill_Arcana" && (_classType == "Player_Controller" || _classType == "Player_Scourge")) ||
  2660. (slot.name == "Item_Consumable_Skill_Religion" && _classType == "Player_Devoted") ||
  2661. (slot.name == "Item_Consumable_Skill_Thievery" && _classType == "Player_Trickster") ||
  2662. (slot.name == "Item_Consumable_Skill_Nature" && _classType == "Player_Archer")
  2663. ) {
  2664. _Limit = 0;
  2665. }
  2666. }
  2667. // Sell Items
  2668. if (slot.count > _Limit) {
  2669. _sellCount++;
  2670. var vendor = {
  2671. vendor: "Nw_Gateway_Professions_Merchant"
  2672. };
  2673. vendor.id = slot.uid;
  2674. vendor.count = slot.count - _Limit;
  2675. console.log('Selling', vendor.count, slot.name, 'to vendor.');
  2676. window.setTimeout(function () {
  2677. client.sendCommand('GatewayVendor_SellItemToVendor', vendor);
  2678. }, _delay);
  2679. _delay = _delay + 400;
  2680. break;
  2681. }
  2682. }
  2683. }
  2684. });
  2685.  
  2686. return _sellCount;
  2687. }
  2688.  
  2689. function switchChar() {
  2690.  
  2691. failedProf = [];
  2692.  
  2693. setTaskSlots();
  2694.  
  2695. //if (settings["refinead"]) {
  2696. var _currencies = unsafeWindow.client.dataModel.model.ent.main.currencies;
  2697. if (_currencies.diamondsconvertleft && _currencies.roughdiamonds) {
  2698. var refined_diamonds;
  2699. if (_currencies.diamondsconvertleft < _currencies.roughdiamonds) {
  2700. refined_diamonds = _currencies.diamondsconvertleft
  2701. } else {
  2702. refined_diamonds = _currencies.roughdiamonds
  2703. }
  2704. chardiamonds[charcurrent] += refined_diamonds
  2705. console.log("Refining AD for", settings["nw_charname" + charcurrent] + ":", refined_diamonds);
  2706. console.log(settings["nw_charname" + charcurrent] + "'s", "Astral Diamonds:", chardiamonds[charcurrent]);
  2707. unsafeWindow.client.sendCommand('Gateway_ConvertNumeric', 'Astral_Diamonds');
  2708. WaitForState("button.closeNotification").done(function () {
  2709. $("button.closeNotification").click();
  2710. });
  2711. }
  2712. //}
  2713. if (settings["easy_start"]) {
  2714. get_banker();
  2715. }
  2716. // MAC-NW -- AD Consolidation
  2717. if (settings["autoexchange"]) {
  2718.  
  2719. // Check that we dont take money from the character assigned as the banker // Zen Transfer / Listing
  2720. if (settings["bankchar"] != unsafeWindow.client.dataModel.model.ent.main.name) {
  2721. // Check the required min AD amount on character
  2722. if (settings["banktransmin"] && settings["bankcharmin"] && parseInt(unsafeWindow.client.dataModel.model.ent.main.currencies.diamonds) >= (parseInt(settings["banktransmin"]) + parseInt(settings["bankcharmin"]))) {
  2723. // Check that the rate is not less than the min & max
  2724. if (settings["banktransrate"] && parseInt(settings["banktransrate"]) >= 50 && parseInt(settings["banktransrate"]) <= 500) {
  2725. window.setTimeout(postZexOffer, delay.SHORT);
  2726. }
  2727. // Crash ZEX Domino
  2728. if (unsafeWindow.client.dataModel.model.exchangeaccountdata.openorders.length >= 4) {
  2729. window.setTimeout(withdrawZexOffer, delay.MEDIUM);
  2730. }
  2731. else {
  2732. console.log("Zen transfer rate does not meet the minimum (50) or maximum (500). Skipping Zex Posting..");
  2733. }
  2734. } else {
  2735. console.log("Character does not have minimum AD balance to do funds transfer. Skipping Zex Posting..");
  2736. }
  2737. }
  2738.  
  2739. } else {
  2740. console.log("Zen Exchange AD transfer not enabled. Skipping Zex Posting..");
  2741. }
  2742.  
  2743. if (settings["openrewards"]) {
  2744. var _pbags = unsafeWindow.client.dataModel.model.ent.main.inventory.playerbags;
  2745. var _cRewardPat = /Reward_Item_Chest|Gateway_Rewardpack/;
  2746. console.log("Opening Rewards");
  2747. $.each(_pbags, function (bi, bag) {
  2748. bag.slots.forEach(function (slot) {
  2749. if (slot && _cRewardPat.test(slot.name)) {
  2750. if (slot.count >= 99)
  2751. slot.count = 99;
  2752. for (i = 1; i <= slot.count; i++) {
  2753. window.setTimeout(function () {
  2754. client.sendCommand('GatewayInventory_OpenRewardPack', slot.uid);
  2755. }, 500);
  2756. }
  2757. }
  2758. });
  2759. });
  2760. }
  2761.  
  2762. // Check Vendor Options & Vendor matched items
  2763. vendorJunk();
  2764.  
  2765. // MAC-NW (endchanges)
  2766.  
  2767. console.log("Switching Characters");
  2768.  
  2769. var chardate = null, nowdate = new Date(); // chardelay moved global
  2770. nowdate = nowdate.getTime();
  2771. for (var cc = 0; cc < settings["charcount"]; cc++) {
  2772. if (chartimers[cc] != null) {
  2773. console.log("Date found for " + settings["nw_charname" + cc]);
  2774. if (!chardate || chartimers[cc] < chardate) {
  2775. chardate = chartimers[cc];
  2776. charcurrent = cc;
  2777. chardelay = chardate.getTime() - nowdate - unsafeWindow.client.getServerOffsetSeconds() * 1000;
  2778. if (chardelay < delay.SHORT) {
  2779. chardelay = delay.SHORT;
  2780. }
  2781. }
  2782. } else {
  2783. charcurrent = cc;
  2784. chardelay = delay.SHORT;
  2785. chardate = null;
  2786. console.log("No date found for " + settings["nw_charname" + cc] + ", switching now.");
  2787. break;
  2788. }
  2789. }
  2790.  
  2791. // Count AD
  2792. var curdiamonds = 0;
  2793. for (var cc = 0; cc < settings["charcount"]; cc++) {
  2794. if (chardiamonds[cc] != null) {
  2795. curdiamonds += Math.floor(chardiamonds[cc] / 50) * 50;
  2796. }
  2797. }
  2798.  
  2799. console.log("Next run for " + settings["nw_charname" + charcurrent] + " in " + parseInt(chardelay / 1000) + " seconds.");
  2800. $("#prinfopane").empty().append("<h3 class='promo-image copy-top prh3'>Professions Robot<br />Next task for " + settings["nw_charname" + charcurrent] + "<br /><span data-timer='" + chardate + "' data-timer-length='2'></span><br />Diamonds: " + curdiamonds.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " #SCA[" + GM_getValue("dailyswordcoast", 0) + "]times." + "</h3>");
  2801. GM_setValue("charcurrent", charcurrent);
  2802. dfdNextRun.resolve(chardelay);
  2803. }
  2804.  
  2805. /**
  2806. * Waits for the loading symbol to be hidden.
  2807. *
  2808. * @return {Deferred} A jQuery defferred object that will be resolved when loading is complete
  2809. */
  2810. function WaitForLoad() {
  2811. return WaitForState("");
  2812. }
  2813. /**
  2814. * Creates a deferred object that will be resolved when the state is reached
  2815. *
  2816. * @param {string} query The query for the state to wait for
  2817. * @return {Deferred} A jQuery defferred object that will be resolved when the state is reached
  2818. */
  2819. function WaitForState(query) {
  2820. var dfd = $.Deferred();
  2821. window.setTimeout(function () {
  2822. AttemptResolve(query, dfd);
  2823. }, delay.SHORT); // Doesn't work without a short delay
  2824. return dfd;
  2825. }
  2826. function WaitForNotState(query) {
  2827. var dfd = $.Deferred();
  2828. window.setTimeout(function () {
  2829. AttemptNotResolve(query, dfd);
  2830. }, delay.SHORT); // Doesn't work without a short delay
  2831. return dfd;
  2832. }
  2833. /**
  2834. * Will continually test for the given query state and resolve the given deferred object when the state is reached
  2835. * and the loading symbol is not visible
  2836. *
  2837. * @param {string} query The query for the state to wait for
  2838. * @param {Deferred} dfd The jQuery defferred object that will be resolved when the state is reached
  2839. */
  2840. function AttemptResolve(query, dfd) {
  2841. if ((query === "" || $(query).length) && $("div.loading-image:visible").length === 0) {
  2842. dfd.resolve();
  2843. }
  2844. else {
  2845. window.setTimeout(function () {
  2846. AttemptResolve(query, dfd);
  2847. }, delay.SHORT); // Try again in a little bit
  2848. }
  2849. }
  2850. /* Opposite of AttemptResolve, will try to resolve query until it doesn't resolve. */
  2851. function AttemptNotResolve(query, dfd) {
  2852. if (!$(query).length && $("div.loading-image:visible").length === 0) {
  2853. dfd.resolve();
  2854. }
  2855. else {
  2856. window.setTimeout(function () {
  2857. AttemptNotResolve(query, dfd);
  2858. }, delay.SHORT); // Try again in a little bit
  2859. }
  2860. }
  2861. /**
  2862. * The main process loop:
  2863. * - Determine which page we are on and call the page specific logic
  2864. * - When processing is complete, process again later
  2865. * - Use a short timer when something changed last time through
  2866. * - Use a longer timer when waiting for tasks to complete
  2867. */
  2868. function process() {
  2869. // Make sure the settings button exists
  2870. addSettings();
  2871.  
  2872. // Enable/Disable the unconditional page reload depending on settings
  2873. loading_reset = settings["autoreload"];
  2874.  
  2875. // Check if timer is paused
  2876. s_paused = settings["paused"]; // let the Page Reloading function know the pause state
  2877. if (settings["paused"]) {
  2878. // Just continue later - the deferred object is still set and nothing will resolve it until we get past this point
  2879. var timerHandle = window.setTimeout(function () {
  2880. process();
  2881. }, delay.DEFAULT);
  2882. return;
  2883. }
  2884.  
  2885. // Check for Gateway down
  2886. if (window.location.href.indexOf("gatewaysitedown") > -1) {
  2887. // Do a long delay and then retry the site
  2888. console.log("Gateway down detected - relogging in " + (delay.MINS / 1000) + " seconds");
  2889. window.setTimeout(function () {
  2890. unsafeWindow.location.href = current_Gateway; // edited by RottenMind
  2891. }, delay.MINS);
  2892. return;
  2893. }
  2894.  
  2895. // Check for login or account guard and process accordingly
  2896. var currentPage = GetCurrentPage();
  2897. if (currentPage == PAGES.LOGIN) {
  2898. page_LOGIN();
  2899. return;
  2900. }
  2901. else if (currentPage == PAGES.GUARD) {
  2902. page_GUARD();
  2903. return;
  2904. }
  2905.  
  2906. window.setTimeout(function () {
  2907. loginProcess();
  2908. }, delay.SHORT);
  2909.  
  2910. // Continue again later
  2911. dfdNextRun.done(function (delayTimer) {
  2912. dfdNextRun = $.Deferred();
  2913. timerHandle = window.setTimeout(function () {
  2914. process();
  2915. }, typeof delayTimer !== 'undefined' ? delayTimer : delay.DEFAULT);
  2916. });
  2917. }
  2918.  
  2919. function loginProcess() {
  2920. // Get logged on account details
  2921. var accountName;
  2922. try {
  2923. accountName = unsafeWindow.client.dataModel.model.loginInfo.publicaccountname;
  2924. }
  2925. catch (e) {
  2926. // TODO: Use callback function
  2927. window.setTimeout(function () {
  2928. loginProcess();
  2929. }, delay.SHORT);
  2930. return;
  2931. }
  2932.  
  2933. // Check if timer is paused again to avoid starting new task between timers
  2934. s_paused = settings["paused"]; // let the Page Reloading function know the pause state
  2935. if (settings["paused"]) {
  2936. // Just continue later - the deferred object is still set and nothing will resolve it until we get past this point
  2937. var timerHandle = window.setTimeout(function () {
  2938. process();
  2939. }, delay.DEFAULT);
  2940. return;
  2941. }
  2942.  
  2943. if (accountName) {
  2944. // load current character position and values
  2945. charcurrent = GM_getValue("charcurrent", 0);
  2946. for (var i = 0; i < (charSettings.length / settings["charcount"]); i++) {
  2947. j = i + (charcurrent * charSettings.length / settings["charcount"]);
  2948. settings[charSettings[j].name.replace(new RegExp(charcurrent + "$"), '')] = settings[charSettings[j].name];
  2949. }
  2950.  
  2951. var charName = settings["nw_charname"];
  2952. var fullCharName = charName + '@' + accountName;
  2953.  
  2954. if (charName.match(/Character/)) {
  2955. if (!settings["paused"])
  2956. PauseSettings("pause");
  2957. console.log("Loading character list", charName);
  2958. charNameList = [];
  2959. client.dataModel.model.loginInfo.choices.forEach(function (char) {
  2960. if (char.name == "Author") return;
  2961. charNameList.push(char.name);
  2962. });
  2963. console.log("Found names: " + charNameList);
  2964.  
  2965. GM_setValue("charcount", charNameList.length);
  2966. charNameList.forEach(function (name, i) {
  2967. GM_setValue("nw_charname" + i, name);
  2968. })
  2969. if (settings["paused"]) {
  2970. window.setTimeout(function () {
  2971. PauseSettings("unpause");
  2972. }, 3000);
  2973. }
  2974. window.setTimeout(function () {
  2975. unsafeWindow.location.href = current_Gateway;
  2976. }, delay.MEDIUM);
  2977. console.log("ReStarting");
  2978. }
  2979.  
  2980. if (unsafeWindow.client.getCurrentCharAtName() != fullCharName) {
  2981. loadCharacter(fullCharName);
  2982. return;
  2983. }
  2984.  
  2985. // Try to start tasks
  2986. if (processCharacter()) {
  2987. return;
  2988. }
  2989.  
  2990. // Switch characters as necessary
  2991. switchChar();
  2992. }
  2993. dailySCA();
  2994. }
  2995.  
  2996. function loadCharacter(charname) {
  2997. // Load character and restart next load loop
  2998. console.log("Loading gateway script for", charname);
  2999. startedTask["currTaskChar"] = charname;
  3000. unsafeWindow.client.dataModel.loadEntityByName(charname);
  3001.  
  3002. // MAC-NW -- AD Consolidation -- Banker Withdraw Secion
  3003. try {
  3004. var testChar = unsafeWindow.client.dataModel.model.ent.main.name;
  3005. unsafeWindow.client.dataModel.fetchVendor('Nw_Gateway_Professions_Merchant');
  3006. console.log("Loaded datamodel for", charname);
  3007. }
  3008. catch (e) {
  3009. // TODO: Use callback function
  3010. window.setTimeout(function () {
  3011. loadCharacter(charname);
  3012. }, delay.SHORT);
  3013. return;
  3014. }
  3015.  
  3016. setTaskSlots();
  3017.  
  3018. if (settings["autoexchange"]) {
  3019.  
  3020. unsafeWindow.client.dataModel.fetchExchangeAccountData();
  3021.  
  3022. try {
  3023. var testExData = unsafeWindow.client.dataModel.model.exchangeaccountdata.openorders;
  3024. console.log("Loaded zen exchange data for", charname);
  3025. }
  3026. catch (e) {
  3027. // TODO: Use callback function
  3028. window.setTimeout(function () {
  3029. loadCharacter(charname);
  3030. }, delay.SHORT);
  3031. return;
  3032. }
  3033.  
  3034. // Check to see if this is the designated banker character
  3035. if (settings["bankchar"] == unsafeWindow.client.dataModel.model.ent.main.name) {
  3036. // This is the banker -- withdraw any buy listings that match the transfer rate set in panel
  3037. window.setTimeout(withdrawZexOffer, delay.MEDIUM);
  3038. // withdraw the balance from exchange
  3039. window.setTimeout(function () {
  3040. if (parseInt(client.dataModel.model.exchangeaccountdata.readytoclaimescrow) > 0) {
  3041. client.sendCommand("GatewayExchange_ClaimTC", client.dataModel.model.exchangeaccountdata.readytoclaimescrow);
  3042. console.log("Attempting to withdraw exchange balancees... ClaimTC: " + client.dataModel.model.exchangeaccountdata.readytoclaimescrow);
  3043. }
  3044. if (parseInt(client.dataModel.model.exchangeaccountdata.readytoclaimmtc) > 0) {
  3045. client.sendCommand("GatewayExchange_ClaimMTC", client.dataModel.model.exchangeaccountdata.readytoclaimmtc);
  3046. console.log("Attempting to withdraw exchange balancees... ClaimMT: " + client.dataModel.model.exchangeaccountdata.readytoclaimmtc);
  3047. }
  3048.  
  3049. }, delay.SHORT);
  3050. }
  3051.  
  3052. WaitForState("button.closeNotification").done(function () {
  3053. $("button.closeNotification").click();
  3054. });
  3055.  
  3056. unsafeWindow.client.dataModel.loadEntityByName(charname);
  3057.  
  3058. } else {
  3059. console.log("Zen Exchange AD transfer not enabled. Skipping Zex Posting..");
  3060. }
  3061. // MAC-NW
  3062.  
  3063. // MAC-NW -- Moved Professoin Merchant loading here with testing/waiting to make sure it loads
  3064. try {
  3065. var testProfMerchant = client.dataModel.model.vendor.items;
  3066. console.log("Loaded profession merchant for", charname);
  3067. }
  3068. catch (e) {
  3069. // TODO: Use callback function
  3070. window.setTimeout(function () {
  3071. loadCharacter(charname);
  3072. }, delay.SHORT);
  3073. return;
  3074. }
  3075.  
  3076. // Check Vendor Options & Vendor matched items
  3077. vendorJunk();
  3078.  
  3079. dfdNextRun.resolve();
  3080. }
  3081.  
  3082. function addSettings() {
  3083. if ($("#settingsButton").length)
  3084. return;
  3085. // Add the required CSS
  3086. AddCss("\
  3087. #settingsButton{border-bottom: 1px solid rgb(102, 102, 102); border-right: 1px solid rgb(102, 102, 102); background: none repeat scroll 0% 0% rgb(238, 238, 238); display: block; position: fixed; overflow: auto; right: 0px; top: 0px; padding: 3px; z-index: 1000;}\
  3088. #pauseButton{border-bottom: 1px solid rgb(102, 102, 102); border-right: 1px solid rgb(102, 102, 102); background: none repeat scroll 0% 0% rgb(238, 238, 238); display: block; position: fixed; overflow: auto; right: 23px; top: 0px; padding: 3px; z-index: 1000;}\
  3089. /* MAC-NW -- Put Panel at a higher layer than status window */ #settingsPanel{border-bottom: 1px solid rgb(102, 102, 102); border-right: 1px solid rgb(102, 102, 102); background: none repeat scroll 0% 0% rgb(238, 238, 238); color: rgb(0, 0, 0); position: fixed; overflow: auto; right: 0px; top: 0px; width: 750px;max-height:800px;font: 12px sans-serif; text-align: left; display: block; z-index: 1001;}\
  3090. #settings_title{font-weight: bolder; background: none repeat scroll 0% 0% rgb(204, 204, 204); border-bottom: 1px solid rgb(102, 102, 102); padding: 3px;}\
  3091. #settingsPanelButtonContainer {background: none repeat scroll 0% 0% rgb(204, 204, 204); border-top: 1px solid rgb(102, 102, 102);padding: 3px;text-align:center} \
  3092. #settingsPanel label.purple {font-weight:bold;color:#7C37F6}\
  3093. #settingsPanel label.blue {font-weight:bold;color:#007EFF}\
  3094. #settingsPanel label.green {font-weight:bold;color:#8AFF00}\
  3095. #settingsPanel label.white {font-weight:bold;color:#FFFFFF}\
  3096. #charPanel {width:98%;max-height:400px;overflow:auto;display:block;padding:3px;}\
  3097. #charPanel div div ul li { display: inline-block; width: 48%; }\
  3098. .inventory-container {float: left; clear: none; width: 270px; margin-right: 20px;}\
  3099. #prinfopane {position: fixed; top: 5px; left: 200px; display: block; z-index: 1000;}\
  3100. .prh3 {padding: 5px; height: auto!important; width: auto!important; background-color: rgba(0, 0, 0, 0.7);}\
  3101. .custom-radio{width:16px;height:16px;display:inline-block;position:relative;z-index:1;top:3px;background-color:#fff;margin:0 4px 0 2px;}\
  3102. .custom-radio:hover{background-color:black;} .custom-radio.selected{background-color:red;} .custom-radio-selected-text{color:darkred;font-weight:500;}\
  3103. .custom-radio input[type='radio']{margin:1px;position:absolute;z-index:2;cursor:pointer;outline:none;opacity:0;_nofocusline:expression(this.hideFocus=true);-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);filter:alpha(opacity=0);-khtml-opacity:0;-moz-opacity:0}\
  3104. #settingsPanel input[type='button'].button-green,#settingsPanel input[type='button'].button-red,#settingsPanel input[type='button'].button-yellow,#settingsPanel input[type='button'].button-blue{color:#eff;border-radius:4px;text-shadow:0 1px 1px rgba(0,0,0,0.2);font-size:110%;font-weight:bold;}\
  3105. .pure-button{display:inline-block;*display:inline;zoom:1;line-height:normal;white-space:nowrap;vertical-align:baseline;text-align:center;cursor:pointer;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button{font-family:inherit;font-size:100%;*font-size:90%;*overflow:visible;padding:.5em 1em;color:#444;color:rgba(0,0,0,.8);*color:#444;border:1px solid #999;border:0 rgba(0,0,0,0);background-color:#E6E6E6;text-decoration:none;border-radius:2px}.pure-button-hover,.pure-button:hover,.pure-button:focus{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0);background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),color-stop(40%,rgba(0,0,0,.05)),to(rgba(0,0,0,.1)));background-image:-webkit-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.05) 0,rgba(0,0,0,.1));background-image:-o-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.pure-button:focus{outline:0}.pure-button-active,.pure-button:active{box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset}.pure-button[disabled],.pure-button-disabled,.pure-button-disabled:hover,.pure-button-disabled:focus,.pure-button-disabled:active{border:0;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);filter:alpha(opacity=40);-khtml-opacity:.4;-moz-opacity:.4;opacity:.4;cursor:not-allowed;box-shadow:none}.pure-button-hidden{display:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button-primary,.pure-button-selected,a.pure-button-primary,a.pure-button-selected{background-color:#0078e7;color:#fff}\
  3106. #settingsPanel input[type='button'].button-green{background:#1cb841; margin: 2px 20px 2px 2px;}\
  3107. #settingsPanel input[type='button'].button-red{background:#ca3c3c; margin: 2px 2px 2px 2px;}\
  3108. #settingsPanel input[type='button'].button-yellow{background:#df7514; margin: 2px 2px 2px 2px;}\
  3109. #settingsPanel input[type='button'].button-blue{background:#42b8dd; margin: 2px 2px 2px 2px;}\
  3110. ");
  3111.  
  3112. // Add settings panel to page body
  3113. $("body").append(
  3114. '<div id="settingsPanel">\
  3115. <div id="settings_title">\
  3116. <img src=' + image_prefs + ' style="float: left; vertical-align: text-bottom;"\>\
  3117. <img id="settings_close" src=' + image_close + ' title="Click to hide preferences" style="float: right; vertical-align: text-bottom; cursor: pointer; display: block;"\>\
  3118. <span style="margin:3px">Settings</span>\
  3119. </div>\
  3120. <form style="margin: 0px; padding: 0px">\
  3121. <ul style="list-style: none outside none; max-height: 500px; overflow: auto; margin: 3px; padding: 0px;">\
  3122. </ul>\
  3123. </form>\
  3124. </div>'
  3125. );
  3126.  
  3127. // Add each setting input
  3128. var settingsList = $("#settingsPanel form ul");
  3129. for (var i = 0; i < settingnames.length; i++) {
  3130. var id = 'settings_' + settingnames[i].name;
  3131. var indent = (countLeadingSpaces(settingnames[i].title) >= 1) ? 1 : 0;
  3132. /*if ((settingnames[i].type == 'text' && settingnames[i-1].type == 'checkbox') || (settingnames[i-1] && settingnames[i].type == 'checkbox' && settingnames[i-1].type == 'text'))
  3133. settingsList.append('<li style="margin-left:0em; width: 48%; display: inline-block;"/>&nbsp;</li>')*/
  3134. var border = "";
  3135. if (settingnames[i].border)
  3136. border = "border-top: #000 solid 1px;"
  3137. switch (settingnames[i].type) {
  3138. case "checkbox":
  3139. var _checkWidth = "48%";
  3140. if (i < 9)
  3141. _checkWidth = "31%";
  3142. if (settingnames[i].border)
  3143. _checkWidth = "98%";
  3144. settingsList.append('<li title="' + settingnames[i].tooltip + '" style="' + border + 'padding-left:' + indent + 'em; width: ' + _checkWidth + '; display: inline-block;"><input style="margin:4px" name="' + id + '" id="' + id + '" type="checkbox" /><label class="' + settingnames[i].class + '" for="' + id + '">' + settingnames[i].title + '</label></li>')
  3145. $('#' + id).prop('checked', settings[settingnames[i].name]);
  3146. break;
  3147. case "text":
  3148. if (settingnames[i].border)
  3149. _inputkWidth = "95%; padding: 10px";
  3150. else
  3151. _inputkWidth = "46%";
  3152. settingsList.append('<li title="' + settingnames[i].tooltip + '" style="' + border + 'padding-left:' + indent + 'em; margin-top:1em; width: ' + _inputkWidth + '; display: inline-block;"<label class="' + settingnames[i].class + '" for="' + id + '">' + settingnames[i].title + '</label><input style="margin:4px; padding: 2px; min-width: 80%;" name="' + id + '" id="' + id + '" type="text" /></li>')
  3153. $('#' + id).val(settings[settingnames[i].name]);
  3154. break;
  3155. case "password":
  3156. settingsList.append('<li title="' + settingnames[i].tooltip + '" style="' + border + 'padding-left:' + indent + 'em; margin-top:1em; width: 46%; display: inline-block;"' + settingnames[i].class + '" for="' + id + '">' + settingnames[i].title + '</label><input style="margin:4px; padding: 2px; min-width: 80%;" name="' + id + '" id="' + id + '" type="password" /></li>')
  3157. $('#' + id).val(settings[settingnames[i].name]);
  3158. break;
  3159. case "select":
  3160. settingsList.append('<li title="' + settingnames[i].tooltip + '" style="' + border + 'padding-left:' + indent + 'em; width: 48%; display: inline-block;"' + settingnames[i].class + '" style="padding-left:4px" for="' + id + '">' + settingnames[i].title + '</label><select style="margin:4px" name="' + id + '" id="' + id + '" /></li>')
  3161. var options = settingnames[i].opts;
  3162. var select = $('#' + id);
  3163. for (var j = 0; j < options.length; j++) {
  3164. if (settings[settingnames[i].name] == options[j].path)
  3165. select.append('<option value="' + options[j].path + '" selected="selected">' + options[j].name + '</option>');
  3166. else
  3167. select.append('<option value="' + options[j].path + '">' + options[j].name + '</option>');
  3168. }
  3169. break;
  3170. case "label":
  3171. settingsList.append('<li title="' + settingnames[i].tooltip + '" style="' + border + 'margin-left:' + indent + 'em;><label class="' + settingnames[i].class + '">' + settingnames[i].title + '</label></li>')
  3172. break;
  3173. }
  3174. }
  3175.  
  3176. // Add character settings for each char
  3177. var addText = '\
  3178. <script type="text/javascript">\
  3179. <!--\
  3180. function click_position(obj)\
  3181. {\
  3182. change_position(obj.value)\
  3183. }\
  3184. \
  3185. function customRadio(radioName) {\
  3186. var radioButton = $( \'input[name="\'+ radioName +\'"]\');\
  3187. $(radioButton).each(function(){\
  3188. $(this).wrap( "<span class=\'custom-radio\'></span>" );\
  3189. if($(this).is(\':checked\')){\
  3190. $(this).parent().addClass("selected");\
  3191. $(this).parent().parent().addClass("custom-radio-selected-text");\
  3192. }\
  3193. });\
  3194. $(radioButton).click(function(){\
  3195. if($(this).is(\':checked\')){\
  3196. $(this).parent().addClass("selected");\
  3197. $(this).parent().parent().addClass("custom-radio-selected-text");\
  3198. }\
  3199. $(radioButton).not(this).each(function(){\
  3200. $(this).parent().removeClass("selected");\
  3201. $(this).parent().parent().removeClass("custom-radio-selected-text");\
  3202. });\
  3203. });\
  3204. }\
  3205. function change_position(val)\
  3206. {\
  3207. for (var i = 0; i < ' + settings["charcount"] + '; i++)\
  3208. {\
  3209. document.getElementById("charContainer"+i).style.display="none";\
  3210. }\
  3211. document.getElementById("charContainer"+val).style.display="block";\
  3212. }\
  3213. //-->\
  3214. </script>\
  3215. <div id="charPanel">\
  3216. <div style="width:30%;float:left;max-height:400px;overflow:auto;">\
  3217. ';
  3218. for (var i = 0; i < settings["charcount"]; i++) {
  3219. addText += '\
  3220. <div><label for="value_' + i + '" style="display:block;padding-top:2px;"><input autocomplete="off" type="radio" name="radio_position" onclick="click_position(this)" id="value_' + i + '" value="' + i + '" />' + settings["nw_charname" + i] + '</label></div>\
  3221. ';
  3222. }
  3223. addText += '\
  3224. </div>\
  3225. <div style="width:69%;float:right;">\
  3226. ';
  3227. for (var i = 0; i < settings["charcount"]; i++) {
  3228. addText += '\
  3229. <div id="charContainer' + i + '" style="display:none">\
  3230. <ul style="list-style: none outside none; max-height: 500px; overflow: auto;">\
  3231. ';
  3232. var k = 0 + (i * charSettings.length / settings["charcount"]);
  3233. var id = 'settings_' + charSettings[k].name;
  3234. addText += '<li title="' + charSettings[k].tooltip + '"><input style="margin:4px; padding: 2px;" name="' + id + '" id="' + id + '" type="text" /></li>';
  3235. for (var j = 1; j < (charSettings.length / settings["charcount"]); j++) {
  3236. k = j + (i * charSettings.length / settings["charcount"]);
  3237. if (charSettings[k].type == 'void') {
  3238. continue;
  3239. }
  3240. id = 'settings_' + charSettings[k].name;
  3241. addText += '<li title="' + charSettings[k].tooltip + '"><input maxlength="2" size="1" style="margin:4px; padding: 2px;" name="' + id + '" id="' + id + '" type="text" /><label class="' + charSettings[k].class + '" for="' + id + '">' + charSettings[k].title + '</label></li>';
  3242. }
  3243. addText += '</ul>\
  3244. </div>';
  3245. }
  3246. addText += '\
  3247. </div>\
  3248. </div>\
  3249. ';
  3250. $("#settingsPanel form").append(addText);
  3251.  
  3252. // Add values to character input fields
  3253. for (var i = 0; i < charSettings.length; i++) {
  3254. var id = 'settings_' + charSettings[i].name;
  3255. $('#' + id).val(settings[charSettings[i].name]);
  3256. }
  3257.  
  3258. // Add save/cancel buttons to panel
  3259. $("#settingsPanel form").append('\
  3260. <div id="settingsPanelButtonContainer">\
  3261. <input id="settings_save" class="button-blue pure-button" type="button" value="Save and Apply">\
  3262. <input id="settings_close" class="button-yellow pure-button" type="button" value="Close">\
  3263. <input id="settings_sca" class="button-red pure-button" type="button" value="Cycle SCA">\
  3264. <input id="log_error" class="button-green pure-button" type="button" value="Log Error">\
  3265. <input id="settings_wipe" class="button-white pure-button" type="button" value="RESET all">\
  3266. </div>');
  3267.  
  3268. // Add open settings button to page
  3269. $("body").append('<div id="settingsButton"><img src="' + image_prefs + '" title="Click to show preferences" style="cursor: pointer; display: block;"></div>');
  3270.  
  3271. // Add pause button to page
  3272. $("body").append('<div id="pauseButton"><img src="' + (settings["paused"] ? image_play : image_pause) + '" title="Click to ' + (settings["paused"] ? "resume" : "pause") + ' task script" style="cursor: pointer; display: block;"></div>');
  3273.  
  3274. // Add info pane
  3275. $("body").append("<div id='prinfopane' class='header-newrelease'>");
  3276.  
  3277. // Add the javascript
  3278. $("#settingsPanel").hide();
  3279. $("#settingsButton").click(function () {
  3280. $("#settingsButton").hide();
  3281. $("#pauseButton").hide();
  3282. $("#settingsPanel").show();
  3283. });
  3284. $("#settings_close,settings_cancel").click(function () {
  3285. $("#settingsButton").show();
  3286. $("#pauseButton").show();
  3287. $("#settingsPanel").hide();
  3288. });
  3289. $("#pauseButton").click(PauseSettings);
  3290.  
  3291. // Use setTimeout to workaround permission issues when calling GM functions from main window
  3292. $("#settings_save").click(function () {
  3293. setTimeout(function () {
  3294. SaveSettings();
  3295. }, 0)
  3296. });
  3297. $("#settings_sca").click(function () {
  3298. $("#settings_close").trigger("click");
  3299. unsafeWindow.location.hash = unsafeWindow.location.hash.replace(/\)\/.+/, ')' + "/adventures");
  3300. processSwordCoastDailies();
  3301. });
  3302. $("#log_error").click(function () {
  3303. setTimeout(function () {
  3304. var epic = GM_getValue("Epic_error", 0);
  3305. var un_def_err = GM_getValue("Undefine_error", 0)
  3306. console.log("Button Epic fails[" + epic +"] & undefine [" + un_def_err + "].");
  3307. }, 0)
  3308. });
  3309. $("#settings_wipe").click(function() {
  3310. setTimeout(function () {
  3311. // Delete all saved settings, EXCEPT password/username
  3312. var keys = GM_listValues();
  3313. for (i = 0; i < keys.length; i++) {
  3314. var key = keys[i];
  3315. if (!key.match(/(username|password)/)) {
  3316. //console.log("do delete these", key);
  3317. GM_deleteValue(key);}
  3318. }
  3319. }, 0)
  3320. unsafeWindow.location.href = current_Gateway;
  3321. return;
  3322. });
  3323.  
  3324. customRadio("radio_position");
  3325.  
  3326. $('#update-content-inventory-bags-0 .bag-header').waitUntilExists(function () {
  3327. if ($('#update-content-inventory-bags-0 .bag-header div').length && !$('#update-content-inventory-bags-0 .bag-header div.autovendor').length) {
  3328. $('#update-content-inventory-bags-0 .bag-header').append('<div class="input-field button light autovendor"><div class="input-bg-left"></div><div class="input-bg-mid"></div><div class="input-bg-right"></div><button id="nwprofs-autovendor">Auto Vendor</button></div>');
  3329. $("button#nwprofs-autovendor").on("click", vendorJunk);
  3330. }
  3331. });
  3332. }
  3333.  
  3334. function PauseSettings(_action) {
  3335. if (_action != "pause" || _action != "unpause")
  3336. _action = "toggle";
  3337. if (_action == "toggle")
  3338. settings["paused"] = !settings["paused"];
  3339. if (_action == "pause")
  3340. settings["paused"] = true;
  3341. if (_action == "unpause")
  3342. settings["paused"] = false;
  3343. setTimeout(function () {
  3344. GM_setValue("paused", settings["paused"]);
  3345. }, 0);
  3346. $("#settings_paused").prop("checked", settings["paused"]);
  3347. $("#pauseButton img").attr("src", (settings["paused"] ? image_play : image_pause));
  3348. $("#pauseButton img").attr("title", "Click to " + (settings["paused"] ? "resume" : "pause") + " task script");
  3349. }
  3350.  
  3351. function SaveSettings() {
  3352. var charcount = settings["charcount"];
  3353.  
  3354. // Get each value from the UI
  3355. for (var i = 0; i < settingnames.length; i++) {
  3356. var name = settingnames[i].name;
  3357. var el = $('#settings_' + name);
  3358. var value = false;
  3359. switch (settingnames[i].type) {
  3360. case "checkbox":
  3361. value = el.prop("checked");
  3362. break;
  3363. case "text":
  3364. value = el.val();
  3365. break;
  3366. case "password":
  3367. value = el.val();
  3368. break;
  3369. case "select":
  3370. value = el.val();
  3371. break;
  3372. case "label": // Labels don't have values
  3373. continue;
  3374. }
  3375. if (typeof (settingnames[i].onsave) === "function") {
  3376. console.log("Calling 'onsave' for", name);
  3377. settingnames[i].onsave(value, settings[name]);
  3378. }
  3379. if (settings[name] !== value) {
  3380. settings[name] = value;
  3381. } // Save to local cache
  3382. if (GM_getValue(name) !== value) {
  3383. GM_setValue(name, value);
  3384. } // Save to GM cache
  3385. }
  3386.  
  3387. // Get character settings from UI
  3388. for (var i = 0; i < charSettings.length; i++) {
  3389. if (charSettings[i].type == 'void') {
  3390. continue;
  3391. }
  3392. var name = charSettings[i].name;
  3393. var el = $('#settings_' + name);
  3394. var value = el.val();
  3395. // Save to local cache
  3396. if (settings[name] !== value) {
  3397. settings[name] = value;
  3398. }
  3399. // Save to GM cache
  3400. GM_setValue(name, value);
  3401. }
  3402.  
  3403. // If character numbers have changed reload page
  3404. if (charcount != settings["charcount"]) {
  3405. console.log("Reloading gateway to update character count");
  3406. unsafeWindow.location.href = current_Gateway; // edited by RottenMind
  3407. return;
  3408. }
  3409.  
  3410. // Close the panel
  3411. $("#settingsButton").show();
  3412. $("#pauseButton img").attr("src", (settings["paused"] ? image_play : image_pause));
  3413. $("#pauseButton img").attr("title", "Click to " + (settings["paused"] ? "resume" : "pause") + " task script");
  3414. $("#pauseButton").show();
  3415. $("#settingsPanel").hide();
  3416. }
  3417.  
  3418. function vendorJunk(evnt) {
  3419. var _charGold = unsafeWindow.client.dataModel.model.ent.main.currencies.gold;
  3420. var _vendorItems = [];
  3421. var _sellCount = 0;
  3422. if (settings["autovendor_kits_altars_limit"]) {
  3423. _vendorItems[_vendorItems.length] = {pattern: /^Item_Consumable_Skill/, limit: 50};
  3424. _vendorItems[_vendorItems.length] = {pattern: /^Item_Portable_Altar$/, limit: 80};
  3425. }
  3426. if (settings["autovendor_kits_altars_all"]) {
  3427. _vendorItems[_vendorItems.length] = {pattern: /^Item_Portable_Altar$/, limit: 0};
  3428. _vendorItems[_vendorItems.length] = {pattern: /^Item_Consumable_Skill/, limit: 0};
  3429. }
  3430. if (settings["autovendor_rank2"]) {
  3431. _vendorItems[_vendorItems.length] = {pattern: /^T1_Enchantment/, limit: 0};
  3432. _vendorItems[_vendorItems.length] = {pattern: /^T1_Runestone/, limit: 0};
  3433. }
  3434. if (settings["autovendor_rank2"]) {
  3435. _vendorItems[_vendorItems.length] = {pattern: /^T2_Enchantment/, limit: 0};
  3436. _vendorItems[_vendorItems.length] = {pattern: /^T2_Runestone/, limit: 0};
  3437. }
  3438. if (settings["autovendor_rank3"]) {
  3439. _vendorItems[_vendorItems.length] = {pattern: /^T3_Enchantment/, limit: 0};
  3440. _vendorItems[_vendorItems.length] = {pattern: /^T3_Runestone/, limit: 0};
  3441. }
  3442. if (settings["autovendor_pots1"]) {
  3443. _vendorItems[_vendorItems.length] = {
  3444. pattern: /^Potion_(Healing|Tidespan|Force|Fortification|Reflexes|Accuracy|Rejuvenation)$/, limit: 0
  3445. };
  3446. }
  3447. if (settings["autovendor_pots2"]) {
  3448. _vendorItems[_vendorItems.length] = {
  3449. pattern: /^Potion_(Healing|Tidespan|Force|Fortification|Reflexes|Accuracy|Rejuvenation)_2$/,
  3450. limit: 0
  3451. };
  3452. }
  3453. if (settings["autovendor_pots3"]) {
  3454. _vendorItems[_vendorItems.length] = {
  3455. pattern: /^Potion_(Healing|Tidespan|Force|Fortification|Reflexes|Accuracy|Rejuvenation)_3$/,
  3456. limit: 0
  3457. };
  3458. }
  3459. if (settings["autovendor_pots4"]) {
  3460. _vendorItems[_vendorItems.length] = {
  3461. pattern: /^Potion_(Healing|Tidespan|Force|Fortification|Reflexes|Accuracy|Rejuvenation)_4$/,
  3462. limit: 0
  3463. };
  3464. }
  3465. if (settings["autovendor_junk"]) {
  3466. _vendorItems[_vendorItems.length] = {pattern: /^Item_Snowworks_/, limit: 0}; // Winter Festival fireworks small & large
  3467. _vendorItems[_vendorItems.length] = {pattern: /^Item_Skylantern/, limit: 0}; // Winter Festival skylantern
  3468. _vendorItems[_vendorItems.length] = {pattern: /^Item_Partypopper/, limit: 0}; // Party Poppers
  3469. _vendorItems[_vendorItems.length] = {pattern: /^Item_Fireworks/, limit: 0}; // Fireworks
  3470. _vendorItems[_vendorItems.length] = {pattern: /^Object_Plate_/, limit: 0};
  3471. _vendorItems[_vendorItems.length] = {pattern: /^Object_Decoration_/, limit: 0};
  3472. _vendorItems[_vendorItems.length] = {pattern: /_Green_T[1-7]_Unid$/, limit: 0}; // Unidentified Green Gear
  3473. }
  3474. if (settings["autovendor_profresults"] && _charGold < 2) { //this "gold" threshold must be global var and adjustable by users
  3475. _vendorItems[_vendorItems.length] = {
  3476. pattern : /(Crafting_Resource_Pelt)_T[1-3]$/,
  3477. limit : 10
  3478. }; //"Crafting_Resource_Ore_T1" Pelt_T1
  3479. _vendorItems[_vendorItems.length] = {
  3480. pattern : /(Resource_Wood)_T[1-3]$/,
  3481. limit : 10
  3482. }; //"Crafting_Resource_Ore_T1" Pelt_T1
  3483. _vendorItems[_vendorItems.length] = {
  3484. pattern : /(Crafting_Resource_Ore)_T[1-3]$/,
  3485. limit : 10
  3486. }; //"Crafting_Resource_Ore_T1"> Pelt_T1
  3487. console.log("copper amount is under sale threshold", _charGold);
  3488. }
  3489.  
  3490. // edited by RottenMind
  3491. if (settings["autovendor_profresults"]) {
  3492. _vendorItems[_vendorItems.length] = {
  3493. pattern: /^Crafted_(Jewelcrafting_Waist_Offense_3|Jewelcrafting_Neck_Defense_3|Jewelcrafting_Waist_Defense_3|Tailoring_T3_Helm_Set_1|Med_Armorsmithing_T3_Chain_Armor_Set_1|Med_Armorsmithing_T3_Chain_Pants2|Med_Armorsmithing_T3_Chain_Shirt2|Med_Armorsmithing_T3_Chain_Helm_Set_1|Med_Armorsmithing_T3_Chain_Pants|Med_Armorsmithing_T3_Chain_Boots_Set_1|Hvy_Armorsmithing_T3_Plate_Armor_Set_1|Hvy_Armorsmithing_T3_Plate_Pants2|Hvy_Armorsmithing_T3_Plate_Shirt2|Hvy_Armorsmithing_T3_Plate_Helm_Set_1|Hvy_Armorsmithing_T3_Plate_Boots_Set_1|Leatherworking_T3_Leather_Armor_Set_1|Leatherworking_T3_Leather_Pants2|Leatherworking_T3_Leather_Shirt2|Leatherworking_T3_Leather_Helm_Set_1|Leatherworking_T3_Leather_Boots_Set_1|Tailoring_T3_Cloth_Boots_Set_1|Tailoring_T3_Cloth_Armor_Set_3|Tailoring_T3_Cloth_Armor_Set_2|Tailoring_T3_Cloth_Armor_Set_1|Tailoring_T3_Cloth_Pants2_Set2|Tailoring_T3_Cloth_Shirt2|Tailoring_T3_Cloth_Helm_Set_1|Artificing_T3_Pactblade_Temptation_5|Artificing_T3_Icon_Virtuous_5|Weaponsmithing_T3_Dagger_4|Weaponsmithing_T3_Longsword_Set_3|Weaponsmithing_T3_Mace_Set_3|Weaponsmithing_T3_Greatsword_Set_3|Weaponsmithing_T3_Dagger_Set_3|Weaponsmithing_T3_Blades_Set_3|Weaponsmithing_T3_Longbow_Set_3)$/, limit: 0};
  3494. _vendorItems[_vendorItems.length] = {
  3495. pattern: /^Potion_(Unstable|Unstable_[1-3])$/, limit : 0}; // Alchemy experience potions
  3496.  
  3497. }
  3498. // edited by RottenMind
  3499. if (_vendorItems.length > 0) {
  3500. console.log("Attempting to vendor selected items...");
  3501. _sellCount = vendorItemsLimited(_vendorItems);
  3502. if (_sellCount > 0 && !evnt) {
  3503. var _sellWait = _sellCount * 1000;
  3504. PauseSettings("pause");
  3505. window.setTimeout(function () {
  3506. PauseSettings("unpause");
  3507. }, _sellWait);
  3508. }
  3509. }
  3510. }
  3511.  
  3512. /** Start, Helpers added by users.
  3513. * Adds fetures, options to base script and can be easily removed if needed
  3514. * Add description so anyone can see if they can use Function somewhere
  3515. * Use "brackets" around function start and end //yourname
  3516. */
  3517. //RottenMind, returns inventory space, use Inventory_bagspace(); gives current free bags slots, from MAC-NW function
  3518. function Inventory_bagspace() {
  3519. var _pbags = client.dataModel.model.ent.main.inventory.playerbags;
  3520. var _bagUnused = 0;
  3521. $.each(_pbags, function (bi, bag) {
  3522. bag.slots.forEach(function (slot) {
  3523. if (slot === null || !slot || slot === undefined) {
  3524. _bagUnused++;
  3525. }
  3526. });
  3527. });
  3528. return _bagUnused;
  3529. }
  3530.  
  3531. /** Count resouce in bags
  3532. * edited by WloBeb
  3533. * @param {string} name The name of resource
  3534. */
  3535. function countResource(name) {
  3536. var count = 0;
  3537. var _bags = unsafeWindow.client.dataModel.model.ent.main.inventory.bags;
  3538. console.log("Checking bags for " + name);
  3539. $.each(_bags, function (bi, bag) {
  3540. bag.slots.forEach(function (slot) {
  3541. if (slot && slot.name === name) {
  3542. count = count + slot.count;
  3543. }
  3544. });
  3545. });
  3546. return count;
  3547. }
  3548. /** Report error in GM for later use
  3549. * edited by RM
  3550. *
  3551. */
  3552. function Epic_button_error() {
  3553. var counter = GM_getValue('Epic_error', 0);
  3554. // console.log('This script has been run ' + counter + ' times.');
  3555. GM_setValue('Epic_error', ++counter);
  3556. return counter;
  3557. }
  3558. function Array_undefine_error() {
  3559. var counter = GM_getValue('Undefine_error', 0);
  3560. // console.log('This script has been run ' + counter + ' times.');
  3561. GM_setValue('Undefine_error', ++counter);
  3562. return counter;
  3563. }
  3564. // This just set Banker to character 1 if its not him all-ready
  3565. function get_banker(){
  3566. var me = GM_getValue("nw_charname0",0);
  3567. var banker = GM_getValue("bankchar",0);
  3568. //console.log(me, banker);
  3569. if (me !== banker) {
  3570. GM_setValue('bankchar', me);
  3571. unsafeWindow.location.href = current_Gateway;
  3572. return;
  3573. }
  3574. }
  3575. /**
  3576. * Created by RM on 29.4.2015.
  3577. * Runs daily SCA -rolls in GAteway Bot
  3578. */
  3579. function dailySCA() {
  3580. if (settings["dailySCA"]) {
  3581. var char, today, thisday, thishour, dailyroll, dateforlastroll;
  3582. char = settings["charcount"];
  3583. today = new Date();
  3584. thisday = today.getDay();
  3585. thishour = today.getHours();
  3586. dailyroll = GM_getValue("dailyswordcoast", 0);
  3587. dateforlastroll = GM_getValue("dateforlastrolls", 0);
  3588. //console.log(thisday, dateforlastroll, dailyroll, chardelay, thishour);
  3589. if (thisday !== dateforlastroll) {
  3590. GM_setValue("dateforlastrolls", thisday);
  3591. GM_setValue("dailyswordcoast", 0);
  3592. dailyroll = 0;
  3593. }
  3594. if (dailyroll < (4 || undefined) && chardelay > 10000 * char && (thishour >= 14 || thishour >= 23)) {
  3595. unsafeWindow.location.hash = unsafeWindow.location.hash.replace(/\)\/.+/, ')' + "/adventures");
  3596. processSwordCoastDailies();
  3597. dailyroll++;
  3598. GM_setValue("dailyswordcoast", dailyroll);
  3599. GM_getValue("dailyswordcoast", 0);
  3600. }
  3601. }
  3602. }
  3603.  
  3604. /** End, Helpers added by users.*/
  3605.  
  3606. // Add the settings button and start a process timer
  3607. addSettings();
  3608. timerHandle = window.setTimeout(function () {
  3609. process();
  3610. }, delay.SHORT);
  3611. })();