TheDcoder

Maps 101: All you need to know about them!

49 posts in this topic

#1 ·  Posted (edited)

Hello Again! I previously stumbled upon a topic asking for maps datatype's instructions... I too wasn't sure what a map is until I tried it... So I am making this topic to help other newbies (and some oldbies) better understand the Maps datatype of AutoIt! Lets start! :D

A Note for Readers

The maps datatype is still in development and is currently in Alpha Stage (More Risky than Beta) and its unstable, so AutoIt can crash indefinably while using Maps! I can't guarantee if this will be implemented in stable versions, this is a fairly new thing to AutoIt coders & in my honest opinion I don't see any use for it Maps are the best datatype in AutoIt, Very Useful ^_^... Not hurting anyone though ;).  Also the maps datatype is DISABLED IN STABLE VERSIONS, So you need to install the latest beta version of AutoIt to make maps work :). If you find any bugs while using a map, please report it in the Official Bug Tracker

Introduction To Maps

Maps are just like arrays, instead they use "keys" to access elements inside them... A key can be either a string or an integer (Other datatypes work too but they are converted to a integer [Equivalent to Int($vKey)] before assignment [Source]). Although Integers don't represent the order of elements in a map unlike in an array...

Declaring Maps

Its similar to declaring an Array:

; This is the only way to declare a map
; You must have a declarative keyword like Dim/Global/Local before the declaration unless the map is assigned a value from a functions return

Local $mMap[] ; Don't insert any numbers or strings it!

Simple, Isn't it? :D

Using Maps

Using maps is similar to arrays (again!):

Local $mMap[] ; Lets declare our map first!

; Adding data to maps is easy...

; This is our key
;       |
;       v
$mMap["Key"] = "Value" ; <--- And our value!

; A key is Case-Sensitive meaning "Key" is not same as "key"!

$mMap["key"] = "value" ; Not the same as $mMap["Key"]!

; There are 2 different ways to access an element in a map

$mMap["Key"] ; 1st Method
$mMap.Key    ; 2nd Method

 Enumerating Maps

Its quite easy to enumerate through arrays but what about maps? how can I enumerate through them!?

#include <MsgBoxConstants.au3>

; Lets create our map first
Local $mMap[]

; Lets add some information to the map, feel free to modify & add new elements
$mMap["Name"] = "Damon Harris"
$mMap["Alias"] = "TheDcoder"
$mMap["Gender"] = "Male"
$mMap["Age"] = 14
$mMap["Location"] = "India"

$aMapKeys = MapKeys($mMap) ; MapKeys function returns all the keys in the format of an array
Local $sProfile = "Profile of " & $mMap["Name"] & ':' & @CRLF ; We will use this string later

For $vKey In $aMapKeys ; We use this to get the keys in a map :)
    $sProfile &= @CRLF & $vKey & ': ' & $mMap[$vKey] ; Add some details to the profile string using our map!
Next

MsgBox($MB_ICONINFORMATION + $MB_OK, "Profile", $sProfile) ; Finally display the profile :)

It is easy as always :P

Multi-Dimensional Maps

Now now... I know that you are a little confused that how can an multi-dimensional maps exist... Although I am not 100% sure if its called that but lets continue:

10d2e8e0d938774a7916595bedab6db8.png

#include <MsgBoxConstants.au3>

; Multi-Dimensional maps are just maps in a map

Local $mMapOfMapsvilla[] ; This map will store an other map

Local $mParkMap[] ; This Park map will be inserted in the Mapsvilla's map :P

$mMapOfMapsvilla["Map Item 1"] = "Town Hall"
$mMapOfMapsvilla["Map Item 2"] = "Police Station"
$mMapOfMapsvilla["Map Item 3"] = "Shopping Mall"
$mMapOfMapsvilla["Map Item 4"] = "Residential Area"
$mMapOfMapsvilla["Map Item 5"] = "Park"

$mParkMap["Map Item 1"] = "Cottan Candy Stand"
$mParkMap["Map Item 2"] = "Public Toilet"
$mParkMap["Map Item 3"] = "Woods"

$mMapOfMapsvilla.Park = $mParkMap

MsgBox($MB_OK, "Map Location", $mMapOfMapsvilla["Map Item 1"]) ; Will display Town Hall
MsgBox($MB_OK, "Map Location", $mMapOfMapsvilla.Park["Map Item 1"]) ; Will display Cottan Candy Stand

I am sure its easy for you to understand now :)

Frequently Asked Questions (FAQs) & Their answers

Q #1. Help! My code does not respond to anything (or) I get an "Variable subscript badly formatted" error on the line of declaration...
A. DONT USE F5 or Go, Instead use Alt + F5 or Tools -> Beta Run in SciTE (Make sure that you have Beta installed)

