Starcraft II:: Automation

This is a discussion on Starcraft II:: Automation within the Starcraft 2 Hacks, bots and tools board part of the Starcraft 2 forum category; After creating the script for auto-injections for Zerg i am interested in automating many other mechanics or functions in the ...

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1. #1
    Darious4's Avatar
    Darious4 is offline Hacker
    Array
    Join Date
    Dec 2016
    Location
    San Francisco, CA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    2
    Reputation
    136

    Lightbulb Starcraft II:: Automation

    After creating the script for auto-injections for Zerg i am interested in automating many other mechanics or functions in the game that would give players an edge. I am looking for any suggestions for functions you would like to be automated in Sc2. This could be anything related to mechanics. I will look into anything you ask to be automated. All automations will be coded in AHK for its simplicity and effectiveness in-game. Thanks




    Example: Auto-"gl hf"
    Code:
    F2::SendInput  {Enter}{h}{i}{Enter}
    Sleep, 2000
    SendInput  {Enter}^{tab}{g}{l}{space}{h}{f}{Enter}
    Sleep, 10
    return





    Example: Jump in and out of Minimap

    Code:
    ^Numpad4::SendInput {Click, 150, 945 0}
    ^Numpad5::SendInput {Click, 990, 405 0}
    
    Last edited by Darious4; 05-23-2017 at 08:28 PM.

  2. The Following User Says Thank You to Darious4 For This Useful Post:


  3. #2
    LongJohns is offline Newbie
    Array
    Join Date
    Sep 2016
    Posts
    7
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    A few ideas of mine:

    - Auto set camera location hotkeys over bases
    - Nearing supply block alert
    - Creep spreading
    - Auto worker production
    - Auto blink back hurt stalkers (at some hp threshold)

    I understand if some of these are too ambitious (or not useful to everyone), just a few tasks that might benefit from automation based off of personal experience

  4. #3
    Darious4's Avatar
    Darious4 is offline Hacker
    Array
    Join Date
    Dec 2016
    Location
    San Francisco, CA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    2
    Reputation
    136
    A few ideas of mine:

    - Auto set camera location hotkeys over bases
    - Nearing supply block alert
    - Creep spreading
    - Auto worker production
    - Auto blink back hurt stalkers (at some hp threshold)

    I understand if some of these are too ambitious (or not useful to everyone), just a few tasks that might benefit from automation based off of personal experience
    I am not aiming to use memory access to send mouse and key events but, simple external key and mouse scripts that a player would be able to accomplish. So Automatic blink micro for hurt stalkers would have to utilize extracting memory to be able to make an accurate script. These are ideas I am looking into for automating through AHK, so thanks. I didn't know what you meant by "creep spreading". Like they would automatically spread accurately while your are somewhere else in-game. That is not as simple, and would take memory-reading to send key events through a program. I am looking into all of the other mentioned functions you recommend players benefitting from.

  5. #4
    bysorynyos is offline Banned User Array
    Join Date
    Dec 2013
    Posts
    56
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    13
    Quote Originally Posted by Darious4 View Post
    I am not aiming to use memory access to send mouse and key events but, simple external key and mouse scripts that a player would be able to accomplish. So Automatic blink micro for hurt stalkers would have to utilize extracting memory to be able to make an accurate script. These are ideas I am looking into for automating through AHK, so thanks. I didn't know what you meant by "creep spreading". Like they would automatically spread accurately while your are somewhere else in-game. That is not as simple, and would take memory-reading to send key events through a program. I am looking into all of the other mentioned functions you recommend players benefitting from.
    No, they all can be done without memory access.
    1) Pixel detection on the mineral field across the minimap to make it auto, or prerecord position and do pixel detection on few key points to figure the map on loading screen, then acurately set the keys (don't have this yet for myself but it's very easy and will do it).
    2) Curently working on it for a friend (almost done), pixel detection on the numbers for the supply. at 100+ supply you have to shift numbers position with 4 pixels (you can figure that out by looking at the \ position), you do a map with 16 points and check how many of them are white and you figure what digit is undeneth in the box.
    3) This is a bit harder, have something working, but it's obvious in replays so I dont use it. It involves scanning the minimap to determine creep edges, moving the camera to a position, selecting everyhting and then shift click selecting only the tumors and then spread, you select the direction you want to spread at anypoint with any of the numkeys around 5. It will spread the tumors you have selected on 9, and deselect the ones that are not active anymore (you can figure that out with pixel colors too).
    4) This is the easiest, every cycle you que x workers base on how many cc/nexus etc you have, until you reach a limit. Auto update the count by hovering to the top when it detects the numbers of workers (pixel detection on the digits as well).
    5) Same, Pixel detection on the stalker health, in your units selection menu (works like a human to blink them one by one, not obvious, already have this one for myself). Blink direction as well base on the numkey direction.

    Something that I have and is functional and working is a mapAware script.
    Pings when enemy units get inside my field of view, quite easy to do
    A mapVision bot, you select few units and the script will move them around the map to cover as much as posible, and keep rotating them.
    Last edited by bysorynyos; 05-25-2017 at 12:42 PM.

  6. #5
    Darious4's Avatar
    Darious4 is offline Hacker
    Array
    Join Date
    Dec 2016
    Location
    San Francisco, CA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    2
    Reputation
    136
    I agree, these functions are possible with using pixel implementation to make. I am saying its easier to use memory access. Pixels do not always make the most accurate conclusions in StarCraft II. Could you post your script of the mapAware bot onto this thread? The more ideas, the purpose for this thread increases. Also I do have a folder containing all the textures of units, upgrades, mineral patches crystal/gold, gas geysers, and xel'naga towers. Would this be useful in AHK automation, because I don't know if this would be useful for a scripting language to send mouse and keyboard events to. I'm still pretty new to scripting languages for games. Here is a simple Automatic reminder script to remind you to check minimap, supply and when to spread more creep after you just set one down.


    DEL:: CheckSupply
    HOME:: CreepTumor
    NumLock:: CheckMinimap
    Attached Files
    Last edited by Darious4; 05-25-2017 at 03:42 PM.

  7. #6
    yxvv is offline Wannabe Member
    Array
    Join Date
    Mar 2012
    Posts
    21
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    hi your auto-inject is not work,i don't know why

  8. #7
    Vertumnus is offline Newbie
    Array
    Join Date
    May 2017
    Posts
    6
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    1
    Reputation
    5
    Here's a minor SC2 script I like to use someone might benefit from I only made it after finding "Esc" only de-selects units sometimes and other times cancels eggs or other nonsense... imo it should be built in the game:
    Code:
    `::
         DeSelectUnits(3)
    return
    
    
    +z::
         DeSelectUnits(1)
    return
    
    
    DeSelectUnits(amnt)
    {
        SetDefaultMouseSpeed, 0
        Coordmode, mouse, screen
        MouseGetPos, xpos, ypos
        Loop, %amnt%
        {
            Send +{Click 437, 680} 
        }
        MouseMove, xpos, ypos
    }
    I use ` or ~ to de-select 3 units quickly. It helps for selecting over 3 drones, right click gas, hit subtract key, then right click minerals, ezpz. I also use it to split my units ala Select Units-> right click move them->subtract 3->right click move them somewhere else->subtract 3, etc, If you add a right click at the end of it makes it easier for splitting and can even rapidfire it albeit less accurately but I prefer to choose my clicks myself. Anywho it gives me nice groups of 3 everywhere.

    I use shift+z to de-select 1 unit for scouting purposes. I'll have a few lings/overlords selected and do the move->shift+z->move->shift+z all over the minimap to get a fast scout.

    You may have to adjust the coordinates based on resolution I'm not sure, I just haven't seen it so I'm posting it :p


    On the topic of making complicated stuff... I think a solid mini-map scanner we could customize would be a nice resource to have... I started one myself but being a noob with autohotkey and the like I don't know the fastest/best ways to do things and am still figuring it all out. I do know you can do A LOT with the minimap, basically all the info you need as long as you can process it all fast enough.
    You could:
    -Have a button that sends any Idle workers to the nearest mineral patch
    -Have a button that sends multiple scouts across all bases/in random patterns
    -Monitor those scouts/overlords and have them ping/retreat from incoming threats
    -Get enemy trajectories and anticipate possible locations based on their speed/direction
    -Figure out what is Ground/Airspace and have intercept squads for incoming drops/run-bys

    Right now I have a pinging system down but I don't exactly like HOW I'm doing it as I'm kinda winging it as I go. Currently it only pings if an enemy enters vision and is within 50 pixels of a hatchery or if it is close to a designated "scout" I set with a key. I can set multiple scouts at once and they're kept track of as they move around the map. They don't retreat from enemies yet but that'll be next. I toned down the frequency/distance allowed between pings so for instance it'll only ping as something just enters a unit's vision and then once more on the way out if it leaves vision on a different side. It also won't ping close to the same location again for 30 seconds. I've played a few games with it and it works well so far but I already know ways I can improve it but at the same time if there's better ways to approach it I'd rather use those than continue polishing a turd so to speak :p
    I'd love to see some of bysorynyos's methods and what direction he's taking, I'll gladly share what I've got but I have a feeling I'll be starting over soon

  9. #8
    Darious4's Avatar
    Darious4 is offline Hacker
    Array
    Join Date
    Dec 2016
    Location
    San Francisco, CA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    2
    Reputation
    136
    hi your auto-inject is not work,i don't know why
    Make sure you post in the right thread next time for help but, the script works perfectly for me. Post your script with your hotkeys onto the Auto-queen thread, not this one.

  10. #9
    Vertumnus is offline Newbie
    Array
    Join Date
    May 2017
    Posts
    6
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    1
    Reputation
    5
    Just wanted to contribute. Here's a helper script I use regularly for SC2, can't imagine playing without it now
    Feel free to do w/e with it
    Code:
    global US_MinXbound := 0
    global US_MinYbound := 0
    global US_MaxXbound := 0
    global US_MaxYbound := 0
    
    
    System_SetDimensions()
    
    
    `::
        SubtractUnits(3)
    return
    
    
    +z::
        SubtractUnits(1, true)
    return
    
    
    +x::
        SubtractUnits(2, true)
    return
    
    
    System_SetDimensions()
    {
        Ratio := A_ScreenWidth / A_ScreenHeight
    
    
        if (Ratio = 1.6)
        {
            US_MinXbound := floor(A_ScreenWidth / 3.054545)
            US_MinYbound := floor(A_ScreenHeight / 1.218097)
            US_MaxXbound := floor(A_ScreenWidth / 2.776860)
            US_MaxYbound := floor(A_ScreenHeight / 1.145038)
        }
        else
        {
            US_MinXbound := floor(A_ScreenWidth / 3.401993)
            US_MinYbound := floor(A_ScreenHeight / 1.217116)
            US_MaxXbound := floor(A_ScreenWidth / 3.020649)    
            US_MaxYbound := floor(A_ScreenHeight / 1.146269)
        }
    }
    
    
    SubtractUnits(amnt, rightClick = false)
    {
        SetDefaultMouseSpeed, 0
        Coordmode, mouse, screen
        MouseGetPos, xpos, ypos
        
        Loop, %amnt%
        {
            Random, RandomX, US_MinXbound, US_MaxXbound
            Random, RandomY, US_MinYbound, US_MaxYbound
            
            Send +{Click %RandomX%, %RandomY%} 
        }
        MouseMove, xpos, ypos
        
        if rightClick
            MouseClick, right, xpos, ypos
    }
    The right click var is just extra if you want to do that after de-selecting, I've found I like it for some things, others I prefer to do the clicking myself.
    I use the "SubtractUnits(3)" bind if I grab too many workers and right click a gas geyser; just subtract 3 units and send the rest to the minerals.
    I use the single unit subtract for getting good scouting with groups of a lings or overlords you can just right click move the group somewhere, hit the key over and over on the minimap to get them going fast.
    I use the subtract 2 script for splitting drones/lings/etc to help with fighting AOE stuffs.

    IDK if there's a faster way to click a position with autohotkey but if there is someone tell me :p

    I'm working on a minimap scanner and I would love to see anyone else's work to see if I'm on the right track or if they have any nice tricks. I'll share mine after I clean it up a bit.

  11. The Following 2 Users Say Thank You to Vertumnus For This Useful Post:


  12. #10
    mfedorov is offline Wannabe Member
    Array
    Join Date
    Jun 2014
    Location
    Russia
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    4
    Reputation
    6
    Very strange script actually. Make some random clicks with shift in units stack?

    Quote Originally Posted by Darious4 View Post
    I am not aiming to use memory access to send mouse and key events but, simple external key and mouse scripts that a player would be able to accomplish. So Automatic blink micro for hurt stalkers would have to utilize extracting memory to be able to make an accurate script. These are ideas I am looking into for automating through AHK, so thanks. I didn't know what you meant by "creep spreading". Like they would automatically spread accurately while your are somewhere else in-game. That is not as simple, and would take memory-reading to send key events through a program. I am looking into all of the other mentioned functions you recommend players benefitting from.
    - i make several methods for stalkers blink. one of them without mem reading

  13. The Following 4 Users Say Thank You to mfedorov For This Useful Post:


Page 1 of 4 123 ... LastLast

Similar Threads

  1. Introducing Robot - The Next Step in System Automation
    By Torpedoes in forum Development
    Replies: 0
    Last Post: 04-26-2016, 09:07 PM
  2. Replies: 0
    Last Post: 08-30-2012, 01:19 AM
  3. Replies: 3
    Last Post: 03-05-2012, 05:31 AM
  4. What Starcraft 2 automation hacks should look like !
    By maximalista in forum Starcraft 2 Hacks, bots and tools
    Replies: 12
    Last Post: 02-21-2012, 05:49 PM
  5. [Release] [DETECTED] Vuno's Automation Hack
    By Vuno in forum Starcraft 2 Hacks, bots and tools
    Replies: 65
    Last Post: 04-30-2011, 11:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •