Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. The problem is that the image is semi-transparent and thus it looks good on white background. If you change the bg to black the result is the same as in your code. I don't have an idee yet how to display it with white bg but in a transparent GUI.
  3. Today
  4. Connect casually with like-minded individuals on the ultimate dating platform. Actual Girls Premier casual Dating
  5. Take a look https://www.autoitscript.com/forum/topic/208404-scite-plusbar
  6. Yesterday
  7. Final version: I wanted to demonstrate the constant evolution of this code since its inception to highlight the ease of use of object-oriented programming in AutoItObject.au3, in addition to the remarkable power already provided by AutoIt. This combination forms a single entity: maximum power. So, I effortlessly introduced a new feature in the game: a speed reducer, where the snake must do everything to swallow it in order to slightly slow down and catch its breath. You'll notice that adding new features doesn't affect the structure of the code, which remains easy to maintain. That's the magic of AutoItObject. I encourage you to explore this aspect in depth. You are free to develop this game, whose code is clean, modular, and easy to design and maintain. #include-once #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #INDEX# ======================================================================================================================= ; Title .........: Snake Game ; AutoIt Version : 3.3 ; AutoItObject Version : v1.2.8.2 ; Language ......: English ; Description ...: A simple Snake game implementation using AutoIt->AutoItObject.au3. ; Dependencies ..: AutoItObject.au3 ; Author ........: Numeric ; =============================================================================================================================== #include <GUIConstantsEx.au3> #include "AutoItObject.au3" #include <GDIPlus.au3> #include <Misc.au3> #include <WinAPISysWin.au3> #include "LinkedList.au3" Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") _GDIPlus_Startup() _AutoItObject_Startup() ; Error handling function Func _ErrFunc($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc ; Define Segment class Func Segment($X = 0, $Y = 0) Local $cSegment = _AutoItObject_Class() With $cSegment .Create() .AddProperty("X", $ELSCOPE_PRIVATE, $X) .AddProperty("Y", $ELSCOPE_PRIVATE, $Y) .AddMethod("setXPos", "_setXPos") .AddMethod("setYPos", "_setYPos") .AddMethod("getXPos", "_getXPos") .AddMethod("getYPos", "_getYPos") EndWith Return $cSegment.Object EndFunc ;==>Segment ; Methods for setting and getting X and Y positions of a Segment Func _setXPos($this, $iX) $this.X = $iX EndFunc ;==>_setXPos Func _setYPos($this, $iY) $this.Y = $iY EndFunc ;==>_setYPos Func _getXPos($this) Return $this.X EndFunc ;==>_getXPos Func _getYPos($this) Return $this.Y EndFunc ;==>_getYPos ; Define Food class Func Food($X = 0, $Y = 0, $Type = "normal") Local $cFood = _AutoItObject_Class() With $cFood .Create() .AddProperty("X", $ELSCOPE_PUBLIC, $X) .AddProperty("Y", $ELSCOPE_PUBLIC, $Y) .AddProperty("Type", $ELSCOPE_PUBLIC, $Type) EndWith Return $cFood.Object EndFunc ;==>Food ; Define Snake class Func Snake($iBackgroundColor = 0xFF0000FF) Local $dx = Random(-1, 1, 1) Local $dy = Random(-1, 1, 1) Local $oLinkedList = LinkedList() Local $oFoodList = LinkedList() $oLinkedList.insertAtIndex(Segment(Random(100, 280, 1), Random(100, 280, 1)), 0) ; head $oFoodList.insertAtIndex(Food(Random(10, 380, 1), Random(10, 380, 1), "normal"), 0) ; food Local $Board = GUICreate("Snake", 400, 400) GUISetState() Local $aBoardPos = WinGetClientSize($Board) Local $iBoardWidth = $aBoardPos[0] Local $iBoardHeight = $aBoardPos[1] Local $aGDIMap[] $aGDIMap["hGraphics"] = _GDIPlus_GraphicsCreateFromHWND($Board) $aGDIMap["hBitmap"] = _GDIPlus_BitmapCreateFromGraphics($iBoardWidth, $iBoardHeight, $aGDIMap["hGraphics"]) $aGDIMap["hGraphicsContext"] = _GDIPlus_ImageGetGraphicsContext($aGDIMap["hBitmap"]) $aGDIMap["hBrush"] = _GDIPlus_BrushCreateSolid($iBackgroundColor) $aGDIMap["hFoodBrush"] = _GDIPlus_BrushCreateSolid(0xFF00FF00) $aGDIMap["hPoisonedFoodBrush"] = _GDIPlus_BrushCreateSolid(0xFFFF0000) $aGDIMap["headBrush"] = _GDIPlus_HatchBrushCreate(4, 0xFF00FF00, $iBackgroundColor) $aGDIMap["speedPowerBrush"] = _GDIPlus_HatchBrushCreate(4, 0xFFD2691E, 0xFFFF00FF) Local $sClass = _AutoItObject_Class() With $sClass .Create() .AddProperty("dx", $ELSCOPE_PUBLIC, $dx) .AddProperty("dy", $ELSCOPE_PUBLIC, $dy) .AddProperty("speedLevel", $ELSCOPE_PUBLIC, 100) .AddProperty("foodCounter", $ELSCOPE_PUBLIC, 0) .AddProperty("SnakeSegments", $ELSCOPE_PUBLIC, $oLinkedList) .AddProperty("foodList", $ELSCOPE_PUBLIC, $oFoodList) .AddProperty("powerList", $ELSCOPE_PUBLIC, LinkedList()) .AddProperty("gdiMap", $ELSCOPE_PUBLIC, $aGDIMap) .AddProperty("Board", $ELSCOPE_PUBLIC, $Board) .AddProperty("iBoardWidth", $ELSCOPE_PUBLIC, $iBoardWidth) .AddProperty("iBoardHeight", $ELSCOPE_PUBLIC, $iBoardHeight) .AddProperty("poisonedFoodManager", $ELSCOPE_PUBLIC, FoodManager()) .AddProperty("speedPowerManager", $ELSCOPE_PUBLIC, FoodManager()) .AddMethod("move", "_move") .AddMethod("drawStage", "_drawStage") .AddMethod("resetGame", "_resetGame") .AddMethod("runGameLoop", "_runGameLoop") .AddMethod("cleanUpResources", "_cleanUpResources") .AddDestructor("_cleanUpResources") EndWith Return $sClass.Object EndFunc ;==>Snake ; Creates and returns a FoodManager object with default properties. ; Note: Traps, power-ups, and food itself are all considered as "food" because the snake Kaa only wants to eat. Func FoodManager() Local $sClass = _AutoItObject_Class() With $sClass .Create() .AddProperty("ifreq", $ELSCOPE_PUBLIC, 0) .AddProperty("iduration", $ELSCOPE_PUBLIC, 50) .AddProperty("isPresent", $ELSCOPE_PUBLIC, False) .AddProperty("disappearTime", $ELSCOPE_PUBLIC, 2000) .AddProperty("timeCounter", $ELSCOPE_PUBLIC, 0) EndWith Return $sClass.Object EndFunc ;==>FoodManager ; Run the game loop Func _runGameLoop($this) $this.poisonedFoodManager.disappearTime = 4000 ; Duration in milliseconds after which poisoned food disappears $this.poisonedFoodManager.timeCounter = TimerInit() ; Initialize the time counter $this.speedPowerManager.disappearTime = 3000 $this.speedPowerManager.timeCounter = TimerInit() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop _WinAPI_SetWindowText($this.Board, "Score : " & $this.foodCounter & " SpeedLevel : " & (100 - $this.speedLevel)) $this.poisonedFoodManager.ifreq += 1 $this.speedPowerManager.ifreq += 1 ; Check if speed reducer is present If Not $this.speedPowerManager.isPresent Then ; If no speed reducer is present, generate a new one after a delay If $this.speedPowerManager.ifreq >= 90 Then $this.powerList.insertAtEnd(Food(Random(10, 380, 1), Random(10, 380, 1), "speedPower")) $this.speedPowerManager.ifreq = 0 $this.speedPowerManager.isPresent = True $this.speedPowerManager.timeCounter = TimerInit() EndIf Else ; If speed reducer is present, check if it should disappear If TimerDiff($this.speedPowerManager.timeCounter) >= $this.speedPowerManager.disappearTime Then $this.powerList.clear() ;remove_last_node() $this.speedPowerManager.isPresent = False EndIf EndIf ; Check if poisoned food is present If Not $this.poisonedFoodManager.isPresent Then ; If no poisoned food is present, generate a new one after a delay If $this.poisonedFoodManager.ifreq >= 70 Then $this.foodList.insertAtEnd(Food(Random(10, 380, 1), Random(10, 380, 1), "poisoned")) ; Food $this.poisonedFoodManager.ifreq = 0 $this.poisonedFoodManager.isPresent = True $this.poisonedFoodManager.timeCounter = TimerInit() ; Reset the time counter EndIf Else ; If poisoned food is present, check if it should disappear If TimerDiff($this.poisonedFoodManager.timeCounter) >= $this.poisonedFoodManager.disappearTime Then ; If elapsed time exceeds the poisoned food disappearance duration $this.foodList.remove_last_node() $this.poisonedFoodManager.isPresent = False ; Mark poisoned food as disappeared EndIf EndIf ; Check for user input to control the snake's movement If _IsPressed(25) Then $this.dx = -1 $this.dy = 0 EndIf If _IsPressed(27) Then $this.dx = 1 $this.dy = 0 EndIf If _IsPressed(26) Then $this.dx = 0 $this.dy = -1 EndIf If _IsPressed(28) Then $this.dx = 0 $this.dy = 1 EndIf If _IsPressed(53) Then ; If the S key is pressed, pause the game until another arrow key is pressed While 1 If _IsPressed(25) Or _IsPressed(26) Or _IsPressed(27) Or _IsPressed(28) Then ExitLoop Sleep(100) WEnd EndIf ; Draw the game stage $this.drawStage() ; Pause for a short duration determined by the snake's speed level Sleep($this.speedLevel) WEnd EndFunc ;==>_runGameLoop ; Move the snake Func _move($this) Local $oLinkedList = $this.SnakeSegments Local $head = $oLinkedList.getAtIndex(0) Local $newX = $head.getXPos() + $this.dx * 10 Local $newY = $head.getYPos() + $this.dy * 10 Local $hW = $newX + 10 Local $hH = $newY + 10 ; Check collisions with the edges of the screen If $newX <= 0 Or $newX >= $this.iBoardWidth - 10 Or $newY <= 0 Or $newY >= $this.iBoardHeight - 10 Then MsgBox(64, "Game Over", "Collision! Game Over.") Local $iResponse = MsgBox(36, "Restart Game", "Do you want to restart the game?") If $iResponse = 6 Then $this.resetGame() Return True Else $this.cleanUpResources() Exit EndIf EndIf ; Check collisions with the snake's body For $i = 1 To $oLinkedList.sizeOfLL() - 1 Local $segment = $oLinkedList.getAtIndex($i) Local $cX = $segment.getXPos() Local $cY = $segment.getYPos() Local $cW = $cX + 10 Local $cH = $cY + 10 If $newX < $cW And $hW > $cX And $newY < $cH And $hH > $cY Then MsgBox(64, "Game Over", "Collision with self! Game Over.") $iResponse = MsgBox(36, "Restart Game", "Do you want to restart the game?") If $iResponse = 6 Then $this.resetGame() Return True Else $this.cleanUpResources() Exit EndIf EndIf Next ; Check collisions with food For $i = 0 To $this.foodList.sizeOfLL() - 1 Local $food = $this.foodList.getAtIndex($i) Local $fX = $food.X Local $fY = $food.Y Local $fW = $fX + 10 Local $fH = $fY + 10 If $newX < $fW And $hW > $fX And $newY < $fH And $hH > $fY Then If $food.Type = "poisoned" Then MsgBox(64, "Game Restart", "Warning! You have eaten poisoned food! The game will restart for your safety.") $this.resetGame() Return True EndIf ; Generate new food $food.X = Random(10, $this.iBoardWidth - 10) $food.Y = Random(10, $this.iBoardHeight - 10) ; Add a new segment to the snake Local $lastSegment = $oLinkedList.getLastNode() Local $lastX = $lastSegment.getXPos() Local $lastY = $lastSegment.getYPos() $oLinkedList.insertAtEnd(Segment($lastX, $lastY)) ; Update food counter and speed level $this.foodCounter += 1 If $this.foodCounter = 4 Then $this.speedLevel -= 20 If $this.speedLevel < 0 Then $this.speedLevel = 1 EndIf $this.foodCounter = 0 EndIf EndIf Next ; Check collisions with speedPower For $i = 0 To $this.powerList.sizeOfLL() - 1 Local $timeReducer = $this.powerList.getAtIndex($i) Local $tX = $timeReducer.X Local $tY = $timeReducer.Y Local $tW = $tX + 10 Local $tH = $tY + 10 If $newX < $tW And $hW > $tX And $newY < $tH And $hH > $tY Then If $timeReducer.Type = "speedPower" Then $this.speedLevel += 20 $this.powerList.clear() ;remove_last_node() $this.speedPowerManager.isPresent = False $this.speedPowerManager.timeCounter = TimerInit() EndIf EndIf Next ; Update positions of subsequent segments For $i = $oLinkedList.sizeOfLL() - 1 To 1 Step -1 Local $currentSegment = $oLinkedList.getAtIndex($i) Local $previousSegment = $oLinkedList.getAtIndex($i - 1) $currentSegment.setXPos($previousSegment.getXPos()) $currentSegment.setYPos($previousSegment.getYPos()) Next ; Update head position $head.setXPos($newX) $head.setYPos($newY) EndFunc ;==>_move ; Reset the game Func _resetGame($this) Local $oLinkedList = $this.SnakeSegments Local $oFoodList = $this.foodList Local $oPowerList = $this.powerList ; Clear snake segments linked list $oLinkedList.clear() $oFoodList.clear() $oPowerList.clear() ; Generate new snake segments $oLinkedList.insertAtIndex(Segment(Random(100, $this.iBoardWidth - 100), Random(100, $this.iBoardHeight - 100)), 0) $oFoodList.insertAtIndex(Food(Random(10, $this.iBoardWidth - 10), Random(10, $this.iBoardHeight - 10)), 0) ; Generate new food Local $food = $this.foodList.getAtIndex(0) $food.X = Random(10, $this.iBoardWidth - 10) $food.Y = Random(10, $this.iBoardHeight - 10) ; Reset snake direction and other parameters $this.dx = Random(-1, 1, 1) $this.dy = Random(-1, 1, 1) $this.speedLevel = 100 $this.foodCounter = 0 $this.poisonedFoodManager.ifreq = 0 $this.poisonedFoodManager.disappearTime = 4000 ; Duration in milliseconds after which poisoned food disappears $this.poisonedFoodManager.timeCounter = TimerInit() ; Initialize the time counter $this.speedPowerManager.ifreq = 0 $this.speedPowerManager.disappearTime = 3000 $this.speedPowerManager.timeCounter = TimerInit() ; Redraw game board $this.drawStage() EndFunc ;==>_resetGame ; Draw the game stage Func _drawStage($this) Local $gdiMap = $this.gdiMap Local $oLinkedList = $this.SnakeSegments Local $oFoodList = $this.foodList Local $oPowerList = $this.powerList Local $hGraphics = $gdiMap["hGraphics"] Local $hGraphicsCtx = $gdiMap["hGraphicsContext"] Local $hBrush = $gdiMap["hBrush"] Local $hFoodBrush = $gdiMap["hFoodBrush"] Local $headBrush = $gdiMap["headBrush"] Local $hImage = $gdiMap["hBitmap"] Local $speedPowerBrush = $gdiMap["speedPowerBrush"] $this.move() ; Clear previous graphics content _GDIPlus_GraphicsClear($hGraphicsCtx, 0xFF000000) ; Draw food Local $foodListIterator = $oFoodList.iterator() While Not $foodListIterator.isDone() Local $food = $foodListIterator.next() If $food.Type = "poisoned" Then $hFoodBrush = $gdiMap["hPoisonedFoodBrush"] EndIf _GDIPlus_GraphicsFillRect($hGraphicsCtx, $food.X, $food.Y, 10, 10, $hFoodBrush) WEnd Local $powerListIterator = $oPowerList.iterator() While Not $powerListIterator.isDone() Local $oPower = $powerListIterator.next() _GDIPlus_GraphicsFillRect($hGraphicsCtx, $oPower.X, $oPower.Y, 10, 10, $speedPowerBrush) WEnd _GDIPlus_GraphicsFillRect($hGraphicsCtx, $oLinkedList.getAtIndex(0).getXPos(), $oLinkedList.getAtIndex(0).getYPos(), 10, 10, $headBrush) ; Draw each snake segment For $i = 1 To $oLinkedList.sizeOfLL() - 1 Local $segment = $oLinkedList.getAtIndex($i) _GDIPlus_GraphicsFillRect($hGraphicsCtx, $segment.getXPos(), $segment.getYPos(), 10, 10, $hBrush) Next _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $this.iBoardWidth, $this.iBoardHeight) EndFunc ;==>_drawStage ; Clean up resources when game ends Func _cleanUpResources($this) Local $gdiMap = $this.gdiMap ; Dispose graphics resources _GDIPlus_GraphicsDispose($gdiMap["hGraphics"]) _GDIPlus_BrushDispose($gdiMap["hBrush"]) _GDIPlus_BrushDispose($gdiMap["hFoodBrush"]) _GDIPlus_BrushDispose($gdiMap["hPoisonedFoodBrush"]) _GDIPlus_Shutdown() ; Set map and linked list items to zero For $gdih In $this.gdiMap $gdih = 0 Next $this.gdiMap = 0 Local $oLinkedList = $this.SnakeSegments $oLinkedList.clear() ; Clear snake segments linked list ; Shutdown AutoItObject _AutoItObject_Shutdown() EndFunc ;==>_cleanUpResources ;==================================================== ; Create and run the snake game Global $snakeGame = Snake() $snakeGame.runGameLoop() $snakeGame = 0 ;====================================================
  8. I will be using some images similar to the one I have attached to this post, which isn't the clearest, so it would be nice to have a better rendering on the PC's Here is the slightly modified following code I'm using. Thanks @UEZ! What can I do to increase the clarity since the example image is very pixelated yet it shows up much clearer in other code? I'll provide another example if needed. BTW I left in a white slightly shaded oval in that image that you might not see until it's rendered using the code below. #include <WindowsConstants.au3> #include <WinAPISysWin.au3> #include <GDIPlus.au3> Opt("GUIOnEventMode", 1) Global Const $width = 600 Global Const $height = 600 _GDIPlus_Startup() Global $ghGDIPDll = DllOpen("gdiplus.dll") ; Open GDI+ DLL Local $IMAGE_PATH = @ScriptDir & "\TransparentImageOverlay.png" If Not FileExists($IMAGE_PATH) Then MsgBox(($MB_SYSTEMMODAL + $MB_ICONHAND), "", $IMAGE_PATH & " not found!", 30) Exit EndIf $g_hImage = _GDIPlus_ImageLoadFromFile($IMAGE_PATH) $hBG_Bitmap = $g_hImage Global $hWnd = GUICreate("GDI+: Example by UEZ 2010", $width, $height, -1, -1, 0, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW) GUISetOnEvent(-3, "_Exit") GUISetState() Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd) Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphics) ; AI recommends a 4th param 32-bit ARGB bitmap to be higher res Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) ; Set up transparency Global $alpha = 255 ; Full opacity Global $tBlend = DllStructCreate($tagBLENDFUNCTION) Global $pBlend = DllStructGetPtr($tBlend) ; Declare $pBlend and get its pointer DllStructSetData($tBlend, "Alpha", $alpha) DllStructSetData($tBlend, "Format", 1) #Region Make GUI transparent $ScreenDc = _WinAPI_GetDC($hWnd) $GDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) $dc = _WinAPI_CreateCompatibleDC($ScreenDc) _WinAPI_SelectObject($dc, $GDIBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", $width) DllStructSetData($tSize, "Y", $height) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tPoint = DllStructCreate($tagPOINT) $pPoint = DllStructGetPtr($tPoint) DllStructSetData($tPoint, "X", 0) DllStructSetData($tPoint, "Y", 0) #EndRegion Global $hMatrix = _GDIPlus_MatrixCreate() Global $rot_mid_x = $width / 2 Global $rot_mid_y = $height / 2 _GDIPlus_MatrixTranslate($hMatrix, $rot_mid_x, $rot_mid_y) Local $iAngle = 10 While Sleep(50) _GDIPlus_GraphicsClear($hBackbuffer, 0xFF000000) ; Clear with opaque black color _GDIPlus_MatrixRotate($hMatrix, $iAngle, "False") _GDIPlus_GraphicsSetTransform($hBackbuffer, $hMatrix) _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hBG_Bitmap, -$rot_mid_x / 2, -$rot_mid_y / 2, $width / 2, $height / 2) ;_GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hBG_Bitmap, -$aFittingRect[0]/2, -$aFittingRect[1]/2, $aFittingRect[0], $aFittingRect[1]) $GDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _WinAPI_SelectObject($dc, $GDIBitmap) _WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 1) _WinAPI_DeleteObject($GDIBitmap) WEnd Func _Exit() _WinAPI_DeleteDC($dc) _WinAPI_ReleaseDC($hWnd, $ScreenDc) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() DllClose($ghGDIPDll) ; Close GDI+ DLL Exit EndFunc
  9. The thread it's 15 years old so it's a small change in order to work with current AutoIt version.
  10. Thank you, @Andreik I had to do the following to get it to work. ; Replace AdlibEnable("_ExternalButtonFollow_Proc", 1) with: AdlibRegister("_ExternalButtonFollow_Proc", 100) ; Call _ExternalButtonFollow_Proc every 100 milliseconds Will play with it some more. taurus905
  11. I don't know what you saw but take a look here.
  12. Hello all, I saw this years ago and thought it might be useful in the future. Now I can't find anything that works. I'd like to place or embed a button on a title bar gui using Windows 10 or 11. Thank you for any clues. taurus905
  13. That's an copy&paste error. The first example script created was _TS_Wrapper_TaskCreate.au3. This was then used to create the _TS_TaskCreate.au3 example. The lines of code you mentioned are just an leftover and are not used in _TS_TaskCreate. So just ignore them
  14. The only error _AD_GetGroupMembers returns is 1 - Specified group does not exist. Can you please provide the full code you run that returns this error?
  15. I see that $sStartTime is declared as Global in both example scripts, but it appears never to be used in these scripts, and not in TaskScheduler.au3 _Perhaps $sStartTime is not used in _TS_TaskCreate.au3 because this script has "TRIGGERS|Type|" & $TASK_TRIGGER_LOGON . I do read that for schtasks you cannot specify ONLOGON and a date. Is this also true for non-schtasks ? I would expect the start time to be used in _TS_TaskRun.au3. because $sStartTime is set to 20 minutes from now in line 16. What am i not understanding?
  16. Last week
  17. That was one of the first things I tried, but it didn't work, just gave me a -1 error.
  18. Please have a look at function _AD_GetGroupMembers: Returns an array of group members.
  19. The code above run just fine. You might have some application that steal the focus of you window. Try this and let me know if it works: Run("write.exe") WinWait('[CLASS:WordPadClass]') Send ("{PRINTSCREEN}") SendKeepActive('[CLASS:WordPadClass]') Send ("^v") SendKeepActive('')
  20. #include <Date.au3> #include <MsgBoxConstants.au3> Local $hSleep = 5000 Sleep($hSleep) RUN ("Write.exe") Sleep($hSleep) Send ("{PRINTSCREEN}") Sleep($hSleep) Send ("^v")
  21. Further more it would be better to mark this post as "solution" instead of my question about "updates on this here" 😄 . I believe this lead to more context and so one. Best regards Sven
  22. You're welcome @MarcoMonte 😀 . No worries, simply open a new Thread with "WebDriver" in the title. No need to have one long Thread for different questions/problems (at least in my opinion). So please close this one if okay and open new one when the time will come. I observe Threads with WebDriver related question, so I will see it and most likely will react on such Threads if I can. So like other people here too 😀 . Best regards Sven
  23. Sven, I would like to thank you for your support, It worked and I started (slowly) to get the basic, pls, keep this thread alive because I will need help for sure. See you soon Marco
  24. Hi, I'm currently using this script to generate an array called $usernames which just contains the members of an AD group: #include <Array.au3> $objGroup = ObjGet("LDAP://cn=just_a_group,ou=groups,dc=here,dc=com") $objGroup.GetInfo $arrMemberOf = $objGroup.GetEx("member") Local $usernames[UBound($arrMemberOf)] For $i = 0 To UBound($arrMemberOf) - 1 $usernames[$i] = $arrMemberOf[$i] Next It works fine, but I never wrote it and I'd normally use the AD udf to do it. But I've tried and failed! How would I do the above with the AD udf? Thanks, Graybags
  25. Sorry, guys, i was tired and forgot to write about hardware acceleration. If you have gpu that supports vulkan backend, you can get answers from AI much faster. To enable gpu you should change False to True in this script's line: Local $answer = DllCall($hDLL, "str:cdecl", "Dllama_Simple_Inference", "str", "C:\LLM\gguf\", "str", "models.json", "str", "phi3:4B:Q4", "boolean", False, "uint", 1024, "int", 27, "str", $question) By the way, please, download the latest dll version from official github repo. It was updated since i posted this thread: https://github.com/tinyBigGAMES/Dllama/blob/main/bin/Dllama.dll Virustotal check can be found here: https://github.com/tinyBigGAMES/Dllama/blob/main/docs/VIRUSTOTAL.txt
  26. Thanks for the explanation. It does a lot for such a small amount of code
  27. Hi @SlavaS, yes of course you only get the texts of the image tags. This is intended because I only concentrated on your post with you solution: Which means here you only get the alt attributes of the images tags too. So I would suggest simply do two requests. One for the texts of the ticket cards and one for the alt tags. Best regards Sven
  28. Post the script involving wordpad that fails if VM is not open. Also have a look at SendKeepActive().
  1. Load more activity
×
×
  • Create New...