PixelBot Code Collection LUA / Java / X menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PixelBot Code Collection LUA / Java / X

    Hi, since there are a few private coders here i want to share some of my work and in best case, get some useful informations back.

    Lets start with my latest development:

    Check if Target is inFight - Code:LUA - Class:Hunter
    Code:
    function EnemyIsAlreadyInfight()
    
    local affectingCombat = UnitAffectingCombat("target");
    if affectingCombat == true then
       
        --If Enemy is already Infight, turn Pixel red
        NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(1,0,0)
        
        --Check if he might be infight with me or my pet
        if ( UnitIsUnit("targettarget", "player") ) then 
        NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(0,1,0)
        end;
    
        if ( UnitIsUnit("targettarget", "pet") ) then 
        NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(0,1,0)
        end;
        
    else
    
    --not inFight
    NewAddon.Frame_EnemyIsAlreadyInfight.texture:SetColorTexture(0,1,0)
    end
    end

    Check if the Mob is Skinnable - Code:LUA - Class: Every
    I really got mad on this but the solution was simple. Already implemented ocr reading but got this one.
    Code:
    function isSkinnable()
    
    local isDead = UnitIsDead("mouseover")
    local count = GameTooltip:NumLines();
    if count == 3 and isDead == true then
    NewAddon.Frame_IsSkinnable.texture:SetColorTexture(0,1,0)
    else
    NewAddon.Frame_IsSkinnable.texture:SetColorTexture(1,0,0)
    end
    
    end
    Check if you are drowning - Code:LUA - Class: Every
    Code:
    function breath()
    
    local value = GetMirrorTimerProgress("BREATH")
    local seconds = value/1000
    if seconds < 30 then
    NewAddon.Frame_Breath.texture:SetColorTexture(1, 0, 0, alphaColor)
    else
    NewAddon.Frame_Breath.texture:SetColorTexture(0, 1, 0, alphaColor)
    end
    end
    If someone is intersted in more details, PM me. Please note i will not guide how to code more, just exchange knowledge and talk about improofements or why my code sucks

    Im not really into code formatting, so maybe someone knows a good structure for this kind of collection?
    Last edited by Kwapuzzi; 09-29-2019 at 11:13 AM.

    PixelBot Code Collection LUA / Java / X
  2. #2
    devops's Avatar Member
    Reputation
    1
    Join Date
    Apr 2017
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    which lua unlocker can be use in classic

  3. #3
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no need for a lua unlocker!

  4. #4
    Cashless's Avatar Member
    Reputation
    3
    Join Date
    Oct 2018
    Posts
    17
    Thanks G/R
    9/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any idea for a unstucking feature?

  5. #5
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My Java Solution (not perfect, but working) Also only snippets. I think you get the idea.


    Code:
    long stuck_timer = System.currentTimeMillis() + 5000;
    Position savedPosition1 = new Position(f1, f1);
    Position savedPosition2 = new Position(f1, f1);
    
    if (i % 2 == 0) {
                            try
                            {
                                savedPosition1 = c.getcords();
                            } catch (AWTException | IOException | InterruptedException e)
                            {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                        }
                        else
                        {
                            try
                            {
                                savedPosition2 = c.getcords();
                            } catch (AWTException | IOException | InterruptedException e)
                            {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                            
                        }
    
    System.out.println("Stucktimer Triggered - check for same coords");
    
            if ((savedPosition1.x == savedPosition2.x) && savedPosition1.y == savedPosition2.y){
    unstuck() //here your unstuck method.
    
    }
    
    I have made random 1,2 
    
    1 = turn left 
    2 = turn right
    Last edited by Kwapuzzi; 10-11-2019 at 03:29 PM.

  6. #6
    devops's Avatar Member
    Reputation
    1
    Join Date
    Apr 2017
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Kwapuzzi View Post
    My Java Solution (not perfect, but working) Also only snippets. I think you get the idea.


    Code:
    long stuck_timer = System.currentTimeMillis() + 5000;
    Position savedPosition1 = new Position(f1, f1);
    Position savedPosition2 = new Position(f1, f1);
    
    if (i % 2 == 0) {
                            try
                            {
                                savedPosition1 = c.getcords();
                            } catch (AWTException | IOException | InterruptedException e)
                            {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                        }
                        else
                        {
                            try
                            {
                                savedPosition2 = c.getcords();
                            } catch (AWTException | IOException | InterruptedException e)
                            {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                            
                        }
    
    System.out.println("Stucktimer Triggered - check for same coords");
    
            if ((savedPosition1.x == savedPosition2.x) && savedPosition1.y == savedPosition2.y){
    unstuck() //here your unstuck method.
    
    }
    
    I have made random 1,2 
    
    1 = turn left 
    2 = turn right
    how to getcords in java ? need some wow plugin to show x,y in interface ?

  7. #7
    chiem's Avatar Contributor
    Reputation
    137
    Join Date
    Sep 2007
    Posts
    506
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No offense but there's no context what frameworks your code is using and what the addon itself does. API documentation would be helpful if you really want a community effort in this.
    Character Level: 63
    Goal: 80

  8. #8
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WoW Addons are always in Lua, everything is well documented here:

    Category:World of Warcraft API | WoWWiki | FANDOM powered by Wikia

    There rest are some pure java ideas, no more. I dont think there will be an API documentation for snippets in here. This is mostly for the few people coding in their own. The idea is always the same, if you write it in c#, .net or java. If you need help on anything, just let me know and i will try my best to explain.

  9. #9
    chiem's Avatar Contributor
    Reputation
    137
    Join Date
    Sep 2007
    Posts
    506
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let's set up a github repo for this? That way we can make active contributions to it and actually have more context with the packages and code.

    c.getCords() doesn't really tell us much. We'd need to know if there's an underlying addon being utilized, or if there's some sort of memory reading going on here.
    Character Level: 63
    Goal: 80

  10. #10
    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 devops View Post
    how to getcords in java ? need some wow plugin to show x,y in interface ?
    You get the coordinates by showing them in the game through the API.

    Code:
    posX, posY = GetPlayerMapPosition("player")
    And then you show the coordinates as colored boxes instead of numbers. (Or you can use OCR)

    Once that's done, you read the pixel color and determine the numbers out of that.
    Last edited by stonebent; 10-13-2019 at 05:31 PM.

  11. #11
    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)
    How are you handling turning? Im finding using my script to push down turn key and checking if the character has turned enough to be not be accurate enough. Also calculating the time to have the key pressed is not that much more accurate. Havent looked into using the mouse to turn yet.

    Im using python if it makes any difference.

  12. #12
    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 someorother View Post
    How are you handling turning? Im finding using my script to push down turn key and checking if the character has turned enough to be not be accurate enough. Also calculating the time to have the key pressed is not that much more accurate. Havent looked into using the mouse to turn yet.

    Im using python if it makes any difference.
    I'm currently using the mouse to turn, finding it much more responsive and fast.

  13. #13
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    180 Degree is exactly one second of pressing A or D you can simply calculate and write a function. for example

    Java
    deg is turning degree, r is java robot
    Code:
        public void rotateRightExact(int deg) {
            float secs =(float) 1 / 180;
            r.keyPress(KeyEvent.VK_D);
            r.delay((int) ((int) ((secs*deg)*1000)));
            r.keyRelease(KeyEvent.VK_D);
        }

  14. #14
    Kwapuzzi's Avatar Member
    Reputation
    12
    Join Date
    Apr 2007
    Posts
    62
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stonebent View Post
    I'm currently using the mouse to turn, finding it much more responsive and fast.
    I have also thought about just using the mouse, the problems is the turning speed was not controllable. if you move too fast you are spinning like a rollercoaster =)

    Maybe you can show us your solution.

  15. #15
    Cashless's Avatar Member
    Reputation
    3
    Join Date
    Oct 2018
    Posts
    17
    Thanks G/R
    9/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Atm I have a lot of waypoints for my pathfinding. The bot is running with WASD. Go to a point -> rotate with AD and go to the next point with W.
    That looks just like a robot.
    Thought about interpolate the points and turning while running. But I have no clue how to deal with that

Page 1 of 2 12 LastLast

Similar Threads

  1. [Selling] Private pixelbot coding service - Best security!
    By kihan112 in forum Overwatch Buy Sell Trade
    Replies: 4
    Last Post: 01-08-2017, 11:09 PM
  2. [Help] Need someone to test a lua code
    By dude891 in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-12-2008, 09:59 PM
  3. [lua help] I need you guys to see if i missed somthing in the code please
    By runiker in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 03-09-2008, 08:19 AM
  4. question->lua mob code.
    By secretdragon008 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 02-13-2008, 03:13 PM
  5. [Collection]Mountain climber codes & download links
    By aasi888 in forum World of Warcraft Bots and Programs
    Replies: 3
    Last Post: 08-03-2007, 02:04 AM
All times are GMT -5. The time now is 06:15 AM. 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