Withdraw All

From Snakehead Games Wiki
Jump to: navigation, search
Greasemonkey.png
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.
The user then still has to click on the [Withdraw] button for the actual withdrawal.
Created after reading a suggestion thread.

WARNING: Use at your own risk.
If any of your money gets pickpocketed, don't come complaining to me, the mods or the admins.
If you get attacked and any of your money disappears, don't come complaining to me, the mods or the admins.
If you get disconnected from the internet while using this script and your money is looted, don't come complaining to me, the mods or the admins.

Changelog:
2009-11-14 First released version

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'/>";


Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox