User:Rehevkor/Scripts/Currency Converter

From Discworld MUD Wiki
< User:Rehevkor‎ | Scripts
Revision as of 15:29, 8 August 2009 by Rehevkor (Talk | contribs) (Created page with 'To install copy and paste the text in the box below to zMUD. <pre> #CLASS {Lexx's Currency Conv} #VAR CAMT {142016112} #VAR CAMD {355040.28125} #CLASS 0 #CLASS {Lexx's Currency ...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To install copy and paste the text in the box below to zMUD.

#CLASS {Lexx's Currency Conv}
#VAR CAMT {142016112}
#VAR CAMD {355040.28125}
#CLASS 0
#CLASS {Lexx's Currency Conv|Lancre}
#ALIAS CLaConv {
  #IF (%1 =~ "-") {#VAR CLaH 0} {#MATH CLaH (%1 * 248832)}
  #IF (%2 =~ "-") {#VAR CLaSov 0} {#MATH CLaSov (%2 * 20736)}
  #IF (%3 =~ "-") {#VAR CLaC 0} {#MATH CLaC (%3 * 1728)}
  #IF (%4 =~ "-") {#VAR CLas 0} {#MATH CLas (%4 * 144)}
  CLapSplit %-5
  #MATH CLap (@CLapt * 12)
  #VAR CLapt 0
  #MATH CAMT (@CLaH + @CLaSov + @CLaC + @CLas + @CLap)
  #MATH CAMD (@CAMT / %float(400))
  }
#ALIAS CLapSplit {
  #VAR CLap 0
  #IF (%1 =~ "-") {#VAR CLap 0} {#IF ("%1" =~ "1/4") {#VAR CLapf %float(0.25)} {#IF ("%1" =~ "1/2") {#VAR CLapf %float(0.5)} {#IF ("%1" =~ "3/4") {#VAR CLapf %float(0.75)} {#VAR CLap %1}}}} {}
  #IF ("%2") {#IF ("%2" =~ "1/4") {#VAR CLapf %float(0.25)} {#IF ("%2" =~ "1/2") {#VAR CLapf %float(0.5)} {#IF ("%2" =~ "3/4") {#VAR CLapf %float(0.75)}}}} {}
  #MATH CLapt (@CLap + @CLapf)
  #VAR CLap 0
  #VAR CLapf 0
  }
#VAR CLaC {19008}
#VAR CLaH {0}
#VAR CLap {129}
#VAR CLas {864}
#VAR CLaSov {0}
#VAR CLapt {0}
#TRIGGER {^{^ }%1 for Lp %2.$} {
  CLaConv - - - - %2
  #SUB {%1 for Lp %2 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^{^ }%1 for Ls %2|%3.} {
  CLaConv - - - %2 %3
  #SUB {%1 for Ls %2|%3 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^{^ }%1 for LC %2|%3|%4.$} {
  CLaConv - - %2 %3 %4
  #SUB {%1 for LC %2|%3|%4 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^{^ }%1 for LSov %2|%3|%4|%5.$} {
  CLaConv - %2 %3 %4 %5
  #SUB {%1 for LSov %2|%3|%4|%5 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^{^ }%1 for LH %2|%3|%4|%5|%6.$} {
  CLaConv %2 %3 %4 %5 %6
  #SUB {%1 for LH %2|%3|%4|%5|%6 |AM$%format(&-.2n,@CAMD)|.}
  } "" {case}
#TRIGGER {^  ?#%1 for LC %2|%3|%4.$} {
  CLaConv - - %2 %3 %4
  #SUB {%repeat(" ",2)[#%1 for LC %2|%3|%4 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^  ?#%1 for LH %2|%3|%4|%5|%6.$} {
  CLaConv %2 %3 %4 %5 %6
  #SUB {%repeat(" ",2)[#%1 for LH %2|%3|%4|%5|%6 |AM$%format(&-.2n,@CAMD)|.}
  } "" {case}
