So, Chatscript can do computation.
But if you want pass this information to the java from Chatscript, then you have to use the function ^popen and pass the command to execute through the console. I think is not possible to use socket from chatscript to java, but the opposite is possible.
example:
In the chatscript:
t: ( ) when were you born? <<- Here the bot ask to the user
u: (i was born _* ) $$date = ‘_0 <<- Here the bot save the date
$$commad = ^join(“java computeDate.java ” ^eval( $$date ) ) <<- Here we build the string that we will use to call the java program, passing the date as an argument
popen($$commad ‘^myfunc) <<-Here we execute the command in the console and capture the java program output.
outputmacro: ^myfunc(^data) <<- Here we process the java program output.
_0 = ^data
In the Java:
You need catch the information through the argument list.
P.S: Please, see the GERMAN bot that come with Chatscript for more details about this example that I wrote.