Bank Balance Tracker (script): Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 25: Line 25:
==Changelog==
==Changelog==


'''5/14/2016'''
*Fixed error with Fang Cove bank not logging plats
'''9/16/2015'''
*Fixed possible hangup in bank script when checking balance
'''9/6/2015'''
*Added support for Fang Cove bank (both triggers and script updated)
'''12/24/2014'''
'''12/24/2014'''
*Bug fix: (triggers) Fixed a case where a place shift would cause a greatly inflated bank balance when there were no coins of a given type in that bank account after receiving a currency output from a different source that included that coin type.
*Bug fix: (triggers) Fixed a case where a place shift would cause a greatly inflated bank balance when there were no coins of a given type in that bank account after receiving a currency output from a different source that included that coin type.
Line 66: Line 72:
You must install the following triggers:
You must install the following triggers:


<pre>#trigger {^The clerk counts out .+ and hands them over, making a notation|^The clerk slides a small metal box across the counter|^You don't have any .+ to deposit|^Searching methodically through the shelves, you finally manage to locate the jar labeled .+ and (drop your coins inside|thrust your hand inside)|^You find your jar with little effort, thankfully, and (drop your coins inside|thrust your hand inside)} {#send balance} {bank}
<pre>#trigger {^The clerk counts out .+ and hands them over, making a notation|^The clerk slides a small metal box across the counter|^You don't have any .+ to deposit} {#send balance} {bank}
#trigger {^The clerk flips through (his|her) ledger then says, \"\w+, you do not seem to have an account with us\.|^A voice behind you calls out, \"I don't recognize you,.+Perhaps you should find a new deposit jar for your financial needs\.|^You sift through shelf after shelf} {#var platinum 0;#var gold 0;#var silver 0;#var bronze 0;#var copper 0;#if {contains("$zonename","Rossman's Landing")} {#var map.30.bank 0} {#if {contains("$zonename", "Hollow Eve") or ($zoneid=114) or ($zoneid=123) or ($zoneid=127)} {#var map.116.bank 0} {#if {$zoneid=112} {#var map.61.bank 0} {#if {$zoneid=40} {#var map.42.bank 0} {#var map.$zoneid.bank 0}}}};#var save} {bank}
#trigger {(current balance|As expected).+ (\d+) bronze} {#var bronze $2} {bank}
#trigger {(current balance|As expected).+ (\d+) copper} {#var copper $2} {bank}
#trigger {As expected, there are.+(\d+) copper} {#var copper $1} {bank}
#trigger {(current balance|As expected).+ (\d+) gold} {#var gold $2} {bank}
#trigger {As expected, there are.+(\d+) bronze} {#var bronze $1} {bank}
#trigger {(current balance|As expected).+ (\d+) platinum} {#var platinum $2} {bank}
#trigger {As expected, there are.+(\d+) silver} {#var silver $1} {bank}
#trigger {(current balance|As expected).+ (\d+) silver} {#var silver $2} {bank}
#trigger {As expected, there are.+(\d+) gold} {#var gold $1} {bank}
#trigger {As expected, there are (\d+) platinum} {#var platinum $1} {bank}
#trigger {(current balance|As expected).+(Kronars|Lirums|Dokoras)\.(\"|)$} {#if {contains("$zonename", "Rossman's Landing"} {#var map.30.bank $platinum$gold$silver$bronze$copper} {#if {contains("$zonename", "Hollow Eve") or ($zoneid=114) or ($zoneid=123) or ($zoneid=127)} {#var map.116.bank $platinum$gold$silver$bronze$copper} {#if {$zoneid=112} {#var map.61.bank $platinum$gold$silver$bronze$copper} {#if {$zoneid=40} {#var map.42.bank $platinum$gold$silver$bronze$copper} {#var map.$zoneid.bank $platinum$gold$silver$bronze$copper}}}};#var platinum 0;#var gold 0;#var silver 0;#var bronze 0;#var copper 0;#var save} {bank}
#trigger {current balance.+ (\d+) copper} {#var copper $1} {bank}
#trigger {^The clerk flips through (his|her) ledger then says, \"\w+, you do not seem to have an account with us\.|^You sift through shelf after shelf of the jars} {#var platinum 0;#var gold 0;#var silver 0;#var bronze 0;#var copper 0;#if {contains("$zonename","Rossman's Landing")} {#var map.30.bank 0;#var save} {#if {contains("$zonename", "Hollow Eve") or ($zoneid=114) or ($zoneid=123) or ($zoneid=127)} {#var map.116.bank 0;#var save} {#if {$zoneid=112} {#var map.61.bank 0;#var save} {#if {$zoneid=40} {#var map.42.bank 0;#var save} {#var map.$zoneid.bank 0;#var save}}}}} {bank}</pre>
#trigger {current balance.+ (\d+) bronze} {#var bronze $1} {bank}
#trigger {current balance.+ (\d+) silver} {#var silver $1} {bank}
#trigger {current balance.+ (\d+) gold} {#var gold $1} {bank}
#trigger {current balance.+ (\d+) platinum} {#var platinum $1} {bank}
#trigger {current balance.+(Kronars|Lirums|Dokoras)\.\"$|^Searching methodically through the shelves, you finally manage to locate the jar labeled|^You find your jar with little effort, thankfully, and carefully count out the contents of it} {#if {contains("$zonename", "Rossman's Landing"} {#var map.30.bank $platinum$gold$silver$bronze$copper} {#if {contains("$zonename", "Hollow Eve") or ($zoneid=114) or ($zoneid=123) or ($zoneid=127)} {#var map.116.bank $platinum$gold$silver$bronze$copper} {#if {$zoneid=112} {#var map.61.bank $platinum$gold$silver$bronze$copper} {#if {$zoneid=40} {#var map.42.bank $platinum$gold$silver$bronze$copper} {#var map.$zoneid.bank $platinum$gold$silver$bronze$copper}}}};#var platinum 0;#var gold 0;#var silver 0;#var bronze 0;#var copper 0;#var save} {bank}</pre>