#TRIGGER {^  ?#%1 for Lp %2.$} {
  CLaConv - - - - %2
  #SUB {%repeat(" ",2)[#%1 for Lp %2 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^  ?#%1 for Ls %2|%3.} {
  CLaConv - - - %2 %3
  #SUB {%repeat(" ",2)[#%1 for Ls %2|%3 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^  ?#%1 for LSov %2|%3|%4|%5.$} {
  CLaConv - %2 %3 %4 %5
  #SUB {%repeat(" ",2)[#%1 for LSov %2|%3|%4|%5 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^   %1 for LC %2|%3|%4 ~(%5.$} {
  CLaConv - - %2 %3 %4
  #SUB {%repeat(" ",3)%1 for LC %2|%3|%4 |AM$%format(&-.2n,@CAMD)| (%5.}
  }
#TRIGGER {^   %1 for LH %2|%3|%4|%5|%6 ~(%7.$} {
  CLaConv %2 %3 %4 %5 %6
  #SUB {%repeat(" ",3)%1 for LH %2|%3|%4|%5|%6 |AM$%format(&-.2n,@CAMD)| (%7.}
  } "" {case}
#TRIGGER {^   %1 for Lp %2 ~(%3.$} {
  CLaConv - - - - %2
  #SUB {%repeat(" ",3)%1 for Lp %2 |AM$%format(&-.2n,@CAMD)| (%3.}
  }
#TRIGGER {^   %1 for Ls %2|%3 ~(%4.$} {
  CLaConv - - - %2 %3
  #SUB {%repeat(" ",3)%1 for Ls %2|%3 |AM$%format(&-.2n,@CAMD)| (%4.}
  }
#TRIGGER {^   %1 for LSov %2|%3|%4|%5 ~(%6.$} {
  CLaConv - %2 %3 %4 %5
  #SUB {%repeat(" ",3)%1 for LSov %2|%3|%4|%5 |AM$%format(&-.2n,@CAMD)| (%6.}
  }
#TRIGGER {^   %1 for LC %2|%3|%4~;%5.$} {
  CLaConv - - %2 %3 %4
  #SUB {%repeat(" ",3)%1 for LC %2|%3|%4 |AM$%format(&-.2n,@CAMD)|~;%5.}
  }
#TRIGGER {^   %1 for LH %2|%3|%4|%5|%6~;%7.$} {
  CLaConv %2 %3 %4 %5 %6
  #SUB {%repeat(" ",3)%1 for LH %2|%3|%4|%5|%6 |AM$%format(&-.2n,@CAMD)|~;%7.}
  } "" {case}
#TRIGGER {^   %1 for Lp %2~;%3.$} {
  CLaConv - - - - %2
  #SUB {%repeat(" ",3)%1 for Lp %2 |AM$%format(&-.2n,@CAMD)|~;%3.}
  }
#TRIGGER {^   %1 for Ls %2|%3~;%4.$} {
  CLaConv - - - %2 %3
  #SUB {%repeat(" ",3)%1 for Ls %2|%3 |AM$%format(&-.2n,@CAMD)|~;%4.}
  }
#TRIGGER {^   %1 for LSov %2|%3|%4|%5~;%6.$} {
  CLaConv - %2 %3 %4 %5
  #SUB {%repeat(" ",3)%1 for LSov %2|%3|%4|%5 |AM$%format(&-.2n,@CAMD)|~;%6.}
  }
#CLASS 0
#CLASS {Lexx's Currency Conv|Genua}
#VAR CGeC {0}
#VAR CGeL {promoting 0}
#VAR CGeF {0}
#VAR CGeD {300000}
#TRIGGER {^   %1 for %2,%3,%4Gf %5$} {
  #MATH CGeC (%2 * 3000)
  #MATH CGeL (%3 * 300)
  #MATH CGeF (%4 * 3)
  #MATH CAMT (@CGeC + @CGeL + @CGeF)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",3)%1 for %2,%3,%4Gf |AM$%format(&-.2n,@CAMD)| %5}
  } "" {case}
#TRIGGER {^   %1 for %2,%3,%4,%5Gd %6$} {
  #MATH CGeD (%2 * 30000)
  #MATH CGeC (%3 * 3000)
  #MATH CGeL (%4 * 300)
  #MATH CGeF (%5 * 3)
  #MATH CAMT (@CGeC + @CGeL + @CGeF + @CGeD)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",3)%1 for %2,%3,%4,%5Gd |AM$%format(&-.2n,@CAMD)| %6}
  }
