Page 1 of 1

Changing Class Stops Bot

Posted: Sat Jun 08, 2013 11:32 pm
by McGuffin
This is weird. Just started happening yesterday, got around to rebooting the system today and it persists.

Here is the problem, the code below is part of the beginning of my dailies. It gets my character to the daily location. But first, it changes to the class I want to run the dailies on. It leaves the house in Lower East and is supposed to travel via snoops to another map. Problem is when it gets to Varanas Bridge it just sits there. If I leave the bot running and port back to Lower East the bot then continues as though it just arrived on the bridge. So now for the weird. If I remove the class change portion and change class manually before starting the bot, it runs flawlessly. The code below is the portion that is hanging. It should take you to Varanas Snoop but it just sits on the bride.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
	<!-- #  1 --><waypoint x="0" z="2" y="0">
        player:target_NPC("Housekeeper");
        ChoiceOptionByName("Change class");
        yrest(500);
        player:update();
        player:target_NPC("Housekeeper");
        ChoiceOptionByName("Leave the house");
        waitForLoadingScreen(); 
        player:update();
        player:mount();
        yrest(3000);
	</waypoint>
	<!-- #  2 --><waypoint x="4726" z="416" y="77">	</waypoint>
	<!-- #  3 --><waypoint x="4392" z="174" y="78">	</waypoint>
	<!-- #  4 --><waypoint x="4471" z="-35" y="77">
        player:target_NPC("Dieve");
        ChoiceOptionByName("I want to transport to Varanas Gates");
        waitForLoadingScreen(); 
        player:update();
        yrest(500);
	</waypoint>
	<!-- #  5 --><waypoint x="2336" z="1139" y="28">
    error("Finished",0)
	</waypoint>
</waypoints>

Re: Changing Class Stops Bot

Posted: Sun Jun 09, 2013 1:59 am
by rock5
I ran it a couple of times, it worked both times.

It was probably just a timing glitch of some sort. I suggest you add a time limit to waitForLoadingScreen.

Re: Changing Class Stops Bot

Posted: Sun Jun 09, 2013 2:20 am
by McGuffin
Changed to

Code: Select all

waitForLoadingScreen(2000);
and it worked perfectly. Thx.

Re: Changing Class Stops Bot

Posted: Sun Jun 09, 2013 2:29 am
by rock5
waitForLoadingScreen takes seconds so if it gets stuck then you will be waiting about 33m. Usually you want about 30s just to be sure. The time limit applies to only the time it waits for the loading screen to appear. Once the loading screen appears it switches to waiting for it to disappear which is not effected by the limit.

Re: Changing Class Stops Bot

Posted: Sun Jun 09, 2013 3:41 am
by McGuffin
Checked it while running two other clients and bots. May have forced an unintentional wait because of that. Normally this runs as a solo client/bot to get the morning trash stuff done. Will change it to (2) and see if that works when it runs by itself.

Just not sure why it works if the bot does not change class, but fails if the bot does change class. When it "fails" it just does not realize it went anywhere, it does not kick out a message saying there was no loading screen, it just sits there. If I then manually port somewhere, then it sees the loading screen and continues the WP file.

Re: Changing Class Stops Bot

Posted: Sun Jun 09, 2013 5:10 am
by rock5
I can think of no reason why it would fail only if you change class.

What I think is happening is when it does the ChoiceOptionByName it starts relogging too fast ans some RoMScript in that function failed to get a response before it started to relog. This has been known to happen. So the RoMScript doesn't return control until the teleport has finished. Then the function ends and it does your waitForLoadingScreen at which point it gets stuck. So adding a time limit to waitForLoadingScreen should work.

So for instance if you set it to (2) and the loading screen doesn't appear in 2 seconds then it will continue.

Re: Changing Class Stops Bot

Posted: Sun Jun 09, 2013 8:13 am
by McGuffin
Just did another test, this time I added a 5 second rest after the class change and kept the original waitForLoadingScreen();, it worked just fine. So I guess there is something going on with that ChoiceOptionByName that take a tick or two to work through.

ETA: Made a mistake and did not take out the (2), was looking at a different waitForLoadingScreen();. It failed with the 5 second rest after changing class so I used waitForLoadingScreen(2); and it worked. It did give the error that no loading screen appeared.