
SoulA
Active Members-
Posts
249 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
SoulA's Achievements

Polymath (5/7)
5
Reputation
-
jaberwacky reacted to a post in a topic: Receiving data from a connected TCP device
-
jaberwacky reacted to a post in a topic: Receiving data from a connected TCP device
-
jaberwacky reacted to a post in a topic: Receiving data from a connected TCP device
-
jaberwacky reacted to a post in a topic: Receiving data from a connected TCP device
-
jaberwacky reacted to a post in a topic: Receiving data from a connected TCP device
-
Anyone still use this? I had made a bot using this a while ago and it's been running great up until a few days ago. Seems like the TOC servers both in the original script and the one that is posted by others seems to not want to work for me anymore. Anyone able to get this working again? Seems like AOL is very hush hush now about doing bots. I found a developers page but they seemed to have gotten rid of it or locked it down.
-
Everything I have tested with this shows it's working for at least what I'm doing. Thank you very much.
-
You should be able to use any file over 4GB's. It should return the uncompressed size if I'm reading things right.
-
After testing this out and looking at the documentation this only works on files less than 4GB and I need to get the data for things larger than that. I'm not too familiar with how this works but it seems like lpFileSizeHigh needs to be something other than null.
-
Awesome, thank you all.
-
This has been really helpful. Thank you very much for all of the suggestions. Just to add on to my problem I think what I'm dealing with are actually sparse files. So the "Size" will be something like 20GB's but they "SizeOnDisk" will actually only be 13GB's. So it all is a bit funky now and none of the cluster size to file size relationships work out.
-
That gives me the total size of the disk that a file/folder is located on... not really what I'm looking for unless this is a clue to something I'm missing.
-
I'm having a lot of trouble and my searches of both the internet and the forums haven't really helped too much. It led me in some directions but not to the answer. Basically, I want to get the "Size on Disk" value as opposed to just the "Size" value that you see when you right click on files or folders. It looks like DirGetSize and FileGetSize will give just the "Size" value. Any help would be greatly appreciated.
-
Help please with TCP/IP script to control Onkyo receiver
SoulA replied to wyerd's topic in AutoIt General Help and Support
Maybe if you post your code we can help a bit more. Looks like this takes it's own special stuff on top of a regular TCP packet. -
You can check out this thread that can probably help you with what you are doing: http://www.autoitscript.com/forum/index.php?showtopic=54039&hl=winpcap&st=0
-
TCPTimeout does not work or how to abort TCPConnect ...
SoulA replied to sc4ry's topic in AutoIt General Help and Support
I feel like someone runs into this problem at least every week. Like trance said there is no solution based in autoit right now though I hope that there is some added functionality in future releases. Where can I request that sort of thing? Anyway, here is my suggestion. Start using the winpcap based UDF here. Basically it gives you a ton more options when dealing with packet sending/capturing since it is all winpcap based. It is obviously a bit more complicated but if you are doing a port scanner it should give you all you need. -
I see. Good info thank you. Here is updated code to adhere. Also changed the progress bar to be more accurate and did a few GUI tweaks so it looked a tad nicer. Only thing I can think of to add is to be able to copy elements out of the list but I'm drawing a blank on how to do that. If someone else can come up with a good way please feel free to add on! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> AutoItSetOption("GUIOnEventMode", 1) Global $MAX_PROCESS = 10 ; We spawn a maximum of 10 processes at once $hGUI = GUICreate("Alive", 365, 320, -1, -1, $WS_SYSMENU) $hGo = GUICtrlCreateButton("Go", 210, 10, 57, 25) $hInput = GUICtrlCreateInput("", 5, 10, 200) $hAlive = GUICtrlCreateList("", 5, 64, 170, 200, -1, 0x00000100) $hDead = GUICtrlCreateList("", 185, 64, 170, 200, -1, 0x00000100) $hClear = GUICtrlCreateButton("Clear", 135, 265, 89, 25) $hExample = GUICtrlCreateLabel("Ex. 192.168.1.* or 192.168.1-2.1-10", 5, 40) $hAliveLabel = GUICtrlCreateLabel("Alive", 75, 265) $hDeadLabel = GUICtrlCreateLabel("Dead", 265, 265) $hProg = GUICtrlCreateProgress(190, 40, 165) $hMaxProc = GUICtrlCreateInput($MAX_PROCESS, 325, 10, 30) $hMaxProcLabel = GUICtrlCreateLabel("Max" & @CRLF & "Proc's", 285, 5, 30, 30) GUICtrlSetOnEvent($hGo, "alive") GUICtrlSetOnEvent($hClear, "clear") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlSetState($hInput, $GUI_FOCUS) GUISetState(@SW_SHOW) While 1 Sleep(50) If _IsPressed("0D") And WinActive($hGUI) Then alive() WEnd Func alive() GUICtrlSetState($hGo, $GUI_DISABLE) GUICtrlSetState($hClear, $GUI_DISABLE) $sAddress = GUICtrlRead($hInput) If $sAddress = "" Then error1("Input was null") Return EndIf $aArray = _GetIpAddressList($sAddress) If $aArray[0] = "" Then error1("Input was incorrect. Check syntax.") Return EndIf $MAX_PROCESS = GUICtrlRead($hMaxProc) If $MAX_PROCESS = 0 Then $MAX_PROCESS = 1 Local $aProcess[$MAX_PROCESS] ; An array to keep a reference to spawned processes, in the next loop we fill it with value 0 For $i = 0 to UBound($aProcess) - 1 $aProcess[$i] = 0 Next Local $i = 0 Local $iFinished = 0 While True For $n = 0 to UBound($aProcess) - 1 If ($i <> UBound($aArray) AND $aProcess[$n] == 0) Then ; Check if we need a spot, and there is an existing spot $aProcess[$n] = _MSPing($aArray[$i]) $i += 1 Else If ($aProcess[$n] <> 0 And _MSPingIsReady($aProcess[$n])) Then GUICtrlSetData($hProg, ($iFinished / (UBound($aArray) - 1)) * 100) $sHostname = _MSPingGetHostname($aProcess[$n]) $sResult = _MSPingGetResult($aProcess[$n]) If ($sResult <> -1) Then GUICtrlSetData($hAlive, $sHostname & " is alive " & $sResult & " ms" & @CRLF) Else GUICtrlSetData($hDead, $sHostname & " is dead" & @CRLF) EndIf ; Free up an empty space for the next address to Ping $aProcess[$n] = 0 $iFinished += 1 ; <=== New line If $iFinished == UBound($aArray) Then ExitLoop 2 ; Return EndIf EndIf Next Sleep(50) ; Give existing ping commands some time to process the request WEnd GUICtrlSetData($hProg, 0) enableButtons() EndFunc Func error1($sMessage) MsgBox(0, "Error", $sMessage, 0, $hGUI) Sleep(50) enableButtons() GUICtrlSetState($hInput, $GUI_FOCUS) EndFunc Func enableButtons() GUICtrlSetState($hGo, @SW_ENABLE) GUICtrlSetState($hClear, @SW_ENABLE) EndFunc Func clear() GUICtrlSetData($hAlive, "") GUICtrlSetData($hDead, "") EndFunc Func _GetIpAddressList($ipFormat) Local $aResult[1] If StringInStr(StringStripWS($ipFormat, 3), " ") Or StringInStr($ipFormat, ".", "", 4) Then Return $aResult $ipFormat = StringReplace($ipFormat, "*", "1-255") $ipSplit = StringSplit($ipFormat, ".") If $ipSplit[0] <> 4 Then Return $aResult Local $ipRange[4][2], $totalPermu = 1 For $i = 0 To 3 If StringInStr($ipSplit[$i + 1], "-") Then If StringInStr($ipSplit[$i + 1], "-", "", 2) Then Return $aResult $m = StringSplit($ipSplit[$i +1 ],"-") For $i2 = 1 to $m[0] If Number($m[$i2]) > 255 Or Number($m[$i2]) < 0 Then Return $aResult $ipRange[$i][$i2 - 1] = Number($m[$i2]) Next Else $n = Number($ipSplit[$i + 1]) If $n > 255 Or $n < 0 Then Return $aResult $ipRange[$i][0] = $n $ipRange[$i][1] = $n EndIf $totalPermu *= $ipRange[$i][1] - $ipRange[$i][0] + 1 Next Local $aResult[$totalPermu], $i = 0 For $a = $ipRange[0][0] To $ipRange[0][1] For $b = $ipRange[1][0] To $ipRange[1][1] For $c = $ipRange[2][0] To $ipRange[2][1] For $d = $ipRange[3][0] To $ipRange[3][1] $aResult[$i] = $a & "." & $b & "." & $c & "." & $d $i += 1 Next Next Next Next Return $aResult EndFunc ;==>_GetIpAddressList Func _Exit() Exit EndFunc Func _MSPing($sHostname, $timeout = 50) Local $return_struc[4] ; [0] = Result (in ms) ; [1] = The hostname originally used ; [2] = Process handle (for internal use only) ; [3] = Buffer (for internal use only) $return_struc[1] = $sHostname $return_struc[2] = Run("ping " & $sHostname & " -n 1 -w " & $timeout, "", @SW_HIDE, $STDOUT_CHILD) Return $return_struc EndFunc Func _MSPingIsReady(ByRef $return_struc) Return ___MSPingReadOutput($return_struc) EndFunc Func _MSPingGetResult($return_struc) Return $return_struc[0] EndFunc Func _MSPingGetHostname($return_struc) Return $return_struc[1] EndFunc ; Internal use only Func ___MSPingReadOutput(ByRef $return_struc) $data = StdoutRead($return_struc[2]) If (@error) Then ___MSPingParseResult($return_struc) Return 1 Else $return_struc[3] &= $data Return 0 EndIf EndFunc ; Internal use only Func ___MSPingParseResult(ByRef $return_struc) $result = StringRegExp($return_struc[3], "([0-9]*)ms", 3) If @error Then $return_struc[0] = -1 Else $return_struc[0] = $result[0] EndIf EndFunc Func _IsPressed($sHexKey, $vDLL = 'user32.dll') ; $hexKey must be the value of one of the keys. ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is. Local $a_R = DllCall($vDLL, "int", "GetAsyncKeyState", "int", '0x' & $sHexKey) If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1 Return 0 EndFunc ;==>_IsPressed
-
Explain! What makes this so terrible?
-
How do I create a GUI with no minimize or maximize buttons on the top bar?
-
Here is a better GUI based off of llewxam's GUI posted in the thread previously. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> AutoItSetOption("GUIOnEventMode", 1) Global $MAX_PROCESS = 10 ; We spawn a maximum of 10 processes at once $hDefault = GUICreate("") $hGUI = GUICreate("Alive", 375, 300) $hGo = GUICtrlCreateButton("Go", 230, 10, 57, 25) $hInput = GUICtrlCreateInput("", 15, 10, 200) $hAlive = GUICtrlCreateList("", 15, 64, 165, 200) $hDead = GUICtrlCreateList("", 200, 64, 165, 200) $hClear = GUICtrlCreateButton("Clear", 150, 275, 89, 25) $hExample = GUICtrlCreateLabel("Ex. 192.168.1.* or 192.168.1-2.1-10", 15, 40) $hAliveLabel = GUICtrlCreateLabel("Alive", 85, 255) $hDeadLabel = GUICtrlCreateLabel("Dead", 275, 255) $hProg = GUICtrlCreateProgress(200, 40, 165) $hMaxProc = GUICtrlCreateInput($MAX_PROCESS, 335, 10, 30) $hMaxProcLabel = GUICtrlCreateLabel("Max" & @CRLF & "Proc's", 295, 5, 30, 30) GUICtrlSetOnEvent($hGo, "alive") GUICtrlSetOnEvent($hClear, "clear") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlSetState($hInput, $GUI_FOCUS) GUISetState(@SW_SHOW) While 1 Sleep(50) If _IsPressed("0D") And WinActive($hGUI) Then alive() WEnd Func alive() GUICtrlSetState($hGo, $GUI_DISABLE) GUICtrlSetState($hClear, $GUI_DISABLE) $sAddress = GUICtrlRead($hInput) If $sAddress = "" Then error1("Input was null") Return EndIf $aArray = _GetIpAddressList($sAddress) If $aArray[0] = 0 Then error1("Input was incorrect. Check syntax.") Return EndIf $MAX_PROCESS = GUICtrlRead($hMaxProc) If $MAX_PROCESS = 0 Then $MAX_PROCESS = 1 Local $aProcess[$MAX_PROCESS] ; An array to keep a reference to spawned processes, in the next loop we fill it with value 0 For $i = 0 to UBound($aProcess) - 1 $aProcess[$i] = 0 Next Local $i = 1 Local $iFinished = 1 While True For $n = 0 to UBound($aProcess) - 1 If ($i <> UBound($aArray) AND $aProcess[$n] == 0) Then ; Check if we need a spot, and there is an existing spot $aProcess[$n] = _MSPing($aArray[$i]) $i += 1 Else If ($aProcess[$n] <> 0 And _MSPingIsReady($aProcess[$n])) Then GUICtrlSetData($hProg, ($iFinished / 255) * 100) $sHostname = _MSPingGetHostname($aProcess[$n]) $sResult = _MSPingGetResult($aProcess[$n]) If ($sResult <> -1) Then GUICtrlSetData($hAlive, $sHostname & " is alive " & $sResult & " ms" & @CRLF) Else GUICtrlSetData($hDead, $sHostname & " is dead" & @CRLF) EndIf ; Free up an empty space for the next address to Ping $aProcess[$n] = 0 $iFinished += 1 ; <=== New line If ($iFinished == UBound($aArray)) Then ExitLoop 2 ; Return EndIf EndIf Next Sleep(50) ; Give existing ping commands some time to process the request WEnd GUICtrlSetData($hProg, 0) enableButtons() EndFunc Func error1($sMessage) MsgBox(0, "Error", $sMessage, 0, $hDefault) Sleep(50) enableButtons() GUICtrlSetState($hInput, $GUI_FOCUS) EndFunc Func enableButtons() GUICtrlSetState($hGo, @SW_ENABLE) GUICtrlSetState($hClear, @SW_ENABLE) EndFunc Func clear() GUICtrlSetData($hAlive, "") GUICtrlSetData($hDead, "") EndFunc Func _GetIpAddressList($ipFormat) Local $aResult[1] $aResult[0] = 0 If StringInStr(StringStripWS($ipFormat, 3), " ") Or StringInStr($ipFormat, ".", "", 4) Then Return $aResult $ipFormat = StringReplace($ipFormat, "*", "1-255") $ipSplit = StringSplit($ipFormat, ".") Local $ipRange[4][2], $totalPermu = 1 For $i = 0 To 3 If StringInStr($ipSplit[$i + 1], "-") Then If StringInStr($ipSplit[$i + 1], "-", "", 2) Then Return $aResult $m = StringSplit($ipSplit[$i +1 ],"-") For $i2 = 1 to $m[0] If Number($m[$i2]) > 255 Or Number($m[$i2]) < 0 Then Return $aResult $ipRange[$i][$i2 - 1] = Number($m[$i2]) Next Else $n = Number($ipSplit[$i + 1]) If $n > 255 Or $n < 0 Then Return $aResult $ipRange[$i][0] = $n $ipRange[$i][1] = $n EndIf $totalPermu *= $ipRange[$i][1] - $ipRange[$i][0] + 1 Next Local $aResult[$totalPermu + 1], $i = 1 For $a = $ipRange[0][0] To $ipRange[0][1] For $b = $ipRange[1][0] To $ipRange[1][1] For $c = $ipRange[2][0] To $ipRange[2][1] For $d = $ipRange[3][0] To $ipRange[3][1] $aResult[$i] = $a & "." & $b & "." & $c & "." & $d $i += 1 Next Next Next Next $aResult[0] = $i - 1 Return $aResult EndFunc ;==>_GetIpAddressList Func _Exit() Exit EndFunc Func _MSPing($sHostname, $timeout = 50) Local $return_struc[4] ; [0] = Result (in ms) ; [1] = The hostname originally used ; [2] = Process handle (for internal use only) ; [3] = Buffer (for internal use only) $return_struc[1] = $sHostname $return_struc[2] = Run("ping " & $sHostname & " -n 1 -w " & $timeout, "", @SW_HIDE, $STDOUT_CHILD) Return $return_struc EndFunc Func _MSPingIsReady(ByRef $return_struc) Return ___MSPingReadOutput($return_struc) EndFunc Func _MSPingGetResult($return_struc) Return $return_struc[0] EndFunc Func _MSPingGetHostname($return_struc) Return $return_struc[1] EndFunc ; Internal use only Func ___MSPingReadOutput(ByRef $return_struc) $data = StdoutRead($return_struc[2]) If (@error) Then ___MSPingParseResult($return_struc) Return 1 Else $return_struc[3] &= $data Return 0 EndIf EndFunc ; Internal use only Func ___MSPingParseResult(ByRef $return_struc) $result = StringRegExp($return_struc[3], "([0-9]*)ms", 3) If @error Then $return_struc[0] = -1 Else $return_struc[0] = $result[0] EndIf EndFunc Func _IsPressed($sHexKey, $vDLL = 'user32.dll') ; $hexKey must be the value of one of the keys. ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is. Local $a_R = DllCall($vDLL, "int", "GetAsyncKeyState", "int", '0x' & $sHexKey) If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1 Return 0 EndFunc ;==>_IsPressed