Hey I really like the idea, but.. sry if I say that, but your script is kinda badly done in some ways. This is no offense, I just want to help here and since the script was made with a Macromaker and not by hand it's understandable. Some problems with your script:
- Has to be located on a specific location on your drive
- Only works for a resolution of 1366 x 768. All other might won't get the notification (if the window is further bottom right)
- An amount of how often to loop. This is so not neccessary at all. Is there really a reason to put a number below 99999999 in there? Why not using an infinite loop?
- No pause / restart. Only start and complete exit out of the script
- No errors! (Yeah I know not really important, but if someone swaps the sound or image file and the script is not working anymore he won't get a reasoning)
-Lots of stuff you don't need (Macro Creator's fault)
So I changed it a bit. It has all the above points fixed.
Put it where you want. F3 to start, F4 to pause and F8 to exit.
Code:
F3::
Loopbreak = 0
InputBox, spamtext, Spam Text, What Message Do You Want Spammed?, , , , , , , 0
InputBox, delay, Delay Time?, What do you want your delay time to be? 1000 = 1 Second, , , , , , , 0
Loop,
{
if (Loopbreak = 1)
break
Sleep, %delay%
Send, {Enter}
SetKeyDelay, 0
SendRaw, %spamtext%
Send, {Enter}
CoordMode, Pixel, Screen
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %A_ScriptDir%\accept.png
If ErrorLevel = 2
{
MsgBox Could not load image file!
}
If ErrorLevel = 0
{
SoundPlay, %A_ScriptDir%\trade.mp3
If ErrorLevel = 1
{
MsgBox Could not load sound file!
}
}
}
Return
F4::
Loopbreak = 1
Return
F8::ExitApp
Also OP: If you like you can update your first post with this one or compile it. so others will have a fixed version without scrolling down the thread