Creating a Pixel Bot in C# from zero  - "kinda" tutorial menu

User Tag List

Page 4 of 9 FirstFirst 12345678 ... LastLast
Results 46 to 60 of 122
  1. #46
    KKira's Avatar Active Member
    Reputation
    20
    Join Date
    Apr 2019
    Posts
    36
    Thanks G/R
    5/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    Creating a Pixel Bot in C# from zero  - "kinda" tutorial
  2. #47
    stonebent's Avatar Member
    Reputation
    9
    Join Date
    Sep 2008
    Posts
    36
    Thanks G/R
    3/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by KKira View Post
    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.

  3. #48
    KKira's Avatar Active Member
    Reputation
    20
    Join Date
    Apr 2019
    Posts
    36
    Thanks G/R
    5/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #49
    stonebent's Avatar Member
    Reputation
    9
    Join Date
    Sep 2008
    Posts
    36
    Thanks G/R
    3/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by KKira View Post
    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.
    I've created no such bot, you must be mistaking me for someone else.

  5. #50
    Humbleguy's Avatar Active Member
    Reputation
    24
    Join Date
    Dec 2019
    Posts
    27
    Thanks G/R
    6/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kaysonv View Post
    Hey Humbleguy, I have a dumb question here: Do you know how to extract coordinates in battlegrounds? The

    C_Map.GetPlayerMapPosition

    isn't quite working in battlegrounds. Many thanks for any help!
    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.

  6. #51
    Humbleguy's Avatar Active Member
    Reputation
    24
    Join Date
    Dec 2019
    Posts
    27
    Thanks G/R
    6/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Angler23 View Post
    1st, +rep and thanks for the weakaura strings. And this whole tutorial. You put a lot of effort into it, looks great.

    1 concern I have is blizzard seeing everyone using the same weakaura strings, not sure if they are able to detect something like that?

    Would be curious to hear everybody's thoughts.

    Thanks again for the solid tutorial
    Those are just ideas... the safe way is doing ones yourself.

  7. #52
    Humbleguy's Avatar Active Member
    Reputation
    24
    Join Date
    Dec 2019
    Posts
    27
    Thanks G/R
    6/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ganndos View Post
    First of all thank you very much for creating this tutorial. I used this as entry point for creating an own bot and it helped me very much so far.

    Is there a way to get directly the position of an enemy? Or what do you use to move and aim to an enemy?
    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 
    }

  8. #53
    Angler23's Avatar Member Authenticator enabled
    Reputation
    13
    Join Date
    Jan 2019
    Posts
    30
    Thanks G/R
    10/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please don't add this to Github. I agree with you completely on why you have chosen not to

  9. #54
    someorother's Avatar Member
    Reputation
    3
    Join Date
    Oct 2019
    Posts
    12
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  10. #55
    Humbleguy's Avatar Active Member
    Reputation
    24
    Join Date
    Dec 2019
    Posts
    27
    Thanks G/R
    6/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by someorother View Post
    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!
    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.

  11. #56
    someorother's Avatar Member
    Reputation
    3
    Join Date
    Oct 2019
    Posts
    12
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Humbleguy View Post
    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 might end up using that but it frustrates me if I dont manage to debug this and quit.

    Still struggling with this and any help is appreciated!

  12. #57
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  13. #58
    stonebent's Avatar Member
    Reputation
    9
    Join Date
    Sep 2008
    Posts
    36
    Thanks G/R
    3/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    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?
    Instead of having actual color codes, use a texture along with SetTexCoord.
    It does the trick.

  14. Thanks hjalplos (1 members gave Thanks to stonebent for this useful post)
  15. #59
    FearThree's Avatar Member
    Reputation
    5
    Join Date
    Dec 2019
    Posts
    20
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone have an idea on how to navigate to a enemy/target location for looting?

  16. #60
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by FearThree View Post
    Does anyone have an idea on how to navigate to a enemy/target location for looting?
    Use binds? Target Last Enemy -> Interract with Target (need to have ctm on) ez

Page 4 of 9 FirstFirst 12345678 ... LastLast

Similar Threads

  1. [Question] Has anyone ever made an entire farming-bot with much much pixel-reading in AutoIt?
    By crunk001 in forum WoW Bots Questions & Requests
    Replies: 18
    Last Post: 02-05-2017, 06:34 AM
  2. Gold from botting in MOP
    By 403Forbidden in forum WoW Bots Questions & Requests
    Replies: 3
    Last Post: 01-16-2013, 06:49 AM
  3. Replies: 0
    Last Post: 09-09-2012, 06:38 AM
  4. Replies: 4
    Last Post: 04-18-2010, 12:47 PM
  5. Botting in Barrens 12-20
    By karokekid in forum World of Warcraft Bots and Programs
    Replies: 20
    Last Post: 12-02-2006, 07:21 PM
All times are GMT -5. The time now is 01:59 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search