Jump to content

SpookMeister

Active Members
  • Posts

    840
  • Joined

  • Last visited

Everything posted by SpookMeister

  1. The subject says it all I think... anyone know of a way to do it?
  2. Hi, I'm hoping someone can point me in the right direction. I need to be able to Set a dynamicly created TrayItem as the currently selected item based on information I will have stored on the last use of a program. Consider this example: #include <Constants.au3> #NoTrayIcon ; set script wide options Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown. Opt("TrayOnEventMode", 1) ; pretend I am populating this array from some external semi-dynamic data Global $a_Things[6] For $x = 1 To UBound($a_Things, 1) - 1 $a_Things[$x] = "Item " & $x Next $submenu = TrayCreateMenu("Submenu") For $y = 1 To UBound($a_Things, 1) - 1 TrayCreateItem($a_Things[$y], $submenu, -1, 1) TrayItemSetOnEvent(-1, "_SubmenuChoice") Next TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1, "_About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "_Exit") TraySetState() While 1 Sleep(1000) WEnd Func _Exit() Exit EndFunc ;==>_Exit Func _About() MsgBox(4096, "About", "Blah Blah Blah") EndFunc ;==>_About Func _SubmenuChoice() MsgBox(4096, "Info", "Menu Choice:" & @TRAY_ID) EndFunc ;==>_SubmenuChoice I can work with the @TRAY_ID value to do the actions I need within the program, but I want to save their choice, and re-use it later. Now, I know how to do that (writing to and reading from the registry for example), but what I do not know how to do, is to programatically mark the submenu item as the current selected choice upon loading, based on the info that I have stored.
  3. In autoit, and many other scripting languages, arrays typically include and begin with element 0. So if you did: $str = "one,two,three" $strarr = StringSplit($str,",",1) Then: $strarr[0] = "one" $strarr[1] = "two" $strarr[2] = "three" ubound returns the number of elements in the array, so ubound($strarr) would = 3 $strarr[3] gives the error you see because the last element of the array is actually $strarr[2] This is why you will so often see the code: "ubound($array) - 1" being used.
  4. As per the grammar improvement request in your sig Rudi, I believe you wanted to say: "To double the message "help very important" is absolutely meaningless."
  5. Nevermind KaFu, Figured it out... was just scared I guess
  6. Thanks KaFu, This sounds like what I'm looking for. I'm looking at the help file now and will play with it, but at first glance implementation is not obvious to me (of the WinAPI parts). If you feel up to it, could you see your way to give a little example, even pseudo-code would be of great help. Thanks again, -Spook
  7. I currently have a script that is working fairly well, lets say that it is accurate 90% of the time, at detecting when a desired event is happening by reading visual clues from another program's display. However, I have recently learned that the program being monitored also has a logging option I can enable that would include (among many other things) the triggering of the event I want to catch. I would like to use this feature to improve my script's accuracy if I can, but I'm not sure how to proceed. Does anyone have some advice/pointers on how I go about monitoring new data as it is added to this log file for the event I am looking for? I'm thinking that constantly re-reading the entire data file trying to get the new data will be far more CPU/HDD intensive than I can afford.
  8. It kind of depends on the tasks you are talking about... we need more information. However, if you just don't want to see the browser... you can allways have it do its thing in hidden mode.
  9. I'll be parsing, adding, removing, and modifying entries (elements? sections? shrug... whatever you call them)
  10. I'm going to be messing around with a bunch of XML files shortly, but I know next to nothing about them. I did a quick search through the help file and couldn't find anything (except some references to the _Word* UDF). A search on here brought up _XMLDomWrapper.au3 which looks promising and I am looking into it now... But I was wondering if anyone had other suggestions of things I should be looking at as well, even a link to a general XML primer would be helpful. TIA, -Spook
  11. You can embed IE into your application to display the page... if that is what you are asking.
  12. IMHO there is nothing wrong with offering money for a service... nor in requesting that service here (though I think there are better places for it). However ~$50 isn't gonna get much interest from too many people here.
  13. Save your money. Look at the help file for Autoit, it has plenty of examples... Look for HotKeySet specifically to get started
  14. I would tweak that with: While 1 WinActivate("MyGameTitle") Send("TextHere{enter}") Sleep(60000 * 5); 60000(ms) = 1min * 5 = 5min WEnd Just to make sure the text goes to the right place.
  15. skruge's solution does what you are asking. Alternatively you could also simply comment out (or delete) the MsgBox line: If ProcessExists(help.Exe) Then ;MsgBox(4096, "", "Value might be hexadecimal!") Else ShellExecute("help.exe") EndIf
  16. Is mail merge a frequent function for you? If it is not something you do daily, then I would look at keeping Thunderbird as your default client normally, and only switching it to Outlook when you need that functionality (then going back).
  17. Two questions... What are you smoking? and Where can I get some?
  18. Lame... but if you throw a sleep statement in the loop you will avoid maxing out your CPU (perhaps where the faults come from) and at the very least get "fewer" of the faults.
  19. Dont forget the windows scheduled tasks as an option too...
  20. Loops are pretty basic... While <something is true> ; do this ; then do this ; then do that WEnd Which will do all those things in the middle over and over and over as long as <something is true> is in fact true I don't know what you are doing with your run command... but I fear you are trying to restart your script at the end of your script.... very bad idea.
  21. That is what I gave you... Perhaps you could make an example script that shows what you are trying to do we could help more.
  22. Replace the file with the newer version?
  23. But perhaps you mean Do ; some code Until $z >= $x - 4 AND $z <= $x + 4
  24. You are right... you are not good at explaining.
×
×
  • Create New...