Thread: [Essentials Script] Password Gift
View Single Post
Old March 4th, 2012 (8:25 AM).
Ho-oh 112's Avatar
Ho-oh 112 Ho-oh 112 is offline
Advance Scripter
Join Date: Feb 2011
Age: 20
Gender: Male
Nature: Hasty
Posts: 311
Originally Posted by help-14 View Post
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
yeah I knew that, but I was giving him a challenge of finding a method to do so....
(another method is the .pack/.unpack function)
Scripting Level: Advance

RMXP Poke-Essentials MySQL Trading System Link:

RMXP Poke-Essentials Mystery Gift Link:

RMXP Poke-Essentials Award System Link:
Reply With Quote