• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:07
CET 06:07
KST 14:07
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
HomeStory Cup 28 - Info & Preview11Rongyi Cup S3 - Preview & Info3herO wins SC2 All-Star Invitational14SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8
Community News
Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win1RSL Season 4 announced for March-April5Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8
StarCraft 2
General
Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win StarCraft 2 Not at the Esports World Cup 2026 HomeStory Cup 28 - Info & Preview Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win Oliveira Would Have Returned If EWC Continued
Tourneys
RSL Season 4 announced for March-April HomeStory Cup 28 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) KSL Week 85 OSC Season 13 World Championship
Strategy
Simple Questions Simple Answers
Custom Maps
[A] Starcraft Sound Mod
External Content
Mutation # 511 Temple of Rebirth The PondCast: SC2 News & Results Mutation # 510 Safety Violation Mutation # 509 Doomsday Report
Brood War
General
Can someone share very abbreviated BW cliffnotes? Liquipedia.net NEEDS editors for Brood War BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion [ASL21] Potential Map Candidates
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 Azhi's Colosseum - Season 2 [BSL21] Non-Korean Championship - Starts Jan 10
Strategy
Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Battle Aces/David Kim RTS Megathread Nintendo Switch Thread Path of Exile Mobile Legends: Bang Bang Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Let's Get Creative–Video Gam…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1915 users

Dota 2 Bot API Part 4: bloody creep variables

Blogs > LetaBot
Post a Reply
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 21 2016 02:22 GMT
#1
Creating a Dota 2 Bot API Part 4: bloody creep variables

Part 1: http://www.liquiddota.com/blogs/503835-dota-2-bot-api-the-glutinitial-step
Part 2: http://www.liquiddota.com/blogs/508438-dota-2-bot-api-2-training-for-a-trainer
Part 3: http://www.liquiddota.com/blogs/508958-creating-a-dota-2-bot-api-part-3-float-on



Next up in the variables needed for a Bot API is determining to which team each entity belongs to.




If you want to try it yourself, keep in mind that you should start steam in offline mode and turn of your internet

1. After you made sure that steam is in offline mode and you have no internet, you start Dota 2 with the launch option: -console

Then start a bot game with you playing as Chen. Put your skill point in "Holy Persuasion".

2. You start of by finding the HP of an enemy creep. I choose a melee creep, but this works on all three types.
( Look at part 2 of my blog to see how to get the HP value )

[image loading]


3. Now press ctrl+T to start a new scan (or click on file->Add scan tab).

4. Search for an unknown integer between the memory address of the HP and that memory address + 3000 (in hex). Technically you have to search from the base of an entity, which is the memory address of the HP - BC , but since the offset we are looking for is beyond the HP we can fill in the memory address of the HP straight away.

[image loading]


