[Tool] Auto-Click script [Linux]

User avatar
lisacvuk
Member
 
Posts: 165
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

[Tool] Auto-Click script [Linux]

by lisacvuk » Fri Jun 26, 2015 08:47

Today I was playing a bit around Craig's server, and I needed some concrete for the ongoing railway project. So, I gone to my storage, took cobble and cactus, and cooked it all in microwaves. Then, after that, I had a full inventory of stone. I thought it would be nice if I could just click once and make it all concrete. So, I came up with this idea: why don't I bind 100 mouse clicks to a specific keyboard shortcut? So... I found out about a program called "xdotool". Moreover, it was inside Kubuntu 15.04 repositories. To install it, I just used:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
sudo apt-get install xdotool

Then, I wrote this script:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#!/bin/bash
xdotool click --repeat 100 1

Quite simple, huh?
It will click 100 times at the current mouse position. So, now we just need to make a keyboard shortcut that activates this script. In KDE, it is quite easy, just follow the pictures...
Image
Image
Image
Image
Image
I hope this helps anyone...
400 character limit? Am I writing a book?
I'm a Minetest player, 'learning' C++ and OpenGL, listening to Blind Guardian, Nightwish, Amon Amarth. Administrator on Craig's server. Likes cookies.
I live in Serbia.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: [Tool] Auto-Click script [Linux]

by Calinou » Fri Jun 26, 2015 11:13

xdotool can do much more, see its command list:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
  getactivewindow
  getwindowfocus
  getwindowname
  getwindowpid
  getwindowgeometry
  getdisplaygeometry
  search
  selectwindow
  help
  version
  behave
  behave_screen_edge
  click
  getmouselocation
  key
  keydown
  keyup
  mousedown
  mousemove
  mousemove_relative
  mouseup
  set_window
  type
  windowactivate
  windowfocus
  windowkill
  windowclose
  windowmap
  windowminimize
  windowmove
  windowraise
  windowreparent
  windowsize
  windowunmap
  set_num_desktops
  get_num_desktops
  set_desktop
  get_desktop
  set_desktop_for_window
  get_desktop_for_window
  get_desktop_viewport
  set_desktop_viewport
  exec
  sleep
 

User avatar
lightonflux
Member
 
Posts: 384
Joined: Mon Nov 11, 2013 07:22
In-game: lof

Re: [Tool] Auto-Click script [Linux]

by lightonflux » Fri Jun 26, 2015 16:13

There is also a proprietary GUI for that:

http://www.murguu.com/

Just for those who need it.
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 27 guests

cron