Page 1 of 1

Problem after switching characters with LoginNextChar();

Posted: Mon Jan 16, 2012 1:10 pm
by squeekthegeek
So I had the idea of changing the last waypoint of the 1-10 levelup thing there.

Code: Select all

	<!-- #22 --><waypoint x="4574" z="-2206">

	printf("We where running for %s seconds.\n", os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time );
	LoginNextChar();
	settings.load ();
	settings.loadProfile ("l1-10");
	yrest (5000);
        loadPaths("1-10Pioneers/l1t_start");	
	 
	</waypoint>
Here's my problem. When the first bot runs the 1-10 waypoints, eveything works perfectly. Now after the second character logs in things start getting messy.

First thing i notice is the <onLoad> works because when the new lvl1 character starts, it opens the gift bag. However, the <onLevelUp> does not seem to work because as soon as the character reaches lvl2, nothing is done(no gift bag open, no leveling skills) it just keeps killing stuff.

Any ideas what might be causing that?

Re: Problem after switching characters with LoginNextChar();

Posted: Mon Jan 16, 2012 9:31 pm
by rock5
This is a known issue. You have to reinitialize the player. I recently added a function that simplifies this for you. Try the following.

Code: Select all

   <!-- #22 --><waypoint x="4574" z="-2206">

   printf("We where running for %s seconds.\n", os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time );
   LoginNextChar();
   loadProfile("l1-10");
   yrest (5000);
        loadPaths("1-10Pioneers/l1t_start");   
    
   </waypoint>
Using the function also makes sure the profile onload section is run again which the old way doesn't do.