LambLongs: Battle Script

Attacks everything, forever.

目前為 2017-05-04 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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();