Jump to content
Sign in to follow this  

Script working while the compiled isn't

Recommended Posts

AutoIT Version:

OS: Windows 7 x64

I've written the following script:

Func main()

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

;~ Inicialização
$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
EndFunc   ;==>main

Func AguardaString(Const $Socket, Const $string)
$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

Share this post

Link to post
Share on other sites


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


João Carlos.

Edited by jscript

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

Somewhere Out ThereJames Ingram


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

Share this post

Link to post
Share on other sites

The problem was the code itself. I think I convinced myself it worked in sciTE all the time. After adding the telnet logout, it does not fail.

Share this post

Link to post
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
Sign in to follow this  

  • Similar Content

    • By v120
      Original posted by CoePSX
    • By Skeletor
      Hi All,
      It has been bugging me for a while now. 
      Can you view the AutoIt code from within a compiled exe. Like how you can with most .Net exe's by using a certain program.
      If this is possible, how then can I secure my program (if this method exists).
    • By ademon
      Hi. I can open the editor with out problems but I can not compile because it is placed on another partition diferent from C.
      Can you provide an update of this bug?

    • By lenclstr746
      Hi guys,
      Some functions of my script are running slowly. Very slow. What is the reason?
      My Code:
    • By tiye0405
      global $y, $x #RequireAdmin Global $Paused HotKeySet("{NUMPAD2}", "Pause") HotKeySet("{NUMPAD8}", "End") Opt("MouseClickDownDelay", 30) #include <ImageSearch2015.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <UpDownConstants.au3> #include <Misc.au3> Sleep(6000) Sleep(3000) $search1 = _WaitForImageSearch("goo.bmp", 30, 1, $x, $y, 10) If $search1 = 1 Then MouseMove(1500, 1500, 10) Sleep(100) MouseClick("right") Sleep(300) EndIf I've this script.
      The problem is that it work the way it is supposed to but doesnt work on a friends pc, even tho we have the same image search in C/programms(x86)/autoit3/include 
      and the same dll in system 32.
      When he starts the script on the desktop without having the "goo.bmp" file on his pc, the script finds it and right clicks the given location, while for me it doesnt and i have to open the folder with the "goo.bmp" picture in it.

      Im out of ideas on what could cause the problem.
      Any help?
      Thank you in advance
  • Create New...