JackBlonder wrote:I'm trying to use the GUID now to get the target of the partyleader.
This works as iit should. The botted partymember has the right target know.
BUT, what drives me crazy now, it never attacks it...it just stands there.
Here's my code. Maybe someone has a good idea.
[Edit] got it to work now (but only if partyleader is not botted)Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints> <onLoad> local maxBattleDistToLeader = 25 --Change to your needs local maxDistToLeader = 100 --Change to your needs (for example if you want use lootBodies) local partymember={} local partymemberName={} local partymemberObj={} local partyleaderIndex local partyleader local partyleaderName local partyleaderObj local noofpartymembers local i settings.profile.options.AUTO_TARGET = false --printf("AUTO_TARGET: %s\n",settings.profile.options.AUTO_TARGET) settings.profile.options.DEBUG_TARGET = true --printf("DEBUG_TARGET: %s\n",settings.profile.options.DEBUG_TARGET) settings.profile.options.ANTI_KS = false --******************************************************** --get all partymembers --******************************************************** if RoMScript("UnitExists('party1')") then partyleaderIndex = RoMScript("GetPartyLeaderIndex()") if partyleaderIndex~=nil then printf("Found partyleaderIndex: %d \n",partyleaderIndex) partyleaderName = RoMScript("UnitName('party"..partyleaderIndex.."')") printf("Partyleader: %s \n",partyleaderName) partyleaderObj = player:findNearestNameOrId(partyleaderName) partyleader = CPawn(partyleaderObj.Address) end table.insert(partymemberName, RoMScript("UnitName('player')")) i = 1 while not(i >= 7 ) do if RoMScript("UnitIsPlayer('party"..i.."');") then table.insert(partymemberName,i+1, RoMScript("UnitName('party"..i.."')")) end i = i + 1 end --show table for i,v in ipairs(partymemberName) do print(i,v) end noofpartymembers = #partymemberName --print(noofpartymembers) for i,v in ipairs(partymemberName) do table.insert(partymemberObj,i,player:findNearestNameOrId(partymemberName[i])) table.insert(partymember,i,CPawn(partymemberObj[i].Address)) end --****DEBUGGING --for i,v in ipairs(partymemberObj) do print(i,v) end --for i,v in ipairs(partymember) do print(i,v) end --************* end --******************************************************************** function getTargetGUID(_target) local GUID_offset = 0x20 GUID = memoryReadInt( getProc(), _target+GUID_offset); GUID = GUID or 0 return GUID end function findEnemyByGUID(_GUID) local obj = nil; local objGUID; local objectList = CObjectList(); objectList:update(); for i = 0,objectList:size() do obj = objectList:getObject(i); if obj ~= nil then --printf("_GUID: %d\n",_GUID) objGUID = getTargetGUID(obj.Address) --printf("objGUID: %d\n",objGUID) if _GUID == objGUID then return obj.Address end end end return nil; end --******************************************************** --Main loop --******************************************************** while(true) do local leaderTargetGUID local playerTargetGUID player:update() partyleader:update() if partyleader.TargetPtr~=0 then leaderTargetGUID = getTargetGUID(partyleader.TargetPtr) --printf("leaderTargetGUID: %d\n",leaderTargetGUID) end if player.Battling then --printf("Party battling\n") player:target( findEnemyByGUID(leaderTargetGUID)) if player.TargetPtr ~= nil then --printf("player.TargetPtr: %d\n",player.TargetPtr) --printf("playerTargetGUID: %d\n",getTargetGUID(player.TargetPtr)) --player:update() --player:getTarget() player:fight() yrest(500) end end RoMScript("FollowUnit('party"..partyleaderIndex.."');"); yrest(1000) end </onLoad> </waypoints>
how i can apply this in butterfly daily quest... i mean i doing daily quest with my alt.. as of now i doing butterfly quest with my alts and open micromacro each... but my problem is my main just doing his quest.. dont help my alt in killing when my main is out of range.... it is possible my main and my alts keep in the range.. if my main is a head he suddenly pause and wait for my alt to keep my alts and main in the range?/