Q #2. Why are you using "m" in-front of every map variable?
A. Best coding Practices: Names of Variables :)

Q #3. What are "Elements" which you mention frequently???
A. This is a newbie question (I have no intention of insulting you :)), so I guess you are new to programming. "Elements" are data slots inside a Map (or an Array), you can imagine elements as individual variable which are stored in a Map. You can access them using "keys", Please refer to "Introduction to Maps" section at the starting of this post :)

Q #4. Are Maps faster than Arrays?
A. You need to understand that Maps have different purpose than Arrays. Maps are designed to store data dynamically (like storing information for certain controlIDs of GUI) and Arrays are designed to store data in a order (for instance, Storing every character of a string in an element for easy access). If you still want to know then if Maps are faster, then the answer is maybe... Maps are *supposed* (I am not sure :unsure:) to be faster in addition of elements (while Arrays are painfully slow while adding or removing elements). Here (Post #24) is a benchmark (Thanks kealper! :D)

 

More FAQs coming soon! Feel free to ask a question in the mean while :)

Edited by TheDcoder
Modified "Introduction To Maps" about using other datatypes as keys...
4 people like this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites



I am lucky because:

  1. The above post was my 1123rd post :D
  2. I completed the post just before deadline :P

I hope you may enjoy the read, TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Wow this looks cool, I am sure it will come in handy.  I just sort of got comfortable with Arrays not too long ago, I assume that Maps are going to be sort of like RegEx.

"The best practice is to not use them unless you need them" and still stick to Arrays for most tasks.

I would love to see some real life examples however of where a map can more easily do what an array could not so that I can sort of wrap my head around when this would be best used or make a task easier. 

Share this post


Link to post
Share on other sites

I can't think use of maps too :P, But I guess I will eventually discover its use :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

use a For..In Loop, instead of a For...To Loop.     Unless thats bad form, imho it looks cleaner.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
$mParkMap["Map Item 1"] = "Cottan Candy Stand"
$mParkMap["Map Item 2"] = "Public Toilet"
$mMapOfMapsvilla["Map Item 3"] = "Woods"

I don't get that bit.

Are you deliberately moving the woods in the park to the shopping mall in mapsvilla?


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@JohnOne :P People in the shopping mall wanted some sandal wood

@boththose How can I get the key to the element if I use For...In?

Edited by TheDcoder
forgot to reply boththose

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
#include <MsgBoxConstants.au3>

; Lets create our map first
Local $mMap[]

; Lets add some information to the map, feel free to modify & add new elements
$mMap["Name"] = "Damon Harris"
$mMap["Alias"] = "TheDcoder"
$mMap["Gender"] = "Male"
$mMap["Age"] = 14
$mMap["Location"] = "India"

$aMapKeys = MapKeys($mMap) ; MapKeys function returns all the keys in the format of an array
Local $sProfile = "Profile of " & $mMap[$aMapKeys[0]] & ':' & @CRLF ; We will use this string later

For $Key In $aMapKeys
    msgbox(0, '' , $Key & " = " & $mMap[$Key])
next

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

You can also keep your Funcs in your map with your data

; Lets create our map first
Local $mMap[]

; Lets add some information to the map, feel free to modify & add new elements
$mMap["Name"] = "Damon Harris"
$mMap["Alias"] = "TheDcoder"
$mMap["Gender"] = "Male"
$mMap["Age"] = 14
$mMap["Location"] = "India"
$mMap["Keys"] = MapKeys($mMap)


For $Key In $mMap["Keys"]
    If $Key <> "Keys" Then msgbox(0, '' , $Key & " = " & $mMap[$Key])
next

 

Edited by boththose
1 person likes this

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

@boththose Nice trick ;), But I will implement it in another example


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

I really don't like documenting alpha (not beta) functionality in the open Forum, because it's suggesting that this will at some point be included in a future release of AutoIt, unless @TheDcoder has been told something I don't know about?!


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

@guinness I think I will update the introduction to be more specific on the current stage of development of maps :)

@TheDcoder has been told something I don't know about?!

Ummm... Maybe.... Maybe Not :P


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

i would want to explore maps in maps to achieve the OP.  start at the smallest unit throwing them into larger and larger containers..

Local $mMapGlo[]
Local $mMapLocAus[]
Local $mMapLocDal[]
Local $mMapPersonNorth[]
Local $mMapPersonSouth[]
Local $mMapPersonDallas[]


$mMapPersonNorth["Jeff"] = "Jeff in N. Austin"
$mMapPersonSouth["Jack"] = "Jack in S. Austin"
$mMapPersonDallas["John"] = "John in Dallas"

