• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:44
CET 11:44
KST 19:44
  • 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
[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy7ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool42Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12
StarCraft 2
General
Explore the Palmistry Certificate Course at Bivs Weekly Cups (March 16-22): herO doubles, Cure surprises Weekly Cups (August 25-31): Clem's Last Straw? Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2)
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
ASL21 General Discussion Soulkey's decision to leave C9 BGH Auto Balance -> http://bghmmr.eu/ JaeDong's form before ASL [ASL21] Ro24 Preview Pt1: New Chaos
Tourneys
[ASL21] Ro24 Group B [ASL21] Ro24 Group A ASL Season 21 LIVESTREAM with English Commentary [Megathread] Daily Proleagues
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2269 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
12074 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
Afreeca Starleague
10:00
Ro24 Group B
Soulkey vs Ample
JyJ vs sSak
Afreeca ASL 8323
StarCastTV_EN212
Liquipedia
Sparkling Tuna Cup
10:00
Weekly #124
Percival vs YoungYakovLIVE!
CranKy Ducklings68
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 199
ProTech119
SortOf 113
StarCraft: Brood War
Calm 12785
Flash 5589
Bisu 4166
GuemChi 1764
BeSt 775
firebathero 562
EffOrt 334
Zeus 268
Pusan 266
Light 259
[ Show more ]
ZerO 219
Leta 214
actioN 208
Stork 204
HiyA 120
Rush 78
ToSsGirL 74
Killer 73
Mind 66
Sharp 56
PianO 49
Barracks 41
Nal_rA 25
Hm[arnc] 21
GoRush 21
Shinee 20
Bale 18
Terrorterran 14
yabsab 13
soO 11
Purpose 10
sorry 9
Noble 7
Snow 1
Dota 2
XcaliburYe267
BananaSlamJamma163
canceldota145
League of Legends
JimRising 340
Counter-Strike
olofmeister2104
shoxiejesuss656
byalli502
x6flipin245
Super Smash Bros
Westballz18
Other Games
singsing1929
ceh9656
Sick311
crisheroes227
Happy162
XBOCT141
Livibee58
Trikslyr20
Organizations
Other Games
gamesdonequick874
StarCraft: Brood War
UltimateBattle 237
Dota 2
PGL Dota 2 - Main Stream115
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH197
• StrangeGG 36
• LUISG 24
• CranKy Ducklings SOOP5
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 4
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
Replay Cast
22h 16m
Afreeca Starleague
23h 16m
hero vs YSC
Larva vs Shine
Kung Fu Cup
1d
Replay Cast
1d 13h
KCM Race Survival
1d 22h
The PondCast
1d 23h
WardiTV Team League
2 days
Replay Cast
2 days
WardiTV Team League
3 days
RSL Revival
3 days
Cure vs Zoun
herO vs Rogue
[ Show More ]
WardiTV Team League
4 days
Platinum Heroes Events
4 days
BSL
4 days
RSL Revival
4 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
5 days
BSL
5 days
Replay Cast
5 days
Afreeca Starleague
5 days
Light vs Calm
Royal vs Mind
Wardi Open
6 days
Monday Night Weeklies
6 days
Sparkling Tuna Cup
6 days
Afreeca Starleague
6 days
Rush vs PianO
Flash vs Speed
Liquipedia Results

Completed

Proleague 2026-03-23
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
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.