randy2631 Posted September 26, 2009 Share Posted September 26, 2009 (edited) I am working on a project for class and have come to the end of my short rope. Ive only been using AutoIT for about a month so its pretty new to me. I cant figure out how to set a users input as a variable. Im working on a network diagnostic tool and im using an input box to get the IP in order to ping a remote computer as well as to show the route to that computer. the trouble is on the remote port scan, it asks you for the IP every time. it took me a few hours but i realized it asked every time because that is what i told it to do. If the IP from the input box was stored as a variable then i think it would work. Im gonna try and post the code but since this is my first post i cant promise it will work. expandcollapse popup#include <GuiMenu.au3> #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> #include <Constants.au3> #include <TCP.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) Global $Memo, $IPAddr, $Input Global Enum $New = 1000, $Open, $Save, $Exit, _ $Cut, $Copy, $Paste, $About, $Ping, $RemScan, $RtPrint _Main() Func _Main() Local $GUI, $File, $Edit, $Help, $Main, $msg $msg = 0 ; Create GUI $GUI = GUICreate("Menu", 600, 400) ; Create File menu $File = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($File, 0, "&Ping", $Ping) _GUICtrlMenu_InsertMenuItem($File, 0, "&Route Print", $RtPrint) _GUICtrlMenu_InsertMenuItem($File, 0, "&Remote Port Scan", $RemScan) ; Create Edit menu $Edit = _GUICtrlMenu_CreateMenu() ; Create Help menu $Help = _GUICtrlMenu_CreateMenu() ; Create Main menu $Main = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($Main, 0, "&System", 0, $File) _GUICtrlMenu_InsertMenuItem($Main, 1, "&Hard Drives", 0, $Edit) _GUICtrlMenu_InsertMenuItem($Main, 2, "&Memory", 0, $Help) ; Set window menu _GUICtrlMenu_SetMenu($GUI, $Main) $Memo = GUICtrlCreateEdit("" & @CRLF, 2, 2, 600, 400, $ES_AUTOVSCROLL + $WS_VSCROLL) GUICtrlSetFont($Memo, 9, 400, 0, "Courier New") GUISetState() ; Loop until user exits GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func WM_COMMAND($Wnd, $Msg, $iwParam, $ilParam) $IPAddr = InputBox("Remote IP Address", "IP Address:", "") Switch _WinAPI_LoWord($iwParam) Case $Ping MemoWrite("Collecting Ping information") Local $hostdata = Run(@ComSpec & " /c ping" & " " & $Input, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Ping: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Ping command complete") Case $RtPrint MemoWrite("Route Print") Local $hostdata = Run(@ComSpec & " /c route print", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Route Print: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Route Print command complete") Case $RemScan MemoWrite("Remote Port Scan") Local $socket, $recdata, $Client, $i While $i < 1024 $i = $i + 1 MemoWrite("Trying to connect to port " & ":" & $i) $Client = _TCP_Client_Create($Input, $i) Sleep(1000) _TCP_RegisterEvent($Client, $TCP_RECEIVE, "Received"); Function "Received" will get called when something is received _TCP_RegisterEvent($Client, $TCP_CONNECT, "Connected"); And func "Connected" will get called when the client is connected. _TCP_RegisterEvent($Client, $TCP_DISCONNECT, "Disconnected"); And "Disconnected" will get called when the server disconnects us, or when the connection is lost. _TCP_Client_Stop($socket) WEnd MemoWrite("Port scan for 1-1024 on " & $Input & " is complete.") Case $Save MemoWrite("Save") Case $Exit Exit Case $Cut MemoWrite("Cut") Case $Copy MemoWrite("Copy") Case $Paste MemoWrite("Paste") Case $About MemoWrite("About") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ; Write message to memo Func MemoWrite($Message) GUICtrlSetData($Memo, $Message & @CRLF, 1) EndFunc ;==>MemoWrite Func Connected($socket, $Error); We registered this (you see?), When we're connected (or not) this function will be called. Local $i If Not $Error Then; If there is no error... MemoWrite("CLIENT: Connected!" & " Port: " & $i); ... we're connected. Else; ,else... MemoWrite("CLIENT: Could not connect to port:" & $i & " Error:" & $Error); ... we aren't. EndIf EndFunc ;==>Connected Func Received($socket, $Received, $Error); And we also registered this! Our homemade do-it-yourself function gets called when something is received. MemoWrite("CLIENT: We received this: " & $Received); (and we'll display it) EndFunc ;==>Received Func Disconnected($socket, $Error); Our disconnect function. Notice that all functions should have an $iError parameter. Local $i MemoWrite("CLIENT: Connection closed or lost. " & ":" & $i & " Error:" & $Error) EndFunc ;==>Disconnected Edited September 26, 2009 by randy2631 Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 I wanted to help, but I can't because I have a file missing... The file is... TCP.au3 Where did you get this line from?#include <TCP.au3> JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 But I noticed that everytime you leave the window, it asks you... JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Crash Posted September 26, 2009 Share Posted September 26, 2009 This is my version:expandcollapse popup#include <GuiMenu.au3> #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> #include <Constants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) Global $Memo, $IPAddr, $Input Global Enum $New = 1000, $Open, $Save, $Exit, _ $Cut, $Copy, $Paste, $About, $Ping, $RemScan, $RtPrint _Main() Func _Main() Local $GUI, $File, $Edit, $Help, $Main, $msg $msg = 0 ; Create GUI $GUI = GUICreate("Menu", 600, 400) ; Create File menu $File = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($File, 0, "&Ping", $Ping) _GUICtrlMenu_InsertMenuItem($File, 0, "&Route Print", $RtPrint) _GUICtrlMenu_InsertMenuItem($File, 0, "&Remote Port Scan", $RemScan) ; Create Edit menu $Edit = _GUICtrlMenu_CreateMenu() ; Create Help menu $Help = _GUICtrlMenu_CreateMenu() ; Create Main menu $Main = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($Main, 0, "&System", 0, $File) _GUICtrlMenu_InsertMenuItem($Main, 1, "&Hard Drives", 0, $Edit) _GUICtrlMenu_InsertMenuItem($Main, 2, "&Memory", 0, $Help) ; Set window menu _GUICtrlMenu_SetMenu($GUI, $Main) $Memo = GUICtrlCreateEdit("" & @CRLF, 2, 2, 600, 400, $ES_AUTOVSCROLL + $WS_VSCROLL) GUICtrlSetFont($Memo, 9, 400, 0, "Courier New") GUISetState() ; Loop until user exits $IPAddr = InputBox("Remote IP Address", "IP Address:", "") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func WM_COMMAND($Wnd, $Msg, $iwParam, $ilParam) Switch _WinAPI_LoWord($iwParam) Case $Ping MemoWrite("Collecting Ping information") Local $hostdata = Run(@ComSpec & " /c ping" & " " & $Input, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Ping: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Ping command complete") Case $RtPrint MemoWrite("Route Print") Local $hostdata = Run(@ComSpec & " /c route print", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Route Print: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Route Print command complete") Case $RemScan MemoWrite("Remote Port Scan") Local $socket, $recdata, $Client, $i While $i < 1024 $i = $i + 1 MemoWrite("Trying to connect to port " & ":" & $i) $Client = _TCP_Client_Create($Input, $i) Sleep(1000) _TCP_RegisterEvent($Client, $TCP_RECEIVE, "Received"); Function "Received" will get called when something is received _TCP_RegisterEvent($Client, $TCP_CONNECT, "Connected"); And func "Connected" will get called when the client is connected. _TCP_RegisterEvent($Client, $TCP_DISCONNECT, "Disconnected"); And "Disconnected" will get called when the server disconnects us, or when the connection is lost. _TCP_Client_Stop($socket) WEnd MemoWrite("Port scan for 1-1024 on " & $Input & " is complete.") Case $Save MemoWrite("Save") Case $Exit Exit Case $Cut MemoWrite("Cut") Case $Copy MemoWrite("Copy") Case $Paste MemoWrite("Paste") Case $About MemoWrite("About") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ; Write message to memo Func MemoWrite($Message) GUICtrlSetData($Memo, $Message & @CRLF, 1) EndFunc ;==>MemoWrite Func Connected($socket, $Error); We registered this (you see?), When we're connected (or not) this function will be called. Local $i If Not $Error Then; If there is no error... MemoWrite("CLIENT: Connected!" & " Port: " & $i); ... we're connected. Else; ,else... MemoWrite("CLIENT: Could not connect to port:" & $i & " Error:" & $Error); ... we aren't. EndIf EndFunc ;==>Connected Func Received($socket, $Received, $Error); And we also registered this! Our homemade do-it-yourself function gets called when something is received. MemoWrite("CLIENT: We received this: " & $Received); (and we'll display it) EndFunc ;==>Received Func Disconnected($socket, $Error); Our disconnect function. Notice that all functions should have an $iError parameter. Local $i MemoWrite("CLIENT: Connection closed or lost. " & ":" & $i & " Error:" & $Error) EndFunc ;==>DisconnectedI removed the #include <TCP.au3> and move this: $IPAddr = InputBox("Remote IP Address", "IP Address:", "") up.It asks you continuously because you put it in the looping command, so I just pull it up, and let the others be looped.One more thing, is it because of your TCP.au3 or is it a bug?After I entered the IP Address, then I pressed System > Remote Port Scan, there is a error:>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Administrator\Desktop\New AutoIt v3 Script.au3" C:\Documents and Settings\Administrator\Desktop\New AutoIt v3 Script.au3 (95) : ==> Unknown function name.:$Client = _TCP_Client_Create($Input, $i)$Client = ^ ERROR>Exit code: 1 Time: 105.692I really admire your work, being able to create such scripts, only using AutoIt for a month...So tell me if I am helping you or not JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
SimonWebstation Posted September 26, 2009 Share Posted September 26, 2009 The error comes because you dont have the function _TCP_Client_Create _TCP_RegisterEvent _TCP_Client_Stop mfg. SimonMany of my answers are translated of google, because I'am from Germany Link to comment Share on other sites More sharing options...
randy2631 Posted September 26, 2009 Author Share Posted September 26, 2009 Thank you for all your replies. I didnt mean to mislead anyone, but i didnt do this myself. its a class project that we are working on. TCP.au3 is another set of functions i got from the forums. i attached it so you can have it. Thank you Crash! i used the code you posted and added the TCP.au3 back in and it works. youre awesomeTCP.au3 Link to comment Share on other sites More sharing options...
Crash Posted September 29, 2009 Share Posted September 29, 2009 (edited) Thank you for all your replies. I didnt mean to mislead anyone, but i didnt do this myself. its a class project that we are working on. TCP.au3 is another set of functions i got from the forums. i attached it so you can have it. Thank you Crash! i used the code you posted and added the TCP.au3 back in and it works. youre awesomeYou're most welcome! Well, I'm not awesome... because I'm also a beginner! I am kind of surprised that despite only using AutoIt for only a few months, you and your friends (or you yourself) are able to produce such complex yet powerful program... Well, good luck then! $$$$$$$$$$$$$$$$$$$$ WAIT!!! $$$$$$$$$$$$$$$$$$That's not the end yet. Personally, I think it will be more user friendly if you add more messages to the user, you know, something like step-by-step; say after the user enter the IP address, the program will tell them what to do next to test their connections.Please consider my humble opinion. Edited September 29, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Crash Posted September 29, 2009 Share Posted September 29, 2009 (edited) The error comes because you dont have the function _TCP_Client_Create_TCP_RegisterEvent_TCP_Client_StopTrue! Thanks, but I've figured that out when I switched off my computer! By the way, your footer message has an error:mfg. SimonMany of my answers are translated of google, because I'am from Germany The I'am should be I'm. Thanks. Edited September 29, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
randy2631 Posted September 29, 2009 Author Share Posted September 29, 2009 Hey Crash i recreated the GUI and added a little to it. I havent added any new functions but this is definetly an improvement. Im not 100% sure the port scan function is working but it looks like it is expandcollapse popup#include <GuiIPAddress.au3> #include <GuiMenu.au3> #include <GuiConstantsEx.au3> #include <GuiConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <TCP.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) Global $Ping, $RoutePrint, $RemotePort, $IPAddress, $Memo _Main() Func _Main() Local $Tool, $System, $HardDrive, $Memory $Tool = GUICreate("Tool Box", 600, 400, 192, 124) $System = GUICtrlCreateMenu("System") $Ping = GUICtrlCreateMenuItem("Ping", $System) $RoutePrint = GUICtrlCreateMenuItem("Route Print", $System) $RemotePort = GUICtrlCreateMenuItem("Remote Port Scan", $System) $HardDrive = GUICtrlCreateMenu("Hard Drive") $Memory = GUICtrlCreateMenu("Memory") $IPAddress = _GUICtrlIpAddress_Create($Tool, 40, 0, 321, 33) _GUICtrlIpAddress_Set($IPAddress, "0.0.0.0") $Memo = GUICtrlCreateEdit("" & @CRLF, 1, 40, 600, 340, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_AUTOHSCROLL) GUICtrlSetFont($Memo, 9, 400, 0, "Courier New") GUISetState() ; Loop until user exits GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func WM_COMMAND($Wnd, $Msg, $iwParam, $ilParam) Switch _WinAPI_LoWord($iwParam) Case $Ping MemoWrite("Collecting Ping information") Local $hostdata = Run(@ComSpec & " /c ping" & " " & _GUICtrlIpAddress_Get($IPAddress), @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Ping: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Ping command complete") Case $RoutePrint MemoWrite("Route Print") Local $hostdata = Run(@ComSpec & " /c route print", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Route Print: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Route Print command complete") Case $RemotePort MemoWrite("Remote Port Scan") Local $socket, $recdata, $Client, $i While $i < 1024 $i = $i + 1 MemoWrite("Trying to connect to port " & ":" & $i) $Client = _TCP_Client_Create(_GUICtrlIpAddress_Get($IPAddress), $i) Sleep(1000) _TCP_RegisterEvent($Client, $TCP_RECEIVE, "Received"); Function "Received" will get called when something is received _TCP_RegisterEvent($Client, $TCP_CONNECT, "Connected"); And func "Connected" will get called when the client is connected. _TCP_RegisterEvent($Client, $TCP_DISCONNECT, "Disconnected"); And "Disconnected" will get called when the server disconnects us, or when the connection is lost. _TCP_Client_Stop($socket) WEnd MemoWrite("Port scan for 1-1024 on " & _GUICtrlIpAddress_Get($IPAddress) & " is complete.") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ; Write message to memo Func MemoWrite($Message) GUICtrlSetData($Memo, $Message & @CRLF, 1) EndFunc ;==>MemoWrite Func Connected($socket, $Error); We registered this (you see?), When we're connected (or not) this function will be called. Local $i If Not $Error Then; If there is no error... MemoWrite("CLIENT: Connected!" & " Port: " & $i); ... we're connected. Else; ,else... MemoWrite("CLIENT: Could not connect to port:" & $i & " Error:" & $Error); ... we aren't. EndIf EndFunc ;==>Connected Func Received($socket, $Received, $Error); And we also registered this! Our homemade do-it-yourself function gets called when something is received. MemoWrite("CLIENT: We received this: " & $Received); (and we'll display it) EndFunc ;==>Received Func Disconnected($socket, $Error); Our disconnect function. Notice that all functions should have an $iError parameter. Local $i MemoWrite("CLIENT: Connection closed or lost. " & ":" & $i & " Error:" & $Error) EndFunc ;==>Disconnected Link to comment Share on other sites More sharing options...
Crash Posted October 1, 2009 Share Posted October 1, 2009 (edited) Hey Crash i recreated the GUI and added a little to it. I havent added any new functions but this is definetly an improvement. Im not 100% sure the port scan function is working but it looks like it is expandcollapse popup#include <GuiIPAddress.au3> #include <GuiMenu.au3> #include <GuiConstantsEx.au3> #include <GuiConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <TCP.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) Global $Ping, $RoutePrint, $RemotePort, $IPAddress, $Memo _Main() Func _Main() Local $Tool, $System, $HardDrive, $Memory $Tool = GUICreate("Tool Box", 600, 400, 192, 124) $System = GUICtrlCreateMenu("System") $Ping = GUICtrlCreateMenuItem("Ping", $System) $RoutePrint = GUICtrlCreateMenuItem("Route Print", $System) $RemotePort = GUICtrlCreateMenuItem("Remote Port Scan", $System) $HardDrive = GUICtrlCreateMenu("Hard Drive") $Memory = GUICtrlCreateMenu("Memory") $IPAddress = _GUICtrlIpAddress_Create($Tool, 40, 0, 321, 33) _GUICtrlIpAddress_Set($IPAddress, "0.0.0.0") $Memo = GUICtrlCreateEdit("" & @CRLF, 1, 40, 600, 340, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_AUTOHSCROLL) GUICtrlSetFont($Memo, 9, 400, 0, "Courier New") GUISetState() ; Loop until user exits GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func WM_COMMAND($Wnd, $Msg, $iwParam, $ilParam) Switch _WinAPI_LoWord($iwParam) Case $Ping MemoWrite("Collecting Ping information") Local $hostdata = Run(@ComSpec & " /c ping" & " " & _GUICtrlIpAddress_Get($IPAddress), @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Ping: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Ping command complete") Case $RoutePrint MemoWrite("Route Print") Local $hostdata = Run(@ComSpec & " /c route print", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line1 While 1 $line1 = StdoutRead($hostdata) If @error Then ExitLoop If $line1 <> "" Then MemoWrite("Route Print: " & $line1) EndIf WEnd While 1 $line1 = StderrRead($hostdata) If @error Then ExitLoop WEnd MemoWrite("Route Print command complete") Case $RemotePort MemoWrite("Remote Port Scan") Local $socket, $recdata, $Client, $i While $i < 1024 $i = $i + 1 MemoWrite("Trying to connect to port " & ":" & $i) $Client = _TCP_Client_Create(_GUICtrlIpAddress_Get($IPAddress), $i) Sleep(1000) _TCP_RegisterEvent($Client, $TCP_RECEIVE, "Received"); Function "Received" will get called when something is received _TCP_RegisterEvent($Client, $TCP_CONNECT, "Connected"); And func "Connected" will get called when the client is connected. _TCP_RegisterEvent($Client, $TCP_DISCONNECT, "Disconnected"); And "Disconnected" will get called when the server disconnects us, or when the connection is lost. _TCP_Client_Stop($socket) WEnd MemoWrite("Port scan for 1-1024 on " & _GUICtrlIpAddress_Get($IPAddress) & " is complete.") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ; Write message to memo Func MemoWrite($Message) GUICtrlSetData($Memo, $Message & @CRLF, 1) EndFunc ;==>MemoWrite Func Connected($socket, $Error); We registered this (you see?), When we're connected (or not) this function will be called. Local $i If Not $Error Then; If there is no error... MemoWrite("CLIENT: Connected!" & " Port: " & $i); ... we're connected. Else; ,else... MemoWrite("CLIENT: Could not connect to port:" & $i & " Error:" & $Error); ... we aren't. EndIf EndFunc ;==>Connected Func Received($socket, $Received, $Error); And we also registered this! Our homemade do-it-yourself function gets called when something is received. MemoWrite("CLIENT: We received this: " & $Received); (and we'll display it) EndFunc ;==>Received Func Disconnected($socket, $Error); Our disconnect function. Notice that all functions should have an $iError parameter. Local $i MemoWrite("CLIENT: Connection closed or lost. " & ":" & $i & " Error:" & $Error) EndFunc ;==>Disconnected Congrats, nice GUI you have there! As for the port scan function, sorry I don't have the time to go through your scripts again -- I'm having the government test soon, and I will not be online -- When I tried it, the scripts go on and on: Trying to connect to port: 1 Trying to connect to port: 2 Trying to connect to port: 3 Trying to connect to port: 4 Trying to connect to port: 5 Trying to connect to port: 6 Trying to connect to port: 7 Trying to connect to port: 8 Trying to connect to port: 9 Trying to connect to port: 10 Trying to connect to port: 11 Trying to connect to port: 12 ...and so on... But some with: CLIENT: Could not connect to port: Error:10060 So anyway, sorry I could not be any help. I really have to study. Bye~ until my exam is over. Edited October 1, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now