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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Snoop Bob
Beginner


Joined: 05 Sep 2003
Posts: 23

PostPosted: Fri Sep 05, 2003 11:26 am   

Reverse...
 
Hello, I was just woundering if it is possible to turn every word revieved on the mud screen backwards...

so, if something was to say:


"You are feeling hungery."


It would change it to:

"Uoy era gnileef yregnuh."



Guess it sounds like a weird question, but feedback would be most thanked for.
Reply with quote
boo_zmud
Newbie


Joined: 05 Sep 2003
Posts: 5
Location: United Kingdom

PostPosted: Fri Sep 05, 2003 3:13 pm   
 
Bit strange this, but this variable function:

#var fncReverseChars {#loop %len(%1),1 {#echoprompt %copy(%1,%i,1)};#echo}

Used like this:

#exec @fncReverseChars(Text I want backwards)

Should return:

sdrawkcab tnaw I txeT

But, it doesn't. It seems the %i in the loop is not instatiated in the function and therefore it fails. Maybe it's a bug.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Sep 05, 2003 4:13 pm   
 
Functions can't contain zMUD commands in them unless you do a special trick with %exec.

To turn everything you receive from the MUD backwards you can use this trigger:
#TRIGGER {(*)} {#PRIORITY {#VAR newline "";#LOOP %len("%1"),1 {#VAR newline {%concat(@newline, %copy("%1", %i, 1))}};#GAG;#SH @newline}} "" {notrig}

Warning: This will make the scrolling of the MUD output extremely slow.
Reply with quote
Snoop Bob
Beginner


Joined: 05 Sep 2003
Posts: 23

PostPosted: Sat Sep 06, 2003 12:35 am   
 
Please explain more...
Whats the name of this trigger?
Reply with quote
Snoop Bob
Beginner


Joined: 05 Sep 2003
Posts: 23

PostPosted: Sat Sep 06, 2003 12:38 am   
 
Hmmm, got it now... DUMB me...


One problem, it keeps going back and forward...


And, it reverses the whole line, whereas I just want every word backwards.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Sep 06, 2003 12:11 pm   
 
Seems like there is a bug with #SH where it will ignore Trigger on Trigger. You can change it to #SAY instead, but it will have a different color.

For flipping only the words, change it to this:
#TRIGGER {(*)} {#PRIORITY {#VAR newline %replace("%1", " ", "|");#LOOP 1,%numitems(@newline) {#VAR newword "";#LOOP %len(%item(@newline, %i)),1 {#VAR newword %concat(@newword, %copy(%item(@newline, %i), %j, 1))};#VAR newline %replaceitem(@newword, %i, @newline)};#VAR newline %replace(@newline, "|", " ");#GAG;#SAY @newline}} "" {notrig}
Reply with quote
Snoop Bob
Beginner


Joined: 05 Sep 2003
Posts: 23

PostPosted: Sat Sep 06, 2003 9:27 pm   
 
Ok, this is real cool... Three problems:

1. The color is annoying, but its not too bigger problem.

2. Any... { [ ( < ...things get gobbled up, and I have some in my prompt...

3. The commands that I type... they disappear, so if I type... north ... I will still go north in the game, but I won't see the command "north" come up on the mud screen.


Thanks!
Reply with quote
Snoop Bob
Beginner


Joined: 05 Sep 2003
Posts: 23

PostPosted: Sun Sep 07, 2003 10:16 pm   
 
Little help here??? :)
Reply with quote
Snoop Bob
Beginner


Joined: 05 Sep 2003
Posts: 23

PostPosted: Wed Sep 17, 2003 10:49 am   
 
please?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Sep 17, 2003 3:06 pm   
 
gnikaM rojam segnahc ot eht txet yalpsid netfo stluser ni dednetninu edis stceffe. ehT seno uoy ebircsed mees ylriaf ronim. fI uoy t'nod ekil meht, evomer eht reggirt.
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Wed Sep 17, 2003 11:38 pm   
 
Okay.. I wonder how long it took Lightbulb to type that reply. Lol
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Tue Sep 30, 2003 7:04 am   
 
I dluow evah desu ym esrever tahc saila ot krow ti tuo rof :em
#var temp ""
#var numw %numwords( %0)
#var j 0
#until (@j>@numw) {
#var wd %word( %0, @j, " ")
#loop %len( @wd)-1,0 {
#var temp %concat( @temp, %left( %right( @wd, %i), 1))
}
#add j 1
#var temp %concat( @temp, " ")
}
chat @temp

saw( gnitpmet ot esrever taht ,oot tub I thguoht retteb fo )!ti
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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