• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:03
CEST 15:03
KST 22:03
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
ZeroSpace Early Access is Now Live!19Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)88Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!18
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) How would you feel about frequent/monthly balance patches for SC2? Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters [D] Wireframe Casting Removed
Tourneys
IntoTheTV X SOOP SC2 League : Weekly & Monthly INu's Battles#18 - Cure, herO, Rogue & ByuN RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
BW General Discussion Animated Gateway BGH Auto Balance -> http://bghmmr.eu/ HORROR STARCRAFT MOVIE How Famous was FlaSh before his Debut?
Tourneys
Escore Tournament - Season 3 [Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
Path of Exile ZeroSpace Early Access is Now Live! Nintendo Switch Thread General RTS Discussion Thread Diablo IV
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Artificial Intelligence Thread US Politics Mega-thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
How Games can Help with Majo…
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4482 users

Creating a Dota 2 Bot API Part 3: float on

Blogs > LetaBot
Post a Reply
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 12 2016 02:30 GMT
#1
Creating a Dota 2 Bot API Part 3: float on

Part 2: http://www.liquiddota.com/blogs/508438-dota-2-bot-api-2-training-for-a-trainer


Next up in the variables needed for a Bot API is the position of units/camera.

If you know anything about the internal workings of RTS games you know that most things in the game are stored as units. In StarCraft Brood War the buildings are stored with the unit class for example. So are most of the spells you can cast.

Dota 2 works in the same way, but it uses the name entities to describe the objects in the game. The position of an entity is in the same class as a unit, so it is just a matter of finding the offset for it, just like xorentor did for his Dota2harvester ( https://github.com/xorentor/dota2harvester/blob/master/src/client_win32cli/d2h.c#L551 ).
Here is how to find the new offset:

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

2. You start of by finding the HP of an entity. I choose my own hero since I can move him around freely, but technically any entity that moves could be used ( so don't use runes :p )

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 a float with an unknown initial value

[image loading]

5. Move to the left ( this decreases the x position )
6. Do a next scan with "Decreased value" selected.

[image loading]

7. Move to the right
8. Do a next scan with "Increased value" selected.

[image loading]

9. After doing this for a while you will narrow the addresses down.
10. open the console with \ , then make sure your cursor is on your hero and type in:
sv_cheats 1
ent_text

11. Look for the addresses that have the same x value as is given in the debug output.
12. Select the ones whose memory address is close the the memory address of your HP.

13. To be sure which one is correct, calculate the difference in memory address between your HP and x possibilities. For example 33C69120 - 33C68C5C = 4C4 .

14. Find the HP memory address of one of the creeps. Add the value from 13 to it, and set the type to a float.
15. Check the resulting value with the ent_text for that creep.
16. Choose the offset difference that gives you the correct result

[image loading]

Getting the camera position

17. Open the console and type in "cl_showpos 1"
18. Search for a float with an unknown initial value
19. Repeat step 5-9 but with your camera instead of your hero
20. Select several of the memory addresses and them to the addresslist below
21. Shift select them then press the space-bar to activate all of them
22. Move your camera around and see if you are forces back to your original location
23. Narrow this down to one address


[image loading]

24. Find out what accesses this memory address
25. Move the camera around and look at the counter of the opcodes that access the address.
26. Select the one you see in the image below and record the offset (22C in this case) and the memory address (0B980C80 in this case)

[image loading]

27. Search for the address you got at 26 in a new scan. This should give you two green memory addresses.
28. Pick any one of them. Now combined with your offset you can not only read the camera x position but also write (change) it.

[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 (and figure out their type/team)
- Translate the position of the entities and the camera into x,y coordinates on the screen


Sending commands to Dota 2 via calling in-game functions (DLL injection) is a bit to much of a hassle for me now. So I will stick with sending commands via simulated input for now.
If you cannot win with 100 apm, win with 100 cpm.
Jaeger
Profile Joined December 2009
United States1150 Posts
May 12 2016 05:44 GMT
#2
Man that is an awesome write up, thanks for the blog.
https://www.dotabuff.com/players/8137911
Ler
Profile Blog Joined August 2012
Germany543 Posts
May 12 2016 08:02 GMT
#3
People that write RE related stuff are awesome! You Sir are awesome!
Twitter: @Ler_GG | Facebook: lergg | youtube: lerlolgg | Twitch.tv/gg_nore | #ArtOfSupport
Please log in or register to reply.
Live Events Refresh
WardiTV Summer Champion…
12:00
Summer Cup Group C
WardiTV514
IndyStarCraft 108
Rex81
LiquipediaDiscussion
CrankTV Team League
11:00
Crank Gathers S4: Playoffs
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko429
IndyStarCraft 108
Rex 81
StarCraft: Brood War
Rain 5986
Calm 5037
Bisu 1457
BeSt 1433
Horang2 608
firebathero 589
Zeus 588
Mini 358
EffOrt 347
Light 306
[ Show more ]
Stork 206
Soulkey 186
Larva 164
Last 163
Snow 153
actioN 134
Hyun 115
Dewaltoss 107
Rush 104
Pusan 97
Mong 87
ggaemo 86
Mind 72
Sea.KH 56
ToSsGirL 55
sorry 45
hero 39
Movie 37
Barracks 34
Shine 33
[sc1f]eonzerg 32
Bale 25
JYJ 24
Sharp 22
Sexy 20
Sacsri 20
zelot 19
yabsab 17
JulyZerg 16
IntoTheRainbow 15
HiyA 14
NaDa 13
Noble 12
ajuk12(nOOB) 12
Icarus 9
Dota 2
Dendi790
XcaliburYe137
Counter-Strike
fl0m1877
shoxiejesuss868
markeloff468
edward62
Other Games
FrodaN2162
singsing2069
B2W.Neo639
hiko537
crisheroes300
RotterdaM281
uThermal256
OGKoka 212
Liquid`LucifroN158
Sick156
Mlord93
ArmadaUGS84
CosmosSc2 23
Trikslyr18
Liquid`VortiX12
DeMusliM0
Organizations
StarCraft: Brood War
UltimateBattle 27
StarCraft 2
angryscii 22
StarCraft: Brood War
lovetv 12
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2305
• WagamamaTV380
League of Legends
• Jankos1948
• TFBlade802
Upcoming Events
Replay Cast
10h 58m
Escore
20h 58m
CrankTV Team League
21h 58m
Big Brain Bouts
1d 2h
Soulspirit vs goblin
TriGGeR vs Bunny
Korean StarCraft League
1d 13h
Afreeca Starleague
1d 14h
RSL Revival
1d 19h
Serral vs SHIN
herO vs Solar
Online Event
2 days
Replay Cast
2 days
RSL Revival
2 days
Clem vs ByuN
Rogue vs Lambo
[ Show More ]
OSC
2 days
WardiTV Weekly
3 days
Sparkling Tuna Cup
4 days
INu's Battles
4 days
Cure vs herO
ByuN vs Rogue
PiGosaur Cup
5 days
The PondCast
5 days
Kung Fu Cup
5 days
Patches Events
6 days
Replay Cast
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-07-22
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 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.