Don't like ads? PRO users don't see any ads ;-)
Guest

sequence update

By: doomed on May 28th, 2012  |  syntax: JavaScript  |  size: 16.63 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //@SequenceName: Daily Prep
  2.  
  3. // 4.14.2011 -- Initial version by SirDuck36 (many placeholder steps)
  4. // 4.15.2011 -- Significant update by Skarn22 (fleshed out many placeholder steps)
  5. // 4.17.2011 -- Bug fix for Food gift and auto bingo village -- update by Skarn22
  6. // 4.18.2011 -- Updated glowslinging to include default PoA strategy -- SirDuck36
  7. // 4.19.2011 -- Updated for non-backwards compatible script version
  8. // 4.20.2011 -- Updated bingo step to autoselect a target in range -- Skarn22
  9. // 4.23.2011 -- Improved bingo step -- Skarn22
  10. // 4.23.2011 -- Add PH Pigeons step -- Skarn22
  11. // 4.23.2011 -- Add better TACOS eating strategy -- Skarn22 + SirDuck36
  12. // 4.23.2011 -- Add kaiju whack steps -- Skarn22
  13. // 4.23.2011 -- Add PH Big board / first loser / pigeons -- Skarn22
  14. // 6.13.2011 -- Fix Show Watchin Quest -- Kazeodori
  15. // 6.19.2011 -- New upgrades, village action step, split off party house items into another sequence -- Skarn22, Edited by SirDuck36
  16. // 6.27.2011 -- Use glowslinging multiduels -- SirDuck36
  17. // 10.31.2011 -- Fix for quest numbers using questnum_diff -- SirDuck36
  18. // 3.16.20112 -- Fixes to Kaiju and Bingo step -- Shade
  19. // 5.28.2012 -- added resource collection option, added dice altar to the script, fixed kaiju battle -- doomed
  20.  
  21. //@SequenceCode
  22.  
  23. // Update for new quests that have been added -- increase this if new quests are added
  24. var questnum_diff = 7;
  25.  
  26.  
  27. // Configuration for Village Action step
  28. // Put your EXACT character names in the "alt#" variables.
  29. // Put your preference for each character in the variables below their name.
  30. // "paperwork", "patrol", "zatrs"(Resupply) and "rescol"(Collect).
  31. // If action a is "useless"/unusable/invalid, the script will use action b.
  32. // "useless" means 0 upkeep(paperwork), or 100% BASIC resource find(rescol).
  33. // Default = paperwork/rescol. Used only if the player/action is not listed.
  34. //
  35. // select what ingredient you want to search by putting one of the folowing behind it:
  36. // "forest", "dumpster", "idol"
  37. //  this defaults to forest
  38. //
  39. var actiondata = new Object();
  40.  
  41. actiondata.alt1     = "examplename";
  42. actiondata.action1A = "paperwork";
  43. actiondata.action1B = "patrol";
  44. actiondata.ingredient1 = "";
  45.  
  46. actiondata.alt2     = "";
  47. actiondata.action2A = "";
  48. actiondata.action2B = "";
  49. actiondata.ingredient2 = "";
  50.  
  51. actiondata.alt3     = "";
  52. actiondata.action3A = "";
  53. actiondata.action3B = "";
  54. actiondata.ingredient3 = "";
  55.  
  56. //------------------------------------------
  57. //@NewTask
  58. //@TaskName: Summoning
  59.  
  60. GoPage("summons");
  61.  
  62. // if summon is here AND available to choose, choose it and submit form.
  63. if (FormCheck(null, "summonname", "Mini Frog"))
  64.     FormSubmit("summonsummon");
  65.  
  66. if (FormCheck(null, "summonname", "Super Frog"))
  67.     FormSubmit("summonsummon");
  68.  
  69. if (FormCheck(null, "summonname", "Sickle Weasel"))
  70.     FormSubmit("summonsummon");
  71.  
  72. IncrementTask();
  73.  
  74.  
  75. //------------------------------------------
  76. //@NewTask
  77. //@TaskName: Kaiju Team
  78.  
  79. GoPage('team');
  80.  
  81. if(DocTest("Strawberry Lvl. 3"))
  82. {
  83.     if(DocTest("Robogirl Lvl. 3"))
  84.    TeamChange("Strawberry","Robogirl"); // Strawberry Shortcake Bonus
  85.     else
  86.    TeamChange("Strawberry","Shorty","Robogirl");
  87. }
  88. else
  89.     TeamChange("Terri","Blind Fury", "SNAKEMAN");
  90.  
  91.  
  92. //------------------------------------------
  93. //@NewTask
  94. //@TaskName: Kaiju Stamina
  95.  
  96. GoPage('kaiju');
  97.  
  98. IncrementTaskIf(DocTest("Unable to fight"));
  99.  
  100. var fought = parseInt(/Number of times fought today: \<b\>(\d+)/.exec(document.body.innerHTML)[1]);
  101.  
  102. if(DocTest("Stamina lost"))
  103. {
  104.     // find all stamina bonuses
  105.     var stam = document.getElementsByTagName("Table")[9].innerHTML.match (/(\d+)(?= Stamina)/g);
  106.     var max = stam.length-1;
  107.     var totstam = 0;
  108.  
  109.     // add all of the individual stam bonuses up.
  110.     for(i=0;i<=max;i++)
  111.    totstam = totstam + parseInt(stam[i]);
  112.  
  113.     var limit = Math.round(totstam/10) - 1;
  114. }
  115. else
  116.     var limit = 4;
  117.  
  118. if(fought < limit)
  119. {
  120.     FormCheck("kat","jutsuused","Bring Down the House Jutsu");
  121.     FormCheck("kat","tsukiball","throw");
  122.     FormSubmit("kat");
  123. }
  124.  
  125. IncrementTask();
  126.  
  127.  
  128. //------------------------------------------
  129. //@NewTask
  130. //@TaskName: Use Booster?
  131.  
  132. GoPage('main');
  133.  
  134. IncrementTaskIf(!DocTest("Boosters:") || DocTest("Max one Boost per day!"));
  135.  
  136. ShowMsg("Use a Booster or Skip Task!");
  137.  
  138.  
  139. //------------------------------------------
  140. //@NewTask
  141. //@TaskName: Video Challenge
  142.  
  143. GoPage('main');
  144.  
  145. IncrementTaskIf(DocTest("<b>Question Answered!</b><br>\nSee you tomorrow!"));
  146.  
  147. ShowMsg("Do the video challenge!");
  148.  
  149.  
  150. //------------------------------------------
  151. //@NewTask
  152. //@TaskName: Hooray Food!
  153.  
  154. GoPage('main');
  155.  
  156. IncrementTaskIf(DocTest("<b>Hooray Food!</b> +11 Stamina!<br>"));
  157.  
  158. ShowMsg("Give food to the hungry!");
  159.  
  160.  
  161. //------------------------------------------
  162. //@NewTask
  163. //@TaskName: Bonus Code
  164.  
  165. GoPage('main');
  166.  
  167. IncrementTaskIf(DocTest("<b>Check back tomorrow for<br>more Bonus Stamina!</b>"));
  168.  
  169. ShowMsg("Enter the bonus code!");
  170.  
  171.  
  172. //------------------------------------------
  173. //@NewTask
  174. //@TaskName: Glowslinging Team
  175.  
  176. GoPage('team');
  177.  
  178. if (DocTest("Lil\' Ro Lvl. 3"))
  179.     TeamChange("Nadeshiko", "Mr. Smith", "Lil\' Ro");
  180. else if (DocTest("Bucketface"))
  181.     TeamChange("Nadeshiko", "Mr. Smith", "Bucketface");
  182. else
  183.     TeamChange("Nadeshiko", "Mr. Smith", "Bruce Sr.");
  184.  
  185. //------------------------------------------
  186. //@NewTask
  187. //@TaskName: Glowsling!
  188.  
  189. GoPage('glowslinging');
  190.  
  191. IncrementTaskIf(DocTest("<b>Out of Duels!</b>"));
  192.  
  193. // Get a PoA duel
  194. if (FormTest('startsling2'))
  195. {
  196.     var res = /Duels remaining: <font[^>]*>(\d+)</.exec(document.body.innerHTML);
  197.     FormSetValue(null, 'multifight', res[1]);
  198.     FormCheck(null, 'choosearea', 'a10');
  199.     FormSubmit('startsling2');
  200. }
  201.  
  202. // Yes I actually want to fight
  203. if (FormTest('gosling'))
  204.     FormSubmit('gosling');
  205.  
  206. if (FormTest('goslinag'))
  207.     FormSubmit('goslinag');
  208.  
  209. //////////////////////////////////
  210. // Glowslinging strategy here ////
  211. //////////////////////////////////
  212.  
  213. var risk = parseInt(/Your Risk: <b>(\d+)<\/b>/.exec(document.body.innerHTML)[1], 10);
  214. var myspin = parseInt(/Your Spin: <b>(\d+)<\/b>/.exec(document.body.innerHTML)[1], 10);
  215. var oppspin = parseInt(/Their Spin: <b>(\d+)<\/b>/.exec(document.body.innerHTML)[1], 10);
  216.  
  217. if (oppspin - myspin >= 2)
  218.     FormCheck(null, 'exausage', 'J'); //  Mystic Eyes
  219.  
  220. if (risk >= 2)
  221.     FormCheck(null, 'slingaction', '4'); // WR
  222. else
  223.     FormCheck(null, 'slingaction', '1'); // FA
  224. FormSubmit('slingact');  
  225.  
  226.  
  227. //------------------------------------------
  228. //@NewTask
  229. //@TaskName: Bingo Team
  230.  
  231. TeamChange("Palmface", "The Paper", "Venus");
  232.  
  233.  
  234. //------------------------------------------
  235. //@NewTask
  236. //@TaskName: Daily Bingo
  237.  
  238. GoPage('bingo');
  239.  
  240. // Select a village
  241. if (LocationTest("bingo.html"))
  242. {
  243.     var check = document.forms.namedItem("lookinto").elements; //pull data
  244.     var Max = Math.min(check.length,10); //determine the number of villages
  245.     var Rnd = Math.floor(Math.random()*Max+2); //pick a random village
  246.     check[Rnd].setAttribute("checked","checked") // check it
  247.     FormSubmit("lookinto")
  248. }
  249.  
  250. // Select
  251. if (LocationTest("bingovillage.html"))
  252. {
  253.     //pull data
  254.     var Check = document.forms.namedItem("lookinto").elements;
  255.    
  256.     //determine number of targets
  257.     var Villagers = Check.length - 4;
  258.    
  259.     //pull stats
  260.     var Stattab = document.getElementsByTagName("Table")[10];
  261.     var Genrange = parseInt(/1-(\d+)/.exec(Stattab.rows[8].innerHTML)[1]);
  262.     var Ninrange = parseInt(/1-(\d+)/.exec(Stattab.rows[9].innerHTML)[1]);
  263.     var Tairange = parseInt(/1-(\d+)/.exec(Stattab.rows[10].innerHTML)[1]);
  264.     var Range = Math.min(Genrange,Ninrange,Tairange)
  265.     var Bingotab = document.getElementsByTagName("Table")[9]; // pull targets
  266.     for(i=1;i<=Villagers;i++)
  267.     {
  268.    var Tdiff = parseInt(/\d+/.exec(Bingotab.rows[i].cells[4].innerHTML));
  269.    if(Range>=Tdiff)
  270.    {
  271.        Check[i+3].setAttribute("checked","checked");
  272.        FormSubmit("lookinto");
  273.    }
  274.     }
  275.  
  276.     // Go back to village page if no good targets available
  277.     FormSubmit("lookinto2");
  278. }
  279.  
  280. // Bingo Tracking
  281. if(LocationTest("bingotrack"))
  282. {
  283.     if(FormTest("lookinto"))
  284.    FormSubmit("lookinto");
  285.     else
  286.    FormSubmit("bingofight");
  287. }
  288.  
  289. if (LocationTest("bingofight"))
  290. {
  291.     IncrementTaskIf(DocTest("You Win!"));
  292.  
  293.     if(DocTest("Write their name"))
  294.     {
  295.    // Notepage if available
  296.    FormCheck(null,'usejutsu',jutsus.EDUT.code);
  297.    FormCheck(null,'notepage',null);
  298.     }
  299.     else
  300.    FormCheck(null,'usejutsu',jutsus.AOTNS.code); // Default attack
  301.  
  302.     // Lost bingo, try again
  303.     if(DocTest("They strike you down, and laugh as they escape into the shadows!"))
  304.    FormSubmit("bingogo");
  305.  
  306.     // Attack!
  307.     FormSubmit("attack");
  308. }
  309.  
  310.  
  311. //----------------------------------
  312. //@NewTask
  313. //@TaskName: Solo Team
  314.  
  315. GoPage('team');
  316.  
  317. IncrementTaskIf(DocTest('<b>-Current Team-</b><br><b>Solo</b> - no Teammates, no Bonus'));
  318.  
  319. if (FormTest('conteam'))
  320.     FormSubmit('conteam');
  321. if (FormTest('maketeam'))
  322.     FormSubmit('maketeam');
  323.  
  324.  
  325. //----------------------------------
  326. //@NewTask
  327. //@TaskName: Blackstones Concert
  328.  
  329. GoPage('village');
  330. IncrementTaskIf(!FormTest('blackstones'));
  331. FormSubmit('blackstones');
  332.  
  333.  
  334. //----------------------------------
  335. //@NewTask
  336. //@TaskName: Lemonaid Stand
  337.  
  338. GoPage('village');
  339. IncrementTaskIf(!FormTest('lemonaid'));
  340. FormSubmit('lemonaid');
  341.  
  342.  
  343. //----------------------------------
  344. //@NewTask
  345. //@TaskName: Dice Altar
  346. /*TODO add a check if they want to roll and which setting*/
  347. GoPage('village');
  348. IncrementTaskIf(!FormTest('dicetime'));
  349. FormSubmit('dicetime');
  350.  
  351.  
  352. //----------------------------------
  353. //@NewTask
  354. //@TaskName: Get your learn on
  355.  
  356. GoPage('village');
  357. IncrementTaskIf(DocTest('You already Got your Learn On today!'));
  358. FormSubmit('pandtime');
  359.  
  360.  
  361. //------------------------------------------
  362. //@NewTask
  363. //@TaskName: Chillax, Bro.
  364.  
  365. GoPage('village');
  366. IncrementTaskIf(!FormTest('brotime'));
  367. FormSubmit("brotime");
  368.  
  369.  
  370. //------------------------------------------
  371. //@NewTask
  372. //@TaskName: Hunt Ingredients
  373.  
  374. GoPage('village');
  375.  
  376. IncrementTaskIf(DocTest("Already Searched Today!"));
  377.  
  378. // Helper function
  379. function CheckCollectionArea(area)
  380. {
  381.         //check if an area was entered and if the area is available
  382.         //if not return the default
  383.         if(area == "" || !FormTest(area) return "forest";
  384.         //else return the area
  385.         return area
  386. }
  387.  
  388.  
  389. var player = document.getElementsByName("player")[1].value;
  390.  
  391. if(player == actiondata.alt1)
  392.     FormCheck(null,'ingredientplace',CheckCollectionArea(actiondata.ingredient1));
  393. else if(player == actiondata.alt2)
  394.     FormCheck(null,'ingredientplace',CheckCollectionArea(actiondata.ingredient2));
  395. else if(player == actiondata.alt3)
  396.     FormCheck(null,'ingredientplace',CheckCollectionArea(actiondata.ingredient3));
  397. else FormCheck(null,'ingredientplace', "forest");
  398.  
  399. FormSubmit("ingredienthunt");
  400.  
  401. //------------------------------------------
  402. //@NewTask
  403. //@TaskName: Village Action
  404.  
  405. GoPage('village');
  406.  
  407. IncrementTaskIf(DocTest("You are helping a Village out today!") ||
  408.        DocTest("You are already helping out your Village today!"));
  409.  
  410. // Helper function
  411. function CompoundAction(actionA, actionB)
  412. {
  413.     // Do paperwork while upkeep is still positive.
  414.     if(actionA == "paperwork")
  415.     {
  416.    var upkeep = /Current Upkeep\D+(\d+)/g.exec(document.body.innerHTML)[1];
  417.    var paper = /Paperwork\D+(\d+)%/g.exec(document.body.innerHTML)[1];
  418.    return(upkeep - paper > 0? actionA:actionB);
  419.     }
  420.  
  421.     // A common request is to collect until 100% basic, then do something else.
  422.     if(actionA == "rescol")
  423.     {
  424.    var chance = /Chance of finding a Resource\D+(\d+)/g.exec(document.body.innerHTML)[1];
  425.    return(chance < 100? actionA:actionB);
  426.     }
  427.  
  428.     // If your first action wasn't one of the above, it's always used.
  429.     return actionA;
  430. }
  431.  
  432. // Helper function
  433. function VillageAction(actionA, actionB)
  434. {
  435.     //If no actions found, set to default.
  436.     if(!actionA && !actionB)
  437.    return CompoundAction("paperwork", "rescol");
  438.  
  439.     //If at least one action found, but neither action is usable:
  440.     if(!FormTest(actionA) && !FormTest(actionB))
  441.    if(confirm("Actions unusable or invalid. Use default actions?" +'\n'+ "Note: Default is paperwork until 0 upkeep, then collect."))
  442.        return CompoundAction("paperwork", "rescol");
  443.     else
  444.    ShowMsg();
  445.  
  446.     //If A is usable, but B is not:
  447.     if(FormTest(actionA) && !FormTest(actionB))
  448.    return actionA;
  449.    
  450.     //If B is usable, but A is not:
  451.     if(!FormTest(actionA) && FormTest(actionB))
  452.    return actionB;
  453.    
  454.     //If you get this far, meaning both A and B are usable:
  455.     return CompoundAction(actionA, actionB);
  456. }
  457.  
  458. var player = document.getElementsByName("player")[1].value;
  459.  
  460. // Action data defined in SequenceCode at top of script
  461. if(player == actiondata.alt1)
  462.     FormSubmit(VillageAction(actiondata.action1A, actiondata.action1B));
  463. if(player == actiondata.alt2)
  464.     FormSubmit(VillageAction(actiondata.action2A, actiondata.action2B));
  465. if(player == actiondata.alt3)
  466.     FormSubmit(VillageAction(actiondata.action3A, actiondata.action3B));
  467.  
  468. // If none of the above, just use the default.
  469. FormSubmit(VillageAction());
  470.  
  471.  
  472. //------------------------------------------
  473. //@NewTask
  474. //@TaskName: Ramen/Show Watchin Team
  475.  
  476. TeamChange("Sue", "Mister Tea", "Big Bo");
  477.  
  478.  
  479. //------------------------------------------
  480. //@NewTask
  481. //@TaskName: Diet Ramens
  482.  
  483. GoPage('village');
  484.  
  485. IncrementTaskIf(DocTest("already swiped today!"));
  486.  
  487. FormCheck(null,'ramentobuy','app');
  488. FormSubmit("ramen")
  489.  
  490.  
  491. //------------------------------------------
  492. //@NewTask
  493. //@TaskName: Show Watchin
  494.  
  495. DoGenericQuest(new Quest("Watchin' Your Shows", 12+questnum_diff, 1), -1);
  496.  
  497.  
  498. //------------------------------------------
  499. //@NewTask
  500. //@TaskName: TACOS Eating Team 1
  501.  
  502. TeamChange("TACOS", "Tsukasa", "Cipher");
  503.  
  504.  
  505. //------------------------------------------
  506. //@NewTask
  507. //@TaskName: Eat TACOs with TACOS
  508.  
  509. GoPage('consumables');
  510.  
  511. if (!DocTest(">TACO</span>"))
  512.     ShowMsg("Out of TACOs! NOOOOOO")
  513.  
  514. var app = parseInt(/Appetite Remaining:\D+(\d+)/.exec(document.body.innerHTML)[1]); //pulls app
  515.  
  516. var numCiciTacos = Math.floor(60000 - app/10) % 6;
  517. var numTACOSTacos = Math.floor( (app - 50*numCiciTacos) / 60);
  518.  
  519. IncrementTaskIf(numTACOSTacos == 0);
  520.  
  521. FormCheck(null, 'onetimeused', '712');
  522. FormSetValue(null, 'onetimenumber', numTACOSTacos);
  523. FormSubmit('otime');
  524.  
  525.  
  526. //------------------------------------------
  527. //@NewTask
  528. //@TaskName: TACOS Eating Team 2
  529.  
  530. GoPage('team');
  531.  
  532. if (DocTest('Cici Lvl. 2'))
  533.     TeamChange("Cici");
  534. else
  535.     TeamChange("Cici", "Lulu");
  536.  
  537.  
  538. //------------------------------------------
  539. //@NewTask
  540. //@TaskName: Eat TACOs with Cici
  541.  
  542. GoPage('consumables');
  543.  
  544. if (!DocTest(">TACO</span>"))
  545.     ShowMsg("Out of TACOs! NOOOOOO")
  546.  
  547. var app = parseInt(/Appetite Remaining:\D+(\d+)/.exec(document.body.innerHTML)[1]); //pulls app
  548.  
  549. var numCiciTacos = Math.floor(60000 - app/10) % 6;
  550. var numTACOSTacos = Math.floor( (app - 50*numCiciTacos) / 60);
  551.  
  552. IncrementTaskIf(numCiciTacos == 0);
  553.  
  554. FormCheck(null, 'onetimeused', '712');
  555. FormSetValue(null, 'onetimenumber', numCiciTacos);
  556. FormSubmit('otime');
  557.  
  558.  
  559. //------------------------------------------
  560. //@NewTask
  561. //@TaskName: Moe Points team
  562.  
  563. TeamChange("Tsukasa", "Yuki-chan");
  564.  
  565.  
  566. //------------------------------------------
  567. //@NewTask
  568. //@TaskName: Eat ninja-on
  569.  
  570. GoPage('consumables');
  571.  
  572. IncrementTaskIf(DocTest("<b>NinjaOn Used!</b>"));
  573.  
  574. FormCheck(null, 'onetimeused', '563');
  575. FormSetValue(null, 'onetimenumber', '10');
  576. FormSubmit('otime');
  577.  
  578.  
  579. //------------------------------------------
  580. //@NewTask
  581. //@TaskName: Buy TsukiArena fights
  582.  
  583. GoPage('ph_tsukiball');
  584.  
  585. IncrementTaskIf(!FormCheck(null, 'tixtype', 'plastic'));
  586.  
  587. FormSubmit('skic');
  588.  
  589.  
  590. //------------------------------------------
  591. //@NewTask
  592. //@TaskName: Arena Fight Team
  593.  
  594. TeamChange("Strawberry", "Bruce Jr.", "Good Boy");
  595.  
  596.  
  597. //------------------------------------------
  598. //@NewTask
  599. //@TaskName: Use Arena Fights
  600.  
  601. GoPage('arena');
  602.  
  603. var fightcost = parseInt(/Current cost for <b>\d+<\/b> Fights: <b>(\d+) Ryo<\/b><br>/.exec(document.body.innerHTML)[1]);
  604. if (fightcost < 10000)
  605. {
  606.     FormSubmit("buyfights");
  607.     ShowMsg("Buying Fights"); // Halts execution
  608. }
  609.  
  610. var numfights = parseInt(/<td>Battles Left today:.*<b>(\d+)<\/b>/.exec(document.body.innerHTML)[1],10);
  611. IncrementTaskIf( numfights == 0 );
  612.  
  613. FormCheck(null, 'megaarena', null);
  614. FormSubmit("arenafight");
  615.  
  616. //------------------------------------------
  617. //@NewTask
  618. //@TaskName: Help With Big Board
  619.  
  620. GoPage("ph_bigboard");
  621.  
  622. IncrementTaskIf(!DocTest("mainform4"));
  623.  
  624. for(i=1;i<=5;i++)
  625.     document.forms.namedItem("mainform4").elements[3+i].value = 11;
  626.  
  627. FormSubmit("mainform4");