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;
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.
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.