Jump to content
Sign in to follow this  

[Py] One safebox password per login

Recommended Posts


Today I want to share with all of you a little thing. All times when you are trying to open your safebox, it's requesting the password, isn't it? But for what?
I modified to limit these requests to one input per login. Of course if you warp or change character, you need to retype your password again.
But with extra modifications you can do it to store the password until you close the client, but I don't recommend this.

So, first go to the uiSafeBox.py file and paste this line into the __init__ method of the PasswordDialog class, with taking care of the tabulators:

self.lastPassword = ""

This variable will store your last entered password.

Then replace the Accept method of the same class with this: (take a look for the syntax, modulename, and true/false!)

	def OnAccept(self):
		self.lastPassword = str(self.passwordValue.GetText())
		m2net.SendChatPacket(self.sendMessage + self.lastPassword)
		return True

When you accept the password input dialog, the entered password will be saved, if it's correct if it isn't as well. Don't worry about it, it will be reset if you entered wrong password.

The next step is that to paste these new functions into the same class.

	def InitSafeboxPassword(self):
		self.lastPassword = ""

	def GetSafeboxPwd(self):
		return self.lastPassword

As you can see, here is a function which will reset the entered password ;).
With this, the file is done.

Open interfaceModule.py and serach this line: ## Safebox then paste this function below:

	def InitSafeboxPassword(self):

Then replace the AskSafeboxPassword and AskMallPassword functions with these:

	def AskSafeboxPassword(self):
		if self.wndSafebox.IsShow():

		if self.dlgPassword.IsShow():

		self.dlgPassword.SetSendMessage("/safebox_password ")
		if self.dlgPassword.GetSafeboxPwd() != "":


	def AskMallPassword(self):
		if self.wndMall.IsShow():

		if self.dlgPassword.IsShow():

		self.dlgPassword.SetSendMessage("/mall_password ")
		if self.dlgPassword.GetSafeboxPwd() != "":


With these functions, if the last entered password is correct, the storages will open automatically with the last entered password.
The file is done.

Next, open your game.py and search this function: OnSafeBoxError and extend it with this line:


So, as you can see this is the answer from the server to entered wrong password and this function will reset the last entered password as well :).

That's all, I hope you like it, and have fun.

  • Like 13

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.