Linux: How To - KeySpam

While this isn’t a true key spam, it is functionally equivalent by spamming an action button. It consists of two scripts.

# Display mouse coodinates.

x = store.get_global_value("clicker_status")
#Find button coords

from Xlib import X, display # import the necessary classes from the specified module
d = display.Display().screen().root.query_pointer() # get pointer location
x = str(d.root_x) # get x coord and convert to string
y = str(d.root_y) # get y coord and convert to string
dialog.info_dialog("(X, Y)", x+", "+y) # create an info dialog to display the coordinates

==================================

#Begin mouse click spam

if x == "on":
#turn it off if it is on
    store.set_global_value("clicker_status","off")
else:
    #any other value is considered off, should cover nulls
    store.set_global_value("clicker_status","on")

while True:
    time.sleep(1)
    #Click inside the action button
    mouse.click_absolute(650,1055,1)
    x = store.get_global_value("clicker_status")
    if x == "off":
        #leave the execution if we've been toggled off
        break
  1. Within Autokey, create a “New Script” from the drop-down. Copy/paste the Display Coords code. Create another script and copy/paste the button spam code. Bind them to keys.

  2. Switch to Warcraft.

  3. Hover over the button you wish to spam and press the key for the Display macro. Write down the coordinates.

  4. Edit the button spam script and change the coordinates to wherever your button is located. “Sleep(x)” is in seconds. 1 = One second. 0.1 = 10 milliseconds. Etc.

  5. Bind it to whatever button you want to spam and off you go.