Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/31/2018 in all areas

  1. ajag

    Problem with StringReplace

    $encText = StringReplace($encText, " ", "#")
    1 point
  2. you must align the returned string to your var: $encText = StringReplace("$encText", " ", "#")
    1 point
  3. As has been suggested, providing some code can be quite helpful, and no need to feel bashful, as we were all beginners once. It can help us understand where you are at, and also maybe save us some work, with the idea being, we teach to fish, rather than fish for you. That said, here are some ideas to go on with. Get the PID return from ProcessExists, when Excel (etc) is detected, and use that for repeated comparisons, so the same instance is not repeatedly detected. It also frees you from waiting for Excel (etc) to close. For every new instance, use _FileWriteLog to write the program name (i.e. Excel) to a Log file (it includes date and time). Put that all in a While 1 .... Wend loop (with the required If ... Then statements), making sure you give yourself an escape option (check out _IsPressed). Also add a delay in the loop i..e. Sleep(2000).
    1 point
  4. Also a new Overworld file: http://songersoft.com/programming/mapit/worlds/Overworld_Tile_Changes.zip (It's the world map in the post above) To use. Run MapIt. World Menu \ File \ Load - Navigate to the Overworld_Tile_Changes.txt. Located in the Extracted: Overworld_Tile_Changes.zip [ _IsPressed( 'x' ) deletes tiles. ] The Accelerator keys seem to get bogged down. So now you can set an Accelerator delete key or use the _IsPressed( 'x') to fire lasers.
    1 point
  5. Properties dialog for World: Layers, Width, Height. Properties dialog for Tile: Width, Height. Fixed a crash occurring on World_Save() - Cancel Changed World_Save() process to create folder of filename entered in dialog and place filename inside folder as well as Tiles folder Toggle display scrolling background layer: On / OFF Converted aWorld from struct to array aWorld[layer][x][y][data] this removes the need to recreate structs on ReDim greater size. Much faster to shift in size. Hotkey_Dialog() Now has pages and saves hotkeys. If hotkeys stop working, sometimes I forget to restore them after another window has been activated. Use F1 to restore the hotkeys. If somehow you have tried F1 and they're are still totally fucked, delete the file at User Documents\Songersoft\MapIt\Hotkeys.txt If the world map fails to repaint to aBoard[] F2 will update the world to aBoard and then to screen. Use F2 to fix if map doesn't update. Moving to board boundaries now redraws world to board. Behold! Dynamic water tile file and dynamic tile frame. Added Background Menu: Custom scrolling background tile layer can be selected Added rando trees, low hanging fruit never looked so good. A new download is available from the MapIt website.
    1 point
  6. This should work to do it dynamically #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Opt("GUIOnEventMode", 1) $hGUI = GUICreate("Test", 232, 90) $Label = GUICtrlCreateLabel("Enter MAC address", 22, 8, 163, 17) $input = GUICtrlCreateInput("", 22, 30, 165, 24) GUICtrlSetLimit(-1, 17) GUICtrlSetFont(-1, 12) GUISetState() GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND') GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") While 1 Sleep(10) WEnd Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $id = BitAND($wParam, 0x0000FFFF) Local $code = BitShift($wParam, 16) If $id = $input AND $code = $EN_UPDATE Then Local $content = GUICtrlRead($input) Local $len = StringLen($content) Local $char = StringRight($content, 1) Local $mod = Mod($len, 3) If not (( ($mod = 1 or $mod = 2) and StringRegExp($char, '[[:xdigit:]]') ) OR _ ($mod = 0 and $char = "-")) Then GUICtrlSetData($input, StringTrimRight($content, 1)) EndIf Return $GUI_RUNDEFMSG EndFunc Func _Exit() Exit EndFunc
    1 point
  7. Melba23

    File extension?

    megablox, Who says folders cannot have an extension? If you want to know if a random name is a file or folder, I would check in the attributes like this: If StringInStr(FileGetAttrib($sName), "D") M23
    1 point
  8. HockeyFan, Two While...WEnd loops in an OnEvent script is just asking for trouble. Let me ask a simple question - how do you ever escape from the second loop in the function? Answer - you do not. AutoIt does not like remaining in functions - it prefers returning to the main idle loop. Alas, it is not as easy as you think it might, or indeed should, be to escape from a loop in a function. As an example, look at this: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Global $fStop = False $hGUI = GUICreate("Test", 500, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlCreateButton("Start", 10, 10, 80, 30) GUICtrlSetOnEvent(-1, "_Start") GUICtrlCreateButton("Stop", 10, 50, 80, 30) GUICtrlSetOnEvent(-1, "_Stop") GUISetState() While 1 Sleep(10) WEnd Func _Exit() Exit EndFunc Func _Start() $fTrue = False $iBegin = TimerInit() ConsoleWrite("Starting" & @CRLF) Do Sleep(10) Until $fStop = True Or TimerDiff($iBegin) > 5000 ConsoleWrite("Stopping" & @CRLF) EndFunc Func _Stop() ConsoleWrite("Please Stop" & @CRLF) $fStop = True EndFuncYou might think that you could easily escape because the Stop button would set the flag and so break the loop. But if you try you see that the loop continues until the timer lets it escape (you see the "TimeOut" message) - and only then will you see the "Please Stop!" messages. This is because AutoIt queues events and only actions them after you return from a running function - I suggest you read the Interrupting a running function tutorial in the Wiki which goes into more depth and also explains how to do it. Please ask - once you have read the tutorial - if anything is unclear. Although as I wrote it, I hope that everything will be as clear as crystal! M23
    1 point
  9. Events are queued and ran after each other, they doesn't interrupt each other. If you want to do this with OnEvent then remove the loop from the event. In this situation it might be easier to use MessageLoop like Melba did though.
    1 point
×
×
  • Create New...