===Maps===
===Maps===
Line 104: Line 115:


<pre>send balance
<pre>send balance
waitforre ^The clerk pages through|^The clerk flips through|^You are
waitforre ^A voice behind you calls out|^Searching methodically through the shelves|^The clerk (flips|pages) through|^You are.+balanced|^You find your jar with little effort|^You sift through
put #var save

if $charactername = Isharon && $zoneid = 1 then
{
put #math map.1.bank subtract $owr_balance
put #var save
}


evalmath TotalKronars $map.1.bank + $map.13.bank + $map.61.bank
evalmath TotalKronars $map.1.bank + $map.13.bank + $map.61.bank
Line 110: Line 128:
evalmath TotalLirums $map.30.bank + $map.35.bank + $map.42.bank + $map.47.bank + $map.90.bank + $map.99.bank + $map.106.bank + $map.107.bank
evalmath TotalLirums $map.30.bank + $map.35.bank + $map.42.bank + $map.47.bank + $map.90.bank + $map.99.bank + $map.106.bank + $map.107.bank
put #var TotalLirums %TotalLirums
put #var TotalLirums %TotalLirums
evalmath TotalDokoras $map.66.bank + $map.67.bank + $map.116.bank
evalmath TotalDokoras $map.66.bank + $map.67.bank + $map.116.bank + $map.150.bank
put #var TotalDokoras %TotalDokoras
put #var TotalDokoras %TotalDokoras
evalmath LirKro round(%TotalLirums * 1.25)
evalmath LirKro round(%TotalLirums * 1.25)
evalmath DokKro round(%TotalDokoras * 1.385)
evalmath DokKro round(%TotalDokoras * (1/.902))
evalmath NetWorth $TotalKronars + %LirKro + %DokKro
evalmath NetWorth $TotalKronars + %LirKro + %DokKro
put #var NetWorth %NetWorth
put #var NetWorth %NetWorth
Line 131: Line 149:
evalmath pmap.107.bank round(($map.107.bank/10000),1)
evalmath pmap.107.bank round(($map.107.bank/10000),1)
evalmath pmap.116.bank round(($map.116.bank/10000),1)
evalmath pmap.116.bank round(($map.116.bank/10000),1)
evalmath pmap.150.bank round(($map.150.bank/10000),1)
evalmath PKronars round(($TotalKronars/10000),1)
evalmath PKronars round(($TotalKronars/10000),1)
evalmath PLirums round(($TotalLirums/10000),1)
evalmath PLirums round(($TotalLirums/10000),1)
Line 153: Line 172:
if $map.107.bank > 0 then echo Mer'Kresh: $map.107.bank Lirums (%pmap.107.bank plats)
if $map.107.bank > 0 then echo Mer'Kresh: $map.107.bank Lirums (%pmap.107.bank plats)
if $map.116.bank > 0 then echo Hibarnhvidar: $map.116.bank Dokoras (%pmap.116.bank plats)
if $map.116.bank > 0 then echo Hibarnhvidar: $map.116.bank Dokoras (%pmap.116.bank plats)
if $map.150.bank > 0 then echo Fang Cove: $map.150.bank Dokoras (%pmap.150.bank plats)
echo
echo
echo $charactername's Net Worth:
echo $charactername's Net Worth:

