LambLongs: Battle Script

Attacks everything, forever.

  1. // ==UserScript==
  2. // @name LambLongs: Battle Script
  3. // @author A Spooky-Assed Ghost
  4. // @description Attacks everything, forever.
  5. // @version 1.0.7
  6. // @icon http://i.imgur.com/bdLGq.png
  7. // @namespace http://userscripts.org/users/171410
  8. // @include http://www.goatlings.com/battle_1player.php*
  9. // @include http://www.goatlings.com/battling_1p.php*
  10. // @include http://www.goatlings.com/battle_1p_end.php*
  11. // @include http://www.goatlings.com/battle_1p.pro.php*
  12. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
  13. // ==/UserScript==
  14. var boners = '';
  15. var initial=true;
  16. var currentFile = window.location.href.split('.com/')[1].split('?')[0];
  17. var turncount = GM_getValue('turncount', 0);
  18. var weaponlist = ['Bow Of Cupid', 'Ruby Wand', 'Cutie Rod', 'Love Potion', 'Stinky Parfum', 'Cobra Mirror', 'Goat Horn Dagger', 'Laser', 'Water Balloon', 'Water Gun', 'Tornado Bottle', 'Sleeping Powder', 'Attack Rattle', 'Hero Sword', 'Revolver', 'Pink Popper', 'Orange Popper', 'Teal Popper', 'Green Popper', 'Blue Popper', 'Flutter Wand IV', 'Flutter Wand III', 'Flutter Wand II', 'Flutter Wand I', 'Dark Ice Fury', 'Earth Ice Fury', 'Love Ice Fury', 'Gold Ice Fury', 'Blue Ice Fury', 'Stab Crystal Sword', 'Burn Crystal Sword', 'Ice Crystal Sword'];
  19. var currentweapon = GM_getValue('currentweapon', 0);
  20.  
  21. function doMain(){
  22. if(initial){
  23. initial=false;
  24. }else{
  25. if(currentFile == 'battle_1p.pro.php'){
  26. window.location.href = 'http://www.goatlings.com/battle_1player.php';
  27. }else if(currentFile == 'battle_1player.php'){
  28. boners = $("a:contains('Challenge')");
  29. if(boners && boners.length){
  30. window.location.href = boners[0].href;
  31. }else{
  32. window.document.forms[1].elements.namedItem("usepet").selectedIndex = 0;
  33. window.document.getElementsByTagName('form')[1].submit();
  34. }
  35. }else if(currentFile == 'battling_1p.php'){
  36. boners = $("a:contains('here')");
  37. if(boners && boners.length){
  38. GM_setValue('turncount',0);
  39. window.location.href = boners[0].href;
  40. }else if(turncount>=0){
  41. GM_setValue('turncount',turncount+1);
  42. for(var i=currentweapon;i<=weaponlist.length;i=i+1){
  43. boners = $("a:contains('"+weaponlist[i]+"')");
  44. if(boners && boners.length){
  45. GM_setValue('currentweapon',i);
  46. window.location.href = boners[0].href;
  47. }
  48. }
  49. if(i>=weaponlist.length){
  50. window.document.forms[1].elements.namedItem("use_attack").selectedIndex = 1;
  51. window.document.getElementsByTagName('form')[1].submit();
  52. }
  53. }
  54. }else if(currentFile == 'battle_1p_end.php'){
  55. boners = $("a:contains('Back to the battle center.')");
  56. if(boners && boners.length){
  57. window.location.href = boners[0].href;
  58. }
  59. }
  60. }
  61. setTimeout(doMain,1);
  62. }
  63. doMain();