Ticket #730: zOMG.idle.au3

File zOMG.idle.au3, 1.7 KB (added by ransombot, 16 years ago)
Line 
1#include <GUIConstants.au3> ; enable gui elements like forms buttons and pix
2#include "speak.au3" ;  enble speak("text") function
3Opt("SendKeyDelay", 0)
4Opt("SendKeyDownDelay", 0)
5Opt("ColorMode", 0)
6Global $Paused
7HotKeySet("{PAUSE}", "TogglePause")
8HotKeySet("{ESC}", "Terminate")
9HotKeySet("^s","SetLoc")
10HotKeySet("^c","SetCombat")
11
12;HotKeySet("{ESC}", "Quit") ;So we be able to exit from the loop
13
14;setup our locations as globals so we can grab them anywhere & have them the same.
15Const $xc as 0
16Const $yc as 1
17Global $CombatLoc[2]
18$CombatLoc[$xc] = 133
19$CombatLoc[$yc]=150
20
21;setup our color swatch for
22Global $CombatColor
23
24;a toggle to see if we are in combat
25Global $InCombat as Binary
26$InCombat = 0
27;$run = 1
28
29;While $run = 1
30
31;WEnd
32
33Func CombatLoop
34        While 1
35                Sleep(2000)
36                ;set up a scanner that loops every second could be faster
37                Do             
38                        ToolTip(PixelGetColor(CombatLoc[$xc], $CombatLoc[$yc]),0,0)
39                        sleep(1000)
40                        Send("`")
41                Until PixelGetColor(CombatLoc[$xc], $CombatLoc[$yc]) <> "101010"
42               
43                ; we are in combat so we need to do combat stuff now every second it spams skills
44                ; since the smallest cool downs are about a second this works grate.
45                While PixelGetColor(CombatLoc[$xc], $CombatLoc[$yc]) = "101010"
46                        ToolTip(PixelGetColor(CombatLoc[$xc], $CombatLoc[$yc]),6),0,0)
47                        sleep(1000)
48                        Send("15")
49                WEnd
50                Send("67")
51                Sleep(1000)
52                send("k")
53        WEnd
54EndFunc
55
56Func Quit()
57    Exit
58EndFunc
59
60
61Func TogglePause()
62    $Paused = NOT $Paused
63    While $Paused
64        sleep(100)
65        ToolTip('Script is "Paused"',0,0)
66    WEnd
67    ToolTip("")
68EndFunc
69
70Func Terminate()
71        Speak("I hope you liked the fish!")
72    Exit 0
73EndFunc
74
75Func SetCombat()
76        $InCombat = Binary
77EndFunc