Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Dummy Auto-NMZ
- # Automatically toggles "Rapid Heal" to prevent HP gain in NMZ.
- # Single and Double Click functions with configurable randomization.
- # Toggle ON/OFF with CapsLock
- # SINGLE/DOUBLE CLICK PROBABILITY: Set % for single/double click mix.
- probability=60
- # 0 = All Single
- # 100 = All Double
- # Initializing...
- loop_count=0
- clicking=false
- prev_caps_state="off"
- # Check CapsLock status and toggle ON/OFF
- while true; do
- # Check current Caps Lock state
- caps_lock_state=$(xset q | grep "Caps Lock:" | awk '{print $4}')
- if [[ $caps_lock_state != $prev_caps_state ]]; then
- if [[ $caps_lock_state == "on" ]]; then
- clicking=true
- echo "CapsLock ON: Starting clicks."
- loop_count=0 # Reset counter
- prev_caps_state="on"
- else
- clicking=false
- echo "CapsLock OFF: Stopping clicks."
- prev_caps_state="off"
- sleep 0.1
- fi
- fi
- # If CapsLock enabled, perform clicking actions
- if $clicking; then
- # Increment loop counter
- ((loop_count++))
- # Left click #1
- xdotool click 1
- # Select 10s bracket for random delay, with weighting
- weights=(18 19 19 20 20 21 21 21 22 22 22 23 23 23 24 24 25 25 26)
- random_index=$((RANDOM % ${#weights[@]}))
- wait_time=${weights[$random_index]}
- # Select 0.1s bracket for random delay, with weighting
- 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)
- additional_random_index=$((RANDOM % ${#additional_weights[@]}))
- # Add additional random delay (0.0xxms)
- additional_delay=$((additional_weights[additional_random_index] * 100)) # in milliseconds
- # Convert additional_delay to seconds
- additional_delay_seconds=$(echo "scale=4; $additional_delay / 1000" | bc)
- # Generate a random delay between 1 and 100 ms
- random_tenths_of_ms=$((RANDOM % 991 + 10))
- # Convert to seconds
- random_seconds=$(echo "scale=4; $random_tenths_of_ms / 10000" | bc)
- total_wait_time=$(echo "$wait_time + $additional_delay_seconds + $random_seconds" | bc)
- echo "[$loop_count] Waiting for $total_wait_time seconds..."
- # Trigger additional click with variable probability and delay
- if (( RANDOM % 100 < $probability )); then
- # Select double click delay between 120 and 160 ms
- bonus_delay=$((RANDOM % 41 + 120)) # 0-40 + 120
- echo "Triggered Double Click [$bonus_delay ms]"
- sleep $(echo "scale=4; $bonus_delay / 1000" | bc) # Convert to seconds
- xdotool click 1
- fi
- # Sleep for total delay duration
- sleep $total_wait_time
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment