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
目前為
// ==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);
}