Nahd Posted October 28, 2019 Share Posted October 28, 2019 My script is not working, nothing happens when I press PrtSc and also when set other buttons, what could be the issue? HotKeySet("{PRINTSCREEN}","snap()") while 1 WEnd func snap() ConsoleWrite("screenshot taken") EndFunc Link to comment Share on other sites More sharing options...
Somerset Posted October 28, 2019 Share Posted October 28, 2019 screen capture? Link to comment Share on other sites More sharing options...
Nahd Posted October 28, 2019 Author Share Posted October 28, 2019 Program works fine, screenshot transfering to clipboard works fine, just the consolewrite part doesnt work when pressed the button. Link to comment Share on other sites More sharing options...
Nine Posted October 28, 2019 Share Posted October 28, 2019 hotkeyset is badly formatted... Nahd 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Musashi Posted October 28, 2019 Share Posted October 28, 2019 (edited) HotKeySet("{PRINTSCREEN}", "snap") HotKeySet("{ESC}", "terminate") While 1 Sleep(10) WEnd Func snap() ConsoleWrite("screenshot taken" & @CRLF) EndFunc ;==>snap Func terminate() Exit EndFunc ;==>terminate Edited October 28, 2019 by Musashi Nahd 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Nahd Posted October 28, 2019 Author Share Posted October 28, 2019 28 minutes ago, Musashi said: HotKeySet("{PRINTSCREEN}", "snap") HotKeySet("{ESC}", "terminate") While 1 Sleep(10) WEnd Func snap() ConsoleWrite("screenshot taken" & @CRLF) EndFunc ;==>snap Func terminate() Exit EndFunc ;==>terminate Oh thanks, I didnt know terminate function is mandatory Link to comment Share on other sites More sharing options...
Musashi Posted October 28, 2019 Share Posted October 28, 2019 17 minutes ago, Nahd said: Oh thanks, I didnt know terminate function is mandatory terminate is not mandatory but an exit condition increases the comfort . More important is Sleep in the While loop. The actual problem was, as @Nine has indicated, the syntax -> HotKeySet("{PRINTSCREEN}", "snap()") Nahd 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Nine Posted October 28, 2019 Share Posted October 28, 2019 Now that you have the code, find out why PrtSc does not copy screen into clipboard... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nahd Posted October 28, 2019 Author Share Posted October 28, 2019 8 minutes ago, Nine said: Now that you have the code, find out why PrtSc does not copy screen into clipboard... I fixed it, thanks guys. HotKeySet("{tab}", "snap") HotKeySet("{ESC}", "terminate") While 1 Sleep(10) WEnd Func snap() Send("{printscreen}") ConsoleWrite("screenshot taken" & @CRLF) EndFunc Func terminate() Exit EndFunc Link to comment Share on other sites More sharing options...
Nine Posted October 28, 2019 Share Posted October 28, 2019 Instead of using another key, why not use UDF ScreenCapture ? Would make more sense, IMO, take a look at it in help file... Nahd 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nahd Posted October 28, 2019 Author Share Posted October 28, 2019 6 minutes ago, Nine said: Instead of using another key, why not use UDF ScreenCapture ? Would make more sense, IMO, take a look at it in help file... Anyways, I think that should be enough for my school project so Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now