SCRIPT language
===============

NOTE
----

    "string": ڿ. '\n'̳ '\008'  control character  
	     ִ.
    #       : '#' Ĵ comment ֵȴ. string #  쿡
	     ݵ string '  "  ־ Ѵ.


COMMAND LIST
------------

-.  ASSIGN
    : assign varname "string"
    : ο  Ѵ.  ٸ 
           '$' ٿ   ִ.
    : assign prompt "\$"
	  assign filename "~/somewhere/upload/filename.ext"

	  transmit $filename	# filename send
	  waitfor $prompt	# wait prompt

-.  AUTORES
    : autores [add/gadd] "wait-string" [string/script/sfile]
			     "string-script-file"
    : auto response Ͽ ߰. remote wait-string 
	    parameter string̸ string transmitϰ, script̸
	  script Ѵ. 'add' ÿ disconnectÿ removeȴ.
	  gadd 쿡 gtkcomm   ȴ.
    : autores gadd "[ENTER] Էϼ" string "\r"
	  autores add "Send file with zmodem" script 'sendfile zmodem "?"'
	  autores add "Send file with zmodem" sfile 'sendfile.scr'

-.  BEEP
    : beep <percent>
    :  Ҹ . 'percent'   config BeepPercent 
	  ȴ. 'percent'  -100 ~ 100.
    : beep
	  beep 50
	  beep -50

-.  BOOKMARK
    : bookmark [add/gadd] "bookmark-name" [string/script/sfile]
			      "string-script-file"
    : Bookmark menu ο menu item ߰Ѵ.
	  gadd global add ڷμ disconnectǾ  ʴ´.
	  add   disconnect  bookmark entry ȴ.
    : bookmark add "ٷΰ/ȣȸ" string "go linux\r"
	  bookmark add "ٷΰ/ȣȸ" script "transmit 'go linux\n'"
	  bookmark add "ȣȸ" sfile "golinux.scr"
 
-.  BUTTON
    : button [add/gadd] "button-name" [string/script/sfile]
			   "string-script-file"
    : control-bar ο button ߰Ѵ.
	  gadd global add ڷμ disconnectǾ  ʴ´.
	  add   disconnect  button ȴ.
    : button add "TOP" string "t\r"
	  button gadd "FAST" script 'transmit "chgbaud 115200\r"; \
	                             waitfor "Change baud to 115200"; \
				     set baudrate 115200; \
				     pause 3; transmit "\r"'
	  button add "SLOW" sfile 'slow.scr'
 
-.  CAPTURE
    : capture [on/off] <filename> <includebuf>
    : capture file ų ݴ´. 'capture on' ÿ ݵ filename
	  ־ ϸ, 'includebuf' keyword ־ capture  
	  terminal buffer  capture file Ѵ. 'includebuf' 
	  Ư ڿ waitfor   ȭ  capture  ϴٰ
	  ϰڴ.
    : capture on "today.cap" includebuf
	  capture on "today.cap"
	  capture off
 
-.  CLEAR
    : clear
    : ȭ .
    : clear
 
-.  CTLMENU
    : ctlmenu [add/gadd] title itemname [string/script/sfile]
				"string-script-file"
    : control-bar  ޴ ߰Ѵ. add ÿ disconnect
	  ڵ ȴ.
    : ctlmenu gadd Baudrate 9600 script 'set baudrate 9600'
	  ctlmenu gadd Baudrate 4800 script 'set baudrate 4800'
	  ctlmenu gadd Baudrate 2400 script 'set baudrate 2400'
	  ctlmenu add Download FAST sfile 'fastdown.scr'
	  ctlmenu add Download SLOW sfile 'slowdown.scr'

-.  DISCONNECT
    : disconnect
    :  ´.
    : disconnect
 
-.  DOWNLOAD
    : receivefile zmodem
    : file downloadѴ.
    : receivefile zmodem
 
-.  EMULATE
    : emulate [vt100 | ansi]
    : terminal emulation mode .
    : emulate vt100
	  emulate ansi
 
-.  END
    : end
    : script finish. goto Ǿ   ִ.
    : goto next
	  here:
	    message "works are done"
	    end
	  next:
	    transmit "test goto and end"
	    goto here

-.  ENDWIN
    : endwin
    :   dialog â   â .

