this post was submitted on 27 Nov 2025
13 points (100.0% liked)

No Stupid Questions

3455 readers
35 users here now

There is no such thing as a Stupid Question!

Don't be embarrassed of your curiosity; everyone has questions that they may feel uncomfortable asking certain people, so this place gives you a nice area not to be judged about asking it. Everyone here is willing to help.


Reminder that the rules for lemmy.ca still apply!


Thanks for reading all of this, even if you didn't read all of this, and your eye started somewhere else, have a watermelon slice ๐Ÿ‰.


founded 3 years ago
MODERATORS
 

Doesnt have to be internet related, just useful shtuffs

you are viewing a single comment's thread
view the rest of the comments
[โ€“] lvxferre@mander.xyz 4 points 1 day ago* (last edited 1 day ago) (1 children)

Not quite a function but a small program: xdotool, that simulates keyboard and mouse activity. For plenty games xdotool and bash are all you need for an amazing (albeit simple) autoclicker. For example:

# Clicks the screen every 40ms. Great for Cookie Clicker and similar games.
if [[ $(xset -q | grep -o "Scroll Lock: off") == "Scroll Lock: off" ]]; then xdotool key Scroll_Lock; fi
  ScrollStatus=$"Scroll Lock: on"
  while [[ $(xset -q | grep -o "Scroll Lock: on") == "Scroll Lock: on" ]]; do
    xdotool click --repeat 4 --delay 40 1
    done

# Goes up, then down, then presses C. I use it to farm BP in Final Fantasy V, in an emulator.
if [[ $(xset -q | grep -o "Scroll Lock: off") == "Scroll Lock: off" ]]; then xdotool key Scroll_Lock; fi
  ScrollStatus=$"Scroll Lock: on"
  while [[ $(xset -q | grep -o "Scroll Lock: on") == "Scroll Lock: on" ]]; do
    xdotool key Up; xdotool key Down; xdotool key c
    done

This you assign the script to a shortcut, press it to turn it on, and Scroll Lock to turn it off.

It gets even better - with grabc (another small program, that probes the colour of a pixel), you can even make autoclicking scripts that react to changes in the game screen.

EDIT: as Tal highlighted, xdotool is for X11. It works with Wayland... a bit, most functions are broken. Wayland users are better off using ydotool. Same basic idea, though - you don't need to click it, you can tell your computer to do it for you!

[โ€“] tal@lemmy.today 2 points 1 day ago (1 children)

Note that xdotool is specific to X11. Ydotool can do some similar things in Wayland.

[โ€“] lvxferre@mander.xyz 1 points 1 day ago

True - I'll edit my comment to include this info.