Reverse script

By Kurama_ on May 02, 2009

This is basically an edited version of beau's "Reverse Text Script" all I did was just made it so you won't have to keep typing /rev. It was kinda getting on my nerves @.@ Anyway, just copy and paste into your remotes, Right click in any channel, go to reverse to turn it on, and just go to reverse a gain to turn it off. Enjoy.

menu channel {
  reverse
  .on:/set %backwards on
  .off:/set %backwards off
}
on 1:INPUT:#: {
  if (%backwards == on ) {
    if ($1) {
      var %c $strip($1-),%a $len(%c)
      while %a >= 1 {
        var %b %b $+ $replace($mid(%c,%a,1),$chr(32),$str($chr(32),2))
        dec %a
      }
    }
    msg $active %b | halt
  }
}

Comments

Sign in to comment.
Kentaro Kurosaki   -  Feb 14, 2012

What is $chr(9) for?

Also, how could I use this perhaps as a bot command,
like !backwards TEXT........

 Respond  
Kirby   -  May 03, 2009

Adding on to what Jethro_ posted, you can use groups instead of variables, to enable or disable the script.

on *:INPUT:*: {
  if ($left($1,1) !isin / $readini($mircini,text,commandchar)) && (!$ctrlenter) && (!$inpaste) {
    say $+($chr(9),$regsubex($1-,/(.)/g,$mid(\A,-\n,1))) | halt
  }
}

to

menu * {
  $iif($group(#Rev) == On,$style(1)) Reverse Text!
  .$iif($group(#Rev) == On,$style(2)) On: .enable #Rev
  .$iif($group(#Rev) == Off,$style(2)) Off: .disable #Rev
}

#Rev Off
on *:input:*: {
  if (!$regex($1-,^[\/(.*)])) && (!$ctrlenter) && (!$inpaste) {
    say $+($chr(9),$regsubex($1-,/(.)/g,$mid(\A,-\n,1))) | halt
  }
}
#Rev End
 Respond  
Kurama_   -  May 03, 2009

Hey, hey, I'm mostly an amateur scripture, I'm still learning. The thing is that it works. That's mostly what I care about. :P

 Respond  
Aucun50   -  May 02, 2009

This is interesting I've seen it done but never thought it would have much use, maybe for the off you could have it unset the var because there is no reason for it when you do "if (!%backwards)".

 Respond  
Jethro   -  May 02, 2009

Here is the $regsubex version without the use of while loop:

on *:INPUT:*: {
  if ($left($1,1) !isin / $readini($mircini,text,commandchar)) && (!$ctrlenter) && (!$inpaste) {
    say $+($chr(9),$regsubex($1-,/(.)/g,$mid(\A,-\n,1))) | halt
  }
}
 Respond  
Kurama_   -  May 02, 2009

Yes Peanut, but for people who want to talk backwards continuously they won't have to worry about typing /rev over and over again. And FordLawnmower, nuf si sdrawkcab gnipyt esuaceb and it confuses people :D

 Respond  
Peanut118   -  May 02, 2009

For funsies. :\

 Respond  
FordLawnmower   -  May 02, 2009

I'm lost ;/ Why do you want to type backwards?

 Respond  
Peanut118   -  May 02, 2009

But if I wanna just type one thing in reverse then I have to do all that, it's easier to just type /rev

 Respond  
Kurama_   -  May 02, 2009

Hit me with the ratings peeps! :O

 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.