ahmetpi Posted December 8, 2020 Share Posted December 8, 2020 Hi, I am kinda noob I have an ini file which contains time and website url. I want the website to be opened at the time specified as the key in the ini file. I made a simple program. But it's run exe only the first key and value in the ini file. How can I loop this? Thanks in advance example ini file: [MONDAY] 06:00=https://google.com/ 07:00=https://facebook.com/ my code: Global $inifile = IniReadSection(@ScriptDir & "\example.ini", "MONDAY") $hour1 = $inifile[1][0] $url1 = $inifile[0][1] $hour2 = $inifile[2][0] $url2 = $inifile[2][1] While 1 $nMsg = GUIGetMsg() If ($hour1 = @HOUR & ":" & @MIN) Then ShellExecute($url1) ElseIf ($hour2 = @HOUR & ":" & @MIN) Then ShellExecute($url2) EndIf WEnd please help * I'm sorry for my bad English Link to comment Share on other sites More sharing options...
Nine Posted December 8, 2020 Share Posted December 8, 2020 (edited) Here to start you up : #include <Array.au3> HotKeySet("{ESC}", _Exit) Global $inifile = IniReadSection(@ScriptDir & "\Test.ini", "MONDAY") _ArrayColInsert($inifile,2) While 1 For $i = 1 to $inifile[0][0] If Not $inifile[$i][2] And $inifile[$i][0] = @HOUR & ":" & @MIN Then $inifile[$i][2] = True ShellExecute($inifile[$i][1]) EndIf Next Sleep (1000) WEnd Func _Exit() Exit EndFunc Edited December 8, 2020 by Nine ahmetpi 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
ahmetpi Posted December 8, 2020 Author Share Posted December 8, 2020 It worked. Thank you for helping 41 minutes ago, Nine said: Here to start you up : #include <Array.au3> HotKeySet("{ESC}", _Exit) Global $inifile = IniReadSection(@ScriptDir & "\Test.ini", "MONDAY") _ArrayColInsert($inifile,2) While 1 For $i = 1 to $inifile[0][0] If Not $inifile[$i][2] And $inifile[$i][0] = @HOUR & ":" & @MIN Then $inifile[$i][2] = True ShellExecute($inifile[$i][1]) EndIf Next Sleep (1000) WEnd Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now