You mentioned PVP bg bot, how do you get unit position with pixels since API UnitPosition - Wowpedia - Your wiki guide to the World of Warcraft does not work in instanced areas at all.
You mentioned PVP bg bot, how do you get unit position with pixels since API UnitPosition - Wowpedia - Your wiki guide to the World of Warcraft does not work in instanced areas at all.
I don't have access to classic right now so I don't know if it will work, but you could try this - API GetPlayerMapPosition | WoWWiki | Fandom
Another, but more complicated way is to locate the player arrow on the map itself and evaluate the coordinates with some calculations from there.
You could change the player arrow to a green dot or something to make it more recognizable. Also, make the map smaller so that it can be visible at all times.
Ok, so for clarity your BG pvp bot does not navigate or move? what does it do then.
But thanks will check that method out.
Unfortunately API functions do not return coordinates at battelground. You would need to use a differente navigation system, or even "blind" playing.
Blind playing would be possible in Warsong Gulch, as long as you stay only in the middle....
Your "friends" then would be: tab targeting, checking spell distance range, and auto-targeting when you are attacked. Pet classes could also use assist pet to help, and spells like health funnel, or drain life will also help.
Another alternative would be scanning minimap or big map to get your location.
You could also use a kind of "intertial" navigation, the same one that North Korea missiles use to navigate without a GPS or Satellite.... then you know that you rotate 90degrees per second pressing A and D keys, and you move at 100 yards per second. Using trigonometry you might have some idea of where you are. Those are only ideas... i have no PVP bot.
You never know where enemies are. No enemy coordinates. Your tools to deal with it are:
- Tab-Targeting mobs in front of you. Use a macro: "/cleartarget /targetenemy". That will focus the nearest mob in a cone in front of you.
- You automatically targets any mob that attacks you.
- You can estimate mob distance using spell-in-range API check. Some classes have various spells (melee, ranged, intermediate range).
- Use the "interact with target" wow interface key binding + "click to move".
For melee classes, use a loop with "interact with target" until you get into melee range:
Code:WHILE not in melee range: { /cleartarget /targetenemy interact with target }
Please don't add this to Github. I agree with you completely on why you have chosen not to
I'm struggling with my addon that converts the position of the player into the pixels. It works fine most of the time but occasionally it messes up x or y coordinate and this really messes up my pathing. It appears that x and y coordinates get somehow mixed and are shown in the wrong pixel although I'm not sure if this is the case. My code for the addon is below. Its a mess as I'm new to this. This has proven really difficult for me to debug and any help is appreciated!
Code:message('Hello World2!') local CoordsEtc_UpdateInterval = 0.07 local timeSinceLastUpdate = 0 local CoordsEtc_position local CoordsEtc_mapID local CoordsEtc_eventFrame = CreateFrame("Frame") CoordsEtc_eventFrame:RegisterEvent("ADDON_LOADED") CoordsEtc_eventFrame:SetScript("OnEvent", function(self,event,...) self[event](self,event,...) end) local suunta_frame = CreateFrame("Frame", "suuntaframe", UIParent) suunta_frame:SetPoint("TOP"); suunta_frame:SetWidth(20); suunta_frame:SetHeight(20); local suunta_tex = suunta_frame:CreateTexture("ARTWORK"); suunta_tex:SetAllPoints(true); suunta_tex:SetAlpha(1); local posx_frame = CreateFrame("Frame", "posxframe", UIParent) posx_frame:SetPoint("TOP", 20, 0); posx_frame:SetWidth(20); posx_frame:SetHeight(20); local posx_tex = posx_frame:CreateTexture("ARTWORK"); posx_tex:SetAllPoints(true); posx_tex:SetAlpha(1); local posy_frame = CreateFrame("Frame", "posyframe", UIParent) posy_frame:SetPoint("TOP", 40, 0); posy_frame:SetWidth(20); posy_frame:SetHeight(20); local posy_tex = posy_frame:CreateTexture("ARTWORK"); posy_tex:SetAllPoints(true); posy_tex:SetAlpha(1); function CoordsEtc_UpdateCoordinates() -- CoordsEtc_mapID = C_Map.GetBestMapForUnit("player") CoordsEtc_position = C_Map.GetPlayerMapPosition(mapID,"player") contId, worldpos = C_Map.GetWorldPosFromMapPos(mapID,CoordsEtc_position) suunta = GetPlayerFacing() local x1, xx = math.modf(abs(worldpos.x) / 10) local x2, x3 = math.modf(xx * 255) local y1, yy = math.modf(abs(worldpos.y) / 10) local y2, y3 = math.modf(yy * 255) local r1, rr = math.modf(suunta * 20) local r2, r3 = math.modf(rr * 255) suunta_tex:SetColorTexture(r1/255, r2/255, r3, 1); posx_tex:SetColorTexture(x1/255, x2/255, x3, 1); posy_tex:SetColorTexture(y1/255, y2/255, y3, 1); end function CoordsEtc_OnUpdate(self, elapsed) timeSinceLastUpdate = timeSinceLastUpdate + elapsed if (timeSinceLastUpdate > CoordsEtc_UpdateInterval) then -- Update the update time timeSinceLastUpdate = 0 CoordsEtc_UpdateCoordinates() end end function CoordsEtc_eventFrame:ADDON_LOADED() if (not CoordinatesDB) then CoordinatesDB = {} CoordinatesDB["worldmap"] = true CoordinatesDB["minimap"] = true end mapID = C_Map.GetBestMapForUnit("player") CoordsEtc_eventFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") CoordsEtc_eventFrame:RegisterEvent("ZONE_CHANGED_INDOORS") CoordsEtc_eventFrame:RegisterEvent("ZONE_CHANGED") CoordsEtc_eventFrame:SetScript("OnUpdate", function(self, elapsed) CoordsEtc_OnUpdate(self, elapsed) end) end function CoordsEtc_eventFrame:ZONE_CHANGED_NEW_AREA() mapID = C_Map.GetBestMapForUnit("player") --CoordsEtc_UpdateCoordinates() end function CoordsEtc_eventFrame:ZONE_CHANGED_INDOORS() mapID = C_Map.GetBestMapForUnit("player") --CoordsEtc_UpdateCoordinates() end function CoordsEtc_eventFrame:ZONE_CHANGED() mapID = C_Map.GetBestMapForUnit("player") --CoordsEtc_UpdateCoordinates() end SLASH_TEST1 = "/test1" SlashCmdList["TEST"] = function(msg) print(CoordsEtc_position.x) print(CoordsEtc_position.y) print(suunta) print(worldpos.x) print(worldpos.y) end
Last edited by someorother; 01-27-2020 at 11:09 AM.
I created my bot with WeakAura addon, I think its somewhat easier do test and implement than a standalone addon. WHy dont you give it a try?
At the first page of this post you can find the import strings.
256 color variation is not enough to precise coordinates, so I used one component (red) to X integer part, green to X fraction part, and , blue to facing position.
Then another pixel would take red=y integer, green=y fraction, and last spot is free to whatever you need.
I too experience wierd Colors of my standalone LUA addon pixel boxes. Depends on where I am in the world. In Durotar close to Razorhill I can make my X-cord box become a strange color by just moving slightly. If i print out the values they don't change. Just the color of the box for no reason. Blizz have some anti pixel code ? or there are some bugs on their side?
Does anyone have an idea on how to navigate to a enemy/target location for looting?