ambitious bot for Heroes of the Storm (HotS)

Ask gaming related questions (AHK v1.1 and older)
yeah
Posts: 5
Joined: 14 Aug 2017, 22:08

ambitious bot for Heroes of the Storm (HotS)

15 Aug 2017, 00:17

...well ambitious for me, because i only have a basic knowledge of ahk. bots kill the fun, they suck to get teamed with, and they are so easy, they are not fun to play against. there are several bots that i've been reporting for months that blizzard does nothing about, that's fine, i'm a fan of "let's break it 'til it's broken" -- and then the logical conclusion (for me, anyway) is to make a bot that's better than the average player (which wouldn't be hard at all with a little image recognition).

to explicitly state, i have 2 goals:
1) completely automate hero selection and play/not go afk
2) automate competent play

so this is what the bot will do:
-select your lowest level available hero and queue for vs ai (not quick match, i want to troll blizzard, not their players - ideally i'd put five in a group, so my bots are playing blizzard's ai bots, which i would find hilarious)
-recognize the hero (for appropriate talent selection and skill spamming)
-recognize the map (for optimal lane pushing and/or map objectives -- map objectives, generally speaking, are not optimal vs ai)

so far i have a script that left-clicks the bottom right hero and then the ready button, then the next hero and the ready button and so on until it queues (in queue, the rest of those clicks are still going, but they mean nothing). it's interspersed with mousemove to the far right of the screen and "send a" (which is "attack") and then at the bottom of the script, hotkey selection of the 1st talent, then a left click of the skip button on the mvp screen, then a left click of the leave button on the vote screen. this is on a loop that takes about 5 seconds.

that alone accomplishes the first goal of automating selection/play (and not going afk), but it only works if your team is going left to right, and falls very short of the second goal.

challenges remaining:
-basic recognition of the map (so it will at least go right to left, as necessary)
-basic hero recognition (so it will spam some skills and better talent selection)
-better map recognition (better laning/merc camps)
-opponent recognition (better positioning/best use of skills)

all these can be accomplished by incorporating PixelGetColor/ImageSearch into the loop, so my next step is trying to figure out how those work.

any suggestions or example scripts would be greatly appreciated, THANK YOU
yeah
Posts: 5
Joined: 14 Aug 2017, 22:08

Re: ambitious bot for Heroes of the Storm (HotS)

15 Aug 2017, 00:22

oh and...
-better recognition on hero selection screen so that it just clicks the lowest level available hero and ready instead of clicking all until an available one is selected.
yeah
Posts: 5
Joined: 14 Aug 2017, 22:08

Re: ambitious bot for Heroes of the Storm (HotS)

15 Aug 2017, 01:00

so will this work...
replace:
"MouseMove, 1600, 460
sleep 10
send a
sleep 10"
with:
"PixelSearch, Px, Py, 1600, 810, 1620, 830, 0x4000DB, 3
if ErrorLevel
[something here that would make it search somewhere else, another "pixelsearch" cmd?]
else
send a
sleep 10"

i'm sure i'll have tried it 100 different ways and know the answer by the time i get a response, but all input is appreciated
yeah
Posts: 5
Joined: 14 Aug 2017, 22:08

Re: ambitious bot for Heroes of the Storm (HotS)

15 Aug 2017, 04:25

so i did this...
"PixelSearch, Px, Py, 1300, 700, 1680, 1050, 0x4000DB, 3, Fast
if ErrorLevel {
MouseMove, 848, 472
sleep 20
send a
sleep 20
}
else {
MouseMove, Px+10, Py+10
sleep 20
send a
sleep 20
}"
and it's clunky, but it works (right to left too)
yeah
Posts: 5
Joined: 14 Aug 2017, 22:08

Re: ambitious bot for Heroes of the Storm (HotS)

15 Aug 2017, 22:42

so for hero select i replaced 22 lines of click here with 11 pixelsearches with if/else and gotos and it looks cleaner (on the surface anyway).

it is possible (for the whole script) to do something like:

loop {
heroselect:
if/else with goto ingame
}
loop {
ingame:
if/else with goto mvp
}
loop {
mvp:
if/else with goto heroselect
}

...with something in a loop pointing to something inside a different loop?
User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: ambitious bot for Heroes of the Storm (HotS)

16 Aug 2017, 06:05

This is something that will be extremely difficult to implement with Image/Pixel searching, especially navigating the map, not even mentioning all the objectives in HoTS.

The best way would be to use memory reading, but that requires a lot of knowledge about game structures and how to find them in the process, which is no easy task.

While programming bots is fun, doing so with pixel data on a game like HoTS is probably not going to yield very much success.
geni

Re: ambitious bot for Heroes of the Storm (HotS)

20 Dec 2017, 18:13

This is what i'm using it can be a lot simpler made, I just re-purposed a clickerheroes script I used in the past.
The main thing I noticed is that when you play an ai game, after 2:15 min it kick's you for afk and you rejoin, but after that you don't get kicked anymore.

SetTitleMatchMode 2
SetControlDelay -1

f7:: ; Rejoin

loop {
ControlClick x50 y150, Heroes of the Storm,,,, NA
ControlClick, x740 y950, Heroes of the Storm,,,, NA ; Ready
sleep 1000
ControlClick, x170 y980, Heroes of the Storm,,,, NA ; Exit
sleep 11000
}

f8:: ; Exit + Ready
SetTimer, ClickEnemy, 13000 ;
return

ClickEnemy:
ControlClick, x480 y580, Heroes of the Storm,,,, NA ; Rejoin

return

f9::pause ; pauses timer
f10::reload ; turns off timer

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 67 guests