Enhancing the waitforloadinscreen function?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Enhancing the waitforloadinscreen function?

#1 Post by botje »

i was thinking, seeying it gets stuck reguralary for me, would it not be possible to enhace it some more?

was thinking about the line of ...

well, since i saw there is a getzone id function, would it not be possible to dio a while loop checking if zoneid has changed?

because we can get zoneid when we execute the function, we could store it and check if it changed right?

can anybody help me out with this? i suck at lua :)

Botje
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#2 Post by lisa »

reason for the waitforloadingscreen function is while you have a loading screen you can't do any macros as it will error out saying you need to define a macro key.

What is the issue you are having with the function?
Did you know it has a argument for maximum time to wait?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#3 Post by botje »

well, it mostly just stops, so im standing there, without it detecting loading is done.

ofcourse i could use the timeout, but what if i didnt go in instance? then i would load next waypoint, and get in trouble :P

Botje
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#4 Post by lisa »

reason I mention the timer is you can set it to like 10 seconds, usually more then enough time to actually load a new zone and then after that time check zone Id.
By using the time on the function you should be able to reduce the chance of trying to check zone while screen is still loading =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#5 Post by botje »

yes, but i dont know how to check zoneid... :oops:
User avatar
Administrator
Site Admin
Posts: 5344
Joined: Sat Jan 05, 2008 4:21 pm

Re: Enhancing the waitforloadinscreen function?

#6 Post by Administrator »

Code: Select all

/script DEFAULT_CHAT_FRAME:AddMessage(GetZoneID());
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#7 Post by botje »

i see, thanx ^^

and how would i use that in a checking function?

Botje
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#8 Post by lisa »

Code: Select all

local zone = RoMScript("GetZoneID()")
if zone == *** then
blah blah
else 
blah blah
end
obviously change the *** to the zone ID you want and the blah blah to code you want to do if in zone or not.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#9 Post by botje »

i see, thank you very much :)

Botje
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#10 Post by botje »

Code: Select all

local zone = RoMScript("GetZoneID()")

while zone ==  11
keyboardHold( settings.hotkeys.MOVE_FORWARD.key );
keyboardHold( settings.hotkeys.JUMP.key );
yrest(250)
keyboardRelease( settings.hotkeys.MOVE_FORWARD.key );
keyboardRelease( settings.hotkeys.JUMP.key );
waitForLoadingScreen(10);
end

loadPaths("DragonFang/cyclops");
would that work?

Botje
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#11 Post by botje »

nvm, works perfectly :)

hmm, now it doesnt xd

failed to compile and run Lua code...
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#12 Post by botje »

Code: Select all

local zone = RoMScript("GetZoneID()")
		while zone ==  11 do
			local zone = RoMScript("GetZoneID()")
			keyboardHold( settings.hotkeys.MOVE_FORWARD.key );
			yrest(250)
			keyboardRelease( settings.hotkeys.MOVE_FORWARD.key );
			yrest(250)
			waitForLoadingScreen(10);
		end
		
		loadPaths("DragonFang/cyclops");
edit:

now i got this, it enters Cyclops, but doesnt detect the zone change O.o

Botje
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#13 Post by rock5 »

It should be

Code: Select all

while zone == 11 do
I don't see that working anyway. zone is never updated so it wont change value.

Also blindly walking forward is a bit risky. Isn't there any room to place a waypoint at the teleport location? If so, I would do it like this.

Code: Select all

<!-- # 51 --><waypoint x="-32662" z="-14686" y="669">
		player:target_NPC("Kalice");
		sendMacro("ChoiceOption(1);");
		waitForLoadingScreen(10);
	</waypoint>
<!-- # 52 --><waypoint x="-38174" z="-9280" y="1061" tag="again"></waypoint>
<!-- # 52.5 --><waypoint x="xxxxxx" z="xxxxx" y="1061" >
		waitForLoadingScreen(10);
		if RoMScript("GetZoneID()") == 11 then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("again"))
		else
			loadPaths("DragonFang/cyclops");
		end
	</waypoint>
What this does is, after the first teleport, it walks to the teleport waypoint then waits for loading screen. If it doesn't change zone then it goes back to waypoint 52 and walks into the teleport again. It will repeat this until it succeeds. This is safer as it's just walking between 2 waypoints.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#14 Post by botje »

aaah, so thats it xd

thats stupid :P

and thanx, ill make the modifications to get back to previous point :)

Botje
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#15 Post by rock5 »

An idea occured to me this morning, while I was lying in bed, that will improve "waitForLoadingScreen". It's not realy related to your problem but some people have said that their computers were so fast that the function didn't detect the loading screen. In those cases it would get stuck in a loop waiting for a loading screen that's already gone. It occured to me that the player address changes every time it teleports so I could add a check for that aswell. Then it can be sure 100% that it teleported. I'll have to add that to the function.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Enhancing the waitforloadinscreen function?

#16 Post by botje »

well, i think thats precisely my problem, i have a fast quadcore, so i think its just that, way to fast :)

Botje
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#17 Post by rock5 »

ok, in that case I'll add it to my next commit.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhancing the waitforloadinscreen function?

#18 Post by rock5 »

Added to revision 619.

waitForLoadingScreen should now 100% detect when it teleports.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Post Reply