Jump to content

Draygoes

Active Members
  • Posts

    4,212
  • Joined

  • Last visited

  • Days Won

    19

Reputation Activity

  1. Sad
    Draygoes reacted to Jon in Random DoS Attacks   
    Hi, some random DoS attacks ongoing at the mo. Server is auto banning, but maybe some outages.
    Thanks, Jos, for letting me know,
  2. Like
    Draygoes reacted to Jos in Forum login requires now the use of your Email address   
    We have changed the login to require your Email address and disabled the option to use your member name to make the hacking of accounts harder, as that was happening regularly lately. 
    We can assist in case you don't remember the Email address used at signup. Just use the "Contact us" link at the bottom of the page.
  3. Like
    Draygoes got a reaction from VenusProject2 in ISN AutoIt Studio   
    Small suggestion. Perhaps make some tutorial videos on the general use of the product.
    I got a bit confused when using the Form Builder, when adding code to a button. I double clicked the button, clicked save, then saved it as an au3 script for good measure. Upon running the form it launched the MSGbox code that I had included when the form loaded. I had interpreted it as an on button click action rather than a form load action.
    I know better now, but that is why I suggested the above.
    Thank you for all the work you have put into this project. If I knew enough about autoit to help I would do so. Instead, I would like to help by testing from an end user point of view if that will work.
  4. Like
    Draygoes got a reaction from sylremo in Make CapsLock Great Again   
    Hi all,
    I make this thread in reference to this help topic. Call it my "thank you" for the help.
    This actually came about as a random thought while I was taking a smoke break. I personally almost never use the capslock button, so why not find a way to make it more useful right?
    And yes, the title is a play on MAGA. No political attachment , just thought it funny.
    Anyway, here is code.
    Global Const $VK_CAPITAL = 0x14 $WshShell = ObjCreate("WScript.Shell") While 1 Sleep(100) If _Key_Is_On($VK_CAPITAL) Then Run("notepad.exe") $WshShell.SendKeys("{CAPSLOCK}") EndIf WEnd Func _Key_Is_On($nVK_KEY, $vDLL = 'User32.dll') Local $a_Ret = DllCall($vDLL, "short", "GetKeyState", "int", $nVK_KEY) Return Not @error And BitAND($a_Ret[0], 0xFF) = 1 EndFunc This is autoit that we are talking about, so you can probably come up with a number of functions and scripts to be fired on press.
    I hope someone finds this useful.
  5. Like
    Draygoes got a reaction from felix12123 in [Solved] How to run Powershell with AutoIt and use Get-RDUserSession command?   
    Hey, my bad @argumentumThat was a bit harsh of me, I should have commented with more taste. Been thinking about it.
    EDIT: I did end up starting a new thread. Again, sorry. This doesn't make it any better, but I was frustrated by then. Thats all that was.
  6. Like
    Draygoes got a reaction from argumentum in [Solved] How to run Powershell with AutoIt and use Get-RDUserSession command?   
    Hey, my bad @argumentumThat was a bit harsh of me, I should have commented with more taste. Been thinking about it.
    EDIT: I did end up starting a new thread. Again, sorry. This doesn't make it any better, but I was frustrated by then. Thats all that was.
  7. Haha
    Draygoes reacted to kurtykurtyboy in Which of the control styles creates a GUI with no boarder and no title bar?   
    Do you mean this?
    GUICreate("Screen Capture Window", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP)  
    And for your 2nd question...
    There seem to be loads of good techniques and examples from this question asked by YOU in 2018! 🤣
     
  8. Thanks
    Draygoes reacted to genius257 in Does anyone know where I can find an example of a command prompt (Yes, Windows CMD) written in Autoit?   
    Hi @Draygoes.
    Here's a link to a post in the thread with an example:
    I think this is what you need
    Hope it helps
  9. Like
    Draygoes reacted to OJBakker in if statement has no matching endif statement   
    Wow, 5 lines and only the last line is correct syntax! 
        May I suggest you check the helpfile for the correct syntax of using the functions '_ispressed' and 'mouseclick' and study / try the examples for these functions.
     
    #include <Misc.au3> ; $click= ("{alt}+{d}") Local $keyAlt = 12 Local $keyD = 44 If _ispressed($keyAlt) and _IsPressed($keyD) Then MouseClick ( "right" , Default, Default , 22 , 10 ) ; Return ; can only be used in a function EndIf  
  10. Like
  11. Confused
    Draygoes got a reaction from JLogan3o13 in Is there any way we can put a do - until loop on a single line?   
    This doesn't work.
    Do Sleep(100) Until WinActive( "TheNuggetQueen - Discord" ) Everyone here is going "well duh ", but I mean, why can't that work? Is there any other type of loop that I could use in one line that would work here?
    Btw, I want to replace sleep with "WinActivate" to loop until window is at forefront.(EDIT: I'm not automating anything other than Discord! Goodness that came out wrong the first time lmao. I'm writing a love message sender)
  12. Confused
    Draygoes got a reaction from JLogan3o13 in Let your S.O. know how many times you've thought of them over discord! (Well commented, simple example)   
    Here is a well commented and simple example that beginners should be able to follow. It deals with a lot of beginner consepts, a ton of them being consepts I started with.
    You must have discord running, and you will have to modify the Window title names, but it should otherwise work right out of the box for you.

     
    ;This will help us keep a running tally of how often we've thought about our S.O. ;We could do this totally in ram, but we would lose our count any time the program crashes or restarts. ;This allows us to reset our count according to our wishes. If Not FileExists( "count" ) Then ;If file doesn't exist, FileWriteLine( "count", "0" ) ;create the file with the number 0 EndIf ;This sets * on the numberpad as our hotkey to launch the main function. ;The loop just gives us a reason to be running in the background. Script can't end until we want it to or our hotkey isn't being watched for. HotKeySet("{NUMPADMULT}", "KissAndTell"); * on the numberpad. While 1 Sleep( 10000 ) WEnd Func KissAndTell() ;Create Function KissAndTell $count = FileReadLine( "count" ); Get number of times executed. $count = $count + 1; Account for this time by adding one. FileDelete("count"); Delete our file to ensure blank slate. FileWriteLine( "count", $count );write current count to file, recreating it. Do;Keep... WinActivate( "TheNuggetQueen - Discord");... activating this window until... Until WinActive( "TheNuggetQueen - Discord" );... we see that it's active. Send("My program is recording how much I think about you. I've thought about you " & $count & " times today! I love you!",1) Send("{ENTER}") EndFunc ;EndFunction  
  13. Thanks
    Draygoes reacted to Melba23 in GUI_Extender - New Version 16 Apr 2022   
    [New Version] - 16 Apr 2022
    Added: 
    A new function _GUIExtender_Hidden_Control which allows you to specify which controls should not be automatically reshown when it redraws the GUI. You no longer need to hide/show the control within the script - this function does that as well as telling the UDF whether or not to show it on redraw.
    New UDF and an additional example in the first post.
    M23
  14. Thanks
    Draygoes reacted to Gianni in So many applications have the ability to make sure that their window is always on bottom. How are they doing it?   
    ??
    ; https://www.autoitscript.com/forum/topic/111608-window-always-on-bottom/?do=findComment&comment=782930 ; https://www.autoitscript.com/forum/topic/104080-open-winow-in-background/?do=findComment&comment=736679 #include <WinAPI.au3> $PID = Run("notepad.exe", "", @SW_HIDE) ; run notepad $handle = _GetHwndFromPID($PID) ; get its handle ; set the parent to the desktop window so when you shownoactivate it is behind all other windows. $origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $handle, "hwnd", WinGetHandle("Program Manager")) ; shownoactivate the window (notepad) ; it will stay behind all other windows even when you drag it around _WinAPI_ShowWindow($handle, @SW_SHOWNOACTIVATE) ; $origParent2 = DllCall("user32.dll", "int", "SetParent", "hwnd", $handle, "hwnd", $origParent[0]) ; https://www.autoitscript.com/forum/topic/86680-pid-window-handle-hwnd-conversion/?do=findComment&comment=621521 Func _GetHwndFromPID($PID) $hWnd = 0 $stPID = DllStructCreate("int") Do $winlist2 = WinList() For $i = 1 To $winlist2[0][0] If $winlist2[$i][0] <> "" Then DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID)) If DllStructGetData($stPID, 1) = $PID Then $hWnd = $winlist2[$i][1] ExitLoop EndIf EndIf Next Sleep(100) Until $hWnd <> 0 Return $hWnd EndFunc ;==>_GetHwndFromPID  
  15. Thanks
    Draygoes reacted to Earthshine in I can't seem to get my code to run my portable Virtual Box.   
    UAC determines whether you need to be admin. It's better than letting any script run, more secure, that's why--windows is protecting you
     
    same in Linux, have to run as su (super user) to do anything that affects the system that is how it should always be, not the wild wild west. following this practice leads to a pc with a long, reliable well configured life. stable OS
     
    in fact, you should never operate from an elevated account unless you are installing software or doing OS related maintenance, you should be logged in and running as a standard user--much more safe--need to install something (you probably just want to, not need to) --then log in as admin or elevate to admin temporarily
  16. Thanks
    Draygoes reacted to Barney in A Machine Learning Tic Tac Toe Game   
    From MiniMax to Machine Learning ... Tic Tac Toe is a good game for studying AI algorithm because it's simple!
    I use Tabular Q Learning to implement this game, Every time a game finished, it will use the Q function to update
    the score of each steps it played.
    Q(S,A) = Q(S,A) + α ∗ (γ ∗ maxaQ(S′,a) − Q(S,A))
    S being the current state, A the current action, S′ the state after doing A, α being the learning rate, γ being the
    discount factor,  and maxaQ(S′,a) the highest Q value of any move in the next state S′, i.e. the Q value of the best
    move in the following state.
    It's funny to see that it plays better and better. That's why people were charmed by Machine Learning!
    Thank you!
    Download: tic_tac_toe.zip

  17. Thanks
    Draygoes reacted to Werty in How do I find out if I'm running as admin?   
    IsAdmin() ?
  18. Thanks
    Draygoes reacted to Jon in AutoIt v.3.3.16.0 Released   
    AutoIt v3.3.16.0 has been released. 
    Thanks to @jpm and the MVPs who were responsible for the majority of code in this version.
    Download it here.
    Complete list of changes: History
  19. Thanks
    Draygoes reacted to Jos in PC Remote Control 3 via Browser: direct connection & AJAX   
    Don't reinvent that wheel and use something like UltraVNC.  
  20. Haha
    Draygoes got a reaction from argumentum in (Poll) What features do you wish you had in AutoIt?   
    I feel like this conversation has been going since I joined this board.
    I'm starting to wonder if that conversation is as old as Autoit 2.
  21. Haha
    Draygoes got a reaction from TheDcoder in (Poll) What features do you wish you had in AutoIt?   
    I feel like this conversation has been going since I joined this board.
    I'm starting to wonder if that conversation is as old as Autoit 2.
  22. Thanks
    Draygoes reacted to argumentum in (Poll) What features do you wish you had in AutoIt?   
    RAM, Disk and CPU have plenty power/big/unrestricted nowadays.
    I write programs/applications/CallItWhatYouWill without much of a problem in AutoIt. Open your browser and you're gonna see forking left and right.
    I believe that those who wish for MT in AutoIt scripting, could not code it ( in C, Rust, ASM, etc. ) and if did, it would work more like forking than anything else hence, fork if you need to and drop the MT rhetorical. It gets boring.
    ...and if the code is too heavy for AutoIt scripting:
     
  23. Thanks
    Draygoes reacted to KaFu in Are there any .DLL repositories for programmers to use for free?   
    I once started this one, but it stalled 🤐
     
  24. Thanks
    Draygoes reacted to argumentum in Exit 1 reserved   
    I was looking at an example and it would Exit 1 on error.
    So what's wrong with that. Well, we can get an error from different aspects of the script, been the stub errored, or the wrapper errored, or finally, the script.
    What I propose is to start script errors on 3 onwards. Been 1 the error of AutoIt3, 2 of the wrapper, and finally the script.
    If you agree vote for me: "argumentum 2021"
    Really, if the concept is sound then say it and if not ... well, say it too  
    PS: this is in regard to Exit codes of a script and not that of Return in a Function.
  25. Thanks
    Draygoes reacted to argumentum in AutoIt Snippets   
    Center GUI on Monitor based on mouse position
    #include <AutoItConstants.au3> #include <GUIConstants.au3> #include <WinAPIGdi.au3> Func GuiCenterOnMonitorFromMousePosition($hForm, $sText = "") Local $aData, $hMonitor, $tPos = _WinAPI_GetMousePos() If Not @error Then $hMonitor = _WinAPI_MonitorFromPoint($tPos) If Not @error Then $aData = _WinAPI_GetMonitorInfo($hMonitor) If @error Then Return SetError(1, -1, 1) Local $iWinState = WinGetState($hForm, $sText) If @error Then Return SetError(2, $aData[2], 2) If BitAND($iWinState, $WIN_STATE_MINIMIZED) Or _ BitAND($iWinState, $WIN_STATE_MAXIMIZED) Then WinSetState($hForm, $sText, @SW_RESTORE) Local $aWinPos = WinGetPos($hForm, $sText) If @error Then Return SetError(3, $aData[2], 3) WinMove($hForm, _ $sText, _ Int((($aData[0].Right - $aData[0].Left - $aWinPos[2]) / 2) + $aData[0].Left), _ Int((($aData[0].Bottom - $aData[0].Top - $aWinPos[3]) / 2) + $aData[0].Top)) If @error Then Return SetError(4, $aData[2], 4) Return SetError(0, $aData[2], 0) EndFunc ;==>GuiCenterOnMonitorFromMousePosition Example() Func Example() Local $hGUI = GUICreate("GuiCenterOnMonitorFromMousePosition example", 600, 200) GuiCenterOnMonitorFromMousePosition($hGUI) GUICtrlCreateLabel("Primary display monitor = " & @extended, 20, 20, 160, 21) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd GUIDelete() EndFunc ;==>Example  
×
×
  • Create New...