Improve my script help!!!

Ask gaming related questions (AHK v1.1 and older)
trafalgar30
Posts: 4
Joined: 21 Aug 2018, 19:53

Improve my script help!!!

21 Aug 2018, 21:45

this is the code ive been working the instance is:

Loop A, retarget, autoloot should be running from the start
then here comes loop B will run after 30mins
while loop B is executing the command Loop A, retarget, autoloot should stop functioning and resumes after loop B ends
this instance will repeat forever
please help me

#Persistent
SetTimer, LoopA, 500
SetTimer, LoopB, 1800000
SetTimer, Retarget, 2500
SetTimer, Autoloot, 500
Return

LoopA:
Loop
{
Send {1}
sleep 500
Send {2}
sleep 500
Send {3}
sleep 500
Send {4}
sleep 500
Send {5}
sleep 500
Send {6}
sleep 500
Send {7}
sleep 500
Send {8}
sleep 500
}
Return

LoopB:
Loop
{
MouseClick, left, x, y,
sleep 5000
MouseClick, left, x, y,
sleep 30000
MouseClick, left, x, y,
sleep 30000
Return

Retarget:
Send {E down} {E up}
Return

Autoloot:
Send {Space}
Return

Delete::
Pause
Return
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Improve my script help!!!

25 Aug 2018, 11:44

Code: Select all

i := 0
SetTimer, LoopB, -1800000
toggleTimers(true)
Return

LoopA:
	if (++i > 8)
		i := 1

	Send % i
Return

LoopB:
	toggleTimers(false)
	MouseClick, left, x, y,
	sleep 5000
	MouseClick, left, x, y,
	sleep 30000
	MouseClick, left, x, y,
	sleep 30000
	toggleTimers(true)
Return

Retarget:
	Send {E down} {E up}
Return

Autoloot:
	Send {Space}
Return

Delete::Pause

toggleTimers(toggle) {
	SetTimer, LoopA, % toggle ? "500" : "Off"
	SetTimer, Retarget, % toggle ? "2500" : "Off"
	SetTimer, Autoloot, % toggle ? "500" : "Off"
}
Rindis
Posts: 213
Joined: 23 Dec 2013, 13:58
Location: Norway
Contact:

Re: Improve my script help!!!

02 Sep 2018, 07:22

Code: Select all

#Persistent
SetTimer, LoopA, 500
SetTimer, LoopB, 4000
SetTimer, Retarget, 2500
SetTimer, Autoloot, 500
Return

LoopA:
Loop
{
Send {1}
sleep 500
Send {2}
sleep 500
Send {3}
sleep 500
Send {4}
sleep 500
Send {5}
sleep 500
Send {6}
sleep 500
Send {7}
sleep 500
Send {8}
sleep 500
}
Return

LoopB:
SetTimer, LoopA, Off
SetTimer, Retarget, Off
SetTimer, Autoloot, off

MouseClick, left, x, y,
sleep 500
MouseClick, left, x, y,
sleep 300
MouseClick, left, x, y,
sleep 300

SetTimer, LoopA, 500
SetTimer, Retarget, 2500
SetTimer, Autoloot, 500
Return

Retarget:
Send {E down} {E up}
Return

Autoloot:
Send {Space}
Return

Delete::
Pause
Return


esc::
ExitApp

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 73 guests