1 (изменено: mrgro, 2020-09-15 13:19:46)

Тема: AHK: Интегрировать один скрипт в другой

Добрый день!
Первый скрипт должен читать чат лог и при нахождении текста временно прекратить исполнение основного скрипта, выполнить действие, после чего основной сможет продолжить работу. Не знаю как их совместить и дописать, чтобы все работало как задумано.
скрипт, читающий чат лог:

loop
{
	loop, read, путь к файлу
	{
		if A_LoopReadLine contains текст
		действие
	}
	sleep 1000 
}

основной:

^vk4C::
loop 20
{
	send {vk54}
	sleep 500
	send /mine 3 {enter}
	sleep 4500
	send {vk57 Down}
	sleep 600
	send {vk57 Up}
	sleep 200
	DllCall("mouse_event", "UInt", 0x01, "UInt", 0, "UInt", 240)
	sleep 100
	DllCall("mouse_event", "UInt", 0x01, "UInt", 0, "UInt", 240)
	sleep 100
	DllCall("mouse_event", "UInt", 0x01, "UInt", 0, "UInt", 240)
	sleep 300
	send {2}
	send {LButton Down}
	sleep 4800
	send {LButton Up}
	sleep 300
	DllCall("mouse_event", "UInt", 0x01, "UInt", X, "UInt", -130)
	sleep 300
	DllCall("mouse_event", "UInt", 0x01, "UInt", X, "UInt", -130)
	sleep 200
	DllCall("mouse_event", "UInt", 0x01, "UInt", 209, "UInt", 0)
	sleep 200
	send 8
	sleep 100
	send {RButton Down}
	sleep 200
	send {RButton Up}
	sleep 100
	send 7
	send {RButton Down}
	sleep 3000
	send {RButton Up}
	sleep 100
	send {2}
	loop 14
	{
		send {LButton Down}
		send {vk57 Down}
		sleep 27000
		send {vk57 Up}
		send {LButton Up}
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", -209, "UInt", 0)
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", -209, "UInt", 0)
		sleep 300
		send {LButton Down}
		sleep 900
		send {LButton Up}
		sleep 200
		send {vk57 Down}
		sleep 800
		send {vk57 Up}
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", -209, "UInt", 0)
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", -208, "UInt", 0)
		sleep 200
		send {LButton Down}
		send {vk57 Down}
		sleep 27000
		send {vk57 Up}
		send {LButton Up}
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", 209, "UInt", 0)
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", 209, "UInt", 0)
		sleep 300
		send {LButton Down}
		sleep 900
		send {LButton Up}
		sleep 200
		send {vk57 Down}
		sleep 800
		send {vk57 Up}
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", 209, "UInt", 0)
		sleep 200
		DllCall("mouse_event", "UInt", 0x01, "UInt", 208, "UInt", 0)
	}
	send {LButton Down}
	send {vk57 Down}
	sleep 27000
	send {vk57 Up}
	send {LButton Up}
	sleep 100
	send 8
	sleep 100
	send {RButton Down}
	sleep 200
	send {RButton Up}
	sleep 100
	send 7
	send {RButton Down}
	sleep 2000
	send {RButton Up}
	sleep 4000
}
exit