Jump to content

kmeleon

Active Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by kmeleon

  1. 1. line MsgBox(0, "Size of remote file:",& "Size of remote file " $size&" bytes") is error correct line MsgBox(0, "Size of remote file:","Size of remote file " &$size &" bytes") 2. If click Cancel you see MsgBox(16,"Error","The download was cancelled, or did not complete successfully.") and MsgBox(64,"Complete","Download complete!") You see http://www.autoitscript.com/forum/index.php?showtopic=83943
  2. The script opens the file and add the suffix to the name. Goods for text files. Help to create files with subtitles for AVIAddXSubs AddSuffixToFile.au3
  3. Very good radio player
  4. For beginner. #include <GuiConstantsEx.au3> #include <CommMG.au3> #include <file.au3> #include <Date.au3> #include <WindowsConstants.au3> ;You can see what send to port com. You must download PortMon from Microsoft. GuiCreate("ConnectToPort by SZYJA"&Chr(153), 400, 220) GUISetFont (10, 400, 0) $Edit = GUICtrlCreateEdit("",0,120,400,100,$WS_VSCROLL) GUISetFont (8.5, 400, 0) ;---------------------------------------------------------------------- $list_ports = _CommlistPorts() GUICtrlCreateLabel("Choose port: ", 10, 30, 70, 20) $available_port = GuiCtrlCreatecombo("",80, 26, 60,20) GUICtrlSetData(-1,""&$list_ports) $connect = GUICtrlCreateButton("Connect", 155,17,110,40) $disconnect = GUICtrlCreateButton("Disconnect", 280,17,110,40) GUICtrlSetState ($disconnect, $gui_disable) $send_string = GUICtrlCreateButton("Send String", 155,70,110,40) $clear_edit = GUICtrlCreateButton("Clear edit", 280,70,110,40) ;---------------------------------------------------------------------- $HW = "Hello World";string to send guisetstate () while 1;start main loop ;---------------------------------------------------------------------- ;---------------------------------------------------------------------- $open_port = 0 $status_port = 0 while $open_port <= 0 ;start connect loop $msg_1 = GUIGetMsg() Select case $msg_1 = $connect ;connect to port $file = Fileopen("Log.txt", 1);Create a log file ;---------------------------------------------------------------------- local $result $baud = 115200 $bits = 8 $par = 0 $stop = 1 $flow = 0 sleep(100) ;---------------------------------------------------------------------- $_available_port = GUICtrlRead($available_port) $nr_port = StringReplace(""&$_available_port, "COM", "") $status_port = _CommSetPort($nr_port,$result,$baud,$bits,$par,$stop,$flow) if $status_port = 1 Then FileWriteLine($file, "" &_NowTime() &" Connect to port: " &$_available_port) sleep(400) Else MsgBox(0,"Error","Port "&$nr_port &" " &$result) EndIf $open_port = $status_port case $msg_1 = $gui_event_close exit EndSelect wend;end connect loop. We connected. ;---------------------------------------------------------------------- ;---------------------------------------------------------------------- if $open_port = 1 Then GUICtrlSetState ($connect, $gui_disable) GUICtrlSetState ($disconnect, $gui_enable) GUICtrlSetState ($available_port, $gui_disable) EndIf while 1;start program loop $msg = GUIGetMsg() Select case $msg = $send_string _CommSendString($HW,10) FileWriteLine($file, "" &_NowTime() &" " &$HW) ;sometimes need sleep before use _Commgetstring() ;sleep(1500) $rec = _Commgetstring() GUICtrlSetData($Edit, $rec) Case $msg = $clear_edit GUICtrlSetData($Edit, "") case $msg = $disconnect _CommClosePort() sleep(400) GUICtrlSetState ($connect, $gui_enable) GUICtrlSetState ($disconnect, $gui_disable) GUICtrlSetState ($available_port, $gui_hide) $list_ports = _CommlistPorts() $available_port = GuiCtrlCreatecombo("",80, 26, 60,20) GUICtrlSetData(-1,""&$list_ports) FileWriteLine($file, "" &_NowTime() &" Disconnected") FileClose($file) exitloop;escape to start main loop case $msg = $gui_event_close _CommClosePort() exit EndSelect wend;end start program loop ;---------------------------------------------------------------------- wend;end main loop ;----------------------------------------------------------------------
  5. In Windows Click Start->Run...->write cmd->Open write telnet IP Port example telnet 155.155.155.155 1555
  6. GUICreate("Test", 200, 100) $filemenu = GUICtrlCreateMenu("&File") $MenuItem = GUICtrlCreateMenuItem("Open", $filemenu) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $MenuItem MsgBox(0, "", "Menu Button Pressed") If $MenuItem = 0 Then Exit EndSwitch WEnd
  7. I have little problem. How sms send with AT commands and commMG.au3 ? I don't know now how send <ctrl-z> in _CommSendString Command at send sms. HyperTerminal.exe at+cmgs="number"<CR> message<ctrl-z><CR> AutoIt $AT_1 = ('AT+CMGS="') $num_1 = ('+48666777888"'&@CR) $part_0 = (&$AT_1""&$num_1) $part_1 = ("autoIt"&@CR);without <ctrl-z> ? $all = (&$part_0""&$part_1) $time_1 = 1 ;MsgBox(0,"",""&$all) _CommSendString($all,$time_1)
×
×
  • Create New...