Jump to content

Script working while the compiled isn't


Recommended Posts

AutoIT Version: 3.3.8.0

OS: Windows 7 x64

I've written the following script:

main()
Func main()

Local $IPAddress = "192.168.1.1"
Local $recv = ""

;~ Inicialização
TCPStartup()
$Socket = TCPConnect($IPAddress, 23)

;~ Usuário
AguardaString($Socket, "username:")
EnviaComando($Socket, "user")

;~ Senha
AguardaString($Socket, "password:")
EnviaComando($Socket, "password")

;~ Comando de reinicialização
AguardaString($Socket, "TBS>>")
EnviaComando($Socket, "reboot")

;~ Finalização
TCPCloseSocket($Socket)
TCPShutdown()
EndFunc   ;==>main

Func AguardaString(Const $Socket, Const $string)
Do
$recv = TCPRecv($Socket, 500)
Until StringInStr($recv, $string)
EndFunc   ;==>AguardaString

Func EnviaComando(Const $Socket, Const $comando)
TCPSend($Socket, $comando & @CR)
EndFunc   ;==>EnviaComando

When I hit F5 in SciTE the program works properly. I tried to compile it to both x86 and x64 version, they do not work.

Sometimes the autoit icon appears, but the result does not happen.

When I put a MsgBox function right after the reboot command, the .exe works.

What's happening?

Edited by TheGeneral
Link to comment
Share on other sites

Strange!

But I recommend posting your scripts in English, since the native language here is this!

Have you tried compiling your script with the previous version?

If you wish, sign up here: http://autoitbrasil.com

Regards,

João Carlos.

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

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

×
×
  • Create New...