$mMapLocAus["NorthAus"] = $mMapPersonNorth
$mMapLocAus["SouthAus"] = $mMapPersonSouth
$mMapLocDal["Dallas"] = $mMapPersonDallas

$mMapGlo["CentralTx"] = $mMapLocAus
$mMapGlo["NorthTx"] = $mMapLocDal


For $loc in $mMapGlo
    For $key in mapkeys($loc)
        For $item in $loc[$key]
            msgbox(0, '' , $key & @LF & $item)
        Next
    Next
next

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Its very similar to Scripting.Dictionary!

I thinking maps is recursive, it is?


m(o.O)m

Share this post


Link to post
Share on other sites

@Luigi Yes :)

 

I am happy to see people discovering new things with maps! Keep up the good work guys! :D


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Are Maps similar to dynamic arrays? If you are inserting or deleting from a Map, does it work faster than an array?

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

maps are similar to scripting.dictionary which is similar to an ini which i guess is similar to a 2D array with equal signs?

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

@MartinMarris  I thinks its a yes... I am not familiar with the concept of dynamic arrays but a quick google search explained me about them, though I didn't use them, I can say that a Map is similar (not same) to dynamic arrays, Resizing a map (i.e adding or removing elements from it) is faster compared to arrays.

 

Sorry for late reply, I was busy, TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • Fhelipe
      By Fhelipe
      So I wanted to use my machine as a server for a program that had a unique login system. It can only log in 1 person and the password is in the script itself. I would like to adptar my code or change it completely so that I can create a database and the Script At Time Of Login Get Database Login And Log In
      Experience with Autoit: Basic                      (sorry for bad English)
      Experience with SQL: None                              (translator only)
      Code Currently Used To Login:
      ;=========================================================
      While 1
          $MSG = GUIGetMsg()
          Switch $MSG
          Case $ButtonOk
              If VerifyLogin(GUICtrlRead($USERNAME),GUICtrlRead($PASSWORD)) = 1 Then
                  GUIDelete($Form1)
                  MsgBox(-1,"Logado com Sucesso","Login Sucedido, Para Parar o Aimbot Pressione ESC!")
                  Run ("C:\Program Files (x86)\Steam\steamapps\common\Mitos.is The Game\Mitosis.exe")
                  RunP()
              Else
                  MsgBox(-1,"Error","Usúario ou Senha está incorreto, Ou Ainda Não Pagou!")
               EndIf
          Case -3
              Exit
           Case $ButtonCancel
              Exit
                Case $HelpButton
               MsgBox(-1, "Criadores", "Criadores: Zummey & Ralta")
      Case $Register
         MsgBox(-1, "ERRO", "PROGRAMA EM DESENVOLVIMENTO FUNÇÃO DESABILITADA")
          EndSwitch
      WEnd
      Func VerifyLogin($USERNAME,$PASSWORD)
          If $USERNAME = "Zummey" And $PASSWORD = "xd90fe10" Then
              Return 1
          Else
              Return 0
          EndIf
      EndFunc; End login
      ;=========================================================
    • IamKJ
      By IamKJ
      I am trying to allow the GUI to gather info as to when to execute a function.  I am having trouble doing this.  So far this is what I have.
       
      ;Timer Func timer () If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"Timer","Please format your answer in 00:00:00:000") Select Case $iMsgBoxAnswer = 6 ;Yes Global $infotime = InputBox ('Time', 'What time to execute?') Do $rawtimer = ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec()) until $rawtimer = $infotime if $rawtimer = $infotime Then msgbox (0,'Worked','Worked') Else EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect EndFunc Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc I have also tried _GUIToolTip_GetText in order to read the tooltip until the time specified, but it still doesn't work.  Any help would be great.
    • IamKJ
      By IamKJ
      So I have a lot of different functions in the little program I'm making.  Most of them use the Do statement, such as finding images, clicking buttons, etc.
       
      The question I have is how would I be able to both
      1) Create a hotkey to pause whatever I am doing at the moment.  If I have to put something into every function in the program, I don't mind.
      2) Create a hotkey to exit whatever I am doing and stop all loops or commands and bring back the main GUI?
    • Manivel
      By Manivel
      Hi,
      Can any one please share the Connection string for SQL Developer. 
      How to Connect the SQL Developer from AutoIT. We need to execute the query through AutoIt. is that possible ?
    • Manivel
      By Manivel
      We are launching the AutoIT script through selenium and passing the values through command lines.
      Similarly able to return the value from AutoIt to selenium ?  If yes ? how to return the values ?