Bash Scripting & mapwith.ai
Posted by PhysicsArmature on 27 April 2020 in English. Last updated on 4 January 2022.Problem:
I need to slap down one set of 50 houses. I want to click as few things as possible. Script 1 is about this task. Script 2 is about finding the coordinates of things on your screen.
Notice: Eliminate [] before the pound sign, I needed to differentiate kramdown and BASH code. Notice 2: I have this weird spacing, otherwise journal system tries to turn a script into a paragraph.
SCRIPT 1
[]#!/bin/bash
[]#pull up script
sleep 4
[]#0.1 is to fast
for i in {1..49}
do
echo -e $i
[]#Find a house and click on it yourself
[]#Go to xy of use this feature xxxyyy
sleep 1.8
xdotool mousemove 35 243 click 1 &
[]#Go to xy of change this feature
sleep 0.3
xdotool mousemove 53 211 click 1 &
[]#Go to xy of option 1 house
sleep 0.3
xdotool mousemove 51 276 click 1 &
done
echo DONE
SCRIPT 2
[]#!/bin/bash
[]#pull up script
sleep 5
for i in {1..200}
do
xdotool getmouselocation –shell
eval $(xdotool getmouselocation –shell)
echo $X $Y
sleep 5
done
Works used:
https://stackoverflow.com/questions/8480073/how-would-i-get-the-current-mouse-coordinates-in-bash https://askubuntu.com/questions/179581/how-can-i-make-my-mouse-auto-click-every-5-seconds
Potential future targets for when I have time (Not for 2 weeks):
- Another for loop for several sets of 50.
- Search for the color pink on the screen and click it. Ask [Y/n] on the command prompt, then mark it.
- Custom input that asks for pauses.
Discussion