Difference between revisions of "Dsp function"
(→Development) |
m (1 revision imported) |
(No difference)
|
Latest revision as of 08:20, 1 December 2017
The Dsp function is provided by the Script Support Class to StealthBot in order to display a response to one of four locations.
Contents
Development
The Dsp function was originally part of the plugin system in order to create a standard way to respond to a command.
In 2.7, this function was moved to the Script Support Class.
Documentation
'// DSP '// Displays messages via the specified output type and allows for unlimited message Lengths. '// Syntax: Dsp Output, Message, [Username], [Color] '// Output must be one of the following integer Values(): '// 1 = AddQ '// Example: Dsp 1, "Example message" '// 2 = Emote '// Example: Dsp 2, "Example message" '// 3 = Whisper '// Example: Dsp 3, "Example message", "JoeUser" '// 4 = AddChat '// Example: Dsp 4, "Example message", , vbCyan Public Sub Dsp(ByVal intID As Integer, ByVal strMessage As String, _ Optional ByVal strUsername As String, Optional ByVal lngColor As Long = 16777215) Select Case intID Case 1 Me.AddQ strMessage Case 2 Me.AddQ "/me " & strMessage Case 3 If Len(strUsername) = 0 Then AddChat vbRed, "Dsp whisper error: You did not supply a username." Exit Sub End If Me.AddQ "/w " & strUsername & " " & strMessage Case 4 AddChat lngColor, strMessage End Select End Sub
Summary
This function displays the specified message in one of four different ways.
Note: Use the script command system to handle commands. This function is provided only for backwards compatibility for converted plugins.
Syntax
Dsp intID, strMessage, [strUsername], [lngColor]
Arguments
- intID specifies the type of message to display:
- Pass 1 to send to the channel.
- Pass 2 to send as an emote.
- Pass 3 to send as a whisper.
- Pass 4 to display in-bot only.
- strMessage is the message to display.
- strUsername is the username to whisper to if intID was 3.
- lngColor is a color value (see AddChat function) to display the text in if intID was 4.