Guest User

DUMMY AUTO-NMZ (Bash)

a guest
Oct 25th, 2024
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Dummy Auto-NMZ
  4. # Automatically toggles "Rapid Heal" to prevent HP gain in NMZ.
  5. # Single and Double Click functions with configurable randomization.
  6. # Toggle ON/OFF with CapsLock
  7.  
  8.  
  9. # SINGLE/DOUBLE CLICK PROBABILITY: Set % for single/double click mix.
  10. probability=60
  11. # 0 = All Single
  12. # 100 = All Double
  13.  
  14.  
  15. # Initializing...
  16. loop_count=0
  17. clicking=false
  18. prev_caps_state="off"
  19.  
  20. # Check CapsLock status and toggle ON/OFF
  21. while true; do
  22. # Check current Caps Lock state
  23. caps_lock_state=$(xset q | grep "Caps Lock:" | awk '{print $4}')
  24.  
  25. if [[ $caps_lock_state != $prev_caps_state ]]; then
  26. if [[ $caps_lock_state == "on" ]]; then
  27. clicking=true
  28. echo "CapsLock ON: Starting clicks."
  29. loop_count=0 # Reset counter
  30. prev_caps_state="on"
  31. else
  32. clicking=false
  33. echo "CapsLock OFF: Stopping clicks."
  34. prev_caps_state="off"
  35. sleep 0.1
  36. fi
  37. fi
  38. # If CapsLock enabled, perform clicking actions
  39. if $clicking; then
  40. # Increment loop counter
  41. ((loop_count++))
  42. # Left click #1
  43. xdotool click 1
  44. # Select 10s bracket for random delay, with weighting
  45. weights=(18 19 19 20 20 21 21 21 22 22 22 23 23 23 24 24 25 25 26)
  46. random_index=$((RANDOM % ${#weights[@]}))
  47. wait_time=${weights[$random_index]}
  48. # Select 0.1s bracket for random delay, with weighting
  49. additional_weights=(1 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 7 7 7 8 8 9 9)
  50. additional_random_index=$((RANDOM % ${#additional_weights[@]}))
  51. # Add additional random delay (0.0xxms)
  52. additional_delay=$((additional_weights[additional_random_index] * 100)) # in milliseconds
  53. # Convert additional_delay to seconds
  54. additional_delay_seconds=$(echo "scale=4; $additional_delay / 1000" | bc)
  55. # Generate a random delay between 1 and 100 ms
  56. random_tenths_of_ms=$((RANDOM % 991 + 10))
  57. # Convert to seconds
  58. random_seconds=$(echo "scale=4; $random_tenths_of_ms / 10000" | bc)
  59. total_wait_time=$(echo "$wait_time + $additional_delay_seconds + $random_seconds" | bc)
  60. echo "[$loop_count] Waiting for $total_wait_time seconds..."
  61. # Trigger additional click with variable probability and delay
  62. if (( RANDOM % 100 < $probability )); then
  63. # Select double click delay between 120 and 160 ms
  64. bonus_delay=$((RANDOM % 41 + 120)) # 0-40 + 120
  65. echo "Triggered Double Click [$bonus_delay ms]"
  66. sleep $(echo "scale=4; $bonus_delay / 1000" | bc) # Convert to seconds
  67. xdotool click 1
  68. fi
  69. # Sleep for total delay duration
  70. sleep $total_wait_time
  71. fi
  72. done
Advertisement
Add Comment
Please, Sign In to add comment