#include #include #include #include ; HotKeySet ( "key" [, "function"] ) ; Press Esc to terminate script, Pause/Break to "pause" Global $g_bPaused = False HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ; Shift-Alt-d Func TogglePause() $g_bPaused = Not $g_bPaused While $g_bPaused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit EndFunc ;==>Terminate Func ShowMessage() MsgBox($MB_SYSTEMMODAL, "", "This is a message.") EndFunc ;==>ShowMessage ; use this for realtime testing ; https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm While 1 Local $pingclip Local $origional Local $firstFourInClip = StringMid(ClipGet(), 1, 4) Local $http = "http" If $firstFourInClip = $http And $origional <> ClipGet() Then TrimItDown() Else Sleep(200) EndIf WEnd Func TrimItDown() GUICreate("Property of Techloq Ltd.c", 465, 100) GUICtrlCreateLabel("converting clipboard to...", 1, 1) Local $idButton_Page = GUICtrlCreateButton("Page", 15, 25, 75, 50) Local $idButton_Site = GUICtrlCreateButton("Site", 105, 25, 75, 50) Local $idButton_Origional = GUICtrlCreateButton("Ignore", 195, 25, 75, 50) Local $idButton_ip = GUICtrlCreateButton("IP", 285, 25, 75, 50) Local $idButton_Exit = GUICtrlCreateButton("Exit", 375, 25, 75, 50) Local $aAccelKeys[5][5] = [["^!+y", $idButton_Page], ["^!+n", $idButton_Site], ["^!+t", $idButton_Origional], ["^!+u", $idButton_ip], ["^!+u", $idButton_Exit]] GUISetAccelerators($aAccelKeys) GUISetState(@SW_SHOW) ; Display the GUI. ; use this for realtime testing ; https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm ;set this window to always on top ; Retrieve the handle of the active window. Local $hWnd = WinGetHandle("[ACTIVE]") ; Set the active window as being ontop using the handle returned by WinGetHandle. WinSetOnTop($hWnd, "", $WINDOWS_ONTOP) ; Wait for 2 seconds to display the change. Sleep(2000) ; Remove the "topmost" state from the active window. ;WinSetOnTop($hWnd, "", $WINDOWS_NOONTOP) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton_Page $sData1 = ClipGet() $sString1 = StringReplace($sData1, "https://www.", Null) ClipPut($sString1) $sData1 = ClipGet() $sData2 = ClipGet() $sString2 = StringReplace($sData2, "https://", Null) ClipPut($sString2) $sData2 = ClipGet() $sData3 = ClipGet() $sString3 = StringReplace($sData3, "http://www.", Null) ClipPut($sString3) $sData3 = ClipGet() $sData4 = ClipGet() $sString4 = StringReplace($sData4, "http://", Null) ClipPut($sString4) $sData4 = ClipGet() ExitLoop Case $idButton_Site $sData1 = ClipGet() $sString1 = StringReplace($sData1, "https://www.", Null) ClipPut($sString1) $sData1 = ClipGet() $sData2 = ClipGet() $sString2 = StringReplace($sData2, "https://", Null) ClipPut($sString2) $sData2 = ClipGet() $sData3 = ClipGet() $sString3 = StringReplace($sData3, "http://www.", Null) ClipPut($sString3) $sData3 = ClipGet() $sData4 = ClipGet() $sString4 = StringReplace($sData4, "http://", Null) ClipPut($sString4) $sData4 = ClipGet() $url = ClipGet() $spliturl = StringSplit($url, '/') $site = $spliturl[1] ClipPut($site) ExitLoop Case $idButton_Origional $origional = ClipGet() ExitLoop Case $idButton_ip ;trim to site $sData1 = ClipGet() $sString1 = StringReplace($sData1, "https://www.", Null) ClipPut($sString1) $sData1 = ClipGet() $sData2 = ClipGet() $sString2 = StringReplace($sData2, "https://", Null) ClipPut($sString2) $sData2 = ClipGet() $sData3 = ClipGet() $sString3 = StringReplace($sData3, "http://www.", Null) ClipPut($sString3) $sData3 = ClipGet() $sData4 = ClipGet() $sString4 = StringReplace($sData4, "http://", Null) ClipPut($sString4) $sData4 = ClipGet() $url = ClipGet() $spliturl = StringSplit($url, '/') $site = $spliturl[1] ClipPut($site) ;use this for realtime testing ;https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm $CMD = "ping " & ClipGet() & " | clip" RunWait(@ComSpec & " /c " & $CMD) ;save ping clip to $pingclip $pingclip = ClipGet() ;split string pinglip to second substring with '[' as paraneter $pingclip = StringSplit($pingclip, '[') $pingclip = $pingclip[2] ;split string pinglip to first substring with ']' as paraneter $pingclip = StringSplit($pingclip, ']') $pingclip = $pingclip[1] ClipPut($pingclip) ExitLoop Case $idButton_Exit Send("{Esc}") ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>TrimItDown