Mouse / Keyboard Automation for Linux
Suppose your favourite videogame/MiMORPG decides to take almost two minutes per manufactured Leaky Treebark Flask, just as you had bought 80 Wooly Mushrooms which need 80 flasks made to then be turned into Improbable Oil via the world renowned Improbable Oil Schenectady. So that's like six hours or some shit right there, not to mention the Pointy Clumps of Slag and all that jazz. You're looking at two days to digest those sweet, sweet, delicious Wooly Mushrooms! And suppose further you can't just get pissed off at the devs and leave, for... congenital reasons, so to speak.
What the fuck do you do then ?!
Well, here's what I did :
apt-get install xmacro, which is a few C++ scripts that make use of the horribly insecure construction that is the X window system.
xmacrorec2 > herp.txt, after which you proceed to switch back to game, click "Collect All", then shift-clickii the Disgusting Goop into the craft table, then click the Treebark Shavings pileiii and type a 2 so it now reads 12 then drag it over, then click on the Coarse Frangible Thread pile, delete the 12, put in a 3 and move it over.
sed /\n/\nDelay 0.2\n/ to introduce delays everywhere because somehow xmacro hasn't thought of this.
nano herp.txt, which should look at this point something like
MotionNotify 1055 522
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 920 520
Delay 0.6
KeyStrPress Shift_L
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 1135 535
Delay 0.6
KeyStrRelease Shift_L
Delay 0.6
MotionNotify 1145 530
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 914 570
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
KeyStrPress 2
Delay 0.1
KeyStrRelease 2
Delay 0.6
MotionNotify 870 618
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 1129 563
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 921 618
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
KeyStrPress BackSpace
Delay 0.2
KeyStrRelease BackSpace
Delay 0.6
KeyStrPress BackSpace
Delay 0.2
KeyStrRelease BackSpace
Delay 0.6
MotionNotify 920 618
Delay 0.6
KeyStrPress 3
Delay 0.1
KeyStrRelease 3
Delay 0.6
MotionNotify 884 661
Delay 0.6
ButtonPress 1
Delay 0.6
MotionNotify 889 662
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 1179 571
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
Delay 0.6
MotionNotify 1060 482
Delay 0.6
ButtonPress 1
Delay 0.6
ButtonRelease 1
to add a Delay 108 right up top (this number works for me, ymmv).
while :; do xmacroplay "$DISPLAY" < herp.txt; done; and you can now step safely away. The thing will wake up and do a succession of clicks resulting in the desired craft process being started every almost two minutes. You can chat in game or anything you wish - it's not liable to be bothered or care about you at all.
Nifty, huh ?
———Totally Massive. Like... I think earlier today there were five people on! At the same time and everything! [↩]Shift-click takes one out of a stack, ctrl-click takes the whole stack, plain click pops up a number selection dialogue. [↩]1300 items! From a previous lucky hit that yielded 1600 of the things in one go! 160`000% returns on that click! [↩]
« Female Trouble
Ultima Online »
Category: Trolloludens
Friday, 10 July, Year 7 d.Tr.