Reverse Text Script

By beau on Aug 24, 2008

/rev TEXT HERE
Just a random script, tbh.

alias rev {
  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
}

Comments

Sign in to comment.
F*U*R*B*Y*   -  Aug 27, 2008
alias reverse {
  var %old = $strip($1-), %temp = $len(%old), %char, %string
  while (%temp > 0) {
    %char = $mid($1-,%temp,1) | if (%char = $chr(32)) { dec %temp | %char = $mid(%old,%temp,1) | %string = %string %char }
    else { %string = %string $+ %char } | dec %temp 
  }
  if ($isid) return %string | else return %string
}
 Respond  
napa182   -  Aug 27, 2008

mountaindew said

Then you could do something like this to please everyone :)

now why would they want to please everyone?

anyways why not just do

alias rev msg # $regsubex($1-,/(.)/g,$mid(\A,-\n,1))
 Respond  
^Neptune   -  Aug 27, 2008

I like this as an identifier, it's pretty nifty when doing INPUT events.

 Respond  
guest598594   -  Aug 27, 2008

Edit: I use /msg because.. Well I'm lazy and it's easier to type '/rev Hi.' than '//msg # $rev(Hi.)'. To me, anyways.

Then you could do something like this to please everyone :)

$iif($isid,return,msg $active) %b
 Respond  
Zmodem   -  Aug 24, 2008

beau: Preferences, of course! :) Still a nice feature. Well done!

 Respond  
beau   -  Aug 24, 2008

BlueThen, shrugs.
Update your mIRC?

 Respond  
Eugenio   -  Aug 24, 2008

well works for me
/me rates 6

 Respond  
napa182   -  Aug 24, 2008

ah nvm

 Respond  
BlueThen   -  Aug 24, 2008
* Invalid format: $iif
 Respond  
beau   -  Aug 24, 2008

Zmodem, I stripped it because if you "reverse" colors codes, etc., it wouldn't color the text, it would be ugly. Try it out.

Edit: I use /msg because.. Well I'm lazy and it's easier to type '/rev Hi.' than '//msg # $rev(Hi.)'. To me, anyways.

 Respond  
EL   -  Aug 24, 2008

o0o ima try this;p.`-.-´

 Respond  
Zmodem   -  Aug 24, 2008

Why are you stripping it and why does it /msg something? You don't need multiple /var, either :-) It would be better if it was an identifier, that way you could do $rev(Reverse what I'm saying). Why not do this:

alias rev {
  if ($1) {
    var %c = $1-, %a = $len(%c)
    while (%a >= 1) {
      var %b %b $+ $iif($mid(%c,%a,1) == $chr(32),$+($chr(32),$chr(32)),$mid(%c,%a,1))
      dec %a
    }
  }
  return %b
}

Now you can use it wherever. You could do any of these:

//echo -s $rev(This is now reversed!)

//msg # $rev(if you can read this then yer a genius!)

Well, hope it's clear :)

 Respond  
beau   -  Aug 24, 2008

Othanks.

 Respond  
pwnisher3   -  Aug 24, 2008

i wont use it either but it works perfect 6/10

 Respond  
Jamiie   -  Aug 24, 2008

No use for me, but works fine. 3/10.

 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.