Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WinApi.au3>
- #include <WinAPISysWin.au3>
- #include <WindowsConstants.au3>
- #include <Clipboard.au3>
- #include <Array.au3>
- #include <String.au3>
- #include <Misc.au3>
- #include <GUIConstantsEx.au3>
- #include <GuiListView.au3>
- #include <File.au3>
- #include <GDIPlus.au3>
- #include <StaticConstants.au3>
- GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY_HANDLER")
- ; THIS IS MY MAIN AUTOIT BACKGROUND PROCESS SCRIPT TO DO VARIOUS IMPORTANT THINGS :)
- ; IT ALLOWS FOR PINNING WINDOWS TO TOP, FIXING STUPID YOUTUBE KEYBINDINGS THAT F-UP...
- ; DISPLAYS CRYPTO PRICES (CURRENTLY JUST MONERO AND BITCOIN), AND MORE...
- HotKeySet("`", "PinWindow") ; TILDA KEY KEEPS CURRENT WINDOW ON TOP
- ;HotKeySet("{APPSKEY}", "YouTube_Keymap") ; THE MENU KEY (NEXT TO RIGHT-CTRL) FORCES THE YOUTUBE KEYBINDINGS TO WORK
- HotKeySet("{PAUSE}", "YouTube_Keymap")
- HotKeySet("^!b", "CoinPrice") ; CTRL-ALT-B WILL SHOW THE CURRENT COIN PRICE
- HotKeySet("^!n", "DollarToCoin") ; ENTER YOUR AMOUNT OF DOLLARS TO CONVERT TO CURRENT COIN
- HotKeySet("^!m", "CoinToDollar") ; COIN TO DOLLARS
- HotKeySet("^!s", "SwitchCoin") ; SWITCHES WHAT COIN IS CURRENTLY ACTIVE
- HotKeySet("^g", "MapsXClick") ; REMAP THE LEFT MOUSE CLICK AND MOUSE DOWN, TO X KEY - MAKES GOOGLE MAPS NOT OVER-USE MOUSE BUTTON
- HotKeySet("^!1", "HideWin1") ; CTRL-ALT-1 HIDE THE CURRENT FOREGROUND WINDOW IN SLOT 1 - JUST PRESS AGAIN TO SHOW
- HotKeySet("^!2", "HideWin2") ; HIDE CURRENT WINDOW SLOT 2
- HotKeySet("^!3", "HideWin3") ; SLOT 3
- HotKeySet("^!0", "UnhideAll") ; UNHIDE ALL HIDDEN WINDOWS
- HotKeySet("^!c", "CheckSpelling") ; CHECK SPELLING OF THE CURRENT SELECTED WORD - PUTS RESULT IN CLIPBOARD
- ; General declarations
- Local Const $YT_WINDOW = "- YouTube"
- Local $toggle = False
- Local $currentCoin = "Bitcoin"
- Local $mapsToggle = False
- Local $mapsPressed = False
- Local $toggleWin[3] = [False, False, False]
- Local $origHWnd[3]
- ; To-do list declarations
- Local $todoGUI, $todoList, $todoInput, $todoAddBtn, $todoClearBtn, $todoSaveBtn, $todoLoadBtn
- ; BITCOIN PRICE STUFF
- ; ===================
- Global $g_bGDIStarted = False
- Global $g_hCoinPriceWnd = 0
- Global $g_hCoinGraphWnd = 0
- Global $g_idCoinLabel = 0
- Global $g_iCoinModeCoins = 0
- Global $g_iCoinModeDollars = 0
- Global $g_sDisplayedCoin = ""
- Func HttpGet($sURL, $sData = "")
- Local $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
- Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
- $oHTTP.Open("GET", $sURL & "?" & $sData, False)
- If (@error) Then Return SetError(1, 0, 0)
- $oHTTP.Send()
- If (@error) Then Return SetError(2, 0, 0)
- If ($oHTTP.Status <> 200) Then Return SetError(3, 0, 0)
- Return SetError(0, 0, $oHTTP.ResponseText)
- EndFunc
- Func MyErrFunc()
- MsgBox(48, "Error", "API communication error. Check connection.", 5)
- EndFunc
- Func GetPrice($sCoin = "")
- If $sCoin = "" Then $sCoin = $currentCoin
- Local $thePrice = ""
- Local $begining = 0
- Local $ending = 0
- If $sCoin = "Bitcoin" Then
- $thePrice = HttpGet("[redacted]")
- Else
- $thePrice = HttpGet("[redacted]")
- EndIf
- If @error Or $thePrice = "" Then Return 0
- $begining = StringInStr($thePrice, '"last_price":"') + 14
- If $begining <= 14 Then Return 0
- $ending = StringInStr($thePrice, '",', 0, 1, $begining)
- If $ending <= 0 Then Return 0
- Return Number(StringMid($thePrice, $begining, $ending - $begining))
- EndFunc
- Func _FormatCoinValue($nValue)
- If Abs($nValue) >= 1000 Then Return Round($nValue, 0)
- If Abs($nValue) >= 100 Then Return Round($nValue, 2)
- If Abs($nValue) >= 1 Then Return Round($nValue, 4)
- Return Round($nValue, 6)
- EndFunc
- Func _GetPriceHistoryFile($sCoin)
- If $sCoin = "Bitcoin" Then
- Return @ScriptDir & "\bitcoin.log"
- Else
- Return @ScriptDir & "\monero.log"
- EndIf
- EndFunc
- Func SaveCoinPriceHistory($sCoin, $nPrice)
- Local $sFile = _GetPriceHistoryFile($sCoin)
- Local $hFile = FileOpen($sFile, 1)
- If $hFile = -1 Then Return False
- FileWriteLine($hFile, String($nPrice))
- FileClose($hFile)
- Return True
- EndFunc
- Func ReadCoinPriceHistory($sCoin)
- Local $sFile = _GetPriceHistoryFile($sCoin)
- If Not FileExists($sFile) Then
- Local $aEmpty[0]
- Return $aEmpty
- EndIf
- Local $aLines = FileReadToArray($sFile)
- If @error Then
- Local $aEmpty2[0]
- Return $aEmpty2
- EndIf
- Local $iValid = 0
- For $i = 0 To UBound($aLines) - 1
- If StringStripWS($aLines[$i], 8) <> "" Then $iValid += 1
- Next
- If $iValid = 0 Then
- Local $aEmpty3[0]
- Return $aEmpty3
- EndIf
- Local $aValues[$iValid]
- Local $j = 0
- For $i = 0 To UBound($aLines) - 1
- If StringStripWS($aLines[$i], 8) <> "" Then
- $aValues[$j] = Number($aLines[$i])
- $j += 1
- EndIf
- Next
- Return $aValues
- EndFunc
- Func _DownsampleValues(ByRef $aValues, $iMaxPoints)
- Local $iCount = UBound($aValues)
- If $iCount <= $iMaxPoints Then Return $aValues
- Local $iStep = Ceiling($iCount / $iMaxPoints)
- Local $iNewCount = Ceiling($iCount / $iStep)
- Local $aOut[$iNewCount]
- Local $j = 0
- For $i = 0 To $iCount - 1 Step $iStep
- $aOut[$j] = $aValues[$i]
- $j += 1
- Next
- If $aOut[$j - 1] <> $aValues[$iCount - 1] Then
- ReDim $aOut[$j + 1]
- $aOut[$j] = $aValues[$iCount - 1]
- EndIf
- Return $aOut
- EndFunc
- ; COIN DISPLAY AND GRAPHING ROUTINES
- ; ==================================
- Func _EnsureGDIPlus()
- If Not $g_bGDIStarted Then
- _GDIPlus_Startup()
- $g_bGDIStarted = True
- EndIf
- EndFunc
- Func _FillGraphArea($hBuffer, ByRef $aLinePts, $iBaseY, $iGraphLeft, $iGraphRight, $hBrushFill)
- Local $iPts = UBound($aLinePts)
- If $iPts < 2 Then Return
- For $i = 0 To $iPts - 2
- Local $x1 = Int($aLinePts[$i][0])
- Local $y1 = Int($aLinePts[$i][1])
- Local $x2 = Int($aLinePts[$i + 1][0])
- Local $y2 = Int($aLinePts[$i + 1][1])
- If $x2 < $x1 Then
- Local $tx = $x1, $ty = $y1
- $x1 = $x2
- $y1 = $y2
- $x2 = $tx
- $y2 = $ty
- EndIf
- If $x1 = $x2 Then
- Local $topY = $y1
- If $y2 < $topY Then $topY = $y2
- _GDIPlus_GraphicsFillRect($hBuffer, $x1, $topY, 1, $iBaseY - $topY + 1, $hBrushFill)
- Else
- For $x = $x1 To $x2
- Local $t = ($x - $x1) / ($x2 - $x1)
- Local $y = Int(Round($y1 + (($y2 - $y1) * $t)))
- If $y < 0 Then $y = 0
- If $y > $iBaseY Then $y = $iBaseY
- _GDIPlus_GraphicsFillRect($hBuffer, $x, $y, 1, $iBaseY - $y + 1, $hBrushFill)
- Next
- EndIf
- Next
- ; Ensure the filled area reaches the graph edges exactly.
- Local $firstX = Int($aLinePts[0][0])
- Local $firstY = Int($aLinePts[0][1])
- If $firstX > $iGraphLeft Then
- _GDIPlus_GraphicsFillRect($hBuffer, $iGraphLeft, $firstY, $firstX - $iGraphLeft + 1, $iBaseY - $firstY + 1, $hBrushFill)
- EndIf
- Local $lastX = Int($aLinePts[$iPts - 1][0])
- Local $lastY = Int($aLinePts[$iPts - 1][1])
- If $lastX < $iGraphRight Then
- _GDIPlus_GraphicsFillRect($hBuffer, $lastX, $lastY, $iGraphRight - $lastX + 1, $iBaseY - $lastY + 1, $hBrushFill)
- EndIf
- EndFunc
- Func RefreshActiveCoinDisplay($bSaveHistory = False)
- If Not WinExists($g_hCoinPriceWnd) Or Not WinExists($g_hCoinGraphWnd) Then Return False
- Local $rawPrice = GetPrice($currentCoin)
- If $rawPrice = 0 Then Return False
- Local $displayValue = 0
- If $g_iCoinModeDollars = 0 Then
- $displayValue = $rawPrice * $g_iCoinModeCoins
- Else
- $displayValue = $g_iCoinModeDollars / $rawPrice
- EndIf
- $g_sDisplayedCoin = $currentCoin
- WinSetTitle($g_hCoinPriceWnd, "", $currentCoin & " Price")
- WinSetTitle($g_hCoinGraphWnd, "", $currentCoin & " History")
- GUICtrlSetData($g_idCoinLabel, _FormatCoinValue($displayValue))
- ClipPut(String(_FormatCoinValue($displayValue)))
- If $bSaveHistory Then SaveCoinPriceHistory($currentCoin, $rawPrice)
- DrawCoinGraph($g_hCoinGraphWnd, $currentCoin)
- Return True
- EndFunc
- Func SwitchCoin()
- If $currentCoin = "Bitcoin" Then
- $currentCoin = "Monero"
- Else
- $currentCoin = "Bitcoin"
- EndIf
- If WinExists($g_hCoinPriceWnd) And WinExists($g_hCoinGraphWnd) Then
- WinSetTrans($g_hCoinPriceWnd, "", 48)
- RefreshActiveCoinDisplay(True)
- Sleep(250)
- WinSetTrans($g_hCoinPriceWnd, "", 255)
- EndIf
- ToolTip("Current coin is " & $currentCoin, @DesktopWidth / 2, (@DesktopHeight / 2) - 128, "Coin", 1, 2)
- Sleep(1750)
- ToolTip("")
- EndFunc
- Func DrawCoinGraph($hWndGraph, $sCoin)
- Local $aWinPos = WinGetPos($hWndGraph)
- If @error Then Return
- Local $iWidth = $aWinPos[2]
- Local $iHeight = $aWinPos[3]
- Local $iMarginLeft = 2
- Local $iMarginTop = 8
- Local $iMarginRight = 8
- Local $iMarginBottom = 26
- Local $iGraphW = $iWidth - ($iMarginLeft + $iMarginRight)
- Local $iGraphH = $iHeight - ($iMarginTop + $iMarginBottom)
- If $iGraphW < 2 Or $iGraphH < 2 Then Return
- Local $aValues = ReadCoinPriceHistory($sCoin)
- If UBound($aValues) < 2 Then Return
- $aValues = _DownsampleValues($aValues, $iGraphW)
- Local $nMin = $aValues[0]
- Local $nMax = $aValues[0]
- For $i = 1 To UBound($aValues) - 1
- If $aValues[$i] < $nMin Then $nMin = $aValues[$i]
- If $aValues[$i] > $nMax Then $nMax = $aValues[$i]
- Next
- Local $nRange = $nMax - $nMin
- If $nRange = 0 Then $nRange = 1
- _EnsureGDIPlus()
- Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWndGraph)
- Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
- Local $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
- _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)
- _GDIPlus_GraphicsClear($hBuffer, 0xFFFFFFFF)
- Local $hPen = _GDIPlus_PenCreate(0xFF0E5AA7, 2)
- Local $hBrushFill = _GDIPlus_BrushCreateSolid(0x883A8DDE)
- Local $hBrushBg = _GDIPlus_BrushCreateSolid(0xFFF3F8FE)
- _GDIPlus_GraphicsFillRect($hBuffer, 0, 0, $iWidth, $iHeight, $hBrushBg)
- Local $iCount = UBound($aValues)
- Local $nStepX = $iGraphW / ($iCount - 1)
- Local $iBaseY = $iMarginTop + $iGraphH
- Local $aPoly[$iCount][2]
- For $i = 0 To $iCount - 1
- Local $x = $iMarginLeft + ($i * $nStepX)
- Local $y
- If $nMax = $nMin Then
- $y = $iMarginTop + ($iGraphH / 2)
- Else
- $y = $iMarginTop + ($iGraphH - ((($aValues[$i] - $nMin) / $nRange) * $iGraphH))
- EndIf
- $aPoly[$i][0] = Int(Round($x))
- $aPoly[$i][1] = Int(Round($y))
- Next
- _FillGraphArea($hBuffer, $aPoly, $iBaseY, $iMarginLeft, $iMarginLeft + $iGraphW, $hBrushFill)
- For $i = 0 To $iCount - 2
- _GDIPlus_GraphicsDrawLine($hBuffer, $aPoly[$i][0], $aPoly[$i][1], $aPoly[$i + 1][0], $aPoly[$i + 1][1], $hPen)
- Next
- _GDIPlus_GraphicsDrawRect($hBuffer, 0, 0, $iWidth - 1, $iHeight - 1, $hPen)
- _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iWidth, $iHeight)
- _GDIPlus_BrushDispose($hBrushBg)
- _GDIPlus_BrushDispose($hBrushFill)
- _GDIPlus_PenDispose($hPen)
- _GDIPlus_GraphicsDispose($hBuffer)
- _GDIPlus_BitmapDispose($hBitmap)
- _GDIPlus_GraphicsDispose($hGraphics)
- EndFunc
- Func CreateCoinWindows($sCoin, $sText, ByRef $hWndPrice, ByRef $idLabel, ByRef $hWndGraph)
- Local $iPriceW = 420
- Local $iPriceH = 145
- Local $iGraphW = 420
- Local $iGraphH = 220
- Local $iX = -1
- Local $iY = -1
- $hWndPrice = GUICreate($sCoin & " Price", $iPriceW, $iPriceH, $iX, $iY, BitOR($WS_CAPTION, $WS_SYSMENU), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
- GUISetBkColor(0xFFFFFF, $hWndPrice)
- $idLabel = GUICtrlCreateLabel($sText, 10, 25, $iPriceW - 20, 80, BitOR($SS_CENTER, $SS_CENTERIMAGE))
- GUICtrlSetFont($idLabel, 72, 700, 0, "Segoe UI")
- GUICtrlSetColor($idLabel, 0x202020)
- GUISetState(@SW_SHOW, $hWndPrice)
- Local $aPos = WinGetPos($hWndPrice)
- $hWndGraph = GUICreate($sCoin & " History", $iGraphW, $iGraphH, $aPos[0], $aPos[1] + $aPos[3] + 10, BitOR($WS_CAPTION, $WS_SYSMENU), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
- GUISetBkColor(0xFFFFFF, $hWndGraph)
- GUISetState(@SW_SHOW, $hWndGraph)
- EndFunc
- Func UpdateCoinGraphPosition($hWndPrice, $hWndGraph)
- Local $aPos = WinGetPos($hWndPrice)
- If @error Then Return
- WinMove($hWndGraph, "", $aPos[0], $aPos[1] + $aPos[3] + 10)
- EndFunc
- Func CoinPrice()
- DispPrice(1, 0)
- EndFunc
- Func DollarToCoin()
- Local $dollars = Number(InputBox("Dollars", "Type in your amount of dollars to convert to " & $currentCoin & ":"))
- If $dollars > 0 Then DispPrice(0, $dollars)
- EndFunc
- Func CoinToDollar()
- Local $coins = Number(InputBox("Enter Coin", "Type in your amount of " & $currentCoin & ":"))
- If $coins > 0 Then DispPrice($coins, 0)
- EndFunc
- Func DispPrice($coins, $dollars)
- Local $sCoin = $currentCoin
- Local $rawPrice = GetPrice($sCoin)
- If $rawPrice = 0 Then Return
- Local $displayValue = 0
- If $dollars = 0 Then
- $displayValue = $rawPrice * $coins
- Else
- $displayValue = $dollars / $rawPrice
- EndIf
- ClipPut(String(_FormatCoinValue($displayValue)))
- SaveCoinPriceHistory($sCoin, $rawPrice)
- $g_iCoinModeCoins = $coins
- $g_iCoinModeDollars = $dollars
- $g_sDisplayedCoin = $sCoin
- $g_hCoinPriceWnd = 0
- $g_hCoinGraphWnd = 0
- $g_idCoinLabel = 0
- CreateCoinWindows($sCoin, _FormatCoinValue($displayValue), $g_hCoinPriceWnd, $g_idCoinLabel, $g_hCoinGraphWnd)
- DrawCoinGraph($g_hCoinGraphWnd, $sCoin)
- Local $hTimerPrice = TimerInit()
- Local $hTimerRedraw = TimerInit()
- While WinExists($g_hCoinPriceWnd) And WinExists($g_hCoinGraphWnd)
- UpdateCoinGraphPosition($g_hCoinPriceWnd, $g_hCoinGraphWnd)
- If TimerDiff($hTimerPrice) >= 3000 Then
- RefreshActiveCoinDisplay(False)
- $hTimerPrice = TimerInit()
- EndIf
- If TimerDiff($hTimerRedraw) >= 250 Then
- DrawCoinGraph($g_hCoinGraphWnd, $currentCoin)
- $hTimerRedraw = TimerInit()
- EndIf
- Local $msg1 = GUIGetMsg()
- If $msg1 = $GUI_EVENT_CLOSE Then ExitLoop
- Sleep(30)
- WEnd
- If WinExists($g_hCoinGraphWnd) Then GUIDelete($g_hCoinGraphWnd)
- If WinExists($g_hCoinPriceWnd) Then GUIDelete($g_hCoinPriceWnd)
- $g_hCoinGraphWnd = 0
- $g_hCoinPriceWnd = 0
- $g_idCoinLabel = 0
- $g_sDisplayedCoin = ""
- EndFunc
- ; YOUTUBE KEYBOARD CONTROL BUG FIX
- ; ================================
- Func YouTube_Keymap()
- Sleep(150)
- MouseClick($MOUSE_CLICK_LEFT, 750, 500, 1, 4)
- Sleep(250)
- Send("{SPACE}")
- EndFunc
- ; GOOGLE MAPS REMAP MOUSE CLICK TO X KEY
- ; ======================================
- Func MapsXClick()
- If $mapsToggle = False Then
- $mapsToggle = True
- MsgBox(64, "Google Maps Engine", "The X key remap is turned ON.")
- Else
- $mapsToggle = False
- MsgBox(64, "Google Maps Engine", "The X key remap is turned OFF.")
- EndIf
- EndFunc
- Func HoldDownMouse($keyCode)
- If _IsPressed($keyCode) And $mapsPressed = False Then
- $mapsPressed = True
- MouseDown($MOUSE_CLICK_LEFT)
- EndIf
- If Not _IsPressed($keyCode) And $mapsPressed = True Then
- MouseUp($MOUSE_CLICK_LEFT)
- $mapsPressed = False
- EndIf
- EndFunc
- ; KEEP THE WINDOW ON TOP BY PRESSING THE TILDA KEY
- ; ================================================
- Func PinWindow()
- If $toggle = False Then
- $toggle = True
- ; 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)
- Else
- $toggle = False
- ; 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_NOONTOP)
- EndIf
- EndFunc
- ; FUNCTIONS FOR HIDING WINDOWS
- ; ============================
- Func HideWin1()
- DoHideWin(0)
- EndFunc
- Func HideWin2()
- DoHideWin(1)
- EndFunc
- Func HideWin3()
- DoHideWin(2)
- EndFunc
- Func UnhideAll()
- For $i = 0 To 2
- If IsHWnd($origHWnd[$i]) Then
- WinSetState($origHWnd[$i], "", @SW_SHOW)
- $toggleWin[$i] = False
- EndIf
- Next
- EndFunc
- Func DoHideWin($winNumber)
- If $toggleWin[$winNumber] = False Then
- $origHWnd[$winNumber] = WinGetHandle("[ACTIVE]")
- WinSetState("[ACTIVE]", "", @SW_HIDE)
- $toggleWin[$winNumber] = True
- Else
- WinSetState($origHWnd[$winNumber], "", @SW_SHOW)
- WinActivate($origHWnd[$winNumber])
- $toggleWin[$winNumber] = False
- EndIf
- EndFunc
- Func _SendEx($ss)
- Local $iT = TimerInit()
- While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
- Sleep(50)
- WEnd
- Send($ss)
- EndFunc
- ; CHECK SPELLING BY RUNNING EXTERNAL SPELL CHECKER
- ; ================================================
- Func CheckSpelling()
- Local $strClip
- Sleep(150)
- _SendEx("^c")
- Sleep(50)
- $strClip = ClipGet()
- ShellExecuteWait("spellcheck.exe")
- Sleep(150)
- If $strClip <> ClipGet() Then
- _SendEx("^v")
- EndIf
- EndFunc
- ; DISPLAY AND RUN THE TO-DO LIST
- ; ==============================
- Func ShowTodoList()
- Local $width = 400, $height = 350
- $todoGUI = GUICreate("To-Do List", $width, $height, -1, -1)
- $todoList = GUICtrlCreateListView("Task", 10, 10, $width - 20, 250, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT, $LVS_SINGLESEL, $LVS_EDITLABELS))
- Local $hListView = GUICtrlGetHandle($todoList)
- _GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_CHECKBOXES)
- _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE_USEHEADER)
- $todoInput = GUICtrlCreateInput("", 10, 270, $width - 160, 24)
- $todoAddBtn = GUICtrlCreateButton("Add", $width - 145, 270, 65, 24)
- $todoDeleteBtn = GUICtrlCreateButton("Delete", $width - 75, 270, 65, 24)
- $todoClearBtn = GUICtrlCreateButton("Clear", 20, 310, 100, 30)
- $todoSaveBtn = GUICtrlCreateButton("Save", 150, 310, 100, 30)
- $todoLoadBtn = GUICtrlCreateButton("Load", 280, 310, 100, 30)
- GUISetState(@SW_SHOW, $todoGUI)
- LoadTodoList()
- While True
- If _IsPressed("0D") Then ; 0D is virtual key code for Enter - WE ARE ADDING A NEW ITEM TO THE LIST BY PRESSING ENTER KEY, NOT ONLY BY BUTTON CLICK
- Local $focusedCtrl = ControlGetFocus($todoGUI)
- If ControlGetHandle($todoGUI, "", $focusedCtrl) = GUICtrlGetHandle($todoInput) Then
- Local $text = GUICtrlRead($todoInput)
- If StringStripWS($text, 3) <> "" Then
- GUICtrlCreateListViewItem($text, $todoList)
- _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE_USEHEADER)
- GUICtrlSetData($todoInput, "")
- EndIf
- EndIf
- EndIf
- Switch GUIGetMsg() ; SOMEDAY WE NEED TO PUMP THIS INTO ITS OWN VAR THAT WE SWITCH..CASE ON BELOW. THAT WAY WE CAN FAKE TRIGGER A CASE EVENT WHEREEVER WE WANT.
- Case $GUI_EVENT_CLOSE
- GUIDelete($todoGUI)
- ExitLoop
- Case $todoAddBtn
- Local $text = GUICtrlRead($todoInput)
- If StringStripWS($text, 3) <> "" Then
- GUICtrlCreateListViewItem($text, $todoList)
- _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE_USEHEADER)
- GUICtrlSetData($todoInput, "")
- EndIf
- Case $todoDeleteBtn
- Local $index = _GUICtrlListView_GetSelectionMark($hListView)
- If $index <> -1 Then
- _GUICtrlListView_DeleteItem($hListView, $index)
- EndIf
- Case $todoClearBtn
- _GUICtrlListView_DeleteAllItems($hListView)
- Case $todoSaveBtn
- SaveTodoList()
- Case $todoLoadBtn
- LoadTodoList()
- EndSwitch
- WEnd
- EndFunc
- Func SaveTodoList()
- Local $hListView = GUICtrlGetHandle($todoList)
- Local $count = _GUICtrlListView_GetItemCount($hListView)
- If $count <> 0 Then
- Local $f = FileOpen(@ScriptDir & "\todo.ini", 2)
- If $f = -1 Then
- MsgBox(16, "Error", "Cannot save file!")
- Return
- EndIf
- For $i = 0 To $count - 1
- Local $text = _GUICtrlListView_GetItemText($hListView, $i)
- Local $checked = _GUICtrlListView_GetItemChecked($hListView, $i)
- FileWriteLine($f, $checked & "|" & $text)
- Next
- FileClose($f)
- EndIf
- EndFunc
- Func LoadTodoList()
- Local $hListView = GUICtrlGetHandle($todoList)
- If Not FileExists(@ScriptDir & "\todo.ini") Then Return
- _GUICtrlListView_DeleteAllItems($hListView)
- Local $lines = FileReadToArray(@ScriptDir & "\todo.ini")
- For $i = 0 To UBound($lines) - 1
- Local $parts = StringSplit($lines[$i], "|", 2)
- If UBound($parts) = 2 Then
- GUICtrlCreateListViewItem($parts[1], $todoList)
- Local $index = _GUICtrlListView_GetItemCount($hListView) - 1
- _GUICtrlListView_SetItemChecked($hListView, $index, $parts[0] = "True")
- EndIf
- Next
- _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE_USEHEADER)
- EndFunc
- Func WM_NOTIFY_HANDLER($hWnd, $iMsg, $wParam, $lParam)
- Local $tNMHDR = DllStructCreate("int;int;int", $lParam)
- Local $hwFrom = DllStructGetData($tNMHDR, 1)
- Local $code = DllStructGetData($tNMHDR, 3)
- Local $hListView = GUICtrlGetHandle($todoList)
- If $code = $NM_DBLCLK Then
- If $hwFrom = $hListView Then
- Local $index = _GUICtrlListView_GetSelectionMark($hListView)
- If $index <> -1 Then
- Local $oldText = _GUICtrlListView_GetItemText($hListView, $index)
- Local $newText = InputBox("Edit Task", "Double-click edit:", $oldText)
- If Not @error And StringStripWS($newText, 3) <> "" Then
- _GUICtrlListView_SetItemText($hListView, $index, $newText)
- _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE_USEHEADER)
- EndIf
- EndIf
- EndIf
- EndIf
- Return $GUI_RUNDEFMSG
- EndFunc
- ; PREPARE THE TRAY MENUITEMS
- ; ==========================
- Opt("TrayMenuMode", 3) ; Removes default behavior (no auto pause)
- Opt("TrayOnEventMode", 1) ; Enables event-driven tray menu
- TraySetClick(8) ; Enable right-click to show tray menu
- TrayCreateItem("To-Do List")
- TrayItemSetOnEvent(-1, "ShowTodoList")
- TrayCreateItem("")
- TrayCreateItem("Help")
- TrayItemSetOnEvent(-1, "ShowHelp")
- TrayCreateItem("")
- TrayCreateItem("Exit")
- TrayItemSetOnEvent(-1, "ExitScript")
- Func ExitScript()
- If $g_bGDIStarted Then _GDIPlus_Shutdown()
- Exit
- EndFunc
- Func ShowHelp()
- Local $helpMsg = _
- "(Tilda) - Toggle 'Always on Top' for the active window" & @CRLF & _
- "(Pause/Break) - Fix YouTube keybinding issues (simulate SPACE click)" & @CRLF & _
- "Ctrl+Alt+B - Show the current price of Bitcoin or Monero" & @CRLF & _
- "Ctrl+Alt+N - Convert a dollar amount to the selected coin" & @CRLF & _
- "Ctrl+Alt+M - Convert coin amount to dollars" & @CRLF & _
- "Ctrl+Alt+S - Switch between Bitcoin and Monero" & @CRLF & _
- "Ctrl+G - Enable/disable Google Maps mouse-to-X remap" & @CRLF & _
- "Ctrl+Alt+1 - Hide/unhide the current window in slot 1" & @CRLF & _
- "Ctrl+Alt+2 - Hide/unhide the current window in slot 2" & @CRLF & _
- "Ctrl+Alt+3 - Hide/unhide the current window in slot 3" & @CRLF & _
- "Ctrl+Alt+0 - Unhide all hidden windows" & @CRLF & _
- "Ctrl+Alt+C - Check spelling of selected word" & @CRLF & @CRLF & _
- "NOTE: Coin price is automatically copied to clipboard on each refresh." & @CRLF & @CRLF & _
- "Version 9.0 ©2020-2026 DosaidSoft.com - By Paul Meyer"
- MsgBox(64, "MouseWheel Hotkeys Help", $helpMsg)
- EndFunc
- ; THE PROGRAM MAIN LOOP
- ; =====================
- While True
- If $mapsToggle = True Then HoldDownMouse(58) ;if the X key is pressed - hold down the mouse
- GUIGetMsg()
- WEnd
- If $g_bGDIStarted Then _GDIPlus_Shutdown()
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=qmlarndkir
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=tcgwpgwelf
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment