nfwu
Active Members-
Posts
1,195 -
Joined
-
Last visited
Profile Information
-
Member Title
I'm not active on these forums
-
Location
http://claimid.com/nfwu
-
WWW
http://claimid.com/nfwu
Recent Profile Visitors
849 profile views
nfwu's Achievements
Universalist (7/7)
4
Reputation
-
yyywww reacted to a post in a topic: How to sort numerically a CSV file?
-
AnonymousX reacted to a post in a topic: How To Hide Window Title Bar?
-
onlineth reacted to a post in a topic: 3D Graphics in AutoIt
-
Klexur reacted to a post in a topic: _urlencode() / _urldecode()
-
This is so old I'd forgotten about it. How to use the example provided: 1. Press Browse to go to the exe 2. Type in data you want to save to the exe 3. Press Save To retrieve the data, do the following: 1. Press Browse to go to the exe 2. The data magically appears. How does it work: To read the data out of the executable: $the_data_I_want = _BindRead(_BindLoad($path_to_exe)) To save data to the executable: _BindSave($path_to_exe, _BindSet(_BindLoad($path_to_exe), $the_data_to_save)) Work something out with that.
-
detecting network working-ness
nfwu replied to GodForsakenSoul's topic in AutoIt General Help and Support
http://www.autoitscript.com/autoit3/docs/functions/Ping.htm Ping google.com / some other pingable server every 3 minutes or so. When Ping returns 0, you are most likely disconnected from the internet. -
neogia's old guide was handy: http://www.autoitscript.com/forum/index.php?showtopic=23627 "technical" document if you're into that stuff: http://www.autoitscript.com/autoit3/pcrepattern.html
-
Incorrect. That was a one-line If statement, an EndIf is not required. That wouldn't work. The addition operator doesn't work on strings. -------------- Okay. While True Run("Conexion.cmd") ;; Here, we wait until a the window exists. WinWait("Prekybos tinklas internete - Mozilla Firefox", "") ;; Then it brings it to front, and waits for it to come to front... WinActivate("Prekybos tinklas internete - Mozilla Firefox", "") WinWaitActive("Prekybos tinklas internete - Mozilla Firefox", "") ;;Once the window exists and is in front, this would run: Send("{CTRLDOWN}w{CTRLUP}") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Wend Is this what you wanted?
-
Please helpwith runas over network
nfwu replied to hacksawbob's topic in AutoIt General Help and Support
I'm pretty sure you can't run a batch file directly but need a shell to do so, so here: ; Fill in the username and password appropriate for your system. Local $sUserName = "USERNAME" Local $sPassword = "PASSWORD" ; Run a command prompt as the other user. Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, @ComSpec & " /c " & "\\server\share\batch.bat", @SystemDir) ; Wait for the process to close. ProcessWaitClose($pid) ; Show a message. MsgBox(0, "", "The process we were waiting for has closed.") EDIT: Typos -
Without the last backslash: RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\APcDefender")
-
Please helpwith runas over network
nfwu replied to hacksawbob's topic in AutoIt General Help and Support
RunAs("adminuser", @computername, "XXXXPASS", 0, "\\server\share\batch.bat", @SystemDir) String literals, or string data in source code, needs quotes: "". -
You want the server to loop. First ask yourself, what do you need to loop? Since you want the server to do processing then wait for another connection, you need to loop back to the part where the server accepts a connection. ; Initialize a variable to represent a connection ;============================================== $ConnectedSocket = -1 ;;; nfwu: Start an infinite loop While 1 ;Wait for and Accept a connection Do $ConnectedSocket = TCPAccept($MainSocket) Until $ConnectedSocket <> -1 ; Get IP of client connecting $szIP_Accepted = SocketToIP($ConnectedSocket) ; GUI Message Loop While 1 ; Try to receive (up to) 2048 bytes $recv = TCPRecv($ConnectedSocket, 2048) ; If the receive failed with @error then the socket has disconnected If @error Then ExitLoop ; Update the Volume Level If $recv <> "" Then SoundSetWaveVolume ($recv) WEnd ;;;nfwu: Close the previous connection before opening a new one TCPCloseSocket($ConnectedSocket) ;;;nfwu: Mark $ConnectedSocket as being invalid, so the Do...Until loop way up there that waits for a connection actually waits for a connection =P $ConnectedSocket = -1 WEnd ;;;nfwu: Jump back to the start of this loop TCPShutdown() Read my comments. Replacing the appropriate section of code in the server with this should do the trick. Feel free to ask more questions. =P
-
Is there a way to cancel a sleep() ?
nfwu replied to Mixam's topic in AutoIt General Help and Support
Something like this? HotKeySet("{f8}", "_foo") Sleep(1000000000) MsgBox(0, "", "End") Func _foo() MsgBox(0, "", "Do Stuff") EndFunc If I remember correctly, it "continues the sleep", as you say. Just run the code to find out! -
Oh, so you wanted PID by name? Func _ProcessPID($ProcessName) Local $colItems = "" Local $strComputer = "localhost" Local $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") Local $colItems =$objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = '" & $ProcessName& "'") For $objItem In $colItems Return Int($objItem.ProcessID) Next EndFunc
-
{xxx up}, {xxx down} are for send. They don't work on HotKeySet. HotKeySet triggers when the key combo is released. Generator's code is the correct way, but the code has to be in a loop.
-
Spoonfeeding time! Do it like this: Func Button1() MsgBox(0,'',GuiCtrlRead($Input1)) MsgBox(0,'',GuiCtrlRead($Input2)) EndFunc Eval takes the name of the variable as a string and returns the value of that variable. You *cannot* use a string as a variable name directly, like you intended to do.
-
Func _ProcessMem_ByPID($ProcessID) Local $colItems = "" Local $strComputer = "localhost" Local $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") Local $colItems =$objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE ProcessId = '" & $ProcessID& "'") For $objItem In $colItems Local $mem=$objItem.WorkingSetSize /1024 Return Int($mem) Next EndFunc Win32_Process: http://msdn.microsoft.com/en-us/library/aa394372(VS.85).aspx
-
As for failed hardware, you should poll the hardware and check to see if any drop out. (I know how to do that on a *nix, but not a windows server) Or run automated hardware diagnostics periodically. Find a good program and automate it using AutoIt.
-
You should probably remove some rows, like those that are not necessary or not using