xXTurner

Auto change windows crosshair on rust startup

Jun 17th, 2021
1,239
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RustCursorPath := "E:\_After_Windows_Reinstall\rust_crosshair2.cur"
  2. DefaultCursorPath := "%SYSTEMROOT%\Cursors\aero_arrow.cur"
  3.  
  4. UpdateCursor()
  5. {
  6.     SPI_SETCURSORS := 0x57
  7.     result := DllCall("SystemParametersInfo", "UInt", SPI_SETCURSORS, "UInt", 0, "UInt", 0, "UInt", 0)
  8.     if (result != 1)
  9.     {
  10.         MsgBox Error Level: %ErrorLevel% `nLast error: %A_LastError%`nresult: %result%
  11.     }
  12. }
  13.  
  14. Loop
  15. {
  16.     Process, Exist, RustClient.exe
  17.     if (%ErrorLevel% != 0)
  18.     {
  19.         RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER\Control Panel\Cursors, Arrow, %RustCursorPath%
  20.         UpdateCursor()
  21.  
  22.         Process, WaitClose, RustClient.exe
  23.         if (%ErrorLevel% = 0)
  24.         {
  25.             RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER\Control Panel\Cursors, Arrow, %DefaultCursorPath%
  26.             UpdateCursor()
  27.         }
  28.     }
  29.     Sleep, 5000
  30. }
RAW Paste Data