Change account after logout

Would it be possible to switch accounts after logout?

I try to create a plugin for auto-academy and wanted to change the acc after I finished 4 chars, is this possible?

1 Like

Your unique solution is execute a new “phbot.exe” with enough command line parameters (account).

1 Like

Thanks, but how would you start the client or connect to the server?

Use subprocess and pass the command line arguments to it.

https://docs.python.org/3.6/library/subprocess.html

http://guide.phbot.org/#commandline

1 Like

Thank you!
I will try that :slight_smile:

1 Like

This is my Solution

def StartNewBot():
	Username="test123"
	Password = "password123"
	Server ="YourSeverName"
	phBot=str(Path(os.path.realpath(__file__)).parents[1])+"\phBot.exe"
	servertyp ="private-server"
	loginServer ="88.99.90.223:15779"
	servername="Velika"
	character ="MyChar"
	subprocess.Popen([phBot, "--locale", servertyp, "--privateserver", Server, "--loginserver", loginServer,"--startbot",
		                  "--username", Username, "--password", Password, "--server", servername, "--character", character])

And after the next Bot started i kill the old one with

def killBot():
	os.kill(os.getpid(),signal.SIGTERM)
1 Like

Does this work? How do you implement it? Plugin?

yes via Plugin

Can you explain the logic of work?
Can you offer it ready for use?

can u explian to do so this plugin and if u have free time can u describe it for me in discord