-
Notifications
You must be signed in to change notification settings - Fork 4
/
Autoclicker
86 lines (83 loc) · 2.28 KB
/
Autoclicker
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
78
79
80
81
82
83
84
85
86
local CoreGui = game:GetService("CoreGui")
local Players = game:GetService("Players")
local VirtualInputManager = game:GetService("VirtualInputManager")
local Player = Players.LocalPlayer
local Enabled = false
local Mouse = Player:GetMouse()
local X, Y = 0, 0
local LastC = Color3.new(1, 0, 0)
local LastU = tick()
if not pcall(function() return syn.protect_gui end) then
syn = {}
syn.protect_gui = function(A_1)
A_1.Parent = CoreGui
end
end
local Library = loadstring(game:HttpGetAsync('https://pastebin.com/raw/edJT9EGX'))()
local Window = Library:CreateWindow("Autoclicker")
Enabled_1 = Window:AddColor({
text = 'Status:',
flag = "Ezpi_1",
color = Color3.new(1, 0, 0),
callback = function(A_1)
-- "Enabled" Color
local NewColor = Color3.new(0, 1, 0)
if Enabled == false then
NewColor = Color3.new(1, 0, 0)
end
if NewColor ~= Last or A_1 ~= NewColor then
Last = NewColor
Enabled_1:SetColor(NewColor)
end
end
})
Window:AddBind({
text = 'Toggle',
callback = function()
-- Toggle
Enabled = not Enabled
-- "Enabled" Color
local NewColor = Color3.new(0, 1, 0)
if Enabled == false then
NewColor = Color3.new(1, 0, 0)
end
if NewColor ~= Last then
Last = NewColor
Enabled_1:SetColor(NewColor)
end
-- Click Position
if Enabled then
-- Update Mouse Pos
X, Y = Mouse.X, Mouse.Y + 10
-- Update Box
Box_1:SetValue()
else
X, Y = 0, 0
Box_1:SetValue()
end
-- AutoClick
while Enabled do
VirtualInputManager:SendMouseButtonEvent(X, Y, 0, true, game, 1)
VirtualInputManager:SendMouseButtonEvent(X, Y, 0, false, game, 1)
wait(Library.flags.Interval)
end
end
})
Window:AddSlider({
text = 'Interval',
min = 0.01,
max = 2,
value = 1,
float = 0.01
})
Box_1 = Window:AddBox({
text = "AutoClick Position:",
value = "X: " .. X .. ", Y: " .. Y,
callback = function()
if tick()-LastU > 0.1 then
LastU = tick()
Box_1:SetValue("X: " .. X .. ", Y: " .. Y)
end
end
})
Library:Init()