zip code Message box prompt

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
selvaam
Posts: 8
Joined: 10 Aug 2022, 13:48

zip code Message box prompt

Post by selvaam » 07 Feb 2023, 23:18

When I enter the zip code 45211, for example, a message box or splash text will appear with the words Cincinnati, Ohio and us.
I'm new here, can you assist me with this?


Code: Select all

SplashTextOn, 400, 300, Clipboard, The clipboard contains:`n%Clipboard%
WinMove, Clipboard,, 0, 0
MsgBox, the city name,state and country is Cincinnati,OH and us
SplashTextOff
[Mod edit: [code][/code] tags added.]

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

Re: zip code Message box prompt

Post by mikeyww » 08 Feb 2023, 06:34

Hi,

As a first step, you could get a database of the codes, or sign up for one of the online API services.

User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: zip code Message box prompt

Post by flyingDman » 10 Feb 2023, 18:09

Try this:

Code: Select all

tooltip "please wait...", a_screenwidth / 2 - 85, a_screenheight / 2 - 45
zips := whr("https://tinyurl.com/mv47zs2t")
tooltip
needle := InputBox("search...", "zip codes", "w170 h90", "10001")
if (needle.Result = "Cancel" or !needle.value)
	ExitApp
for x,y in strsplit(zips,"`n","`r")
	if (instr(strsplit( y,",")[1],needle.value)=1)
		lst .= y "`n"
msgbox(IsSet(lst)?lst:"no result")
return

whr(url)			;https://www.autohotkey.com/docs/commands/URLDownloadToFile.htm#WHR
	{
	whr := ComObject("WinHttp.WinHttpRequest.5.1")
	whr.Open("GET", url, true)
	whr.Send()
	whr.WaitForResponse()
	return whr.ResponseText
	}
14.3 & 1.3.7

selvaam
Posts: 8
Joined: 10 Aug 2022, 13:48

Re: zip code Message box prompt

Post by selvaam » 05 Mar 2023, 02:24

Thanks buddy i found different method,

Code: Select all

::45211::
SendInput, 45211
MouseGetPos, pX, pY
SplashTextOn, %pX%, %pY%, (Title), (Text here)
Sleep, 2000
SplashTextOff
Return

My another suggestion:

CAN YOU PLEASE HELP ME(IT WILL NOT WORK BUDDY)

Code: Select all

::MCKE{ENTER}155{ENTER}::

SENDINPUT, MCKE{ENTER}155{ENTER}

TOOLTIP, "DONT CAPTURE TRY AGAIN"

SetTimer, 7000 

return
[Mod edit: [code][/code] tags added.]

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: zip code Message box prompt

Post by gregster » 05 Mar 2023, 02:27

@selvaam, in future posts, please use code tags around your posted code. Thank you!

Also, I moved this topic to the AHK v1 help forum, due to your posted code.

selvaam
Posts: 8
Joined: 10 Aug 2022, 13:48

Re: zip code Message box prompt

Post by selvaam » 05 Mar 2023, 02:31

@gregster
SURE BUDDY

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: zip code Message box prompt

Post by gregster » 05 Mar 2023, 02:34

selvaam wrote:
05 Mar 2023, 02:31
@gregster
SURE BUDDY
Well, code tags belong around code, not at random places. But good that you know how to add them. This will be helpful.

Also, no need to YELL.

Post Reply

Return to “Ask for Help (v1)”