Jump to content

matty45

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by matty45

  1. Hello, im trying to make an autoit script that can connect to a websocket then read from it. Is this possible? Thanks Matty45
  2. Hi, i am trying to make a autoit program that checks if a user is online on a website and if so, makes a msgbox appear. Here is the code so far: #include <IE.au3> #include <MsgBoxConstants.au3> $oIE = _IECreate("http://computernewb.com/collab-vm/",0,1) $txt = _IEBodyReadText($oIE) Sleep(9000) If StringInStr($txt,"username") then Msgbox(0, "", "Text detected") EndIf It does not seem to work properly and i do not really know why. Could someone help?
  3. Its ok, I managed to solve it in vbs Here is the code if your curious: If WScript.Arguments.Named.Exists("elevated") = False Then CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ /elevated", "", "runas", 1 WScript.Quit End If User = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%") dim Key, fso, Eater Set Key = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Set oSHApp = CreateObject("Shell.Application") Set Eater = fso.GetFile(Wscript.ScriptFullName) DownPic DownChanger DownBat ChangeWall CleanUp Sub DownPic dim xHttp, bStrm Set xHttp = createobject("Microsoft.XMLHTTP") Set bStrm = createobject("Adodb.Stream") xHttp.Open "GET", "http://whatever.com/test.bmp", False xHttp.Send with bStrm .type = 1 .open .write xHttp.responseBody .savetofile "C:\8ydfdsE.bmp", 2 End With End Sub Sub DownChanger dim xHttp, bStrm Set xHttp = createobject("Microsoft.XMLHTTP") Set bStrm = createobject("Adodb.Stream") xHttp.Open "GET", "http://matthewsstuff.altervista.org/wallpaperchanger/WallpaperChanger.exe", False xHttp.Send with bStrm .type = 1 .open .write xHttp.responseBody .savetofile "C:\wpc.exe", 2 End With End Sub Sub DownBat dim xHttp, bStrm Set xHttp = createobject("Microsoft.XMLHTTP") Set bStrm = createobject("Adodb.Stream") xHttp.Open "GET", "http://matthewsstuff.altervista.org/wallpaperchanger/wpc.bat", False xHttp.Send with bStrm .type = 1 .open .write xHttp.responseBody .savetofile "C:\wpce.bat", 2 End With End Sub Sub ChangeWall Set rchange = CreateObject ("Wscript.Shell") Dim Silent Silent = "cmd /c C:\wpce.bat" rchange.Run Silent, 0, false End Sub Sub CleanUp WScript.Sleep 5000 Dim deleter Set deleter = CreateObject("Scripting.FileSystemObject") deleter.DeleteFile "C:\8ydfdsE.bmp", True deleter.DeleteFile "C:\wpce.bat", True deleter.DeleteFile "C:\wpc.exe", True End Sub Thanks for the help
  4. Hi, i have tried to use many scripts to change a pcs wallpaper but they dont work. This script sets the wallpaper but does not refresh it. Any idea what the problem is? #include <SendMessage.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Misc.au3> #RequireAdmin $UrlDownload = "http://examplesite.org/test.bmp" ;DL link $Directory = "C:\test.bmp" ;Name of your file Local $download = InetGet($UrlDownload, $Directory,0,1) ; download in the background Do Sleep(100) Until InetGetInfo($download, 2) ;Checks to see if $download is completed (param 2) InetClose($download) RunWait($Directory) ;it will pause the script untill the process of the downloaded file is finished RegWrite ("HKEY_CURRENT_USER\Control Panel\Desktop", "wallpaper", "REG_SZ", "C:\test.bmp" ) Dim $hWnd = WinGetHandle('[CLASS:Progman]') _SendMessage($hWnd, $WM_COMMAND, 0x0001A220) Thanks Matthew
  5. How woud i fix this error?
  6. I tried this script but i get errors #include <WinAPI.au3> #include <File.au3> #include <GDIPlus.au3> #Region WallpaperSet() ; =================================================================== ; WallpaperSet($sPath, $nStyle = $WALLPAPER_STRETCH, $sConversionPath = "") ; ; Sets the desktop wallpaper to the specified file. ; Parameters: ; $sPath - IN - The path to the wallpaper file. If this file is not a BMP then it will be converted ; to a BMP at either $sConversionPath (if present) or an auto-generated location. ; $nStyle - IN/OPTIONAL - Controls the display of the wallpaper using the $WALLPAPER_* flags. ; $sConversionPath - IN/OPTIONAL - The path to save a BMP wallpaper when one is generated from ; a non-BMP wallpaper. ; Returns: ; Success - Returns True. ; Failure - Returns False and sets @error to non-zero. ; =================================================================== Func WallpaperSet($sPath, $nStyle = $WALLPAPER_STRETCH, $sConversionPath = "") ; Ensure the file exists. Allows an empty path which clears the wallpaper. If $sPath And Not FileExists($sPath) Then Return SetError(1, 0, False) ; Split the path. Local $sDrive, $sDir, $sFile, $sExt _PathSplit($sPath, $sDrive, $sDir, $sFile, $sExt) ; Convert the image to a bitmap. If $sPath And $sExt <> ".bmp" Then ; Startup GDI Plus. If Not _GDIPlus_Startup () Then Return SetError(2, 0, False) ; Declare variables that are used inside and outside the loop. Local $hImage, $nError, $nExtended ; Pseudo-loop so that cleanup will always happen. Do ; Load the image in it's original format. $hImage = _GDIPlus_ImageLoadFromFile($sPath) If $hImage = -1 Then $nError = 3 ExitLoop EndIf ; Get the Bitmap converter CLSID. Local $sCLSID = _GDIPlus_EncodersGetCLSID ("BMP") If Not $sCLSID Then $nError = 4 ExitLoop EndIf ; If the conversion path isn't specified generate one from the input file. If Not $sConversionPath Then $sConversionPath = _PathMake($sDrive, $sDir, $sFile, ".bmp") ; Change the input path to the converted path. $sPath = $sConversionPath ; Save the output file to the new path. If Not _GDIPlus_ImageSaveToFileEx($hImage, $sPath, $sCLSID) Then $nError = 5 ExitLoop EndIf Until True ; Release the image. _GDIPlus_ImageDispose($hImage) ; Shutdown GDI Plus. _GDIPlus_ShutDown() ; Abort if an error occurred in the loop. If $nError Then Return SetError($nError, $nExtended, False) EndIf ; Constant for the registry key where the wallpaper information is stored. Local Const $sRegKey = "HKEY_CURRENT_USER\Control Panel\Desktop" ; Tiling and centering/stretching are handled by two separate keys. If ; tiling then the style needs set to 0 and tile needs set to 1. Otherwise ; tile needs set to 0 and the style needs set to either 0 or 2. If $nStyle = $WALLPAPER_TILE Then RegWrite($sRegKey, "TileWallPaper", "REG_SZ", 1) RegWrite($sRegKey, "WallpaperStyle", "REG_SZ", 0) Else RegWrite($sRegKey, "TileWallPaper", "REG_SZ", 0) RegWrite($sRegKey, "WallpaperStyle", "REG_SZ", $nStyle) EndIf ; Constants for SystemParametersInfo(). Local $SPI_SETDESKWALLPAPER = 20 Local $SPIF_UPDATEINIFILE = 1 Local $SPIF_SENDCHANGE = 2 ; Create a structure to hold the path string. Local $vPath = DllStructCreate("wchar[" & StringLen($sPath) + 1 & "]") DllStructSetData($vPath, 1, $sPath) ; Update the wallpaper. Local $bResult = _WinAPI_SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, DllStructGetPtr($vPath), BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) ; Ensure the update was successful. If not set @error to a unique value. If Not $bResult Then Return SetError(6, 0, $bResult) Return $bResult EndFunc ; WallpaperSet() #EndRegion WallpaperSet() InetGet("http://mattys-stuff.uboxi.com/s.bmp", @TempDir & "\s.bmp") WallpaperSet(@TempDir&"\s.bmp",$WALLPAPER_STRETCH) ChangeDesktopWallPaper(@TempDir & '\' & 's.bmp',1)>"C:\Users\Matthew\Desktop\install\SciTe\..\autoit3.exe" /ErrorStdOut "C:\Users\Matthew\Desktop\install\wallpapachange.au3" "C:\Users\Matthew\Desktop\install\wallpapachange.au3" (108) : ==> Variable used without being declared.: WallpaperSet(@TempDir&"\s.bmp",$WALLPAPER_STRETCH) WallpaperSet(@TempDir&"\s.bmp",^ ERROR >Exit code: 1 Time: 2.259
  7. How would i make a script that will download a picture off of the internet and set it as a stretched wallpaper? I have searched the forums but found nothing
×
×
  • Create New...