#TRIGGER {^   %1 for %2,%3Gl %4$} {
  #MATH CGeL (%2 * 300) 
  #MATH CGeC (%3 * 3)
  #MATH CAMT (@CGeC + @CGeL)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",3)%1 for %2,%3Gl |AM$%format(&-.2n,@CAMD)| %4}
  } "" {case}
#TRIGGER {^   %1 for %2Gc %3$} {
  #MATH CGeC (%2 * 3)
  #VAR CAMT @CGeC
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",3)%1 for %2Gc |AM$%format(&-.2n,@CAMD)| %3}
  } "" {case}
#TRIGGER {^{^ }%1 for %2Gc%3$} {
  #MATH CGeC (%2 * 3)
  #VAR CAMT @CGeC
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%1 for %2Gc |AM$%format(&-.2n,@CAMD)|%3}
  } "" {case}
#TRIGGER {^{^ }%1 for %2,%3Gl%4$} {
  #MATH CGeL (%2 * 300)
  #MATH CGeC (%3 * 3)
  #MATH CAMT (@CGeC + @CGeL)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%1 for %2,%3Gl |AM$%format(&-.2n,@CAMD)|%4}
  } "" {case}
#TRIGGER {^{^ }%1 for %2,%3,%4Gf%5$} {
  #MATH CGeC (%2 * 3000)
  #MATH CGeL (%3 * 300)
  #MATH CGeF (%4 * 3)
  #MATH CAMT (@CGeC + @CGeL + @CGeF)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%1 for %2,%3,%4Gf |AM$%format(&-.2n,@CAMD)|%5}
  } "" {case}
#TRIGGER {^{^ }%1 for %2,%3,%4,%5Gd%6$} {
  #MATH CGeD (%2 * 30000)
  #MATH CGeC (%3 * 3000)
  #MATH CGeL (%4 * 300)
  #MATH CGeF (%5 * 3)
  #MATH CAMT (@CGeC + @CGeL + @CGeF + @CGeD)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%1 for %2,%3,%4,%5Gd |AM$%format(&-.2n,@CAMD)|%6}
  } "" {case}
#TRIGGER {^  ?#%1 for %2Gc.$} {
  #MATH CGeC (%2 * 3)
  #VAR CAMT @CGeC
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2Gc |AM$%format(&-.2n,@CAMD)|.}
  } "" {case}
#TRIGGER {^  ?#%1 for %2,%3,%4Gf.$} {
  #MATH CGeC (%2 * 3000)
  #MATH CGeL (%3 * 300)
  #MATH CGeF (%4 * 3)
  #MATH CAMT (@CGeC + @CGeL + @CGeF)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2,%3,%4Gf |AM$%format(&-.2n,@CAMD)|.}
  } "" {case}
#TRIGGER {^  ?#%1 for %2,%3,%4,%5Gd.$} {
  #MATH CGeD (%2 * 30000)
  #MATH CGeC (%3 * 3000)
  #MATH CGeL (%4 * 300)
  #MATH CGeF (%5 * 3)
  #MATH CAMT (@CGeC + @CGeL + @CGeF + @CGeD)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2,%3,%4,%5Gd |AM$%format(&-.2n,@CAMD)|.}
  } "" {case}
#TRIGGER {^  ?#%1 for %2,%3Gl.$} {
  #MATH CGeL (%2 * 300)
  #MATH CGeC (%3 * 3)
  #MATH CAMT (@CGeC + @CGeL)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2,%3Gl |AM$%format(&-.2n,@CAMD)|.}
  } "" {case}
#CLASS 0
#CLASS {Lexx's Currency Conv|Djelibeybi}
#VAR CDjT {1600}
#TRIGGER "Djel playershop" {^   %1 for DjToon %2~;%3$} {
  #MATH CDjT (%2 * 200)
  #MATH CAMD (@CDjT / %float(400))
  #SUB {%repeat(" ",3)%1 for DjToon %2 |AM$%format(&-.2n,@CAMD)|~;%3}
  }
