Newer
Older
glitch-o-bolt / ConfigChall03.py
  1. ######
  2. # LEAVE THESE IMPORTS!
  3. ######
  4. import functions
  5. import random
  6. from textual.widgets import Log
  7.  
  8. ######
  9. # config values
  10. ######
  11.  
  12. SERIAL_PORT = '/dev/ttyUSB0'
  13. BAUD_RATE = 115200
  14.  
  15. LENGTH = 6000
  16. REPEAT = 0
  17. DELAY = 1098144
  18.  
  19. ###
  20. # ^ = pullup, v = pulldown
  21. ###
  22. triggers = [
  23. ['-', False], #0
  24. ['v', True], #1
  25. ['-', False], #2
  26. ['-', False], #3
  27. ['-', False], #4
  28. ['-', False], #5
  29. ['-', False], #6
  30. ['-', False], #7
  31. ]
  32.  
  33. ###
  34. # name, enabled, string to match
  35. ###
  36. conditions = [
  37. ['Flag', True, 'ctf', 'stop_glitching'],
  38. ]
  39.  
  40. ######
  41. # Custom functions for conditions to trigger
  42. ######
  43.  
  44. def stop_glitching():
  45. elapsed = functions.get_glitch_elapsed()
  46. functions.glitching_switch(False)
  47. functions.add_text(f"[auto] glitching stopped (elapsed: {elapsed})")
Buy Me A Coffee