Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
illyism
Wanderer


Joined: 09 Dec 2007
Posts: 58

PostPosted: Wed Apr 23, 2008 3:38 pm   

name calculator
 
I made this one, just for plain fun, about the same time I made the encrypter.
input a name, and it will calculate it to numbers.

CALCNAME <text>
say illyism makes 9+12+12+25+9+19+13 so 99

Code:
#CLASS {namecalc}
#ALIAS calcname {
  #var tempstr ""
  #var strlen %len( %-1)
  #var dumpstr "%-1"
  #var dumpstr %replace( %-1, " ", "|")
  #var dumpstr %lower( @dumpstr)
  #loop 1,@strlen {
    #var to_ins ""
    #IF {%copy( @dumpstr, %i, 1)= "a"} {#var to_ins "1+"}
    #IF {%copy( @dumpstr, %i, 1)= "b"} {#var to_ins "2+"}
    #IF {%copy( @dumpstr, %i, 1)= "c"} {#var to_ins "3+"}
    #IF {%copy( @dumpstr, %i, 1)= "d"} {#var to_ins "4+"}
    #IF {%copy( @dumpstr, %i, 1)= "e"} {#var to_ins "5+"}
    #IF {%copy( @dumpstr, %i, 1)= "f"} {#var to_ins "6+"}
    #IF {%copy( @dumpstr, %i, 1)= "g"} {#var to_ins "7+"}
    #IF {%copy( @dumpstr, %i, 1)= "h"} {#var to_ins "8+"}
    #IF {%copy( @dumpstr, %i, 1)= "i"} {#var to_ins "9+"}
    #IF {%copy( @dumpstr, %i, 1)= "j"} {#var to_ins "10+"}
    #IF {%copy( @dumpstr, %i, 1)= "k"} {#var to_ins "11+"}
    #IF {%copy( @dumpstr, %i, 1)= "l"} {#var to_ins "12+"}
    #IF {%copy( @dumpstr, %i, 1)= "m"} {#var to_ins "13+"}
    #IF {%copy( @dumpstr, %i, 1)= "n"} {#var to_ins "14+"}
    #IF {%copy( @dumpstr, %i, 1)= "o"} {#var to_ins "15+"}
    #IF {%copy( @dumpstr, %i, 1)= "p"} {#var to_ins "16+"}
    #IF {%copy( @dumpstr, %i, 1)= "q"} {#var to_ins "17+"}
    #IF {%copy( @dumpstr, %i, 1)= "r"} {#var to_ins "18+"}
    #IF {%copy( @dumpstr, %i, 1)= "s"} {#var to_ins "19+"}
    #IF {%copy( @dumpstr, %i, 1)= "t"} {#var to_ins "20+"}
    #IF {%copy( @dumpstr, %i, 1)= "u"} {#var to_ins "21+"}
    #IF {%copy( @dumpstr, %i, 1)= "v"} {#var to_ins "22+"}
    #IF {%copy( @dumpstr, %i, 1)= "w"} {#var to_ins "23+"}
    #IF {%copy( @dumpstr, %i, 1)= "x"} {#var to_ins "24+"}
    #IF {%copy( @dumpstr, %i, 1)= "y"} {#var to_ins "25+"}
    #IF {%copy( @dumpstr, %i, 1)= "z"} {#var to_ins "26+"}
    #IF {%isnumber( %copy( @dumpstr, %i, 1))} {#var to_ins %copy( @dumpstr, %i, 1)}
    #var tempstr %insert( @to_ins, @tempstr, %len( @tempstr)+1)
    )
    }
  #var templen %len( @tempstr)
  #math templen @templen-1
  #IF (%ends( @tempstr, "+")) {#var endtemp %leftback( @tempstr, 1) (}
  #var endanothertemp %mss( @endtemp)
  say %param makes @endtemp so %mss( @endtemp)
  }
#CLASS 0
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net