Phbot Script Commands

can someone please explain how to use the script commands
def somthing(arg)
something(arg)
return 0

where should i write that
what should write in script and where should i write the function details?

Look at some examples here