Bot-Factory 602 Posted February 12, 2015 Report Share Posted February 12, 2015 Hi. I was looking for an easy method to run my bots with different configurations and on schedule.Previously my bot was running 24x7. I had a loop in my bot and started the task every couple of hours. Between those runs the bot was still active but idling. I had some stability and availability issues on my main server. So my idea was to start the bots only when they are needed. One of my requirements was, to be able to run the same bot with different configurations. So here's what I'm doing. I'm using the great (FREE) Commandline Plugin:http://www.ubotstudio.com/forum/index.php?/topic/15663-free-plugin-command-line-arguments/ That allows me to start my bot viabot.exe /auto parameter1 parameter2 ... Now my bot can react depending on the parameters I sent to the bot. Here's a quick code example: on load("Bot Loaded") { plugin command("Command Line Arguments.dll", "command line arguments list", %cparameters) if($comparison($list item(%cparameters,1),"=","/auto")) { then { set(#folder,$list item(%cparameters,2),"Global") } else { set(#folder,$special folder("Application"),"Global") } } create folder(#folder,"tmp")} And at the beginning of my bot I have something like:RunWithCommandline()stop scriptThis calls a special define where I control the behavior of the bot when it's launched via /auto. The important thing here is, that you don't have any alerts or something that is waiting for user input. Because then your bot will not finish and close. Now I use a free Windows Tool to schedule my bots:http://www.freebyte.com/fbtaskscheduler/ You could also use the Windows task scheduler to configure everything. The windows task schedule has the advantage, that you could logoff from the PC, and the task scheduler would still be able to run the bot (if configured correctly). But the Freebyte software is a lot easier to setup and configure in my opinion. You could setup it like this: The /auto option will automatically launch your bot. Tested it with 5.5.12 and it's working fine.Another alternative task manager (with more options) is:http://www.splinterware.com/products/wincron.htm Hope this helps someone. CheersDan 2 Quote Link to post Share on other sites
RiTu 5 Posted February 22, 2015 Report Share Posted February 22, 2015 Thanks Dan, great idea. I'm going to implement it right now. Quote Link to post Share on other sites
Bot-Factory 602 Posted February 22, 2015 Author Report Share Posted February 22, 2015 Update:Fixed a small error in my example code above. Quote Link to post Share on other sites
saifee 1 Posted April 24, 2015 Report Share Posted April 24, 2015 Thanks Dan.Seems a very good method to run bots on schedule. But I have a problem.My bot starts on the schedule time, but it is waiting for me to click on the RUN command. Although there are no options for user inputs or alert boxes, it still waits for me to click on the RUN button. How can I make it run without clicking on the RUN button? Quote Link to post Share on other sites
Bot-Factory 602 Posted April 24, 2015 Author Report Share Posted April 24, 2015 Thanks Dan.Seems a very good method to run bots on schedule. But I have a problem.My bot starts on the schedule time, but it is waiting for me to click on the RUN command. Although there are no options for user inputs or alert boxes, it still waits for me to click on the RUN button. How can I make it run without clicking on the RUN button? You have to start the bot with parameter /auto Dan Quote Link to post Share on other sites
gavind 6 Posted April 28, 2015 Report Share Posted April 28, 2015 Excellent one here! Thanks for your efforts Dan! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.