New to formatting with applescript.

How can I automate
do shell script “ping 10.0.1.255”
(The list all users on server command)
I need it to
1)Get the computer’s IP and subnet formatted correct
2)Get the info terminal supplies into a option list
Would this be something to do with ruby?