How to set intervals in cron jobs?

You can do this via wp_cron by using the following,

function more_reccurences() {
return array(
    'sixhourly' => array('interval' => 21600, 'display' => 'Every 6 hours'),
);
}
add_filter('cron_schedules', 'more_reccurences');

then find the function that does the autopost and call it by

if ( !wp_next_scheduled('autopost_function') ) {
wp_schedule_event(time(), 'sixhourly', 'autopost_function');
}

If you want to use linux cron should be something like: * 6,12,18,24 * * * /some-command

-new edit: 28-3-2011

I think things are getting mixed up here, let me clarify.
This * 6,12,18,24 * * * /some-command goes into your crontab file, which is completely outside your webserver and wordpress. This cannot be used in php.

If you want to schedule it in wordpress you will need the functions that I gave. I’m not very familiar with wp-robot but i can give try to help. wp-robot is premium so I cant check the code.

the code I gave at the top executes the autopost function every six hours. You need to write the autopost_function yourself or find a function in wp-robot you can trigger.

ill give some examples:

example ssh command:

function autopost_function() {
$cmd = escapeshellcmd('wget --post-data="mincamp=2&maxcamp=3&chance=50" -O /dev/null http://myURL/');
  exec ($cmd);
}

Please note that using exec() is considered very dangerous in PHP, if not done correctly your entire server can be compromised/hacked and it may not run correctly if your server is running in safe-mode. You could try opening the page with curl which would better but your server would need curl support.

Instead of the above I would use the following function to add posts programmatically. But this has nothing to do with wp-robot.

example wp function:

    function autopost_function() {
// Create post object
  $my_post = array(
     'post_title' => 'My post',
     'post_content' => 'This is my post.',
     'post_status' => 'publish',
     'post_author' => 1,
     'post_category' => array(8,39)
  );

// Insert the post into the database
  wp_insert_post( $my_post );
}

this function simply adds a post to the database, you can pass a lot of parameters to it. Look up wp_insert_post() on the codex for more information. Doing it like this is much safer, and easier.

You can use the above code outside wp-robot, so you wont have to change the core files. All examples I have written are untested so they might contain some syntax problems.
Hope this helps get you going.