Permalink
Browse files

Added samples directory

  • Loading branch information...
1 parent afb0190 commit 2022da22d4ee9b7239af2e7906827facb15baddc @ayanko committed Nov 19, 2011
Showing with 29 additions and 0 deletions.
  1. +29 −0 samples/accept_skype_terms.rb
@@ -0,0 +1,29 @@
+$:.unshift File.expand_path("../../lib")
+
+require "x11_client"
+
+client = X11Client.new(":0")
+
+client.start do |event|
+
+ case event['type']
+ when 'CreateWindowEvent'
+ window = client.get_window(event["window_id"])
+ next unless window
+
+ case window['class']
+ when /skype/i
+ case window['name']
+ when /End User License Agreement/i
+ # Accept Skype Agreement
+ client.mousemove(window['x'] + 500, window['y'] + 340)
+ client.sync
+ sleep(1)
+ client.mouseclick(1)
+ client.stop
+ end
+ end
+
+ end
+
+end

0 comments on commit 2022da2

Please sign in to comment.