Page 1 of 1

Troubles at Goblins

Posted: Mon Apr 22, 2013 7:20 pm
by Niko
Hi...
As you all know, now if you don't pay at goblins you can't open any chest so i had to modify my goblins script to make it talk with the guy inside...

First I tried this

Code: Select all

<!-- #  2 --> <waypoint x="1904" z="2230" y="308" tag="STARTM4">
						player:target_NPC(GetIdName(113094));
						sendMacro("ChoiceOption(1);");
						waitForLoadingScreen();</waypoint>
but of course, i forgot the second confirmation message so i did this...

Code: Select all

<!-- #  2 --> <waypoint x="1904" z="2230" y="308" tag="STARTM4">
						player:target_NPC(GetIdName(113094));
						sendMacro("ChoiceOption(1);"); yrest(500)
						sendMacro("ChoiceOption(1);");
						waitForLoadingScreen();</waypoint>
and, i get inside, but micromacro gets frozen... it simply prints that i'v choosen option nÂș1 and, it just does nothing... i just want it to go to the next point...

Could have anything to do, that i get converted into a goblin? an address change or something? anyway i'm not sure how to fix it...

And another thing... when i get to the end, I open the chest, and my character stays there trying to open it once again for about for or five times... then it justs continues...
this is what i have (i haven't made this script...)

Code: Select all

function getTreasureChest()
		EventMonitorStart("TreasureChest", "PLAYER_BAG_CHANGED")
		local retry_count = 0;
		while(retry_count<7)do
			player:target_Object(113137,7000,nil,true)
			local time, moreToCome, msg = EventMonitorCheck("TreasureChest", "1")
			if msg ~= nil then
				EventMonitorStop("TreasureChest")
				break
			end
			retry_count = retry_count + 1;
		end
		printf("Chest opens. continuing.\n")
	end
Do you guys see anything wrong?

Thank's! and forgive me for my bad english...

Re: Troubles at Goblins

Posted: Mon Apr 22, 2013 8:37 pm
by lisa
my guess would be

Code: Select all

waitForLoadingScreen()
That will wait for ever and ever until you actually get a loading screen, the "load" after starting the event can be very fast and it might even happen before MM starts to look for it.

Try adding in an argument for the maximum time to wait.

Code: Select all

waitForLoadingScreen(5)
that will wait a maximum of 5 seconds if the load screen doesn't appear, if it does appear then it will wait until the loading screen finishes.

Re: Troubles at Goblins

Posted: Tue Apr 23, 2013 6:04 pm
by Niko
Loading screen trouble fixed! Thank's Lisa...

Any idea about the other thing?
Thank's!

----
Edit: Found the mistake... it was in this line

"while(retry_count<7)do"

i changed the 7 for a 2 and now it's quite faster :)