Skip to content

Instantly share code, notes, and snippets.

@kasari
Created March 4, 2018 07:58
Show Gist options
  • Save kasari/550c85fcc9f846106fe81a7d5baf2444 to your computer and use it in GitHub Desktop.
Save kasari/550c85fcc9f846106fe81a7d5baf2444 to your computer and use it in GitHub Desktop.
くじ引きサイクルでクルクルするのに疲れたときに使うスクリプト
TOP_RIGHT = {x: 1130, y: 530}
def diff(x, y)
return "#{TOP_RIGHT[:x] + x},#{TOP_RIGHT[:y] + y}"
end
PRE_PROCESS = [
"c:#{diff(0,0)}",
"c:#{diff(0,0)}",
"c:#{diff(0,0)}",
"c:#{diff(0,0)}",
]
LOOP = [
"dd:#{diff(0,0)}",
"dd:#{diff(0,100)}",
"dd:#{diff(-100,100)}",
"dd:#{diff(-100,0)}",
]
POST_PROCESS = [
"du:#{diff(0,0)}",
]
SWEEP = [
POST_PROCESS,
"c:#{diff(0,-130)}",
"c:#{diff(0,-130)}",
"c:#{diff(0,-130)}",
"c:#{diff(0,-130)}",
PRE_PROCESS,
].flatten
loop_count = ARGV[0].to_i
# loop_count = 1
commands = Array.new
commands.concat PRE_PROCESS
loop_count.times{|c|
commands.concat SWEEP if c%40 == 0
commands.concat LOOP
}
commands.concat POST_PROCESS
system("cliclick -r -w 40 #{commands.join(' ')}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment