If you are using the trial version of DarkScript it will not have some of the features I'm going to share below. I don't have my portable out to see if you're on the customer list.
Dbpro user functions are registered to the scripts in this fashion (taken from the help file).
Quote: "SCRIPT LOAD DBP FUNCTION
This command will create a new script command using a user DarkBASIC Professional function. To find the function number you count
each function within your DarkBASIC Pro source code in the order they are coded. The script command name is a string value you
specify that will be used in your scripts to call the DarkBASIC Pro function. The number of parameters is an integer specifying how
many variables your user function takes as input. Be sure to read the usage example for further comments and information on using this
command.
SYNTAX
SCRIPT LOAD DBP FUNCTION Function Number, Script Command Name, Number of Parameters"
For example if you used the command:
script load dbp function 3, "actAdd", 1
You would access that user command in the script like this:
dbpro.call( "actAdd" , Content );
To share variables between scripts and dbpro you can create global variables in your script file. Global variables can be created in this way:
global ActiveSpr;
That command will create a global variable with no value set named ActiveSpr. To set a value to any global variable from dbpro you will use one of these commands:
SCRIPT SET INT VARIABLE Script Global Variable Name, Integer Value
SCRIPT SET FLOAT VARIABLE Script Global Variable Name, Float Value
SCRIPT SET STRING VARIABLE Script Global Variable Name, String Value
It's also possible to use the command SCRIPT EXECUTE to set variables, or execute functions. Here's how to use SCRIPT EXECUTE to set ActiveSpr as 1 (assuming ActiveSpr in your dbpro code is equal to 1).
script execute "ActiveSpr = " + str$(ActiveSpr) + ";"
At some point you'll have to read those values you set in the script in dbpro, so to do that you can use one of these commands.
SCRIPT INT VARIABLE : Return Integer=SCRIPT INT VARIABLE(Script Variable Name)
SCRIPT FLOAT VARIABLE : Return Float=SCRIPT FLOAT VARIABLE(Script Variable Name)
SCRIPT STRING VARIABLE : Return String=SCRIPT STRING VARIABLE(Script Variable Name)
Keep in mind that the suggestions I gave in this post are only that. There are tons of ways to do the same thing with the DarkScript plugin, and users have really came up with some creative uses. Have fun exploring it, and feel free to ask questiosn anytime!