Jump to content

HOw to make this VBS script work in AutoIt


hijolin
 Share

Recommended Posts

host=inputbox("IP:")

port=inputbox("port:")

Set socket=WScript.CreateObject("MSWinsock.Winsock","winsock_")

socket.Protocol=0

socket.RemotePort=port

socket.RemoteHost=host

socket.connect

for a=1 to 30

WScript.sleep 10

next

msgbox("port "&socket.remoteport&" close!")

socket.close

WScript.quit

Sub winsock_connect()

msgbox("port "&socket.remoteport&" open!")

socket.close

WScript.quit

end sub

Link to comment
Share on other sites

I guess this is what it translates to, but I can't get it to do anything on my laptop

$host=inputbox("Enter IP","IP:")
$port=inputbox("EnterPort","port:")
Local  $socket=Objcreate("MSWinsock.Winsock","winsock_")
$socket.Protocol=0
$socket.RemotePort=$port
$socket.RemoteHost=$host
$socket.connect
for $a=1 to 30
sleep (10)
next
msgbox(0,"","port " & $socket.remoteport & " close!")
$socket.close
;WScript.quit


Func winsock_connect()
msgbox(0,"","port " & $socket.remoteport & " open!")
$socket.close
;WScript.quit
EndFunc
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...