-.  GET BAUDRATE
    : get baudrate currbaud
    :  baudrate 'currbaud'  ´.
    : get baudrate currbaud
	  if $currbaud != '115200'
	    set baudrate 115200
	  fi

-.  GET FILE
    : get file filename size filesize
    : 'filename' size 'filesize'  ´.
    : assign filename "~/upload/file.tar.gz"
	  get file $filename size filesize
	  message "The size of the $filename is $filesize"

-.  GOTO
    : goto label
    : label 
    : goto next
	    transmit "skip transmit\r"
	  next:
	    transmit "do transmit\r"

-.  IF/ELSE/ELSEIF/ELIF/FI/ENDIF
    : if $? [==/!=] #num
    : if ǹ.    Ȯϴ μ
	   ַ waitfor    ִ.  Script
	     ̸ 0, и -1  ´.

	  elseif elif ϸ,  fi endif ϴ.

    : waitfor "login:" 2
	  if $? == 0
	    transmit myID
	    waitfor "Password:" 2
	    if $? != -1
	       transmit myPASSWORD
	    fi
	  else
	    message "\n'login:' wait timeout. Login manually!\n"
	  fi

    : if "$variable" == "value"
	    message "value\n"
	  elseif "$variable" == "other_val"
	    message "other_val\n"
	  endif

-.  INCLUDE
    : include "script-filename"
    : ٸ script file include
    : include "my-local.scr"
 
-.  KFLUSH
    : kflush 
    : key buffer flush?   ƹ ۵  ʴ´.
    : kflush
 
-.  LABEL
    : label [add/gadd] [baudrate/emulate/protocol/linestatus]
    : control-bar baudrate, emulate, protocol  label ߰Ѵ.
	  'linestatus'  control-bar line status ִ toggle
	  button   ߰.
    : label add baudrate

-.  MESSAGE
    : message "string"
    : ȭ鿡 string Ʈ. transmitó remote send ʴ´.
    : message "Hello, world!!!"
 
-.  RUN
    : run 'filename'
    : 'filename' file .
    : run 'download.sh'
 
-.  SET BAUDRATE
    : set baudrate [300/600/1200/2400/4800/9600/19200/38400/57600/115200]
    : modem baudrate ٲ۴. Ϲ COM port direct connection
	  ȯ濡 ϰ ȴ.
    : set baudrate 19200
 
-.  SET CONFIG
    : set config [variable-name] [value]
    : gtkcommrc file  variable  ٲ  ִ.
	  (: TermFont, DoLock   ̹ ʱȭ 
		 쿡 ۿ   ʴ´. ׷   ִ)
    : set config LeftMouseClickStr	  "p\r"
	  set config UseBeep		  TRUE
	  set config ColorCyan	          "0.0 0.6 0.6"
	  set config IdleGuardInverval	  240
 
-.  SET TITLE
    : set title "title-string"
    : â  ٲ۴.
    : set title ""
 
-.  PAUSE
    : pause [secs]
    : 'secs'   sleep. 'secs' Ǽ(float) ̰, 0.1 ̻.
    : pause 3
	  pause 0.5
 
-.  RFLUSH
    : rflush
    : rx buffer flush?  ƹ ۵  ʴ´.
    : rflush
 
-.  TRANSMIT
    : transmit "string"
    : ڿ remote .
    : transmit "go linux\r"
 
-.  UPLOAD
    : sendfile [ascii/raw-ascii/xmodem/ymodem/zmodem] filename
    : file ־  ̿Ͽ ۽Ѵ.
    : sendfile xmodem "test.lod"
	  sendfile zmodem "?"	       # "?" file browse â .
 
-.  WAITFOR
    : waitfor "string" <secs> <"string2">
    : ڿ ٸ. 'secs' ־ 쿡 ־ ð() ȸ
	  ٸ. 'secs' ų 0 쿡  ٸ.
	  'secs' ִ  ι° "string2" ߰  ְ,  
	  "string" "string2"  ϳ  waitfor ϸ,
	  "string"  result 0, "string2"  result 1̴.
    : waitfor "$"
	  waitfor "XYZ" 3

    2:
	  waitfor "ABC" 5.5 "DEF"
	  if $? == 1
	    message "met DEF"
	  fi

-.  WIN
    : win begin "title"
	  win ...
    : ȭ â ϰ, button ...
    : ڼ  res/script/dialog.scr .

