auto change message reply depends on time Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
19baliw68
Posts: 5
Joined: 20 Nov 2021, 07:39

auto change message reply depends on time

20 Nov 2021, 08:30

Hi! everyone im newbie here in autohotkey seeking help how to create this auto change message reply depend on the time send it the message
(time 5 am - 11:59am)
Send Good Morning
(Time 12 NN - 5:59pm)
Send Good afternoon
(time 6 pm - 11:59pm)
Send Good Evening
(time 12midnight - 4:59)
send sweetdream

my problem is how to detect time so that message send on the right greeting in the right time
thank in advance....
User avatar
mikeyww
Posts: 26884
Joined: 09 Sep 2014, 18:38

Re: auto change message reply depends on time  Topic is solved

20 Nov 2021, 11:02

Code: Select all

If A_Hour between 0 and 4
 Send Sweet dreams{!}
If A_Hour between 5 and 11
 Send Good morning{!}
If A_Hour between 12 and 17
 Send Good afternoon{!}
If A_Hour between 18 and 23
 Send Good evening{!}
19baliw68
Posts: 5
Joined: 20 Nov 2021, 07:39

Re: auto change message reply depends on time

22 Nov 2021, 22:54

mikeyww wrote:
20 Nov 2021, 11:02

Code: Select all

If A_Hour between 0 and 4
 Send Sweet dreams{!}
If A_Hour between 5 and 11
 Send Good morning{!}
If A_Hour between 12 and 17
 Send Good afternoon{!}
If A_Hour between 18 and 23
 Send Good evening{!}
Thanks you it helps alot thanks again!
19baliw68
Posts: 5
Joined: 20 Nov 2021, 07:39

Re: auto change message reply depends on time

30 Nov 2021, 01:07

hi! again i have a problem all messages send supposedly only messages by the time are the message he's going to send right... what wrong in my syntax because AHK didn't give me error! but when i run all message good morning to evening will send in one time? hope you can help me!
thanks again in advance!

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

F3::



Loop, {
	

	Send, {F5}
	Sleep, 5000


	MouseMove, 53, 142
	Sleep, 1500
	PixelGetColor, pColor, 53, 142, RGB
	If (pColor = "0xFFFFFF") {
		;if webpage has completely loaded, do the following

		
		MouseMove, 45, 244
		Sleep, 1500
		;click "Inbox"
		Send, {Click}
		Sleep, 1500
		MouseMove, 92, 290
		Sleep, 1500
		Send, {Click}
		Sleep, 1500
		SendInput Dudut
		Sleep, 1500
		MouseMove, 88, 409
		Sleep, 1500
		;click result
		Send, {Click}
		Sleep, 1500
		

		;this checks if the DudutWorlD color scheme is present in the header bar
		MouseMove 53, 142
		PixelGetColor, pColor, 53, 142, RGB
		If (pColor = "0xFFFFFF") {
			MouseMove, 241, 243
			Sleep, 1500
			Send, {Click}
			Sleep, 1000
			MouseMove, 211, 310
			Sleep, 1000
			Send, {Click}
			Sleep, 1000

			Loop,  {
				;this checks if there is an unread message
				Sleep, 1500
				MouseMove, 255, 137
				Sleep, 1500
				PixelGetColor, pColor, 60, 292, RGB
				If (pColor = "0xFFFFFF") {
					;if there is at least one unread message, do the following

					MouseMove, 70, 280
					Sleep, 1500
					; click first unread message entry
					Send, {Click}
					Sleep, 1500
					MouseMove, 395, 961
					Sleep, 1500
					; click conversation text box
					Send, {Click}
					Sleep, 1500
					Loop, 1 {
					If A_Hour between 0 and 4
									Send, +{Enter}
									SendInput, Good Morning
									SendInput, This is an acknowledgement receipt for your message.
									Sleep, 150
									Send, +{Enter}
									Send, +{Enter}
									SendInput, Thank you for reaching our store. 
									Send, +{Enter}
									Send, +{Enter}
									SendInput, This message is on queue.
									Send, {Enter}
									Sleep, 1500
								
								If A_Hour between 5 and 11
									Send, +{Enter}
									SendInput, Good Morning{!}
									SendInput, This is an acknowledgement receipt for your message.
									Sleep, 150
									Send, +{Enter}
									Send, +{Enter}
									SendInput, Thank you for reaching our store. 
									Send, +{Enter}
									Send, +{Enter}
									SendInput, This message is on queue.
									Send, {Enter}
									Sleep, 1500
								
								If A_Hour between 12 and 17
									Send, +{Enter}
									SendInput, Good Afternoon {!}
									SendInput, This is an acknowledgement receipt for your message.
									Sleep, 150
									Send, +{Enter}
									Send, +{Enter}
									SendInput, Thank you for reaching our store. 
									Send, +{Enter}
									Send, +{Enter}
									SendInput, This message is on queue.
									Send, {Enter}
									Sleep, 1500
								
								If A_Hour between 18 and 23
									Send, +{Enter}
									SendInput, Good Evening{!}
									Send, +{Enter}
									Send, +{Enter}
									Sleep, 150
									SendInput, This is an acknowledgement receipt for your message.
									Sleep, 150
									Send, +{Enter}
									Send, +{Enter}
									SendInput, Thank you for reaching our store. 
									Send, +{Enter}
									Send, +{Enter}
									SendInput, This message is on queue.
									Send, {Enter}
									Sleep, 1500
								}	
					
				}
				Else {
					break
				}
			}
		}
	}

}
return
`::ExitApp
[Mod edit: [code][/code] tags added.]
Last edited by gregster on 30 Nov 2021, 01:08, edited 1 time in total.
Reason: Please use code tags. Thank you!
User avatar
mikeyww
Posts: 26884
Joined: 09 Sep 2014, 18:38

Re: auto change message reply depends on time

30 Nov 2021, 07:41

The indentation looks nice, but use braces around blocks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, wpulford and 378 guests