1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AutoHotkey

Discussion in 'Fairy Land' started by Maffe811, May 13, 2011.

  1. humblejohnny20

    humblejohnny20 Member

    Joined:
    Nov 17, 2010
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    idk, theyre the same.. downloading autoit and making it now though, since - autoit will prob be easier for u to mod

    here - autoit.

    took a few minutes because i forgot some of the functions, but hey, they're all there, no programmin required ;D

    the key to take a screenshot is M, and remember to change your desktop directory.

    here it is:
    #include <Misc.au3>
    $dll = DllOpen("user32.dll")
    #include <ScreenCapture.au3>
    $Dir="c:\users\admin\desktop\" ;;;;;;;YOU MUST CHANGE YOUR DIRECTORY

    While 1

    Sleep (40)

    If _IsPressed("4D", $dll) Then
    $Name=Random(100,999)
    $MyDir=$Dir&$Name&".bmp"
    $hBmp = _ScreenCapture_Capture ("")
    _ScreenCapture_SaveImage ($MyDir, $hBmp)
    EndIf

    WEnd
    DllClose($dll)
     
  2. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    Thanks ill try it out :D
     
  3. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    I tried... but... its not working... whats supposed to happen ?
    Does it save a .bmp at the directory ?
    Cause it didnt... :/
     
  4. humblejohnny20

    humblejohnny20 Member

    Joined:
    Nov 17, 2010
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    hmm worked for me.. try this one -

    Code:
    #include <Misc.au3>
    $dll = DllOpen("user32.dll")
    #include <ScreenCapture.au3>
    $Dir=@WorkingDir
    
    While 1
    
    Sleep (40)
    
    If _IsPressed("4D", $dll) Then
    $Name=Random(100,999)
    $MyDir=$Dir&"\"&$Name&".bmp"
    $hBmp = _ScreenCapture_Capture ("")
    _ScreenCapture_SaveImage ($MyDir, $hBmp)
    EndIf
    
    WEnd
    DllClose($dll)
     
  5. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    That worked!
    But i did change some of the code!
    My questions:
    1. What is @WorkingDir
    2. Can you make the $Number into a whole number ? I dont like the decimals :p Im to busy with my own program! :p
    3. Can you explain what makes the hotkey M (is it the "4D" ? Is there a list of theese hotkeys) and change it to either ctrl+M or to the actuall Prinscreen button

    Code:
    #include <Misc.au3>
    $dll = DllOpen("user32.dll")
    #include <ScreenCapture.au3>
    $Dir=@WorkingDir
    
    While 1
    
    Sleep (40)
    
    If _IsPressed("4D", $dll) Then
    $Name="Image"
    $Number=Random(10,999)
    $MyDir=$Dir&"\"&$Name&$Number&".bmp"
    $hBmp = _ScreenCapture_Capture ("")
    _ScreenCapture_SaveImage ($MyDir, $hBmp)
    EndIf
    
    WEnd
    DllClose($dll)
     
  6. humblejohnny20

    humblejohnny20 Member

    Joined:
    Nov 17, 2010
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    1. What is @WorkingDir
    its the directory the script is in

    2. Can you make the $Number into a whole number ? I dont like the decimals :p Im to busy with my own program! :p

    floor($Variable)

    3. Can you explain what makes the hotkey M (is it the "4D" ? Is there a list of theese hotkeys) and change it to either ctrl+M or to the actuall Prinscreen button

    its the ascii keycode - theres a list in the help file under " ispressed"
    :D
     
  7. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    Thanks!
    It works brilliantly!

    Code:
    #include <Misc.au3>
    $dll = DllOpen("user32.dll")
    #include <ScreenCapture.au3>
    $Dir = @WorkingDir
    
    While 1
    
    	Sleep(40)
    
    	If _IsPressed("2C", $dll) Then
    		$Name = "Printscreen_"
    		$Number = Floor(Random(1, 9999))
    		$MyDir = $Dir & "\" & $Name & $Number & ".bmp"
    		$hBmp = _ScreenCapture_Capture("")
    		_ScreenCapture_SaveImage($MyDir, $hBmp)
    	EndIf
    
    WEnd
    DllClose($dll)
    Im gonna make an icon for this and make it into a program :p
    If you dont mind! :p
     
  8. humblejohnny20

    humblejohnny20 Member

    Joined:
    Nov 17, 2010
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    uh.. sure

    but please give me 10% if you become a millionaire from the revenues 8)

    jk


    also - something u can add - date and time in filename - so its easier to see which is which
     
  9. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    Yeah, ill try :)
     
  10. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    Okay i made v0.9 !
    I just have to fix a line break issue, or whatever its called!
    When you start the script it shows a tool tip with instructions!
    I just need to figure out how to break em apart :D
    Link in a sec!

    Edit:
    <a class="postlink" href="http://www.mediafire.com/?ol7qntlaiunjiko" onclick="window.open(this.href);return false;">http://www.mediafire.com/?ol7qntlaiunjiko</a>
    I realise the icon could need a little polish.. :p

    Also im making a development thread:
    <a class="postlink-local" href="http://www.gimper.net/viewtopic.php?f=28&t=10613" onclick="window.open(this.href);return false;">viewtopic.php?f=28&t=10613</a>
     
  11. humblejohnny20

    humblejohnny20 Member

    Joined:
    Nov 17, 2010
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    newline in help manual
     
  12. Maffe811

    Maffe811 The forum pet Staff Member

    Joined:
    Jul 2, 2009
    Messages:
    6,813
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Norway/Norge/Norwegen
    i found a topic on the autoit forum
    "text here" & @CRLF & "Some more text on a new line!"
     

Share This Page