Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
i think i tried fixing hotkeys but i wrote this long ago
  • Loading branch information
Banaanae authored Jun 2, 2023
1 parent 6d21a44 commit 286f094
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions source.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ AC/CC/G_(name) = Func Gui (and labels if I add any)

#SingleInstance Force

Gui_G := "CC"

Clicks_CC := 1
Hotkey_CC := ""
previousHotkeyCC := "" ; Prob won't need, same with ac
Active_CC := "False"

HotKey_AC := ""
previousHotkeyAC := ""
Active_AC := "False"

LButton::
Expand All @@ -35,22 +34,25 @@ LButton::
Click
} Until (Active_CC = "False")
}
;Hotkey("LButton", "On")

Hotkey("LButton", "Off")

CC_OpenAutoClicker(*) {
previousHotkeyCC := ""
Hotkey_CC := ""
global
CC_Gui.Hide()
;MsgBox("If you want to click forever press 0 in Click Amount", "Important", 64) ; TODO Find better way
Gui_G := "AC"
AC_Gui.Show()
HotKeyCtrl_AC.Value := Hotkey_CC
MsgBox("1: " HotKeyCtrl_AC.Value "2:" Hotkey_CC)
;Hotkey_CC := ""
}

CC_Gui := Gui(, "Cheat Clicker")
CC_Gui.AddText("x10 y10 w90 h20", "Clicks per click")
CC_Gui.AddText("x110 y10 w90 h20", "Stop Hotkey")
ClicksCtrl_CC := CC_Gui.AddEdit("x10 y40 w90 h20 number", "2")
HotkeyCtrl_CC := CC_Gui.AddHotkey("x110 y40 w90 h20 vHotkey_CC Disabled") ; TODO Fix hotkey
CC_Gui.AddHotkey("x110 y40 w90 h20 vHotkey_CC") ; TODO Fix hotkey ; HotkeyCtrl_CC :=
CC_Gui.AddButton("x10 y70 w190 h20", "Start Cheat Clicking").OnEvent("Click", CC_StartCheatClicking)
CC_Gui.AddButton("x10 y100 w190 h20", "Open AutoClicker").OnEvent("Click", CC_OpenAutoClicker)
CC_Gui.AddText("x58 y130", "Made by Banaanae")
Expand All @@ -60,7 +62,8 @@ CC_Gui.Show()

CC_StartCheatClicking(*) {
global
Hotkey_CC := HotkeyCtrl_CC.value
MsgBox(Hotkey_CC)
MsgBox("1: " HotKeyCtrl_CC.Value "2:" Hotkey_CC)
if (Hotkey_CC = "") {
noHotkey := MsgBox("You have not set a stop hotkey!`nWithout a stop hotkey it may be hard to stop cheat clicking`nSet one now?", "Alert", 52)
if (noHotkey = "Yes") {
Expand All @@ -73,7 +76,7 @@ if (Clicks_CC = 1)
{
Hotkey("LButton", "Off")
}
;Hotkey(Hotkey_CC, CC_Toggle(), "On")
Hotkey(Hotkey_CC, CC_Toggle())
Active_CC := "True"
}

Expand All @@ -97,20 +100,21 @@ Else
AC_Gui := Gui(, "AutoClicker")
AC_Gui.AddText("x10 y10 w70 h20", "Delay (ms)")
AC_Gui.AddText("x90 y10 w70 h20", "Click Amount")
AC_Gui.AddText("x170 y10 w70 h20 Disabled", "Hotkey")
AC_Gui.AddText("x170 y10 w70 h20", "Hotkey")
AC_Gui.AddText("x250 y10 w70 h20", "Click Type")
DelayCtrl_AC := AC_Gui.AddEdit("x10 y30 w70 h20 number", "1")
AmountCtrl_AC := AC_Gui.AddEdit("x90 y30 w70 h20 number", "0")
HotKey_AC := AC_Gui.AddHotkey("x170 y30 w70 h20 Disabled")
HotKeyCtrl_AC := AC_Gui.AddHotkey("x170 y30 w70 h20")
ClickTypeCtrl_AC := AC_Gui.AddDDL("x250 y30 w70 h20 R3 Choose1", ["Left","Middle","Right"])
AC_Gui.AddButton("x10 y60 w150 h20", "Start").OnEvent("Click", AC_StartBtn)
AC_Gui.AddButton("x170 y60 w150 h20", "Stop").OnEvent("Click", AC_StopBtn)
AC_Gui.AddButton("x10 y90 w310 h20", "Return to Cheat Clicker").OnEvent("Click", AC_ReturntoCheatClicker)
AC_Gui.AddText("x120 y120", "Made by Banaanae")


AC_Start(Delay_AC, Amount_AC, ClickType_AC, Active_AC)
AC_Start(Delay_AC, Amount_AC, ClickType_AC)
{
global
Loop Amount_AC
{
if (ClickType_AC = "Left")
Expand All @@ -126,47 +130,44 @@ AC_Start(Delay_AC, Amount_AC, ClickType_AC, Active_AC)
Click("Middle")
}
Sleep(Delay_AC)
} until Active_AC = "False"
} Until Active_AC = "False"
Active_AC := "False"
}


AC_StartBtn(*) {
global
Delay_AC := DelayCtrl_AC.Text
Amount_AC := AmountCtrl_AC.Text
if (Amount_AC = 0) {
Amount_AC := ""
}
;HotKey_AC := HotKeyCtrl_AC.Text
HotKey_AC := HotKeyCtrl_AC.Value
Hotkey(HotKey_AC, AC_HotKey, "On")
ClickType_AC := ClickTypeCtrl_AC.Text
Active_AC := "True"
AC_Start(Delay_AC, Amount_AC, ClickType_AC, Active_AC)
AC_Start(Delay_AC, Amount_AC, ClickType_AC)
}

/*
HotKey_AC() {
if previousHotkeyAC {
Hotkey(%previousHotkeyAC%,, Off)
}
if !HotKey_AC {
Return
}
AC_HotKey(*) {
global
if (Active_AC = "True") {
Active_AC := "False"
} Else {
Active_AC := "True"
;autoClickerStart(Amount, clickType, delay, Active_AC)
AC_Start(Delay_AC, Amount_AC, ClickType_AC)
}
previousHotkeyAC := HotKey_AC
}
*/

AC_StopBtn(*) {
global
Active_AC := "False"
}

AC_ReturntoCheatClicker(*) {
global
AC_Gui.Hide()
Gui_G := "CC"
CC_Gui.Show()
}

Expand All @@ -175,13 +176,19 @@ CC_Gui.OnEvent("Close", G_GuiClose)
AC_Gui.OnEvent("Close", G_GuiClose)

G_GuiClose(*) {
global
if (Active_CC = "True") {
Hotkey("LButton", "Off")
;Active_CC := "False"
Active_CC := "False"
}
closeGui := MsgBox("Do you want to close Cheat Clicker?", "Exit App?", 36)

if (closeGui = "Yes") {
ExitApp
ExitApp
} Else {
if (Gui_G = "CC") {
CC_Gui.Show()
} Else {
AC_Gui.Show()
}
}
}

0 comments on commit 286f094

Please sign in to comment.