Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/01/2024 in all areas

  1. Hi @ValentinM Many thanks for your kind words and feedback! I have not implemented code for warning against undefined variables or functions yet, so it might become an issue later on, but I'll try to keep in mind adding a way to disable it I provide console support via another extension Name: AutoIt3 Debug My extension currently also have the same issue, but i think i just fixed it, and will release an update today or tomorrow No i currently do not have added a feature to access AutoIt3 documentation. I do plan to add links for the online version, for native/built-in functions, but have not finished my doc parser support for tags containing the links.
    3 points
  2. Nine

    Stuck CTRL key

    Try this sequence : Send("{CTRLDOWN}") Send("a") Send("{CTRLUP}")
    1 point
  3. Running this script shows that without (+-)HH:MM, $startTime and $endTime are in local time: #include "TaskScheduler.au3" Local $oService = _TS_Open() Local $startTime = _DateAdd("n",3,_NowCalc()) $startTime = StringReplace($startTime,"/","-") $startTime = StringReplace($startTime," ","T") Local $endTime = _DateAdd("n",20,_NowCalc()) $endTime = StringReplace($endTime,"/","-") $endTime = StringReplace($endTime," ","T") Local $oTaskDefinition = _TS_Wrapper_TaskCreate($oService, "", "") _TS_Wrapper_PrincipalSet($oTaskDefinition,$TASK_LOGON_INTERACTIVE_TOKEN) _TS_Wrapper_TriggerDateTime($oTaskDefinition,$TASK_TRIGGER_TIME,0, 0, $startTime,$endTime) _TS_Wrapper_ActionCreate($oTaskDefinition,"Notepad") if _TS_FolderExists($oService,"\Test")=0 Then _TS_FolderCreate($oService,"\Test") EndIf _TS_Wrapper_TaskRegister($oService, "\Test","starttime",$oTaskDefinition, Default, Default,$TASK_LOGON_INTERACTIVE_TOKEN) MsgBox(1,30,"$startTime " & $startTime & " $endTime " & $endTime) _TS_Close($oService) Microsoft should say this. I was confused by $TASK_LOGON_INTERACTIVE_TOKEN. It means when the user is logged on. As MS says: "User must already be logged on. The task will be run only in an existing interactive session" Causing a task to run soon after logging on appears to depend on the Delay parameter being set. Such a task also needs $TASK_LOGON_INTERACTIVE_TOKEN. BTW when the task has run, the task continues to exist but has Next Run Time as N/A in schtasks /query and no value in _TS_TaskList(). When the task has run, call _TS_TaskDelete() to delete it after Notepad opens.
    1 point
  4. If the current file contains the include statement, and there are no syntax errors detected, then variable and function definitions will be detected. Currently you can ctrl+click or goto definition via right click context menu for variables and functions, if included like previously mentioned. Currently i have not made a good implementation for fast lookup, so when my code currently finds the definition it looks through each syntax tree for each relevant file, until the match is found. The issue is not making the lookup part itself, the hard part for me is finding a good way to be able to update the lookup data when files change, without parsing everything from scratch every time. If you still experience issues, let me know, it might be something that i can fix quickly and give everyone a better experience and setup flow Very cool you found a solution that works for you
    1 point
  5. from: https://usage.imagemagick.org/formats/#bmp If you have an older program cannot read the default BMP4 images written by ImageMagick, (for example a Windows Background Image), you can enforce the generation of a BMP3 format image using... magick image BMP3:image.bmp This format should have no transparency and should be a 'printable image', whatever that means. In other words 'Windows' compatible. However, if a PNG input file was used and it contains a gAMA and cHRM chunk (gamma and chromaticity information) either of which forces "magick" to write a BMP4. To get a BMP3 you need to get rid of that information. One way may be to pipeline the image though a minimal 'image data only' image file format like PPM and then re-save as BMP3. Messy, but it should work. magick image.png ppm:- | magick - BMP3:image.bpm
    1 point
  6. Hi @Jemboy 👋 , thanks for the explanation and the log files. I reviewed the logs and also your webdriver script and my assumption is: it's not a issue of the au3WebDriver at all. Out of the network tab in the Browser DevTools you can see some redirects that will be handled (by the js file content (which I reviewed)) differently in case of timing issues. So if in case of a bad network speed (network throttling) the redirection could be wrong or incomplete. But this isn't important: I tried several times for the suggested URL by @gmmg in this post which is https://login.tecalliance.net and had no issues to get on your expected login page. My recommendation is, switch the URL and you are fine (I hope). Also consider to add more capabilities like in this example. I hope this will help you. Best regards Sven
    1 point
  7. G@!$#$%@#$ #AutoIt3Wrapper_AU3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    1 point
  8. Glad you got the basics to work. Regarding your question, first of all, I'm assuming you already read this part of the FAQ: The answer to your question thus relies on what your target machine(s) is/are. If you're using a hardware signature such as the C drive (or CPU) serial number, your decrypted code will only run if the target environment returns those serials when queried at your script's startup. In other words, the encrypted script is machine-specific and will only run there. But Codecrypter is far more flexible than that. For instance, suppose you only want a group of trusted friends to be able to run your code, then you could use the password option (keyID = 1) and give each of them the secret word or phrase. Or maybe you wish to limit the period of time your code is functional; then you could for example append the current Month and Year macros as your key and distribute as many copies as you like; as soon as the next month starts, all copies will stop working as the decryption no longer produces valid code (of course, if online you could query public internet clocks rather than relying on a machine's internal calendar). On a more advanced level, if you look at the key definitions in function _MCFCC_Init() in MCFinclude.au3, you'll notice that key retrieval is just a function call, and you can just as easily call your own sophisticated functions as relying on the simple examples provided. So suppose you want to set up a licensing system without storing the key in the registry of each machine where you install your programme. Then you could write a little function that instead tries to go online to connect to your own little server (see elsewhere on the forum how to set one up), and queries your database of all your customers that legally bought your software, and if matching the ID sent by your code, the server returns the decryption key(s); if no connection is made, it just produces a message that online connectivity is required for it to work and exits gracefully. Of course this setup does require your server to be online all the time, otherwise your users will get annoyed. Earlier in this thread a user requested a way to get a single, encrypted, portable executable, and they didn't care if the decryption key was discoverable, just to make it difficult enough that the average user would find it too hard to do. In that case, you could consider using the macro @AutoItExe, which returns the full path and filename of the executable of your compiled script (note that the uncompiled encrypted version then won't work(!), as the macro then returns the AutoIt interpreter's full path and name instead, so it would fail when run uncompiled from Scite). I personally wouldn't recommend this, but it's a quick and dirty fix to get some protection. Also note that the decryptor includes the path (unless you remove that part), so if the user decides to move your exeecutable to a different path, it won't work either anymore. These are just examples; your own skill and imagination (and AutoIt's own capabilities) are the only limits on what you can achieve and how to set it up. Simply put: Trusted users? Use a password; trusted/controlled environment? use system specs, hardware IDs, etc. Any other situation? Get creative.
    1 point
  9. Hi, thanks for your great work. I tried to find something to use VS Code, as I am used to it. For some reason, Damien's extension is highlighting a lot of my code due to unreachable functions, since I'm developing in multiples files at once and calling functions outside their files. As I couldn't find a fix, I tried yours. I have to say that it fills all my needs. Lack of debug console was a problem for me ; I fixed it by making a task in my tasks.json that runs Au3Check.exe, and a custom launch.json that runs the task and the script. It works like a charm ! I can even ctrl+click on the error in debug console to get on it. The only trouble I'm struggling to fix is I cannot manage to print special chars in my debug console. My files all are encoded in UTF-8, I've searched in extension settings, tried few parameters in settings.json,... Here's what kind of thing I get : D�marrage de l'application Also, is there any quick way to access to the doc while hovering a function ? just like Damien's extension by pressing ctrl+f1 or SciTE by pressing F1 ? I tried some shortcuts but didn't manage to get it working. Thanks again for your work @genius257 !
    1 point
  10. There is no such thing as an UTC marker! The letter Z sometimes found at the end of a timestamp means "Zulu", for Zero. The time before is both UTC and local in timezone +0 (they are equal). BTW, Greenwich is to be forgotten, speaking of time. GMT has no more any reasonable meaning since 1972-01-01. Use UTC instead.
    1 point
  11. Most likely caused by a popup, banner, etc that doesn't always appear.
    1 point
  12. Hi @Jemboy 👋 , this is not enough. We need the full log of both versions. Because no information about your capabilities string which is essential to know. Please simply set: $_WD_DEBUG = $_WD_DEBUG_Full ... and run again. Post your logs and maybe we are able to help. Also please consider to test your automation with different browsers. How is the behavior in MSEdge or how in Firefox? Another question: Do you use _WD_JsonActionKey in your code? Because I reviewed the changes between v1.3.1 and v1.4.0 and there is nothing which should break somehow. Besides function _WD_JsonActionKey I am sure about this. Best regards Sven
    1 point
  13. Sadbunny's analog/digital AutoIt alarm clock! Simpler but far more effective then my other AutoIt clock... Which also almost no-one cared about. Well heck, as long as I care about my own ability to get out of bed early enough to be only a minute late to work, I guess I can pat myself on the back Born out of the fact that my old alarm clock started boring me. And also because I was trying out a few of these here GuiCtrl[Create/Set]Graphic functions anyway. Do anything you want with this code except for any commercial stuff. But do credit me. And notify me on the AutoIt forum if you find the time - just for my øwn kicks (Not that I believe there's anyone in this world who would find any need to steal some of this code... I just like writing things like that ) Use Left Mouse Button to set alarm, and Right Mouse Button to unset alarm or to quit sounding it. Note: the default alarm sound is @WindowsDir & "\media\ringin.wav". This because it should be present on pretty much any Windows box, and it is a really good alarm clock sound IMHO. I've been waking up to this sound for months now - my AutoItScript is way more useful and dependable than my physical alarm clock. Known Issues: Every time a refresh command is sent to one specific Graphic control, all other graphic controls seem to receive a refresh command too. This causes a small (small on my system at least) flicker every time @SEC changes... If anybody has any suggestions, I'd be happy to be informed. Two advantages: 1 - The alarm keeps sounding FOREVER until you quit it. Hey, I can't bring myself to become conscious in the 30 seconds that most alarm clocks ring. Having to type in my screensaver password before being able to switch off the alarm really, REALLY helps. 2 - The volume is ofcourse adjustable through speaker or windows settings. I'm not a radio or MP3 alarm clock guy, I use a beeping clock for my physical one. Plans: 1 - introduce a button for a settings window, that will at least include a function to set alarm repetition intended for snoozing, like 'sound for A seconds every B minutes between time C and D, and at time E sound forever until quit by user. Damn, in the morning I'm so lazy that I don't even want to worry about the need to press the Snooze button -there's gotta be automation for that... I make up for that by losing sleep in the evening coding an alarm clock. Damn, sucks to be me! #include <GUIConstants.au3> Dim $aDigChar[13] _initDigChar($aDigChar) Dim $aXY[2] Global $sec = @SEC Global $MinDegree = 0 Global $HourDegree = 0 Global $AlarmDegree = 0 Global $alarmHour = 0 Global $alarmMin = 0 Global $alarmSec = 0 Global $alarmIsSet = False Global $alarmIsSounding = False Global $previousMinDegree = 0 Global $previousHourDegree = 0 Global $previousAlarmDegree = 0 Global $pi = 3.14159265358979 Global $degToRad = $pi / 180 Global $RadToDeg = 1 / $degToRad #include <Sound.au3> Global $alarmFile = @WindowsDir & "\media\ringin.wav" Global $soundHandle = _SoundOpen($alarmFile, "alarmfile") $gui = GUICreate("Test", 702, 702) GUISetBkColor(0x000000) GUISetState() $megavierkant = GUICtrlCreateGraphic(0, 0, 700, 700) $vierkant = GUICtrlCreateGraphic(150, 150, 400, 400) $secSquare = GUICtrlCreateGraphic(0, 0, 0, 0) $timeSquare = GUICtrlCreateGraphic(5, 5, 200, 30) $alarmSquare = GUICtrlCreateGraphic(560, 5, 200, 30) _drawInitBorder($megavierkant) Dim $msg[1] While 1 ; main loop, waits until @sec changes and then executes main drawing management function While @SEC = $sec $msg = GUIGetMsg(1) If $msg[0] = -3 Then Exit If $msg[0] = $GUI_EVENT_PRIMARYDOWN Then $alarmIsSounding = False _SoundStop($soundHandle) $mX = $msg[3] - 350 $mY = $msg[4] - 350 $clickAngle = Int(ATan($mY / $mX) * $RadToDeg) + 90 If $mX < 0 Then $clickAngle += 180 $alarmHour = Int($clickAngle / 30) $alarmMin = Mod($clickAngle, 30) * 2 $alarmSec = 0 $alarmIsSet = True _draw() EndIf If $msg[0] = $GUI_EVENT_SECONDARYDOWN Then $alarmIsSounding = False _SoundStop($soundHandle) GUICtrlDelete($alarmSquare) $alarmIsSet = False $alarmHour = -1 _draw(True) EndIf Sleep(20) If $alarmIsSounding Then _soundAlarm() WEnd _draw() Sleep(50) $sec = @SEC If (@HOUR = $alarmHour Or @HOUR = 12 + $alarmHour) And @MIN = $alarmMin And $alarmIsSet Then $alarmIsSounding = True EndIf WEnd Exit Func _soundAlarm() If _SoundStatus($soundHandle) = "stopped" Then _SoundSeek($soundHandle,0,0,0) _SoundPlay($soundHandle, 0) EndIf EndFunc ;==>_soundAlarm Func _draw($forceDraw = False) ; calculates angles for min/sec dials, manages execution of drawing routines Local $doDraw = False $MinDegree = Int((90 - @MIN * 6) - @SEC * 0.1) $HourDegree = Int((90 - @HOUR * 30) - @MIN * .5) $AlarmDegree = Int((90 - $alarmHour * 30) - $alarmMin * .5) If $MinDegree <> $previousMinDegree Or $AlarmDegree <> $previousAlarmDegree Then $doDraw = True $previousMinDegree = $MinDegree $previousAlarmDegree = $AlarmDegree EndIf If $doDraw Or $forceDraw Then GUICtrlDelete($vierkant) $vierkant = GUICtrlCreateGraphic(150, 150, 400, 400) _drawHourPie($vierkant) _drawMinPie($vierkant) If $alarmIsSet Then _drawAlarmPie($vierkant) GUICtrlSetGraphic($vierkant, $GUI_GR_REFRESH) $doDraw = False EndIf Sleep(25) _drawSec() _drawTime() If $alarmIsSet Then _drawAlarmTime() GUICtrlSetGraphic($secSquare, $GUI_GR_REFRESH) EndFunc ;==>_draw Func _drawTime() ; manages execution of write commands for HH MM SS characters GUICtrlDelete($timeSquare) $timeSquare = GUICtrlCreateGraphic(5, 5, 200, 30) _timeWrite(1, Int(@HOUR / 10), "regular", $timeSquare) _timeWrite(20, Mod(@HOUR, 10), "regular", $timeSquare) _timeWrite(50, Int(@MIN / 10), "regular", $timeSquare) _timeWrite(70, Mod(@MIN, 10), "regular", $timeSquare) _timeWrite(100, Int(@SEC / 10), "regular", $timeSquare) _timeWrite(120, Mod(@SEC, 10), "regular", $timeSquare) EndFunc ;==>_drawTime Func _drawAlarmTime() ; manages execution of write commands for HH MM SS characters for the alarm time GUICtrlDelete($alarmSquare) $alarmSquare = GUICtrlCreateGraphic(480, 5, 220, 30) _timeWrite(1, 10, "alarm", $alarmSquare) _timeWrite(20, 11, "alarm", $alarmSquare) _timeWrite(50, 12, "alarm", $alarmSquare) _timeWrite(80, Int($alarmHour / 10), "alarm", $alarmSquare) _timeWrite(100, Mod($alarmHour, 10), "alarm", $alarmSquare) _timeWrite(130, Int($alarmMin / 10), "alarm", $alarmSquare) _timeWrite(150, Mod($alarmMin, 10), "alarm", $alarmSquare) _timeWrite(180, Int($alarmSec / 10), "alarm", $alarmSquare) _timeWrite(200, Mod($alarmSec, 10), "alarm", $alarmSquare) EndFunc ;==>_drawAlarmTime Func _timeWrite($pos, $num, $type, $graph) ; $type is "regular" or "alarm" ; manages coloring and writing of LEDs for time writing _setColorAndPenForWrite(StringMid($aDigChar[$num], 1, 1), $type);0 _line($graph, $pos + 5, 2, $pos + 3, 10) _setColorAndPenForWrite(StringMid($aDigChar[$num], 2, 1), $type);1 _line($graph, $pos + 2, 14, $pos + 0, 22) _setColorAndPenForWrite(StringMid($aDigChar[$num], 3, 1), $type);2 _line($graph, $pos + 5 + 2, 0, $pos + 5 + 8, 0) _setColorAndPenForWrite(StringMid($aDigChar[$num], 4, 1), $type);3 _line($graph, $pos + 2 + 2, 12, $pos + 2 + 8, 12) _setColorAndPenForWrite(StringMid($aDigChar[$num], 5, 1), $type);4 _line($graph, $pos + 2, 24, $pos + 8, 24) _setColorAndPenForWrite(StringMid($aDigChar[$num], 6, 1), $type);5 _line($graph, $pos + 5 + 10, 2, $pos + 3 + 10, 10) _setColorAndPenForWrite(StringMid($aDigChar[$num], 7, 1), $type);6 _line($graph, $pos + 2 + 10, 14, $pos + 10, 22) EndFunc ;==>_timeWrite Func _line($graph, $x1, $y1, $x2, $y2) ; draws line for time writing GUICtrlSetGraphic($graph, $GUI_GR_MOVE, $x1 + 2, $y1 + 2) GUICtrlSetGraphic($graph, $GUI_GR_LINE, $x2 + 2, $y2 + 2) EndFunc ;==>_line Func _setColorAndPenForWrite($char, $type) ; sets color and pen for next line in time writing, based on '0' or '1' in the DigChar array If $char = "1" Then If $type = "alarm" Then GUICtrlSetGraphic($alarmSquare, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic($alarmSquare, $GUI_GR_COLOR, 0xCCCCCC, 0xCCCCCC) Else GUICtrlSetGraphic($timeSquare, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic($timeSquare, $GUI_GR_COLOR, 0xEE0000, 0xEE0000) EndIf Else If $type = "alarm" Then GUICtrlSetGraphic($alarmSquare, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic($alarmSquare, $GUI_GR_COLOR, 0x444444, 0x444444) Else GUICtrlSetGraphic($timeSquare, $GUI_GR_PENSIZE, 2) GUICtrlSetGraphic($timeSquare, $GUI_GR_COLOR, 0x660000, 0x660000) EndIf EndIf EndFunc ;==>_setColorAndPenForWrite Func _drawSec() ; draws circle seconds indicator $aXY = _getXY(@SEC, 240) GUICtrlDelete($secSquare) $secSquare = GUICtrlCreateGraphic(350 + $aXY[0] - 8, 350 + $aXY[1] - 8, 16, 16) GUICtrlSetGraphic($secSquare, $GUI_GR_COLOR, 0x0000FF, 0x0000FF) GUICtrlSetGraphic($secSquare, $GUI_GR_ELLIPSE, 0, 0, 16, 16) EndFunc ;==>_drawSec Func _drawAlarmPie($graph) ; draws alarm dial GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0xDDDDDD, 0xDDDDDD) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 228, $AlarmDegree, 0) GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0xBB9999, 0x000000) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 120, $AlarmDegree - 1, 2) GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0x996666, 0x000000) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 70, $AlarmDegree - 2, 4) GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0x773333, 0x000000) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 20, $AlarmDegree - 4, 8) Return True EndFunc ;==>_drawAlarmPie Func _drawMinPie($graph) ; draws minute dial GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0xBBBB00, 0xBBBB00) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 200, $MinDegree - 2, 4) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 220, $MinDegree, 0) GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0x000000, 0x000000) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 150, $MinDegree - 1, 2) Return True EndFunc ;==>_drawMinPie Func _drawHourPie($graph) ; draws hour dial GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0xAA0000, 0xAA0000) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 140, $HourDegree - 4, 8) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 160, $HourDegree, 0) GUICtrlSetGraphic($graph, $GUI_GR_COLOR, 0x000000, 0x000000) GUICtrlSetGraphic($graph, $GUI_GR_PIE, 200, 200, 120, $HourDegree - 1, 2) Return True EndFunc ;==>_drawHourPie Func _getXY($sec, $hypo) ; returns array with X,Y coordinates for the seconds points for $sec seconds, with $hypo(tenuse) distance from center Dim $result[2] Local $pi = 3.14159265358979 Local $degToRad = $pi / 180 Local $degrees = $sec * 6 - 90 Local $x = Cos($degrees * $degToRad) * $hypo Local $y = Sin($degrees * $degToRad) * $hypo $result[0] = $x $result[1] = $y Return $result EndFunc ;==>_getXY Func _drawInitBorder($megavierkant) ; draws initial border 'circle' For $count = 1 To 60 If $count / 5 = Int($count / 5) Then Dim $a1 = _getXY($count, 260) Dim $a2 = _getXY($count, 280) GUICtrlSetGraphic($megavierkant, $GUI_GR_PENSIZE, 4) GUICtrlSetGraphic($megavierkant, $GUI_GR_COLOR, 0x00CC00, 0x00CC00) GUICtrlSetGraphic($megavierkant, $GUI_GR_MOVE, 350 + $a1[0], 350 + $a1[1]) GUICtrlSetGraphic($megavierkant, $GUI_GR_LINE, 350 + $a2[0], 350 + $a2[1]) Else Dim $a1 = _getXY($count, 270) Dim $a2 = _getXY($count, 280) GUICtrlSetGraphic($megavierkant, $GUI_GR_PENSIZE, 3) GUICtrlSetGraphic($megavierkant, $GUI_GR_COLOR, 0x008800, 0x008800) GUICtrlSetGraphic($megavierkant, $GUI_GR_MOVE, 350 + $a1[0], 350 + $a1[1]) GUICtrlSetGraphic($megavierkant, $GUI_GR_LINE, 350 + $a2[0], 350 + $a2[1]) EndIf Next EndFunc ;==>_drawInitBorder Func _initDigChar(ByRef $aDigChar) ; define leds for digital numbers: 1 or 0 for leds on/off in 7-led digital clock characters $aDigChar[0] = "1110111" $aDigChar[1] = "0000011" $aDigChar[2] = "0111110" $aDigChar[3] = "0011111" $aDigChar[4] = "1001011" $aDigChar[5] = "1011101" $aDigChar[6] = "1111101" $aDigChar[7] = "0010011" $aDigChar[8] = "1111111" $aDigChar[9] = "1011111" $aDigChar[10] = "1111011" ; A $aDigChar[11] = "1100100" ; L $aDigChar[12] = "0001000" ; - EndFunc ;==>_initDigChar
    1 point
×
×
  • Create New...