mabicro 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mabicro.dll +0 -0
- data/lib/mabicro.rb +73 -0
- metadata +95 -0
data/lib/mabicro.dll
ADDED
Binary file
|
data/lib/mabicro.rb
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'Win32API'
|
2
|
+
|
3
|
+
$imageSearch = Win32API.new("mabicro", "ImageSearch", "LLLLPL", "I")
|
4
|
+
$getSearchedX = Win32API.new("mabicro", "GetSearchedX", "", "I")
|
5
|
+
$getSearchedY = Win32API.new("mabicro", "GetSearchedY", "", "I")
|
6
|
+
|
7
|
+
$sendKeyDown = Win32API.new("mabicro", "KeyDown", "I")
|
8
|
+
$sendKeyUp = Win32API.new("mabicro", "KeyUp", "I")
|
9
|
+
$moveCursor = Win32API.new("mabicro", "MouseTo", "II")
|
10
|
+
|
11
|
+
$sendMouseDown = Win32API.new("mabicro", "MouseDown", "I")
|
12
|
+
$sendMouseUp = Win32API.new("mabicro", "MouseUp", "I")
|
13
|
+
|
14
|
+
$getKeyState = Win32API.new("user32", "GetAsyncKeyState", "I", "I")
|
15
|
+
|
16
|
+
LEFT = 1
|
17
|
+
RIGHT = 2
|
18
|
+
|
19
|
+
def imageSearch(x1,y1, x2,y2, image, acc=0)
|
20
|
+
$imageSearch.call(x1,y1, x2,y2, image, acc)
|
21
|
+
end
|
22
|
+
def searchedX
|
23
|
+
$getSearchedX.call
|
24
|
+
end
|
25
|
+
def searchedY
|
26
|
+
$getSearchedY.call
|
27
|
+
end
|
28
|
+
|
29
|
+
def keyPressed?(key)
|
30
|
+
if $getKeyState.call(key.upcase.ord) == 0
|
31
|
+
return false
|
32
|
+
else
|
33
|
+
return true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def sendSingleKey(key, delay=0.01)
|
38
|
+
$sendKeyDown.call key.upcase.ord
|
39
|
+
sleep delay
|
40
|
+
$sendKeyUp.call key.upcase.ord
|
41
|
+
end
|
42
|
+
def sendInput(msg, delay=0.01)
|
43
|
+
msg.each_char do |ch|
|
44
|
+
sendSingleKey ch, delay
|
45
|
+
sleep delay
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def sendMouseDown(btn=LEFT)
|
50
|
+
$sendMouseDown.call btn
|
51
|
+
end
|
52
|
+
def sendMouseUp(btn=LEFT)
|
53
|
+
$sendMouseUp.call btn
|
54
|
+
end
|
55
|
+
|
56
|
+
def sendClick(btn=LEFT, delay=0.1)
|
57
|
+
sendMouseDown btn
|
58
|
+
sleep delay
|
59
|
+
sendMouseUp btn
|
60
|
+
end
|
61
|
+
|
62
|
+
def MoveCursor(x,y)
|
63
|
+
$moveCursor.call x,y
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
def MabiCro(delay=0.03, &block)
|
68
|
+
while true
|
69
|
+
block.call
|
70
|
+
|
71
|
+
sleep delay
|
72
|
+
end
|
73
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mabicro
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- pjc0247
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sqlite3
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.3.7
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.3.7
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: eventmachine
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.0.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: redis
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.0.2
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.0.2
|
62
|
+
description: macro zz
|
63
|
+
email:
|
64
|
+
- pjc0247@naver.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- lib/mabicro.dll
|
70
|
+
- lib/mabicro.rb
|
71
|
+
homepage: http://github.com/pjc0247/
|
72
|
+
licenses: []
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.3.6
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project: mabicro
|
91
|
+
rubygems_version: 1.8.25
|
92
|
+
signing_key:
|
93
|
+
specification_version: 3
|
94
|
+
summary: macro functionset
|
95
|
+
test_files: []
|