Thread: [Essentials script] Password Gift
View Single Post
  #6    
Old March 4th, 2012, 08:25 AM
Ho-oh 112's Avatar
Ho-oh 112
Advance Scripter
 
Join Date: Feb 2011
Age: 18
Gender: Male
Nature: Hasty
Quote:
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:
Code:
$SecretKey = "some crazy text"
Encrypt method will be something like this:
Code:
def Encrypt(pokemon,switch)
   return  Zlib::Inflate.inflate(Zlib::Inflate.inflate(pokemon+"|"+switch)+$SecretKey)
end
And Decrypt mothod
Code:
def Decrypt(pass)
  arg = (Zlib::Deflate.deflate(Zlib::Deflate.deflate(pass).gsub($SecretKey, ""))).split("|")
  @pokemon = arg[0]
  @switch = arg[1]
  #Do something
end
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:
http://www.pokecommunity.com/showthr...62#post7077162

RMXP Poke-Essentials Mystery Gift Link:
http://www.pokecommunity.com/showthread.php?t=270687

RMXP Poke-Essentials Award System Link:
http://www.pokecommunity.com/showthread.php?p=7111566
Reply With Quote