Rennus_Dragonsbane wrote:
Now, I know a fair number of people are going to hate me for all the scottish dwarves that will suddenly appear (I used it to give one my characters an accent), but I have created a script that will allow the replacement of words.
Create a text file called wordchange.txt in your zMud root directory with the format:
Code:
oldword1,newword1
oldword2,newword2
oldword3,newword3
oldwordn,newwordn
And the script:
Code:
#ALIAS say {#file 1 wordchange.txt;message="";#LOOP 1,%numwords( "%-1") {word=%word( "%-1", %i);#IF (%pos( %rightback( @word, 1), ",.;:!?")) {punct=%rightback( @word, 1);word=%leftback( @word, 1)} {punct=""};oword=%grep( 1, %concat( "^", @word, ","));#IF (@oword) { #IF (%numitems( @oword)>1) {oword=@word} {oword=%word( @oword, 2, ",");#IF (%pos( " (or) ", @oword)) {oword=%word( @oword, %random( 1, %numwords( @oword, " (or) ")), " (or) ")}}} {oword=@word};message=%concat( @message, @oword, @punct, " ")};message=%leftback( @message, 1);~say @message;#close 1}
#ALIAS sayto {#file 1 wordchange.txt;message="";#LOOP 1,%numwords( "%-2") {word=%word( "%-2", %i);#IF (%pos( %rightback( @word, 1), ",.;:!?")) {punct=%rightback( @word, 1);word=%leftback( @word, 1)} {punct=""};oword=%grep( 1, %concat( "^", @word, ","));#IF (@oword) { #IF (%numitems( @oword)>1) {oword=@word} {oword=%word( @oword, 2, ",");#IF (%pos( " (or) ", @oword)) {oword=%word( @oword, %random( 1, %numwords( @oword, " (or) ")), " (or) ")}}} {oword=@word};message=%concat( @message, @oword, @punct, " ")};message=%leftback( @message, 1);~sayto %1 @message;#close 1}
#ALIAS yell {#file 1 wordchange.txt;message="";#LOOP 1,%numwords( "%-1") {word=%word( "%-1", %i);#IF (%pos( %rightback( @word, 1), ",.;:!?")) {punct=%rightback( @word, 1);word=%leftback( @word, 1)} {punct=""};oword=%grep( 1, %concat( "^", @word, ","));#IF (@oword) { #IF (%numitems( @oword)>1) {oword=@word} {oword=%word( @oword, 2, ",");#IF (%pos( " (or) ", @oword)) {oword=%word( @oword, %random( 1, %numwords( @oword, " (or) ")), " (or) ")}}} {oword=@word};message=%concat( @message, @oword, @punct, " ")};message=%leftback( @message, 1);~yell @message;#close 1}
#ALIAS tell {#file 1 wordchange.txt;message="";#LOOP 1,%numwords( "%-2") {word=%word( "%-2", %i);#IF (%pos( %rightback( @word, 1), ",.;:!?")) {punct=%rightback( @word, 1);word=%leftback( @word, 1)} {punct=""};oword=%grep( 1, %concat( "^", @word, ","));#IF (@oword) { #IF (%numitems( @oword)>1) {oword=@word} {oword=%word( @oword, 2, ",");#IF (%pos( " (or) ", @oword)) {oword=%word( @oword, %random( 1, %numwords( @oword, " (or) ")), " (or) ")}}} {oword=@word};message=%concat( @message, @oword, @punct, " ")};message=%leftback( @message, 1);~tell %1 @message;#close 1}
#ALIAS reply {#file 1 wordchange.txt;message="";#LOOP 1,%numwords( "%-1") {word=%word( "%-1", %i);#IF (%pos( %rightback( @word, 1), ",.;:!?")) {punct=%rightback( @word, 1);word=%leftback( @word, 1)} {punct=""};oword=%grep( 1, %concat( "^", @word, ","));#IF (@oword) { #IF (%numitems( @oword)>1) {oword=@word} {oword=%word( @oword, 2, ",");#IF (%pos( " (or) ", @oword)) {oword=%word( @oword, %random( 1, %numwords( @oword, " (or) ")), " (or) ")}}} {oword=@word};message=%concat( @message, @oword, @punct, " ")};message=%leftback( @message, 1);~reply @message;#close 1}
#ALIAS gt {#file 1 wordchange.txt;message="";#LOOP 1,%numwords( "%-1") {word=%word( "%-1", %i);#IF (%pos( %rightback( @word, 1), ",.;:!?")) {punct=%rightback( @word, 1);word=%leftback( @word, 1)} {punct=""};oword=%grep( 1, %concat( "^", @word, ","));#IF (@oword) { #IF (%numitems( @oword)>1) {oword=@word} {oword=%word( @oword, 2, ",");#IF (%pos( " (or) ", @oword)) {oword=%word( @oword, %random( 1, %numwords( @oword, " (or) ")), " (or) ")}}} {oword=@word};message=%concat( @message, @oword, @punct, " ")};message=%leftback( @message, 1);~gt @message;#close 1}
#TRIGGER {Opened wordchange.txt as file 1} {#gag (1)}
#TRIGGER {Closed wordchange.txt on file 1} {#gag (1)}
And just enter your command and poof! Ach! Ya got another scottish dwarf!