You can create a script of often-used functions and re-use that script from any other scripts. You do this using the Add .NET Script Reference command.
The following sample contains a script file called Calculator that will be referenced from another script.
Public Class Calculator Public Shared Function Add(left As Integer, right As Integer) Return left + right End Function Public Shared Function Subtract(left As Integer, right As Integer) Return left - right End Function Public Shared Function Multiply(left As Integer, right As Integer) Return left * right End Function Public Shared Function Divide(left As Integer, right As Integer) Return left / right End Function End Class
Create another script, and add Calculator as a reference (expand the Properties tab, right click, select Add .NET Script Reference, and select Calculator) , and use the following code:
Public Module Main Dim _desktop As Desktop = Agent.Desktop Public Sub Main() MsgBox("2 + 3 = " + Calculator.Add(2, 3).ToString()) End Sub End Module