ask for help about my script Topic is solved

Ask gaming related questions (AHK v1.1 and older)
paulai1987
Posts: 4
Joined: 07 Jul 2022, 04:55

ask for help about my script

Post by paulai1987 » 07 Jul 2022, 05:13

Code: Select all

~F9::
ToolTip
Toggle := !Toggle
loop
{
 If not Toggle
	break
    ToolTip, 51f, 798, -29
IfWinActive, Diablo 2
{
img1 = C:\Users\LovesKoh\Downloads\mage bot\inventory\fullbp.png

ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *50 %img1%
if(ErrorLevel == 0)
{

}
else
{
send, A                    <<<<< here i want to stop the script pressing the A because if continue pressing A will automatically teleport to another location
Sleep, 10000             <<<<< as you can see here i put a sleep so the script is not continue for press the A
SendInput, i
Sleep, 5000
}
}
else
{
ToolTip
break
}
}
return

~F11::
ToolTip
Pause::
Suspend
Pause,,1
return
how to solve this problem i want to stop my script automatically when im afk


[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: ask for help about my script  Topic is solved

Post by mikeyww » 07 Jul 2022, 05:58

Welcome to this AutoHotkey forum! Would have a look here: https://www.autohotkey.com/docs/Variables.htm#TimeIdlePhysical

You could use a SetTimer to check it.

paulai1987
Posts: 4
Joined: 07 Jul 2022, 04:55

Re: ask for help about my script

Post by paulai1987 » 07 Jul 2022, 06:25

mikeyww wrote:
07 Jul 2022, 05:58
Welcome to this AutoHotkey forum! Would have a look here: https://www.autohotkey.com/docs/Variables.htm#TimeIdlePhysical

You could use a SetTimer to check it.
hi sir how do you convert this 9.5 sec in sleep script

paulai1987
Posts: 4
Joined: 07 Jul 2022, 04:55

Re: ask for help about my script

Post by paulai1987 » 07 Jul 2022, 06:30

how do you convert 9.5sec to a sleep script like for example: sleep 5000

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: ask for help about my script

Post by mikeyww » 07 Jul 2022, 06:57

9.5 seconds is 9500 milliseconds.

Post Reply

Return to “Gaming Help (v1)”