Okay, I understand! You want to integrate the new clicking and key-sending features directly into the structure and style of the AutoHotkey script you provided.
Here's your edited script with the new functionalities:
🚀 Edited AutoHotkey Script
ahk
#Include C:\Users\owene\Downloads\BGS Infinity Coins Farm V4\Macro\Gdip_All.ahk
#Persistent
#SingleInstance Force
SetTitleMatchMode, 2
SetBatchLines, -1
; ============ CONFIGURABLE SETTINGS ============
global toggle := false
global clickToggle := true ; New: Controls which point is clicked next (A or B)
global interval := 25
global screenshotInterval := 30 * 60 * 1000 ; Unused for this core feature
global targetWindow := "Roblox"
global webhookUrl := "https://discord.com/api/webhooks/1381123746231746612/L_Jp_ovmNa-wrBKLw7uBxQwe0qXKvtCHMinIFZSoDS95kfccYXUD0sQ3ZP-B3XvyRcl0" ; Unused for this core feature
; --- NEW POINT COORDINATES ---
global PointAX := 500 ; X coordinate for Point A
global PointAY := 300 ; Y coordinate for Point A
global PointBX := 800 ; X coordinate for Point B
global PointBY := 300 ; Y coordinate for Point B
global KeyToSend := "q" ; Key to press after each click (e.g., "q", "r", "e", "space")
; ============ GUI SETUP ============
SysGet, monPrimary, MonitorPrimary
SysGet, monArea, MonitorWorkArea, %monPrimary%
guiWidth := 260
guiHeight := 170
xPos := monAreaRight - guiWidth - 10
yPos := monAreaBottom - guiHeight - 10
Gui, New
Gui, -Caption +AlwaysOnTop +ToolWindow
Gui, Color, 2a2a2a
Gui, Font, s10 cFFFFFF, Segoe UI
Gui, Add, Text, x10 y10 w240 h30 cFFDD00, Macro - Auto Clicker
Gui, Add, Text, x10 y50 w240 h20, F1 - Start [Clicks] ; Updated text
Gui, Add, Text, x10 y70 w240 h20, F2 - Stop
Gui, Add, Text, x10 y90 w240 h20, F3 - Exit
Gui, Add, Text, x10 y110 w240 h20, Current Interval: %interval% ms
Gui, Show, x%xPos% y%yPos% w%guiWidth% h%guiHeight%, MacroStatus
return
; ============ HOTKEYS ============
F1::
toggle := true
SetTimer, ClickLoop, %interval% ; Changed SpamKey to ClickLoop
return
F2::
toggle := false
SetTimer, ClickLoop, Off ; Changed SpamKey to ClickLoop
return
F3::
toggle := false
SetTimer, ClickLoop, Off
Gui, Destroy
ExitApp
return
; ============ TIMER FUNCTION (Clicking and Sending) ============
ClickLoop: ; Renamed from SpamKey to better reflect functionality
IfWinActive, %targetWindow%
{
; Ensure script is still meant to be running
if (!toggle) {
return
}
if (clickToggle) { ; If true, click Point A
Click, %PointAX%, %PointAY%
} else { ; If false, click Point B
Click, %PointBX%, %PointBY%
}
SendInput, %KeyToSend% ; Press the specified key after the click
clickToggle := !clickToggle ; Flip the toggle for the next click (A then B, then A, etc.)
}
return
🔥 What's Changed?
New Global Variables:
PointAX, PointAY, PointBX, PointBY: These are your configurable coordinates for Point A and Point B.
KeyToSend: This is the key that will be pressed after each click.
clickToggle := true: A new internal variable to help the script alternate between clicking Point A and Point B.
GUI Text Update:
F1 - Start [R] has been changed to F1 - Start [Clicks] to reflect that it's no longer just sending 'R' but performing clicks and then sending a custom key.
Renamed Timer Function:
The SpamKey label has been renamed to ClickLoop to be more descriptive of its new purpose (clicking and sending).
The F1 and F2 hotkeys now call SetTimer, ClickLoop.
Core Logic in ClickLoop:
It now uses the clickToggle variable to alternate between Point A and Point B.
Click, %PointAX%, %PointAY% or Click, %PointBX%, %PointBY% performs the click.
SendInput, %KeyToSend% presses your defined key immediately after the click.
clickToggle := !clickToggle flips the state of clickToggle so the next execution of ClickLoop clicks the other point.
📝 How to Use:
Update Your Script: Replace the content of your existing .ahk file with the code provided above.
Adjust Coordinates & Key:
PointAX, PointAY, PointBX, PointBY: Crucially, set these to the actual X and Y pixel coordinates on your screen where you want the clicks to occur. (You can use AutoHotkey's built-in "Window Spy" tool to easily find coordinates).
KeyToSend: Change "q" to whatever key you want the script to press after each click (e.g., "e", "space", "1", etc.).
Run: Double-click the .ahk file to run the script.
Control:
Press F1 to start the alternating clicks and key presses.
Press F2 to stop the clicks and key presses.
Press F3 to close the script and its GUI.
Now your script has the exact features you requested, built right into your preferred structure!