-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtility.au3
77 lines (65 loc) · 1.37 KB
/
Utility.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "BasicUI.au3"
; basic key stroke simulator
Func SpamKey($key)
If $key == "" Then
Return
EndIf
If $FeedBack Then
FeedBackTip()
EndIf
$counter = 0
$times = Random(0, $KeySpamVariation, 1)
While $counter<$KeySpamN + $times
Send("{"&$key&"}")
Sleep(Random(0, $KeySpamSleep, 1)) ; sleep for random time
$counter+=1
WEnd
EndFunc
Func FeedBackTip()
ToolTip($FeedBackString, 0, 0)
EndFunc
Func PauseTip() ; report current configuration
ToolTip("Paused."& @CRLF& "keyspamN: "&$KeySpamN& @CRLF& "Keysleep: "&$KeySpamSleep& @CRLF& "keyvariation: "&$KeySpamVariation& @CRLF& "Pet Food Key: "&$PetFoodKey, 0, 0)
EndFunc
Func FeedPet()
If($FeedBack) Then
$FeedBackString = "Feed Pet"
EndIf
SpamKey($PetFoodKey)
Sleep(100)
EndFunc
; hold down the direction key $dir True for left, False for right
Func DirectionDown($dir)
If $dir Then
Spamkey("LEFT DOWN")
Sleep(1)
Else
SpamKey("RIGHT DOWN")
Sleep(1)
EndIf
EndFunc
Func DirectionUp($dir)
If $dir Then
SpamKey("LEFT UP")
Sleep(1)
Else
SpamKey("RIGHT UP")
Sleep(1)
EndIf
EndFunc
; resverse the current direction the character is facing
Func Reverse()
If $Left Then
Turn("right")
Else
Turn("left")
EndIf
EndFunc
; turn to the direction specifiedd by $dir, "left" or else right
Func Turn($dir)
If $dir == "left" Then
SpamKey("LEFT")
Else
SpamKey("RIGHT")
EndIf
EndFunc