#TRIGGER {^{^ }%1 for DjToon %2{^each}.{^~(}$} {
  #MATH CDjT (%2 * 200)
  #MATH CAMD (@CDjT / %float(400))
  #SUB {%1 for DjToon %2 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^  ?#%1 for DjToon %2.$} {
  #MATH CDjT (%2 * 200)
  #MATH CAMD (@CDjT / %float(400))
  #SUB {%repeat(" ",2)[#%1 for DjToon %2 |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^   %1 for DjToon %2 ~(%3$} {
  #MATH CDjT (%2 * 200)
  #MATH CAMD (@CDjT / %float(400))
  #SUB {%repeat(" ",3)%1 for DjToon %2 |AM$%format(&-.2n,@CAMD)| ~(%3}
  }
#TRIGGER {^{^ }%1 for DjToon %2 each.$} {
  #MATH CDjT (%2 * 200)
  #MATH CAMD (@CDjT / %float(400))
  #SUB {%1 for DjToon %2 |AM$%format(&-.2n,@CAMD)|.}
  }
#CLASS 0
#CLASS {Lexx's Currency Conv|Agatea}
#VAR CAgR {142015680}
#VAR CAgS {432}
#VAR CAgSa {48}
#TRIGGER {^{^ }%1 for %2Rh %3s.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAgS (%3 * 4)
  #MATH CAMT (@CAgR + @CAgS)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%1 for %2Rh %3s |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^  ?#%1 for %2Rh %3s.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAgS (%3 * 4)
  #MATH CAMT (@CAgR + @CAgS)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2Rh %3s |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^  ?#%1 for %2s.$} {
  #MATH CAgS (%2 * 4)
  #MATH CAMD (@CAgS / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2s |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^{^ }%1 for &%d{CAgSa}s.$} {
  #MATH CAgS (%2 * 4)
  #MATH CAMD (@CAgS / %float(400))
  #SUB {%1 for %2s |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^   %1 for %2Rh %3s %4.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAgS (%3 * 4)
  #MATH CAMT (@CAgR + @CAgS)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",3)%1 for %2Rh %3s |AM$%format(&-.2n,@CAMD)| %4.}
  }
#TRIGGER {^   %1 for &%d{CAgSa}s %3.$} {
  #MATH CAgS (%2 * 4)
  #MATH CAMD (@CAgS / %float(400))
  #SUB {%repeat(" ",3)%1 for %2s |AM$%format(&-.2n,@CAMD)| %3.}
  }
#TRIGGER {^{^ }%1 for &%d{saveloy}s each.$} {
  #MATH CAgS (%2 * 4)
  #MATH CAMD (@CAgS / %float(400))
  #SUB {%1 for %2s |AM$%format(&-.2n,@CAMD)| each.}
  }
#TRIGGER {^{^ }%1 for %2Rh %3s each.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAgS (%3 * 4)
  #MATH CAMT (@CAgR + @CAgS)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%1 for %2Rh %3s |AM$%format(&-.2n,@CAMD)| each.}
  }
#TRIGGER {^   %1 for %2Rh ~(%3.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAMD (@CAgR / %float(400))
  #SUB {%repeat(" ",3)%1 for %2Rh |AM$%format(&-.2n,@CAMD)| (%3.}
  }
#TRIGGER {^{^ }%1 for %2Rh.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAMD (@CAgR / %float(400))
  #SUB {%1 for %2Rh |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^{^ }%1 for %2Rh each.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAMD (@CAgR / %float(400))
  #SUB {%1 for %2Rh |AM$%format(&-.2n,@CAMD)| each.}
  }
#TRIGGER {^  ?#%1 for %2Rh.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAMD (@CAgR / %float(400))
  #SUB {%repeat(" ",2)[#%1 for %2Rh |AM$%format(&-.2n,@CAMD)|.}
  }
#TRIGGER {^   %1 for %2Rh~; %3.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAMD (@CAgR / %float(400))
  #SUB {%repeat(" ",3)%1 for %2Rh |AM$%format(&-.2n,@CAMD)|~; %3.}
  }
#TRIGGER {^   %1 for %2Rh %3s~;%4.$} {
  #MATH CAgR (%2 * 480)
  #MATH CAgS (%3 * 4)
  #MATH CAMT (@CAgR + @CAgS)
  #MATH CAMD (@CAMT / %float(400))
  #SUB {%repeat(" ",3)%1 for %2Rh %3s |AM$%format(&-.2n,@CAMD)|~;%4.}
  }
#CLASS 0