1m resouces! not more!

Sell ores with just typing "sell all ores" in the chat! This script will just keep 10m stone and 1m of all other ore! :D

目前為 2017-02-13 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         1m resouces! not more!
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  Sell ores with just typing "sell all ores" in the chat! This script will just keep 10m stone and 1m of all other ore! :D
// @author       Lasse98brus
// @match        http://www.diamondhunt.co/game.php
// @grant        none
// ==/UserScript==

var val, amount;

function theMillionaireSeller() {
    var logger = "You used the sell command! here is the results:";
    var dialogue = "You sold some: ";
    var number = 0;
      // Just to make a statement to sell the ores easier
    val = [stone,copper,tin,iron,silver,gold,quartz,flint,marble,titanium,promethium];
    ore = ["stone",'copper','tin','iron','silver','gold','quarts','flint','marble','titanium','promethium'];

      // The statements
    i = 0;
    if(val[i] >= 10000000) {
        amount = val[i] - 10000000;
        sell(ore[i], amount);
        logger = logger + "\n" + amount + " of " + ore[i] + " is sold!";
        dialogue = dialogue + ore[i];
        number = 1;
    }

    i = 1;
    while(i < ore.length) {
        if(val[i] >= 1000000) {
            amount = val[i] - 1000000;
            sell(ore[i], amount);
            logger = logger + "\n" + amount + " of " + ore[i] + " is sold!";
            if(number == 1) {
                dialogue = dialogue + ", " + ore[i];
            } else {
                dialogue = dialogue + ore[i];
            }
            number = 1;
        }
        i++;
    }

    dialogue = dialogue + "!";
      // Detailed info in the console and a popup to tell that the command works!
    console.log(logger);
    openDialogue('Sell Command Used!', dialogue);
}

var originalSendChat = window.sendChat;
window.sendChat = function (msg) {
    var args = command.split(" ");
    if(command === "sell all ores") {
        document.getElementById("textbox-chat").value = "";
        theMillionaireSeller();
        return;
    }
    originalSendChat(msg);
}