Jump to content

My simple script not work


Nahd
 Share

Recommended Posts

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 by Musashi

Musashi-C64.png

"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

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()")

Musashi-C64.png

"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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...