Page 1 of 1

Problem with waypoint

Posted: Wed Aug 01, 2012 6:59 am
by metralla123
Hi buddies, I have a problem with a part of a waypoint, took 3 days trying to solve it but without success.

Code: Select all

<waypoint x="3075" z="2710" y="250">EventMonitorStart("loteado","WARNING_MESSAGE"); 
   local target = player:getTarget();</waypoint>
        <waypoint x="3015" z="2742" y="248"> if player:target_Object(113137,7000,false,false) then
     printf("Loteando\n");
     repeat
       local time, moretocome, msg = EventMonitorCheck("loteado","1")
      if msg ~= nil then
           if string.find(msg, "You have already opened this treasure chest") then
              cprintf(cli.red, "Siguiente\n");
             __WPL:setWaypointIndex(__WPL:findWaypointTag("1cofre"));
	EventMonitorStop("loteado");
        break;
	end
      end
until true
      end			
</waypoint>
	<waypoint x="2960" z="2934" y="248">
        player:update();
        sendMacro("LeaveParty();");
        yrest(4000);
        waitForLoadingScreen();sendMacro('InviteByName("Charnamer")');
        __WPL:setWaypointIndex(__WPL:findWaypointTag("comienzo"));
        end 	</waypoint>
        <waypoint x="2960" z="2934" y="248" tag="1cofre"></waypoint>
	<waypoint x="2965" z="3107" y="248"></waypoint>
	<waypoint x="3026" z="3199" y="248"></waypoint>
When the bot not loot the chest and get the warning message is functioning normally but when loot, walk around and break.
Any help? Thanks!!
I use google translator ;)

Re: Problem with waypoint

Posted: Tue Jan 01, 2013 11:04 am
by Rintintin
Where is this and is it for?
in-game coords or name of the ini might behelpful

Re: Problem with waypoint

Posted: Tue Jan 01, 2013 4:15 pm
by lisa

Code: Select all

if player:target_Object(113137,7000,false,false) then
	printf("Loteando\n");
	repeat
		local time, moretocome, msg = EventMonitorCheck("loteado","1")
		if msg ~= nil then
			if string.find(msg, "You have already opened this treasure chest") then
				cprintf(cli.red, "Siguiente\n");
				__WPL:setWaypointIndex(__WPL:findWaypointTag("1cofre"));
				EventMonitorStop("loteado");
				break;
			end
		end
	until true
end
I think the issue might be with the logic of the code, in the repeat all you do is monitor the text, you don't actually try to open the chest again. Also the end of the repeat is just "true" so it will probably stay in the loop forever or until Micromacro errors because of the loop with no yrest(500) in it.

Maybe try something like this.

Code: Select all

if player:target_Object(113137,7000,false,false) then
	printf("Loteando\n");
	repeat
		player:target_Object(113137,7000,false,false)
		yrest(1000)
		local time, moretocome, msg = EventMonitorCheck("loteado","1")
		if msg ~= nil then
			if string.find(msg, "You have already opened this treasure chest") then
				cprintf(cli.red, "Siguiente\n");
				__WPL:setWaypointIndex(__WPL:findWaypointTag("1cofre"));
				EventMonitorStop("loteado");
				break;
			end
		end
	until not player:target_Object(113137,7000,false,false)
end

Re: Problem with waypoint

Posted: Thu Jan 24, 2013 7:47 pm
by ellisdee
Where is this and is it for?
in-game coords or name of the ini might behelpful
Looks like its around one of the 4 chests at the end of Goblins shell run.