How to automatically heartbeat a TF2 listen server?

Solution 1:

According to Valve's Developer notes on Heartbeat:

This is, in short, a ping sent to the Steam servers when hosting your own server. It tells them your IP, amount of players, ping time, etc. This is usually not required, multiplayer or other, because it automatically runs the command every 30 seconds or so.
- TF2 Developer Wiki

So assuming you've done the other commands for setting up a listen server, i.e.

ip [your static ip address]
sv_lan 0
sv_pure 1
map [map name here]

You shouldn't need to run 'heartbeat' at all.

References

  • TF2 Developer Wiki
  • The Colloquial Coefficient: Hosting a Team Fortress 2 Listening Server