Skip to content

Instantly share code, notes, and snippets.

@pfirsich
Created August 29, 2015 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfirsich/5e3333c81129bb755f71 to your computer and use it in GitHub Desktop.
Save pfirsich/5e3333c81129bb755f71 to your computer and use it in GitHub Desktop.
Helper script/config to make entry fragging practice configs (placing bots in common spots to practice clearing a site). Included example output config for de_mirage A site from ramp.
mp_respawn_on_death_ct 1
bot_stop 1
say Please execute bot_kick before executing this file. 10 bots will be placed
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
setpos_player 2 -975.209106 -2462.290283 -167.968750
setpos_player 3 -735.817200 -2072.579346 -179.968750
setpos_player 4 -395.946442 -2087.285645 -179.968750
setpos_player 5 -224.137421 -2137.031250 -170.426636
setpos_player 6 82.630966 -1995.335449 -167.968750
setpos_player 7 -46.001411 -1845.255249 -167.968750
setpos_player 8 -260.165619 -1528.014771 -167.968750
setpos_player 9 -1181.409058 -1285.046631 -167.968750
setpos_player 10 -507.095795 -1526.037720 -39.968750
setpos_player 11 181.968750 -1719.968750 -167.968750
setpos 687.052185 -1321.758179 -263.968750
setang 0.000000 -111.616829 0.000000
bind o "exec entry_mirage_A_ramp"
import sys
# To record positions exec position_recording
# execute startrec once you're ready and press n for every position you want to record"
# execute stoprec once you're done.
# Please make sure that recorded_positions.cfg does not exist/is empty before you start recording, because it appends to the file
positions = []
with open("recorded_positions.cfg") as posFile:
for line in posFile:
positions.append(line.split(";")[0][12:])
playerAngle = line.split(";")[1][12:]
output = ""
output += "mp_respawn_on_death_ct 1\nbot_stop 1\n\n"
output += "say Please execute bot_kick before executing this file. " + str(len(positions)-1) + " bots will be placed\n\n"
output += "bot_add_ct\n" * (len(positions)-1) + "\n"
for i in xrange(len(positions)-1):
output += "setpos_player " + str(i+2) + positions[i] + "\n"
output += "\n"
output += "setpos" + positions[-1] + "\n"
output += "setang" + playerAngle + "\n"
output += 'bind o "exec ' + sys.argv[1][:-4] + '"' # remove the file extension
with open(sys.argv[1], "w") as outFile:
outFile.write(output)
print output
bind n getpos_exact
alias "startrec" "con_logfile cfg\recorded_positions.cfg"
alias "stoprec" "con_logfile 0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment