Page 1 of 1

waitForLoadingScreen();

Posted: Fri Apr 20, 2012 6:10 pm
by bobdole
I am having big problems with: waitForLoadingScreen(); working, it used to work well but as of late when the character exits instances they are getting stuck on the previous waypoint and perm stuck. The current code I am using is:

Code: Select all

	</waypoint>
	<!-- # 46 --><waypoint x="-150" z="-2206" y="680">
			waitForLoadingScreen(2000);
                       player:update();
			__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
	</waypoint>
Any suggestions would be very helpful.

Re: waitForLoadingScreen();

Posted: Fri Apr 20, 2012 10:32 pm
by BillDoorNZ
do a search for: GoToPortal

and use that in combination with waitForLoadingScreen - also, dont use 2000 (thats 2000 seconds it will wait for a loading screen for - thats why youre getting 'stuck') change it to 10 to 30 - thats usually more than enough.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 12:10 am
by rock5
And make sure the waypoint before entering the portal is far enough that it doesn't enter by mistake. Sometimes if the waypoint is too close and there is a bit of lag, you don't stop in time and end up going through the portal early.

I've been thinking of doing all-in-one functions for going through portals and porting via npc. I'm a bit busy at the moment but I'll try to remember this for later.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 1:40 am
by bobdole
This look right:


Code: Select all

	<!-- # 46 --><waypoint x="-150" z="-2206" y="680">
	waitForLoadingScreen(30);
        if GoToPortal() then
        player:update();
	__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
	</waypoint>

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 8:44 am
by rock5
No that's not right. First you stop outside the portal. Then you GoToPortal() then you waitForLoadingScreen(). And an 'if' statement needs an 'end'. So something like this if you want to use an 'if' statement.

Code: Select all

   <!-- # 46 --><waypoint x="-150" z="-2206" y="680">
   if GoToPortal() then
      waitForLoadingScreen(30);
      player:update();
      __WPL:setWaypointIndex(__WPL:findWaypointTag("first point on other side of portal"));
   else
      error("Can't find portal")
   end
   </waypoint>
Although if the coordinates are correct then the portal will always be there so it's not really worth using an 'if' statement there. Might be worth it on the waitForLoadingScreen to make sure you go through but every time I've used GoToPortal() it's worked. It's very reliable.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 10:19 am
by bobdole
Thanks, I will try that. I am having a hell of time with this code, seems I can sit and watch it and its fine but the moment I walk away it seems to get stuck and auto logout. lol

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 10:25 am
by bobdole
Tried that code and the very 1st attempt it went haywire:

Code: Select all

Moving to waypoint #45, (-123, -2162)
Swimhack DEactivated.
Moving to waypoint #46, (-150, -2206)
Clearing target.
Unsticking player... at position -146,-2200. Trial 1 from maximum 10 trials
Moving to waypoint #46, (-150, -2206)
Player address changed: 0x33C14600
Ranged skill found: SCOUT_VAMPIRE_ARROWS
Unsticking player... at position -146,-2200. Trial 2 from maximum 10 trials
Moving to waypoint #46, (-150, -2206)
Unsticking player... at position -146,-2200. Trial 3 from maximum 10 trials
Moving to waypoint #45, (-123, -2162)
Unsticking player... at position -146,-2200. Trial 4 from maximum 10 trials
Moving to waypoint #45, (-123, -2162)
Unsticking player... at position -146,-2200. Trial 5 from maximum 10 trials

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 10:45 am
by bobdole
Based on your comments about how to use GoToPortal() in your other thread, I am trying something different. Waypoint # 46 was actually in the portal so it would have me just waiting for the waitForLoadingScreen. I have removed that waypoint and moved all the code to the previous way point so now I am entering the portal using GoToPortal():

Code: Select all

	<!-- # 45 --><waypoint x="-123" z="-2162" y="680"> 
        flyoff();
        player:cast("ROGUE_HIDE")
        GoToPortal()
        waitForLoadingScreen(30);
        player:update();
        __WPL:setWaypointIndex(__WPL:findWaypointTag("first point on other side of portal"));
	</waypoint>
I have to ask, what is

Code: Select all

__WPL:setWaypointIndex(__WPL:findWaypointTag("first point on other side of portal")); 
doing in place of

Code: Select all

__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
its working but I just wanted to understand why.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 11:08 am
by rock5

Code: Select all

__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
This sets the next waypoint as the one with tag="start". If your script just continues on the next waypoint then you don't need this line. It's probably worked both ways for you because you don't have either of those tags I'm guessing, so it continues with the next line anyway.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 11:29 am
by bobdole
I have the tag for start and its way above the waypoint I am last using so that's what confused me. So far since removing the one way point everything seems to be going well. My next question is regarding the speed hack. Is there a way to set the speed hack in a waypoint and if so whats the safest speed to use so the character doesn't rubber band?

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 12:51 pm
by bobdole
I found your speedhack userfunction and testing it @ speed(55). Guess if all goes perfect for an hour I will up it to 56 and keep testing.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 1:02 pm
by rock5
bobdole wrote:I found your speedhack userfunction and testing it @ speed(55). Guess if all goes perfect for an hour I will up it to 56 and keep testing.
Someone posted a list of optimal speeds for different situations. The speed they had if you are not using any speed pots etc. was 59. I've been using that for some of my alt scripts with no problem.

Re: waitForLoadingScreen();

Posted: Sat Apr 21, 2012 3:41 pm
by bobdole
So far (knock on wood) since I removed the one waypoint and started using your GoToPortal code from a little further distance, I have not had the character go haywire once!