Page 1 of 1

Stopping waypoint: Target aquired before moving

Posted: Tue Aug 09, 2011 8:56 am
by Se7en
As topic says this is the message i get when trying to farm tp around sardo castle. Just keep typing this and dounst run or attack anything. Any ideas to what the problem might be? I dont get this error while running around fireboot outpost. Just down at sardo.

Bot says:
Stopping waypoint: Target aquired before moving
Moving to waypoint
Stopping waypoint: Target aquired before moving
Moving to wayoint

and so on...

Re: Stopping waypoint: Target aquired before moving

Posted: Tue Aug 09, 2011 9:06 am
by rock5
Is it posible it is seeing a target that it can't attack, such as one behind a wall or something? If so you might have to reduce MAX_TARGET_DIST in those areas. Although, that doesn't sound like the right messages you would get so I could be wrong.

Re: Stopping waypoint: Target aquired before moving

Posted: Tue Aug 09, 2011 9:19 am
by lisa
It's the invisible "hiden" mob I've mentioned before, add it to friend list in your profile.

Re: Stopping waypoint: Target aquired before moving

Posted: Mon Dec 31, 2012 4:50 am
by silinky
ok, i am sorry to revive this thread, but the search threw this one out and didn't think i need to create a topic with the same issue.
the problem is, that i have a card farming script, that is scanning for a specific mob in a certain radius, with this code:

Code: Select all

local mob = player:findEnemy(false, "Mob ID here")
it is successful, but in the script i also inserted a command, to go back to the initial place, if all mobs with that ID are killed.
this also would work, but only if no other mobs around (with different ID's)
when there is any other mob around, it just stays in place, spamming the message in the screenshot, with blue, and writing also my message in white which means that the script works ok, it just does not move to the initial place.
the waypoint type is "TRAVEL"
can anyone clue me in as to where is the problem?

(also, i had to edit player:findEnemy() function in classes.lua, because it kept finding the dead mob after i looted it and before it disappeared. this wasted time. could you include a life check in the next revision? if not, can you tell me how to non destructively tell the function only to target live mob?)

thanks

Re: Stopping waypoint: Target aquired before moving

Posted: Mon Dec 31, 2012 5:06 am
by rock5
I think we would need to see your code to figure out what is happening.

Re: Stopping waypoint: Target aquired before moving

Posted: Mon Dec 31, 2012 6:20 am
by silinky
sure, no problem :)
here it is.
if you spot things that could use some optimization feel free to post it, thx

Code: Select all

startGMDetect()
	
	local farmmob = 105486
	local farmmobselected = nil
	local huntingradius = nil
	changeProfileOption("MAX_TARGET_DIST", 250)
	
	local playerAddress
	local starterX = 0
	local starterY = 0
	local starterZ = 0
	
	function lootBags()
		local _bag = player:findNearestNameOrId("Mysterious Bag")
		if _bag then
			printf("BAG FOUND... LOOTING\n");
			local _dist = distance(player.X,player.Z,_bag.X,_bag.Z)
			player:target(_bag.Address);
			player:target_Object(_bag.Id,nil,true,true)
			yrest(1000)
			player:target_Object(_bag.Id,nil,true,true)
			yrest(1000)
	   end
	end
	
	playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
		starterX = memoryReadFloat(getProc(), playerAddress + addresses.pawnX_offset) or starterX
		starterY = memoryReadFloat(getProc(), playerAddress + addresses.pawnY_offset) or starterY
		starterZ = memoryReadFloat(getProc(), playerAddress + addresses.pawnZ_offset) or starterZ

	-- changeOptionFriendMob("mob", farmmob, "Add")
	changeProfileOption("HARVEST_DISTANCE", 80)
	changeProfileOption("COMBAT_RANGED_PULL", true)
	changeProfileOption("QUICK_TURN",true)
	changeProfileOption("MAX_FIGHT_TIME",15)
	changeProfileOption("TARGET_LEVELDIF_BELOW", 70)
	changeProfileOption("TARGET_LEVELDIF_ABOVE", 5)
	changeProfileOption("COMBAT_DISTANCE", 50)
	changeProfileOption("ANTI_KS", false)
	changeProfileOption("WAYPOINT_DEVIATION", 0)
	changeProfileOption("AUTO_ELITE_FACTOR", 99999999)
	
	settings.profile.events.onLeaveCombat = function()
		lootBags()
	end
				
	
	setwindow("Card - " .. farmmob)
	
	function run(speed)
		RunningSpeed = speed
		local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
		if playerAddress ~= 0 then
			memoryWriteFloat(getProc(), playerAddress + 0x40, RunningSpeed);
			printf("------------------------------\nCurrent speed is set to "..RunningSpeed..".\n------------------------------\n");
		end
	end

	function mobWait(_waitTime)
		local starttime = os.clock()
		repeat
			yrest(500)
			printf("Scanning for ".. farmmob ..".\n");
			if farmmob ~= "undefined" then farmmobselected = farmmob end
			local mob = player:findEnemy(false, farmmobselected)

			if not mob then
				printf("No ".. farmmob .." nearby.\n")
				lootBags()
				player:lootAll()
				if (distance(player.X,player.Z,starterX,starterZ) > 100) then
					printf("Moving home.\n")
					player:moveTo(CWaypoint(starterX, starterZ, starterY))
				end
				break
			end
			
			if (huntingradius ~= nil) and (distance(player.X,player.Z,starterX,starterZ) > huntingradius) then
				printf("We're far enough now, moving home.\n")
				player:moveTo(CWaypoint(starterX, starterZ, starterY))
				break
			end
			
			if mob then
				printf(farmmob .. " found, engaging...\n");
				player:target(mob)
				player:update()
				player:fight()
				player:loot()
				CleanBag(3000, 2)
				run(65)
				break				
			end
			
		until os.clock() - starttime > _waitTime
	end
	
	function unStick3()
		player:moveTo(CWaypoint(starterX, starterZ, starterY))
	end
	
	while (true) do
		mobWait(1)
	end
also, could you provide me a solution for the bot not to clear targets all the time? (after fight and loot, it cleares target 2 times, with 1 second interval, and wastes time. not a problem, just a nuisance)

Re: Stopping waypoint: Target aquired before moving

Posted: Mon Dec 31, 2012 6:28 am
by rock5
The player:moveTo function looks for mobs while moving unless you use 'true' as a second argument. eg.

Code: Select all

player:moveTo(CWaypoint(starterX, starterZ, starterY), true)

Re: Stopping waypoint: Target aquired before moving

Posted: Mon Dec 31, 2012 6:40 am
by silinky
wow thanks, i didn't know that :)