Ninijaludek Posted April 17, 2022 Share Posted April 17, 2022 expandcollapse popup#include <date.au3> HotKeySet("{F1}", "pauze") Sleep(5000) MouseClick("left",1030, 944,1,50) Sleep(3000) While 1 Send("czesc wiola") Send("{Enter}") Sleep(500) SetWakeUpTime(@HOUR,@min+19); wakeup the system in 2 minutes from now SetSuspend(); go to hibernate mode Sleep(30000) Send(":P:P") Send("{Enter}") Sleep(500) WEnd SetWakeUpTime(@HOUR +4,@min+19); wakeup the system in 2 minutes from now SetSuspend(); go to hibernate mode Func pauze() Exit EndFunc ;=============================================================================== ; ; Description: Sets a wakeup time to wake it up if the system / computer is hibernating or standby ; Parameter(s): $Hour - Hour Values : 0-23 ; $Minute - Minutes Values: 0-59 ; $Day - Days Values : 1-31 (optional) ; $Month - Month Values : 1-12 (optional) ; $Year - Year Values : > 0 (optional) ; ; Requirement(s): DllCall ; Return Value(s): On Success - 1 ; On Failure - 0 sets @ERROR = 1 and @EXTENDED (Windows API error code) ; ; Error code(s): [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp]http://msdn.microsoft.com/library/default....error_codes.asp[/url] ; ; Author(s): Bastel123 aka Sebastian ; Note(s): - ; ;=============================================================================== func SetWakeUpTime($Hour,$Minute,$Day=@mday,$Month=@mon,$Year=@YEAR) $SYSTEMTIME = DllStructCreate("ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort") $lpSYSTEMTIME = DllStructGetPtr($SYSTEMTIME) $LOCALFILETIME=DllStructCreate("dword;dword") $lpLOCALFILETIME = DllStructGetPtr($LOCALFILETIME) $DueTime=DllStructCreate("dword;dword") $lpDueTime=DllStructGetPtr($DueTime) DllStructSetData($SYSTEMTIME, 1, $Year) DllStructSetData($SYSTEMTIME, 2, $Month) DllStructSetData($SYSTEMTIME, 3, _DateToDayOfWeek($Year,$Month,$Day)-1) DllStructSetData($SYSTEMTIME, 4, $Day) DllStructSetData($SYSTEMTIME, 5, $Hour) DllStructSetData($SYSTEMTIME, 6, $Minute) DllStructSetData($SYSTEMTIME, 7, 0) DllStructSetData($SYSTEMTIME, 8, 0) $result = DllCall("kernel32.dll", "long", "SystemTimeToFileTime", "ptr", $lpSystemTime, "ptr", $lpLocalFileTime) If $result[0] = 0 Then Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") SetExtended($lastError[0]) SetError(1) Return 0 EndIf $result = DllCall("kernel32.dll", "long", "LocalFileTimeToFileTime", "ptr", $lpLocalFileTime, "ptr", $lpLocalFileTime) If $result[0] = 0 Then Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") SetExtended($lastError[0]) SetError(1) Return 0 EndIf $result = DllCall("kernel32.dll", "long", "CreateWaitableTimer", "long", 0, "long", True, "str", "") If $result[0] = 0 Then Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") SetExtended($lastError[0]) SetError(1) Return 0 EndIf DllCall("kernel32.dll", "none", "CancelWaitableTimer", "long",$result[0]) DllStructSetData($DueTime, 1, DllStructGetData($LocalFILETIME, 1)) DllStructSetData($DueTime, 2, DllStructGetData($LocalFILETIME, 2)) $result = DllCall("kernel32.dll", "long", "SetWaitableTimer", "long",$result[0], "ptr", $lpDueTime, "long", 1000, "long", 0, "long", 0, "long", true) If $result[0] = 0 Then Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") SetExtended($lastError[0]) SetError(1) Return 0 EndIf return 1 EndFunc ;=============================================================================== ; ; Description: Set the computer in Hibernate or Standby Status ; Parameter(s): $Mode - Suspend mode : True=Hibernate, False=Suspend ; $Force - Force-Mode : True=the system suspends operation immediately ; False=FALSE, the system broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation ; ; Requirement(s): DllCall ; ; Author(s): Bastel123 aka Sebastian ; Note(s): If the system does not support hibernate use the standby mode - ; ;=============================================================================== Func SetSuspend($mode=true,$force=true) $result = DllCall("PowrProf.dll", "long", "SetSuspendState", "long",$mode, "long",$force, "long", false) EndFunc This is how my colleague from work teases and we send messages, but when I hibernate the computer, the script wakes it up once (you can manually use the mouse or keyboard) and then not (I can't even wake up the keyboard or mouse manually) then I have to press the power button for the laptop, laptop works on the charger, I will help someone solve the problem. I don't know why it wakes it up once and freezes once and nothing works but the power button Link to comment Share on other sites More sharing options...
Nine Posted April 17, 2022 Share Posted April 17, 2022 “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...
Moderators Melba23 Posted April 18, 2022 Moderators Share Posted April 18, 2022 Ninijaludek, Quote This is how my colleague from work teases You might have changed your story as to why you want this script to work, but you have not chosen a good explanation this time either. As explained in the Forum rules, we do not support prank/joke scripts. And any flex that you might have had has definitely run out - the next time you post something against the rules you are toast. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts