classfile.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #!/usr/bin/python3
  2. import pymumble_py3
  3. import time
  4. import argparse
  5. import os
  6. import subprocess
  7. class IffyAh():
  8. def __init__(self, ip, port, cert, key, name):
  9. ##if gencert == True:
  10. print("Read Siege by James Mason")
  11. os.system("openssl req -subj '/CN=cunny.co/O=Cunny Co/C=US' -x509 -newkey rsa:1048 -nodes -keyout key.pem -out cert.pem; exit")
  12. self.m = pymumble_py3.Mumble(str(ip), port=int(port),certfile="cert.pem", keyfile="key.pem", user=str(name))
  13. self.m.set_application_string("fuck niggers")
  14. self.m.start()
  15. self.m.is_ready()
  16. self.m.set_bandwidth(48000)
  17. def move_into_most_users_channel(self):
  18. arr = []
  19. for u in self.m.users:
  20. arr.append(self.m.users[u].get_property("channel_id"))
  21. values = []
  22. for i, e in enumerate(arr):
  23. values.append([])
  24. values[i].append(e)
  25. values[i].append(0)
  26. for j, el in enumerate(arr):
  27. if e == el:
  28. values[i][1] += 1
  29. top = 0
  30. pick = 0
  31. for v in values:
  32. if v[1] > top:
  33. top = v[1]
  34. pick = v[0]
  35. self.m.channels[pick].move_in()
  36. def move_into_every_channel(self,delay=1):
  37. for y in range(69):
  38. for c in self.m.channels:
  39. self.m.channels[c].move_in()
  40. time.sleep(delay)
  41. def move_into_random_channel(self):
  42. channels = []
  43. for c in self.m.channels:
  44. channels.append(c)
  45. self.m.channels[random.choice(channels)].move_in()
  46. def print_channel_names(self):
  47. for c in self.m.channels:
  48. print (" channel id: " + str(self.m.channels[c].get_property("channel_id")), end=" ")
  49. print (" channel name: "+ str(self.m.channels[c].get_property("name")), end=" ")
  50. print (" description: " + str(self.m.channels[c].get_property("description")), end=" ")
  51. print()
  52. def print_user_names(self):
  53. print(self.m.users)
  54. for c in self.m.users:
  55. print (" name: " + str(self.m.users[c].get_property("name")), end="")
  56. print (" channel: " + str(self.m.users[c].get_property("channel_id")))
  57. def send_global_message(self,message):
  58. for c in self.m.users:
  59. time.sleep(0.1)
  60. self.m.users[c].send_message(message)
  61. def count_channels(self):
  62. print ("server has: "+str(len(self.m.channels))+" channels")
  63. def count_users(self):
  64. print("server has: "+str(self.m.users.count())+" users")
  65. def play_file(self,sound_file):
  66. f = open(sound_file,"rb")
  67. #ffmpeg -i sound.wav -ac 1 -ar 48000 -f s16le -acodec pcm_s16le sound.pcm
  68. self.m.sound_output.set_audio_per_packet(0.02)
  69. chunk = ""
  70. ticks = 0
  71. while 1:
  72. while self.m.sound_output.get_buffer_size() > 0.5:
  73. time.sleep(0.01)
  74. chunk = f.read(2)
  75. if chunk:
  76. self.m.sound_output.add_sound(chunk)
  77. if ticks == 100000:
  78. ticks = 0
  79. #self.move_into_most_users_channel()
  80. if len(chunk) == 0:
  81. break
  82. while self.m.sound_output.get_buffer_size() > 0.1:
  83. time.sleep(0.01)
  84. ticks += 1
  85. f.close()
  86. def play_file_stick_on_users(self,sound_file):
  87. f = open(sound_file,"rb")
  88. #ffmpeg -i sound.wav -ac 1 -ar 48000 -f s16le -acodec pcm_s16le sound.pcm
  89. self.m.sound_output.set_audio_per_packet(0.02)
  90. chunk = ""
  91. ticks = 0
  92. while 1:
  93. while self.m.sound_output.get_buffer_size() > 0.5:
  94. time.sleep(0.01)
  95. chunk = f.read(2)
  96. if chunk:
  97. self.m.sound_output.add_sound(chunk)
  98. if ticks == 100000:
  99. ticks = 0
  100. self.move_into_most_users_channel()
  101. if len(chunk) == 0:
  102. break
  103. while self.m.sound_output.get_buffer_size() > 0.1:
  104. time.sleep(0.01)
  105. ticks += 1
  106. f.close()