emiln / cljck

An OS-agnostic Clojure library for automating keyboard and mouse actions.
GNU General Public License v3.0
5 stars 0 forks source link

Process files with scripted events. #10

Closed emiln closed 9 years ago

emiln commented 9 years ago

It would be neat to be able to save various routines in text files and have cljck process them. The format should be simple data, and EDN seems an excellent fit. It would be simple if the format could be precisely the same as the internal format passed to the event-channel A script could then look as follows:

[:repeat
 [:click]
 [:move-to 500 1200]
 [:click]
 [:click]]

To fit as a single command, I imagine composite events like :repeat will be needed. Repeating stuff over and over again seems to be my primary use case, anyway. This brings the sum total of tasks in this issue to:

  1. [x] Implement a :repeat event that has two function signatures: [& body] and [repetitions & body].
  2. [x] Write a function that processes an EDN file.
emiln commented 9 years ago

As suggested by @Mikkeren it seems simpler to introduce [:repeat n ...] to repeat the body of commands n times, and [:repeatedly ...] to just repeatedly run the body of commands with no termination.