Thread: [Essentials script] Password Gift
View Single Post
Old March 4th, 2012 (08:23 AM).
help-14's Avatar
help-14 help-14 is offline
Join Date: Jul 2007
Location: Viet Nam
Age: 22
Gender: Male
Nature: Adamant
Posts: 281
Send a message via Windows Live Messenger to help-14
Quote originally posted by Ho-oh 112:
Well, this is great as a starter but, for some better scripts you should atleast let people "compile" items/pokemon/eggs without needing pre-defined passwords(a password generator)
That's a really good idea and i think it is possible. First you need a key so no one will able to fake it:
$SecretKey = "some crazy text"
Encrypt method will be something like this:
def Encrypt(pokemon,switch)
   return  Zlib::Inflate.inflate(Zlib::Inflate.inflate(pokemon+"|"+switch)+$SecretKey)
And Decrypt mothod
def Decrypt(pass)
  arg = (Zlib::Deflate.deflate(Zlib::Deflate.deflate(pass).gsub($SecretKey, ""))).split("|")
  @pokemon = arg[0]
  @switch = arg[1]
  #Do something
My Deviantart:
Reply With Quote