LambLongs: Battle Script

Attacks everything, forever.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name           LambLongs: Battle Script
// @author         A Spooky-Assed Ghost
// @description    Attacks everything, forever.
// @version        1.0.7
// @icon           http://i.imgur.com/bdLGq.png
// @namespace      http://userscripts.org/users/171410
// @include        http://www.goatlings.com/battle_1player.php*
// @include        http://www.goatlings.com/battling_1p.php*
// @include        http://www.goatlings.com/battle_1p_end.php*
// @include        http://www.goatlings.com/battle_1p.pro.php*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// ==/UserScript==
var boners = '';
var initial=true;
var currentFile = window.location.href.split('.com/')[1].split('?')[0];
var turncount = GM_getValue('turncount', 0);
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'];
var currentweapon = GM_getValue('currentweapon', 0);

function doMain(){
    if(initial){
        initial=false;
    }else{
        if(currentFile == 'battle_1p.pro.php'){
            window.location.href = 'http://www.goatlings.com/battle_1player.php';
        }else if(currentFile == 'battle_1player.php'){
            boners = $("a:contains('Challenge')");
            if(boners && boners.length){
                window.location.href = boners[0].href;
            }else{
                window.document.forms[1].elements.namedItem("usepet").selectedIndex = 0;
                window.document.getElementsByTagName('form')[1].submit();
            }
        }else if(currentFile == 'battling_1p.php'){
            boners = $("a:contains('here')");
            if(boners && boners.length){
                GM_setValue('turncount',0);
                window.location.href = boners[0].href;
            }else if(turncount>=0){
                GM_setValue('turncount',turncount+1);
                for(var i=currentweapon;i<=weaponlist.length;i=i+1){
                    boners = $("a:contains('"+weaponlist[i]+"')");
                    if(boners && boners.length){
                        GM_setValue('currentweapon',i);
                        window.location.href = boners[0].href;
                    }
                }
                if(i>=weaponlist.length){
                    window.document.forms[1].elements.namedItem("use_attack").selectedIndex = 1;
                    window.document.getElementsByTagName('form')[1].submit();
                }
            }
        }else if(currentFile == 'battle_1p_end.php'){
            boners = $("a:contains('Back to the battle center.')");
            if(boners && boners.length){
                window.location.href = boners[0].href;
            }
        }
    }
    setTimeout(doMain,1);
}
doMain();