Latest revision as of 19:15, 14 May 2016

Bank Balance Tracker (script)
Category information
Front-end Genie
Author Isharon, Celeres, and Absolon


This script displays your bank balances, which are tracked by trigger. This is useful for people who don't have Premium accounts (and therefore don't have access to bank books).

When you run the script, it will display the (non-zero) balance of every bank that you have used since you installed the triggers. It will also display your totals for each currency and your adjusted net worth in Kronars (how much money you would have if you exchanged your Lirums and Dokoras for Kronars, not including exchange fees).

The triggers update your bank balance every time you deposit, withdraw, or check your balance. They will create separate bank balance variables for each character that you use.

This system supports tie-in banks. If you deposit at a bank that ties into another bank, your account balance at the primary bank will update. (For example, if you deposit money at Rossman's Landing, your Riverhaven account balance will update.)

If you wish to stop using this tracking system temporarily, you can input #CLASS BANK <ON|OFF>.

Instructions

  1. Install the required Genie settings and scripts (see below).
  2. Run the Setup Script once per character. This will set your bank balances to 0. (If you don't do this, the Balance Display Script won't be able to compute your currency totals.)
  3. Your balances will automatically update any time you deposit, withdraw, or check your balance. You can review your balances any time by running the Balance Display Script.


Note: If you were using a previous version, you should remove all of those triggers and install these. You will also need to reset your bank balance variables by running the Setup Script once per character. (The current version doesn't include the currency name in the variables, which makes it easier to use Genie's math functions.)

Changelog

5/14/2016

  • Fixed error with Fang Cove bank not logging plats

9/16/2015

  • Fixed possible hangup in bank script when checking balance

9/6/2015

  • Added support for Fang Cove bank (both triggers and script updated)

12/24/2014

  • Bug fix: (triggers) Fixed a case where a place shift would cause a greatly inflated bank balance when there were no coins of a given type in that bank account after receiving a currency output from a different source that included that coin type.

11/01/2014

  • Added support for banks with multiple branches
  • Added support for #class

7/7/2014

  • Added additional teller messaging for checking your balance

8/6/2013

  • If you are at a teller when you run this script, it will now check your balance before updating your bank balance variables.

10/19/2011

  • Added support for currency totals and net worth
  • Added conversion to plats (for easier reading)
  • Note: If you were using a previous version, you should remove all of those triggers and install these. You will also need to reset your bank balance variables by running the Setup Script once per character. (The current version doesn't include the currency name in the variables, which makes it easier to use Genie's math functions.)

Sample Output

Account Balances:

Crossing: 7573630 Kronars (757.4 plats)
Dirge: 204302 Kronars (20.4 plats)
Leth Deriel: 229263 Kronars (22.9 plats)
Riverhaven: 644447 Lirums (64.4 plats)
Therenborough: 2363299 Lirums (236.3 plats)
Muspar'i: 320793 Lirums (32.1 plats)
Shard: 3471430 Dokoras (347.1 plats)
Hibarnhvidar: 1061380 Dokoras (106.1 plats)

Character's Net Worth:

Kronars: 8007195 (800.7 plats)
Lirums: 3328539 (332.9 plats)
Dokoras: 4532810 (453.3 plats)

Adjusted Net Worth: 18445811 Kronars (1844.6 plats)

Required Genie Settings

Triggers

You must install the following triggers:

#trigger {^The clerk counts out .+ and hands them over, making a notation|^The clerk slides a small metal box across the counter|^You don't have any .+ to deposit} {#send balance} {bank}
#trigger {^The clerk flips through (his|her) ledger then says, \"\w+, you do not seem to have an account with us\.|^A voice behind you calls out, \"I don't recognize you,.+Perhaps you should find a new deposit jar for your financial needs\.|^You sift through shelf after shelf} {#var platinum 0;#var gold 0;#var silver 0;#var bronze 0;#var copper 0;#if {contains("$zonename","Rossman's Landing")} {#var map.30.bank 0} {#if {contains("$zonename", "Hollow Eve") or ($zoneid=114) or ($zoneid=123) or ($zoneid=127)} {#var map.116.bank 0} {#if {$zoneid=112} {#var map.61.bank 0} {#if {$zoneid=40} {#var map.42.bank 0} {#var map.$zoneid.bank 0}}}};#var save} {bank}
#trigger {As expected, there are.+(\d+) copper} {#var copper $1} {bank}
#trigger {As expected, there are.+(\d+) bronze} {#var bronze $1} {bank}
#trigger {As expected, there are.+(\d+) silver} {#var silver $1} {bank}
#trigger {As expected, there are.+(\d+) gold} {#var gold $1} {bank}
#trigger {As expected, there are (\d+) platinum} {#var platinum $1} {bank}
#trigger {current balance.+ (\d+) copper} {#var copper $1} {bank}
#trigger {current balance.+ (\d+) bronze} {#var bronze $1} {bank}
#trigger {current balance.+ (\d+) silver} {#var silver $1} {bank}
#trigger {current balance.+ (\d+) gold} {#var gold $1} {bank}
#trigger {current balance.+ (\d+) platinum} {#var platinum $1} {bank}
#trigger {current balance.+(Kronars|Lirums|Dokoras)\.\"$|^Searching methodically through the shelves, you finally manage to locate the jar labeled|^You find your jar with little effort, thankfully, and carefully count out the contents of it} {#if {contains("$zonename", "Rossman's Landing"} {#var map.30.bank $platinum$gold$silver$bronze$copper} {#if {contains("$zonename", "Hollow Eve") or ($zoneid=114) or ($zoneid=123) or ($zoneid=127)} {#var map.116.bank $platinum$gold$silver$bronze$copper} {#if {$zoneid=112} {#var map.61.bank $platinum$gold$silver$bronze$copper} {#if {$zoneid=40} {#var map.42.bank $platinum$gold$silver$bronze$copper} {#var map.$zoneid.bank $platinum$gold$silver$bronze$copper}}}};#var platinum 0;#var gold 0;#var silver 0;#var bronze 0;#var copper 0;#var save} {bank}

Maps

You must be using the official Genie map bundle. (This is how the triggers know which bank balance to update.)

Setup Script

put #var map.1.bank 0
put #var map.13.bank 0
put #var map.61.bank 0
put #var map.30.bank 0
put #var map.35.bank 0
put #var map.42.bank 0
put #var map.47.bank 0
put #var map.66.bank 0
put #var map.67.bank 0
put #var map.90.bank 0
put #var map.99.bank 0
put #var map.106.bank 0
put #var map.107.bank 0
put #var map.116.bank 0
put #var map.150.bank 0

echo
echo Bank balances set to zero! The bank triggers and script will update your bank balances from now on.
echo

Balance Display Script

send balance
waitforre ^A voice behind you calls out|^Searching methodically through the shelves|^The clerk (flips|pages) through|^You are.+balanced|^You find your jar with little effort|^You sift through
put #var save

if $charactername = Isharon && $zoneid = 1 then
{
put #math map.1.bank subtract $owr_balance
put #var save
}

evalmath TotalKronars $map.1.bank + $map.13.bank + $map.61.bank
put #var TotalKronars %TotalKronars
evalmath TotalLirums $map.30.bank + $map.35.bank + $map.42.bank + $map.47.bank + $map.90.bank + $map.99.bank + $map.106.bank + $map.107.bank
put #var TotalLirums %TotalLirums
evalmath TotalDokoras $map.66.bank + $map.67.bank + $map.116.bank + $map.150.bank
put #var TotalDokoras %TotalDokoras
evalmath LirKro round(%TotalLirums * 1.25)
evalmath DokKro round(%TotalDokoras * (1/.902))
evalmath NetWorth $TotalKronars + %LirKro + %DokKro
put #var NetWorth %NetWorth

evalmath pmap.1.bank round(($map.1.bank/10000),1)
evalmath pmap.13.bank round(($map.13.bank/10000),1)
evalmath pmap.61.bank round(($map.61.bank/10000),1)
evalmath pmap.30.bank round(($map.30.bank/10000),1)
evalmath pmap.35.bank round(($map.35.bank/10000),1)
evalmath pmap.42.bank round(($map.42.bank/10000),1)
evalmath pmap.47.bank round(($map.47.bank/10000),1)
evalmath pmap.66.bank round(($map.66.bank/10000),1)
evalmath pmap.67.bank round(($map.67.bank/10000),1)
evalmath pmap.90.bank round(($map.90.bank/10000),1)
evalmath pmap.99.bank round(($map.99.bank/10000),1)
evalmath pmap.106.bank round(($map.106.bank/10000),1)
evalmath pmap.107.bank round(($map.107.bank/10000),1)
evalmath pmap.116.bank round(($map.116.bank/10000),1)
evalmath pmap.150.bank round(($map.150.bank/10000),1)
evalmath PKronars round(($TotalKronars/10000),1)
evalmath PLirums round(($TotalLirums/10000),1)
evalmath PDokoras round(($TotalDokoras/10000),1)
evalmath PNet round(($NetWorth/10000),1)

echo
echo Account Balances:
echo
if $map.1.bank > 0 then echo Crossing: $map.1.bank Kronars (%pmap.1.bank plats)
if $map.13.bank > 0 then echo Dirge: $map.13.bank Kronars (%pmap.13.bank plats)
if $map.61.bank > 0 then echo Leth Deriel: $map.61.bank Kronars (%pmap.61.bank plats)
if $map.30.bank > 0 then echo Riverhaven: $map.30.bank Lirums (%pmap.30.bank plats)
if $map.35.bank > 0 then echo Throne City: $map.35.bank Lirums (%pmap.35.bank plats)
if $map.42.bank > 0 then echo Therenborough: $map.42.bank Lirums (%pmap.42.bank plats)
if $map.47.bank > 0 then echo Muspar'i: $map.47.bank Lirums (%pmap.47.bank plats)
if $map.66.bank > 0 then echo Chyolvea Tayeu'a: $map.66.bank Dokoras (%pmap.66.bank plats)
if $map.67.bank > 0 then echo Shard: $map.67.bank Dokoras (%pmap.67.bank plats)
if $map.90.bank > 0 then echo Ratha: $map.90.bank Lirums (%pmap.90.bank plats)
if $map.99.bank > 0 then echo Aesry Surlaenis'a: $map.99.bank Lirums (%pmap.99.bank plats)
if $map.106.bank > 0 then echo Hara'jaal: $map.106.bank Lirums (%pmap.106.bank plats)
if $map.107.bank > 0 then echo Mer'Kresh: $map.107.bank Lirums (%pmap.107.bank plats)
if $map.116.bank > 0 then echo Hibarnhvidar: $map.116.bank Dokoras (%pmap.116.bank plats)
if $map.150.bank > 0 then echo Fang Cove: $map.150.bank Dokoras (%pmap.150.bank plats)
echo
echo $charactername's Net Worth:
echo
if $TotalKronars > 0 then echo Kronars: $TotalKronars (%PKronars plats)
if $TotalLirums > 0 then echo Lirums: $TotalLirums (%PLirums plats)
if $TotalDokoras > 0 then echo Dokoras: $TotalDokoras (%PDokoras plats)
echo
echo Adjusted Net Worth: $NetWorth Kronars (%PNet plats)
echo

echo
send wealth
waitforre ^Wealth:$
put #var save