Page 1 of 1

Logout > Login (same char) + daily counter

Posted: Sat Sep 25, 2010 5:54 am
by caramel
Hi guys,

I am searching a way to log out to the character selection and reconnect on the same one.
Something like that with the relog working :)

Code: Select all

cprintf(cli.red, "\n***Loging out!***\n");
			sendMacro("Logout();");
			yrest(30000);
			cprintf(cli.red, "\n***Reloging!***\n");
			-- RELOG!
			-- Cplayer:new();
			yrest(20000);
And also put a Daily counter, I tried to use this code but it gives me a TIME OUT error.

Code: Select all

RoMScript("Daily_count()");
Thanks in advance for your help,
Caramel.

Re: Logout > Login (same char) + daily counter

Posted: Sat Sep 25, 2010 11:50 pm
by rock5
caramel wrote:Hi guys,

I am searching a way to log out to the character selection and reconnect on the same one.
Something like that with the relog working :)

Code: Select all

cprintf(cli.red, "\n***Loging out!***\n");
			sendMacro("Logout();");
			yrest(30000);
			cprintf(cli.red, "\n***Reloging!***\n");
			-- RELOG!
			-- Cplayer:new();
			yrest(20000);
You could use my auto login script;
http://www.solarstrike.net/phpBB3/viewt ... 350#p10350
Once installed just set;

Code: Select all

fastLoginRelog= true
in the options section. Then when you "Logout()" it will log you back in with the same character.

Also, instead of waiting 30s which may or may not be long enough, you could use my function that waits until the game is ready then immediately returns control. I was thinking of adding it to rombot but no one seems interested.
http://www.solarstrike.net/phpBB3/viewt ... 638#p13638

And I don't think you need player:new() if you are logging in again with the same character.

So it would look something like this.

Code: Select all

cprintf(cli.red, "\n***Loging out!***\n");
			sendMacro("Logout();");
			waitForLoadingScreen();
			cprintf(cli.red, "\n***Resuming script***\n");
caramel wrote:And also put a Daily counter, I tried to use this code but it gives me a TIME OUT error.

Code: Select all

RoMScript("Daily_count()");
I'm not sure why you got a time out error. Maybe it was a 1 off hiccup. I use this;

Code: Select all

repeat DailyCount, DailyPerDay= RoMScript("Daily_count()") until DailyCount ~= nil and DailyPerDay ~= nil
DailysRemaining = DailyPerDay - DailyCount
The repeat loop is just to make sure RoMScript didn't return any nil values which it does occasionally.

Re: Logout > Login (same char) + daily counter

Posted: Sun Sep 26, 2010 5:04 am
by caramel
Thanks rock for the fast and detailed answer.

I'll give you a feedback asap. :-)

Re: Logout > Login (same char) + daily counter

Posted: Sun Sep 26, 2010 5:38 am
by caramel

Code: Select all

repeat DailyCount, DailyPerDay= RoMScript("Daily_count()") until DailyCount ~= nil and DailyPerDay ~= nil
			DailysRemaining = DailyPerDay - DailyCount
	 		cprintf(cli.green, "Dailies remaining : %d\n", DailysRemaining);			
			cprintf(cli.red, "\n***Loging out!***\n");
			sendMacro("Logout();")
			waitForLoadingScreen();
			cprintf(cli.red, "\n***Reloged!***\n");
Works like a charm :twisted:

Thanks you very much rock5.

Re: Logout > Login (same char) + daily counter

Posted: Thu Sep 30, 2010 5:25 am
by miximixi007
rock5 wrote: Also, instead of waiting 30s which may or may not be long enough, you could use my function that waits until the game is ready then immediately returns control. I was thinking of adding it to rombot but no one seems interested.
http://www.solarstrike.net/phpBB3/viewt ... 638#p13638
I back up u.your way is simpler.