Top Level Namespace

Constant Summary collapse

LEFT =
1
RIGHT =
2

Instance Method Summary collapse

Instance Method Details

#imageSearch(x1, y1, x2, y2, image, acc = 0) ⇒ Object



19
20
21
# File 'lib/mabicro.rb', line 19

def imageSearch(x1,y1, x2,y2, image, acc=0)
	$imageSearch.call(x1,y1, x2,y2, image, acc)
end

#keyPressed?(key) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
35
# File 'lib/mabicro.rb', line 29

def keyPressed?(key)
	if $getKeyState.call(key.upcase.ord) == 0
		return false
	else
		return true
	end
end

#MabiCro(delay = 0.03, &block) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/mabicro.rb', line 67

def MabiCro(delay=0.03, &block)
	while true
		block.call

		sleep		delay
	end
end

#MoveCursor(x, y) ⇒ Object



62
63
64
# File 'lib/mabicro.rb', line 62

def MoveCursor(x,y)
	$moveCursor.call	x,y
end

#searchedXObject



22
23
24
# File 'lib/mabicro.rb', line 22

def searchedX
	$getSearchedX.call
end

#searchedYObject



25
26
27
# File 'lib/mabicro.rb', line 25

def searchedY
	$getSearchedY.call
end

#sendClick(btn = LEFT, delay = 0.1) ⇒ Object



56
57
58
59
60
# File 'lib/mabicro.rb', line 56

def sendClick(btn=LEFT, delay=0.1)
	sendMouseDown btn
	sleep			delay
	sendMouseUp	btn
end

#sendInput(msg, delay = 0.01) ⇒ Object



42
43
44
45
46
47
# File 'lib/mabicro.rb', line 42

def sendInput(msg, delay=0.01)
	msg.each_char do |ch|
		sendSingleKey	ch, delay
		sleep			delay
	end
end

#sendMouseDown(btn = LEFT) ⇒ Object



49
50
51
# File 'lib/mabicro.rb', line 49

def sendMouseDown(btn=LEFT)
	$sendMouseDown.call	btn
end

#sendMouseUp(btn = LEFT) ⇒ Object



52
53
54
# File 'lib/mabicro.rb', line 52

def sendMouseUp(btn=LEFT)
	$sendMouseUp.call		btn
end

#sendSingleKey(key, delay = 0.01) ⇒ Object



37
38
39
40
41
# File 'lib/mabicro.rb', line 37

def sendSingleKey(key, delay=0.01)
	$sendKeyDown.call key.upcase.ord
	sleep				delay
	$sendKeyUp.call	key.upcase.ord
end