$reverse Identifier

By GoldFish on Jul 20, 2011

There are a few times where I've wanted to reverse text but couldn't, so I made this. Pretty much what I did was turn it into an identifier so you can use it with all your scripts.

For example, $reverse(hello) will return olleh

Enjoy!

alias reverse {
  var %string $replace($1-,$chr(32),$chr(96))
  var %count 1
  var %length $len(%string)
  while (%count <= %length) {
    var %backwards %backwards $right(%string,1)
    var %string $left(%string,-1)
    inc %count
  }
  return $replace(%backwards,$chr(32),$null,$chr(96),$chr(32))
}

Comments

Sign in to comment.
Jethro   -  Aug 14, 2011

Dani_l11, at the end of the day, they'll stick with one mentality they know best: "if it ain't broke, don't fix it." :p

 Respond  
Dani_l11   -  Aug 14, 2011

It's really worth it. Just update to 6.35 if you dont want 7.17, it will support most (if not all?) scripts written under 6.16. And $regsubex and $regex are 2 of the best identifiers out there. If you know how to use them, you can't live (or atleast script) without them!

 Respond  
GoldFish   -  Jul 20, 2011

I'm not really sure if it matters for me though. I have no idea what the hell regsubex is, and I probably won't be learning it any time soon. I'm not saying updating is bad, but just kind of inconvenient Thanks for the nice comments though, I appreciate it :).

 Respond  
Jethro   -  Jul 20, 2011

Many people will still stick with the old versions because the scripts they've installed were specifically written under them. For that matter, they don't wanna risk their chances of getting their scripts screwed up and all that. :p This is also the main reason why Khaled keeps all these outdated versions available out there.

 Respond  
napa182   -  Jul 20, 2011

Maybe it is time to update =/
6.16 is an old version an you are not getting all you can out of a version that old.
being mIRC has added a few things in it's newer versions.
Try out version 7.19

 Respond  
Jethro   -  Jul 20, 2011

I wasn't accusing you of ripping or stealing. I was only saying that "it looks like" one that I saw before. Keep up the nice work.

Oh, $regsubex() is supported by 6.17 and up. Though napa may be able to convert it to $regsub() instead...

 Respond  
GoldFish   -  Jul 20, 2011

that's probably it
I use 6.16...

 Respond  
napa182   -  Jul 20, 2011

@GoldFish yes that is the whole thing. Depending on how old your version of mIRC is it should work just fine.

 Respond  
GoldFish   -  Jul 20, 2011

@napa is that the whole thing? When I tried that it wasn't working properly for me
@Jethro_ sorry, I didn't search hawkee to see if someone already posted something like this. If theirs is better, I guess I can delete this. If you're saying I copied this, though, I didn't. I don't even see the point of stealing a script as simple as this since I wouldn't get any praise for it...Yes, I posted this so other people could use it, but most people here are better at mSL than I am anyway, so they could make it themselves. The only other reason people post their scripts here is because they are proud of them, and I wouldn't be proud of something I didn't do...

 Respond  
Jethro   -  Jul 20, 2011

This snippet looks strikingly like a re-post of what had been submitted before.

 Respond  
napa182   -  Jul 20, 2011

nice work. you can also do it like this as well
working example only:

alias reverse return $regsubex($1-,/(.)/g,$mid(\A,-\n,1))

//echo $reverse(hello to you)
uoy ot olleh

 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.