Advertisement
logancberrypie

Generate bot lines

Apr 21st, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. import math
  2.  
  3.  
  4. ###############################################################################################################
  5. ## GO to a position in the game and look in the direction you want the line to spawn
  6. ## Type "get" in console and paste the position in AllPositions
  7. ## You can put as many positions as you want in the "array" and it will go through each one spawning 10 bots
  8. ###############################################################################################################
  9.  
  10.  
  11.  
  12. AllPositions = """
  13. 213.19 13.81 332.07 0.00 237.44 0.00
  14. 210.15 13.77 393.92 0.00 261.39 0.00
  15. 153.92 13.99 436.65 0.00 303.68 0.00
  16. 174.26 14.32 525.35 0.00 100.36 0.00
  17. 325.86 11.73 553.79 0.00 316.70 0.00
  18. 346.85 13.69 542.87 0.00 1.15 0.00
  19. 183.73 13.09 244.38 0.00 240.41 0.00
  20. 172.29 14.00 312.60 0.00 1.37 0.00
  21. 275.69 8.94 522.51 0.00 358.81 0.00
  22. 476.27 14.72 342.10 0.00 258.97 0.00
  23. 454.01 14.14 223.55 0.00 165.21 0.00
  24. """.strip("\n").split("\n")
  25.  
  26.  
  27.  
  28. def produceBots(pos,distance,minID,yVariant=0,botSize = 0.5):
  29. initialX = float(pos[0])
  30. initialY = float(pos[1])
  31. initialZ = float(pos[2])
  32. direction = float(pos[4])
  33.  
  34. cos = math.cos(math.radians(direction))
  35. sin = math.sin(math.radians(direction))
  36. directionZ = botSize * cos
  37. directionX = botSize * sin
  38.  
  39. amountToSpawn = math.ceil(distance / botSize)
  40. for botID in range(minID,minID+amountToSpawn+1):
  41. i = botID - minID
  42. newX = round(initialX + i * directionX,2)
  43. newZ = round(initialZ + i * directionZ,2)
  44. newY = round(initialY + i * yVariant,2)
  45. string = "rc delayed 1140 teleport "+str(botID)+" "+str(newX) + ","+str(newY)+","+str(newZ)
  46. print(string)
  47.  
  48. #produceBots(positionForSpawn,5,112)
  49.  
  50.  
  51.  
  52. def produceMany(positions):
  53. currentBotID = 2
  54. for pos in positions:
  55. temp = pos.strip("\n").split(" ")
  56. produceBots(temp,5,currentBotID)
  57. currentBotID += 10
  58. print("done")
  59.  
  60. ## Should make number of bots per location a bit better
  61.  
  62.  
  63. produceMany(AllPositions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement