Reversed text

By FireFly on Sep 10, 2008

Just a simple snippet that reverses the text, and then outputs it.

Example (Do you really need one?):

The command:
/rev This is some example text.

Outputs this text:
.txet elpmaxe emos si sihT

alias rev {
  var %i = 1
  while (%i <= $len($1-)) {
    set -u0 %bwOut $mid($1-,%i,1) $+ %bwOut
    inc %i
  }
  msg $chan %bwOut
}

Comments

Sign in to comment.
FireFly   -  Sep 11, 2008

Heh, well, I've never actually read anything about coding for mIRC outside of the mIRC help file, so I guess I use some quite odd methods of doing some stuff.. Didn't even know you could create functions in mIRC.
Anyways, thanks for the suggestions.

 Respond  
_Daniel_   -  Sep 11, 2008

Very simple, I like it

 Respond  
Zmodem   -  Sep 10, 2008

Even better!

 Respond  
guest598594   -  Sep 10, 2008

Or maybe "$iif($isid,return,msg $active) %bwOut".

 Respond  
Zmodem   -  Sep 10, 2008

mountaindew: Good call! Another suggestion I would make is to turn this into an identifier that returns the statement within any fashion, not just a message to a channel. ie: $rev(). Here is an example:

alias rev {
  var %i = 1, %bwOut
  while (%i <= $len($1-)) {
    %bwOut = $mid($1-,%i,1) $+ %bwOut
    inc %i
  }
  return %bwOut
}
 Respond  
guest598594   -  Sep 10, 2008

"set -u0 ..." --> You can just use /var to make it a local variable.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.