Withdraw All
From Snakehead Games Wiki
| Author: | not V |
| Description: | Put everything from Bank in the Withdraw field |
| Category: | Finance |
| Compatability: | Firefox 3 (other browsers untested) |
| Notes/Changelog: | Adds a button [All] next to the [Withdraw] button.
Clicking [All] copies the amount in the Bank/Swiss eAccount to the withdraw text field. |
| Download: | http://verzend.be/en/file/37114/withdraw-all.user.js.html |
| Back to: | GreaseMonkey Scripts for SB |
Code:
// ==UserScript==
// @name Withdraw All
// @description Put everything from Bank in the Withdraw field
// @include http://www.spybattle.com/bank.php*
// ==/UserScript==
var allSwiss, bank;
allSwiss = document.evaluate("//a[@title='Swiss e-Account']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allSwiss.snapshotLength; i++) {
bank = allSwiss.snapshotItem(i);
bank = bank.innerHTML;
bank = bank.replace('$', '').replace(/,/g, '');
bank = parseInt(bank);
}
var wamount = document.getElementsByName("wamount").item(0);
wamount.parentNode.innerHTML = wamount.parentNode.innerHTML +
"<input class='button' type='button' value='All' onclick='this.form.wamount.value = this.form.all_bank.value' />" +
"<input type='hidden' value='" + bank + "' name='all_bank'/>";