It's good to start by looking at other addons and learning from that.
That won't work because currently for me torque just looks like an angry seaman swearing%!;$"&
It's funny because it's true.Anyway, take a look at "Iban explains it all", it's a great tutorial.
function add(%num1, %num2){ %ans = (%num1+ %num2);}
if(isObject[whatever variable])
(I'm only a beginner at scripting, but not a complete novice)
Also you don't have to put parentheses around your math if it's a single step operation
%a*%c+%b^%d is perfectly valid.
The real problem is knowing names of functions and names of other things.
If you want to know how to do certain things and need to know more function names, look at other add-ons and go here:
That won't work because currently for me torque just looks like an angry seaman swearing%!#$"&
I still to this date have know idea what ^ does in Torque.
I think it's a bitwise xor