Disconnect from internet when PC is idle?

Is there a option to set comodo firewall to disconnect my PC from internet when it is idle for some time?

Also, what are the best Comodo Firewall security settings i can set to prevent a hacker to hack into my PC?

That is not available in Comodo Firewall. However in Windows power options you can set to disable network adapter after a certain amount of time.

Also, what are the best Comodo Firewall security settings i can set to prevent a hacker to hack into my PC?
You can follow the security settings following Chiron's recommendations as described in his article [url=http://www.techsupportalert.com/content/how-install-comodo-firewall.htm]How to Install Comodo Firewall[/url] for a tighter security.