The Nettalk-language script uses the same syntax as other Visual Basic dialects. However there are some limitations to note:
Do
/ Loop
construct for iterating around a piece of script (ie the For
/ Next
statements are not available).Else If
(or ElseIf
) statement, only Else
.Dim
it will be an empty string.#NewScriptBegin
). Instead of a numeric index a string key can also be used. Nettalks scripting language is closely related to VBScript (and therefore Visual Basic 6) rather than VB.Net and has the limitations noted above. If you are new to VB then some tutorials may be found here. Microsoft's reference for VBScript is available here, and in particular the functions reference is a useful resource.
#NewScriptBegin Script1 'Variable Testvar1 available in Script1 Dim Testvar1 'Variable Testvar2 available in all scripts Public Testvar2 Sub StartTest() Testvar1="Test-Text" Testvar2="More Test-Text" MsgBox "Test2 in Script1" 'Call Test1 in Script1 Test1 'Call Test1 in Script2 Script2.Test1 End Sub Sub Test1() MsgBox "Test1 in Script1 (" + Testvar1 + ")" End Sub #NewScriptBegin Script2 Sub Test1() MsgBox "Test1 in Script2 (" + Testvar2 + ")" End Sub
#NewScriptBegin Script1 Sub StartTest() MsgBox "Test2 in Script1" 'Call Test1 in Script1 Test1 "Burt", "Fred" 'Call Test1 in Script2 TempText = Script2.Test1("Test...") MsgBox TempText End Sub Sub Test1(Text1, Text2) MsgBox "Test1 in Script1 (" + Text1+ " and " + Text2 + ")" End Sub #NewScriptBegin Script2 Function Test1(Text) Test1 = "Text from Test1 in Script2 (" + UCase(Text) + ")" End Sub
Subroutines and functions within your script (or built into the scripting language itself) may be called via the Nettalk command interface (the same place where you type your chat). This may be done using any of the commands /call
, /calc
, or simply ?
. The following three calls therefore all have the same effect:
/call Test1 Burt Fred /calc Test1("Burt", "Fred") ?Test1("Burt", "Fred")
You can see how the single ?
is a shorthand for the /calc
command. The ?
command also has to special modified forms of ?#
and ?@
. Whilst the single ?
just displays the return of the function to just you, the ?#
sends it to the IRC server for all to see as if you had typed the return as chat. The ?@
command goes further still and sends details of the function call as well to the IRC server for all to see:
?@Test1("John", Str(32*1024)) ?5+8 ?#5+2^8 /calc 7*7+5
Since the command / call the arguments without quotation marks are given, can have a maximum of a string with blanks over the result of a “marked. Zudem zeigt /call keine Rückgabewerte an. Moreover / call no return values. Beispiel für einen String mit Leerzeichen: Example of a string with blanks:
Since the /call
command takes its arguments without quotation marks, with each argument separated by one or more spaces. However you can specify the last argument with spaces by prefixing it with a :
(a single colon) like so:
/call Test3 Harry England :and Saint George
Original German content : Die Scriptsprache