Module Utilities.Socket
Utilities - Socket.
Main Features:
- Creates UDP Sockets
- Send messages to Discord
- Compatible with FunkMan
- Compatible with DCSServerBot
Author: funkyfranky
Global(s)
Global SOCKET |
At times I feel like a socket that remembers its tooth. -- Saul Bellow The SOCKET ConceptCreate a UDP socket server. |
At times I feel like a socket that remembers its tooth. -- Saul Bellow
The SOCKET Concept
Create a UDP socket server.
It enables you to send messages to discord servers via discord bots.
Note that you have to de-sanitize require
and package
in your MissionScripting.lua
file, which is in your DCS/Scripts
folder.
Type(s)
Fields and Methods inherited from SOCKET | Description |
---|---|
Name of the class. |
|
Create a new SOCKET object. |
|
Send a table. |
|
Send a text message. |
|
SOCKET:SendTextToSpeech(Text, Provider, Voice, Culture, Gender, Volume) |
Send a text-to-speech message. |
Set host. |
|
Set port. |
|
The host. |
|
JSON. |
|
Class id string for output to DCS log file. |
|
The port. |
|
The socket. |
|
Verbosity level. |
|
SOCKET class version. |
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task. |
|
Adds a score for the FSM to be achieved. |
|
SOCKET:AddScoreProcess(From, Event, State, ScoreText, Score) |
Adds a score for the FSM_PROCESS to be achieved. |
Add a new transition rule to the FSM. |
|
Get current state. |
|
Returns the End states. |
|
Returns a table of the SubFSM rules defined within the FSM. |
|
Returns a table with the scores defined. |
|
Returns the start state of the FSM. |
|
Get current state. |
|
Returns a table with the Subs defined. |
|
Returns a table of the transition rules defined within the FSM. |
|
Check if FSM is in state. |
|
Load call backs. |
|
Creates a new FSM object. |
|
Sets the start state of the FSM. |
|
Add to map. |
|
Call handler. |
|
Create transition. |
|
Delayed transition. |
|
Event map. |
|
Go sub. |
|
Handler. |
|
Is end state. |
|
Sub maps. |
|
Check if can do an event. |
|
Check if cannot do an event. |
|
Check if FSM is in state. |
|
Fields and Methods inherited from SOCKET.DataType | Description |
---|---|
Range bombing. |
|
Airboss LSO grade. |
|
Range strafeing result. |
|
Plain text. |
|
Text-To-Speech. |
SOCKET class.
Field(s)
Name of the class.
The host.
JSON.
Class id string for output to DCS log file.
The port.
The socket.
Verbosity level.
SOCKET class version.
Function(s)
Create a new SOCKET object.
Defined in:
SOCKET
Parameters:
#number Port
UDP port. Default 10042
.
#string Host
Host. Default "127.0.0.1"
.
Return value:
self
Send a table.
Send a text message.
Send a text-to-speech message.
Defined in:
SOCKET
Parameters:
#string Text
The text message to speek.
#number Provider
The TTS provider: 0=Microsoft (default), 1=Google.
#string Voice
The specific voice to use, e.g. "Microsoft David Desktop"
or "en-US-Standard-A
". If not set, the service will choose a voice based on the other parameters such as culture and gender.
#string Culture
The Culture or language code, e.g. "en-US"
.
#string Gender
The Gender, i.e. "male", "female". Default "female".
#number Volume
The volume. Microsoft: [0,100] default 50, Google: [-96, 10] default 0.
Return value:
self
Set host.
Set port.
Field(s)
Name of the class.
The host.
JSON.
Class id string for output to DCS log file.
The port.
The socket.
Verbosity level.
SOCKET class version.
Function(s)
Adds an End state.
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
Core.Fsm#FSM_PROCESS Process
An sub-process FSM.
#table ReturnEvents
A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.
Return value:
The SubFSM.
Adds a score for the FSM to be achieved.
Defined in:
Parameters:
#string State
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
#string ScoreText
is a text describing the score that is given according the status.
#number Score
is a number providing the score of the status.
Return value:
#FSM:
self
Adds a score for the FSM_PROCESS to be achieved.
Defined in:
Parameters:
#string From
is the From State of the main process.
#string Event
is the Event of the main process.
#string State
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
#string ScoreText
is a text describing the score that is given according the status.
#number Score
is a number providing the score of the status.
Return value:
#FSM:
self
Add a new transition rule to the FSM.
A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
#string To
The To state.
Get current state.
Returns the End states.
Returns a table of the SubFSM rules defined within the FSM.
Returns a table with the scores defined.
Returns the start state of the FSM.
Get current state.
Returns a table with the Subs defined.
Returns a table of the transition rules defined within the FSM.
Check if FSM is in state.
Defined in:
Parameter:
#string State
State name.
Return value:
#boolean:
If true, FSM is in this state.
Load call backs.
Sets the start state of the FSM.
Add to map.
Call handler.
Defined in:
Parameters:
#string step
Step "onafter", "onbefore", "onenter", "onleave".
#string trigger
Trigger.
#table params
Parameters.
#string EventName
Event name.
Return value:
Value.
Create transition.
Defined in:
Parameter:
#string EventName
Event name.
Return value:
#function:
Function.
Delayed transition.
Defined in:
Parameter:
#string EventName
Event name.
Return value:
#function:
Function.
Event map.
Go sub.
Defined in:
Parameters:
#string ParentFrom
Parent from state.
#string ParentEvent
Parent event name.
Return value:
#table:
Subs.
Handler.
Is end state.
Defined in:
Parameter:
#string Current
Current state name.
Return values:
#table:
FSM parent.
#string:
Event name.
Sub maps.
Check if can do an event.
Defined in:
Parameter:
#string e
Event name.
Return values:
#boolean:
If true, FSM can do the event.
#string:
To state.
Check if cannot do an event.
Defined in:
Parameter:
#string e
Event name.
Return value:
#boolean:
If true, FSM cannot do the event.
Check if FSM is in state.
Defined in:
Parameters:
#string State
State name.
state
Return value:
#boolean:
If true, FSM is in this state.
Data type.
This is the keyword the socket listener uses.
Field(s)
Range bombing.
Airboss LSO grade.
Range strafeing result.
Plain text.
Text-To-Speech.