5. After clicking on new scan, let the game play for a while (make sure you lock the HP value of the creep so it won't die).
6. Do a new scan with "unchanged value". Repeat this for a while.


[image loading]



7. Now cast Holy persuasion on that creep
8. Scan for "changed value"


[image loading]


9. scan again for values less than 100
10. Add the results to your address list


[image loading]


11. Now look for another melee creep of your team so that you can use the offsets from step 10 and see which values are the same. Those values can be used to determine which team a creep belongs to.

12. After finding the correct HP ( see part 2, some addresses have the same value but are only used for displaying the HP not actually using it in the game logic), take note of the memory address.


[image loading]

13. Now you calculate the offsets based on the memory addresses you got from step 10 . For example,

450CA114 - 450C9B2C = 5E8 (make sure that you put your calculator on "Hex")

You then take the offset and add it to the HP address you found in step 12. In the image below, it gives a value of 3, which is different than the value of 2 for our (holy persuasion) converted creep.

[image loading]


14. Eventually you come across an offset that gives the same value (in my case it was 8D4). It should be just 1 offset that is the same, but if you have multiple you can narrow them down by following the steps below for each address.



[image loading]


15. For each offset you can verify if it is correct. You will need to do this anyway in order to find out which value belongs to Radiant and Dire

16. Get the HP memory address of an enemy creep. Then add the offset you got from step 14 to it. This should give you the team value of that creep ( in my case 4 = Dire, 8 = Radiant , but this can change in an update).

[image loading]

17. To check if it is a team value, use "Holy persuasion" on that creep.

18. If it is correct, then the value should change to the team value of your team ( in my case 4 = Dire, 8 = Radiant , but this can change in an update).

19. If not, then use the other offsets you found at step 14.

[image loading]

---------------------------------------------------------------------------------------------


So the only things left now to make a very simple but already functional bot API is:
- Add a method to access and iterate over all the entities
- Translate the position of the entities and the camera into x,y coordinates on the screen


If you cannot win with 100 apm, win with 100 cpm.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
May 21 2016 17:09 GMT
#2
and this is why we should probably wait for valve to open some api

at any rate I feel the bot for dota is going to be pretty crappy

are you by any chance the letaBot also for starcraft AI?
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 21 2016 17:43 GMT
#3
On May 22 2016 02:09 evanthebouncy! wrote:
and this is why we should probably wait for valve to open some api

at any rate I feel the bot for dota is going to be pretty crappy

are you by any chance the letaBot also for starcraft AI?



Yes I am the same LetaBot that develops a StarCraft bot.

If valve would release their own bot API that would be great ofc, but I doubt that they are going to release one.

Why do you think a dota bot is going to be crappy? The Dota 1 bots were subject to the restrictions of the JASS script engine from WarCraft 3.
If you cannot win with 100 apm, win with 100 cpm.
Yurie
Profile Blog Joined August 2010
12017 Posts
May 22 2016 08:38 GMT
#4
When you use memory search, can you see hp/mana etc of creeps and heroes that is outside the screen but visible for your team? I assume in single player you can see even things hidden in fog since it isn't hosted on the external server but your local server. That would make another variable you need to consider, is the AI cheating by seeing through FoW or not?
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 22 2016 15:24 GMT
#5
On May 22 2016 17:38 Yurie wrote:
When you use memory search, can you see hp/mana etc of creeps and heroes that is outside the screen but visible for your team? I assume in single player you can see even things hidden in fog since it isn't hosted on the external server but your local server. That would make another variable you need to consider, is the AI cheating by seeing through FoW or not?



If you start the game as a server you can see these things yes. But you can build in a "CompleteMapInformation" flag just like in the BWAPI, where you can only access information in the fog of war (or even just on your screen) if that flag is set to true (with that flag set to false by default).
If you cannot win with 100 apm, win with 100 cpm.
Please log in or register to reply.
Live Events Refresh
Next event in 6h 53m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 203
ProTech129
StarCraft: Brood War
Shuttle 405
JulyZerg 110
ZergMaN 101
GoRush 36
Bale 13
yabsab 12
IntoTheRainbow 9
Icarus 9
Dota 2
monkeys_forever606
NeuroSwarm144
febbydoto40
LuMiX1
League of Legends
JimRising 857
C9.Mang0466
Counter-Strike
m0e_tv335
Super Smash Bros
hungrybox496
Other Games
summit1g10994
WinterStarcraft430
Livibee53
KnowMe21
Organizations
Other Games
gamesdonequick1386
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH284
• practicex 30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Diggity2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1017
• Stunt519
Other Games
• Scarra1554
Upcoming Events
Wardi Open
6h 53m
PiGosaur Cup
19h 53m
WardiTV Invitational
1d 6h
Replay Cast
1d 18h
The PondCast
2 days
WardiTV Invitational
2 days
Replay Cast
2 days
RongYI Cup
4 days
uThermal 2v2 Circuit
5 days
Replay Cast
6 days
[ Show More ]
Wardi Open
6 days
Monday Night Weeklies
6 days
Liquipedia Results

Completed

Proleague 2026-02-02
HSC XXVIII
Underdog Cup #3

Ongoing

CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
Acropolis #4 - TS4
Rongyi Cup S3
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W7
Escore Tournament S1: W8
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
LiuLi Cup: 2025 Grand Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.