Version 2.9999943
Bot Clients only work with action script statements. These statements are listed in detail in the ActionScript pages: Bot Client statements and Events: Bot Client handlers.
See Setting up a script connection.
Each bot has a Bot Client that connects to one Server application at a time. Before it can connect, the Bot Client must set the IP address and Port number of the remote listening Server, as well as the Login name and Password (if required by the remote server). This can be done in two ways:
The script must have event handlers installed to trap the Bot Client 'connect', 'login', 'message', 'answer' and 'disconnect' messages. These events are: CLConnect, CLLogin, CLMessage, CLHear, CLAnswer, CLConfirm, CLDisconnect. Other events which can occur: CLAdd, CLDelete and CLUnsent. For example, to install the CLLogin event handler, you could write:
# installer OnCLLoginEvent CLLogin1 # event handler Event CLLogin1 # code here EndEvent |
To connect, send messages and disconnect, the script uses the following statements: CLConnect, CLWrite $n $a, CLWriteAll $a, CLDisconnect.
# somewhere before connecting: # installer OnCLMessageEvent CLMessage1 # in the events handler and sub section # event handler Event CLMessage1 GetMessage $a IfString "bonnie" IsIn $a ClWrite "My bonnie lies over the ocean" Else ClWrite "dunno what you are talking about!" # ClWrite requires proper strings surrounded by "" or variables like $b EndEvent |