User:CALLEK/Scripts/Wealth

From Elanthipedia
< User:CALLEK(Redirected from User:Callek/Scripts/Wealth)
Jump to navigation Jump to search
User:CallekTrader thumb.jpg

About Me

Error: Image is invalid or non-existent.

Contact (Alternate)

Error: Image is invalid or non-existent.

Tools

Error: Image is invalid or non-existent.

Userboxes

Error: Image is invalid or non-existent.

Personal

NOTE This script is no longer useful with current WEALTH changes.

Requires Stormfront

This script will perform a basic WEALTH command and tally all your coins, useful when you end up having many varying types of coin on you. This is a good indication of the power of Stormfront Scripting.

Example:

[Script wealth is running, Esc to cancel, Shift-Esc to pause]
>wealth
>yes
Wealth:
  243 platinum, 535 gold, 590 silver, 587 bronze, and 539 copper Kronars (3030409 copper Kronars).
  4 silver, and 60 copper Lirums (460 copper Lirums).
  5 silver, 1 bronze, and 1 copper Dokoras (511 copper Dokoras).
>
A good positive attitude never hurts.

Total Kronars: 3030409
Total Lirums: 460
Total Dokoras: 511

[script done]

Actual Script:

debug off

setvariable CoinTypeDone None
setvariable totalKronars 0
setvariable totalLirums 0
setvariable totalDokoras 0
put wealth
put yes
loopy:
setvariable platCoins 0
setvariable goldCoins 0
setvariable silverCoins 0
setvariable bronzeCoins 0
setvariable copperCoins 0
matchre startWealthCheck /^ *(?=\d* .*(?:Kronar|Dokora|Lirum))/
matchre exitme /^A good positive attitude never hurts/
matchwait

exitme:
echo
echo Total Kronars: %totalKronars%
echo Total Lirums: %totalLirums%
echo Total Dokoras: %totalDokoras%
echo
exit

startWealthCheck:
setvariable wealthNum 0
loopWealthCheck:
matchre NumMatch0 /^0/
matchre NumMatch1 /^(and )?1/
matchre NumMatch2 /^(and )?2/
matchre NumMatch3 /^(and )?3/
matchre NumMatch4 /^(and )?4/
matchre NumMatch5 /^(and )?5/
matchre NumMatch6 /^(and )?6/
matchre NumMatch7 /^(and )?7/
matchre NumMatch8 /^(and )?8/
matchre NumMatch9 /^(and )?9/
matchre CoinTypeMatch /^ /
matchwait

CoinTypeMatch:
matchre platCoin /^platinum/
matchre goldCoin /^gold/
matchre silverCoin /^silver/
matchre bronzeCoin /^bronze/
matchre copperCoin /^copper/
matchwait

DoneCoinType:
matchre startWealthCheck /^, /
goto DoneCoinType%CoinTypeDone%
DoneCoinTypeNone:
matchre Kronar /^ Kronars.*\./
DoneCoinTypeKronars:
matchre Lirum /^ Lirums.*\./
DoneCoinTypeLirum:
matchre Dokora /^ Dokoras.*\./
matchwait

Kronar:
setvariable platKronar %platCoins%
setvariable goldKronar %goldCoins%
setvariable silverKronar %silverCoins%
setvariable bronzeKronar %bronzeCoins%
setvariable copperKronar %copperCoins%
deletevariable platCoins
deletevariable goldCoins
deletevariable silverCoins
deletevariable bronzeCoins
deletevariable copperCoins
counter set %platKronar%
counter multiply 10
counter add %goldKronar%
counter multiply 10
counter add %silverKronar%
counter multiply 10
counter add %bronzeKronar%
counter multiply 10
counter add %copperKronar%
setvariable totalKronars %c%
goto loopy

Lirum:
setvariable platLirum %platCoins%
setvariable goldLirum %goldCoins%
setvariable silverLirum %silverCoins%
setvariable bronzeLirum %bronzeCoins%
setvariable copperLirum %copperCoins%
deletevariable platCoins
deletevariable goldCoins
deletevariable silverCoins
deletevariable bronzeCoins
deletevariable copperCoins
counter set %platLirum%
counter multiply 10
counter add %goldLirum%
counter multiply 10
counter add %silverLirum%
counter multiply 10
counter add %bronzeLirum%
counter multiply 10
counter add %copperLirum%
setvariable totalLirums %c%
goto loopy

Dokora:
setvariable platDokora %platCoins%
setvariable goldDokora %goldCoins%
setvariable silverDokora %silverCoins%
setvariable bronzeDokora %bronzeCoins%
setvariable copperDokora %copperCoins%
deletevariable platCoins
deletevariable goldCoins
deletevariable silverCoins
deletevariable bronzeCoins
deletevariable copperCoins
counter set %platDokora%
counter multiply 10
counter add %goldDokora%
counter multiply 10
counter add %silverDokora%
counter multiply 10
counter add %bronzeDokora%
counter multiply 10
counter add %copperDokora%
setvariable totalDokoras %c%
goto loopy

platCoin:
setvariable platCoins %wealthNum%
deletevariable wealthNum
goto DoneCoinType

goldCoin:
setvariable goldCoins %wealthNum%
deletevariable wealthNum
goto DoneCoinType

silverCoin:
setvariable silverCoins %wealthNum%
deletevariable wealthNum
goto DoneCoinType

bronzeCoin:
setvariable bronzeCoins %wealthNum%
deletevariable wealthNum
goto DoneCoinType

copperCoin:
setvariable copperCoins %wealthNum%
deletevariable wealthNum
goto DoneCoinType

NumMatch0:
counter set %wealthNum%
counter multiply 10
counter add 0
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch1:
counter set %wealthNum%
counter multiply 10
counter add 1
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch2:
counter set %wealthNum%
counter multiply 10
counter add 2
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch3:
counter set %wealthNum%
counter multiply 10
counter add 3
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch4:
counter set %wealthNum%
counter multiply 10
counter add 4
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch5:
counter set %wealthNum%
counter multiply 10
counter add 5
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch6:
counter set %wealthNum%
counter multiply 10
counter add 6
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch7:
counter set %wealthNum%
counter multiply 10
counter add 7
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch8:
counter set %wealthNum%
counter multiply 10
counter add 8
setvariable wealthNum %c%
goto loopWealthCheck

NumMatch9:
counter set %wealthNum%
counter multiply 10
counter add 9
setvariable wealthNum %c%
goto loopWealthCheck