[Help] [AHK] Auto remove objects issue

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SnijDeBij
Posts: 2
Joined: 19 Jun 2017, 01:59

[Help] [AHK] Auto remove objects issue

19 Jun 2017, 02:11

https://youtu.be/lLMIYcDzvMw
When i do te thing i do in the video all the object are removed, why is that and how could i fix that?

My code is:

Code: Select all

FileInstall, Bar.png, %a_temp%/Bar.png
FileInstall, Close.png, %a_temp%/Close.png
FileInstall, Minemize.png, %a_temp%/Minemize.png
FileInstall, Start.png, %a_temp%/Start.png
FileInstall, Stop.png, %a_temp%/Stop.png
FileInstall, Backround.png, %a_temp%/Backround.png

Index:
Gui, -Caption
Gui, font, s15
Gui, Show, x130 y90 h698 w300, AutoClicker
Gui, Color, 488ccb 
Gui, Add, Radio, x30 y140 Checked vRad1 cWhite, Random Click/MilSec 
Gui, Add, Radio, x30 y260 vRad2 cWhite, Click/MilSec
Gui, Add, Radio, x30 y340 vRad3 cWhite, Double Click
Gui, Add, Radio, x30 y390 vRad4 cWhite, Tripple Click
Gui, Add, Edit, x50 y170 8 vMinSec, 100
Gui, Add, Edit, x50 y208 8 vMaxSec, 120
Gui, Add, Text, x100 y175 cWhite, Min
Gui, Add, Text, x100 y213 cWhite, Max
Gui, Add, Edit, x50 y290 8 vSec, 120
Gui, Add, Picture, x265 y5 gClose, %a_temp%/Close.png
Gui, Add, Picture, x0 y0 gUImove, %a_temp%/Bar.png
Gui, Add, Picture, x35 y440 gStart, %a_temp%/Start.png
Gui, Add, Picture, x35 y540 gStop, %a_temp%/Stop.png
Gui, Add, Picture, x0 y40, %a_temp%/Backround.png
Gui, Submit, NoHide
return

Start:
Gui, Submit, NoHide
if (Rad1==1)
Loop {
MouseClick, left
Random, sleeprand, %MinSec%, %MaxSec%
Sleep, %sleeprand%
}
else if (Rad2==1)
Loop {
MouseClick, left
Sleep, %Clicks%
}
else if (Rad3==1)
Loop {
if(GetKeyState("LButton")) {
Send, {Click 2}
}
}
else if (Rad4 = true)
Loop {
if(GetKeyState("LButton")) {
Send, {Click 3}
}
}
return

Stop:
Reload
return

UImove:
PostMessage, 0xA1, 2,,, A
return

Close:
Exitapp

F11::
Pause, toggle
Return

F12::
Exitapp
User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: [Help] [AHK] Auto remove objects issue

19 Jun 2017, 04:33

It may be useful to return false on WM_ERASEBKGND, it looks similar to issues I've seen before.

Code: Select all

FileInstall, Bar.png, %a_temp%/Bar.png
FileInstall, Close.png, %a_temp%/Close.png
FileInstall, Minemize.png, %a_temp%/Minemize.png
FileInstall, Start.png, %a_temp%/Start.png
FileInstall, Stop.png, %a_temp%/Stop.png
FileInstall, Backround.png, %a_temp%/Backround.png

Index:
Gui, -Caption
Gui, font, s15
Gui, Show, x130 y90 h698 w300, AutoClicker
Gui, Color, 488ccb 
Gui, Add, Radio, x30 y140 Checked vRad1 cWhite, Random Click/MilSec 
Gui, Add, Radio, x30 y260 vRad2 cWhite, Click/MilSec
Gui, Add, Radio, x30 y340 vRad3 cWhite, Double Click
Gui, Add, Radio, x30 y390 vRad4 cWhite, Tripple Click
Gui, Add, Edit, x50 y170 8 vMinSec, 100
Gui, Add, Edit, x50 y208 8 vMaxSec, 120
Gui, Add, Text, x100 y175 cWhite, Min
Gui, Add, Text, x100 y213 cWhite, Max
Gui, Add, Edit, x50 y290 8 vSec, 120
Gui, Add, Picture, x265 y5 gClose, %a_temp%/Close.png
Gui, Add, Picture, x0 y0 gUImove, %a_temp%/Bar.png
Gui, Add, Picture, x35 y440 gStart, %a_temp%/Start.png
Gui, Add, Picture, x35 y540 gStop, %a_temp%/Stop.png
Gui, Add, Picture, x0 y40, %a_temp%/Backround.png
OnMessage(0x14,"OnErase") ;when recieving message 0x14, goto function OnErase()
return

Start:
Gui, Submit, NoHide
if (Rad1) {
	Loop {
		MouseClick, left
		Random, sleeprand, %MinSec%, %MaxSec%
		Sleep, %sleeprand%
	}
} else if (Rad2) {
	Loop {
		MouseClick, left
		Sleep, %Clicks%
	}
} else if (Rad3) {
	Loop {
		if(GetKeyState("LButton"))
			Send, {Click 2}
	}
} else if (Rad4) {
	Loop {
		if(GetKeyState("LButton"))
			Send, {Click 3}
	}
}
return

Stop:
Reload
return

UImove:
PostMessage, 0xA1, 2,,, A
return

Close:
Exitapp

F11::
Pause, toggle
Return

F12::
Exitapp

OnErase() { ;do not erase window when offscreen/minimized
	return false
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid and 211 guests