Jump to content
UBot Underground

How To Auto Run Compiled Bot


Recommended Posts

I've been through the forum and seen a few posts on this but I cannot get my bot to auto run.

 

I am using Windows scheduler with the /auto parameter. At the appropriate time, the compiled bot opens but just waits. I tried with window maximized,normal and minimised. No difference.

 

I also tried Freebyte task scheduler in case that would help - but no good.

 

Am using Ubot Dev 5 with Win 8.1

 

Does anyone know how I can get my bot to auto run on schedule?

 

Thanks

Link to post
Share on other sites

Create a batch file with one line of code as follows:

 

start "" "complete path to compiled ubot exe file" /auto

 

 

The finished bat file will look something like this:

 

start "" "C:\Documents and Settings\Owner\Desktop\Ubot Programs\Finished Programs\My Affiliate Data Bot\My Bot.exe" /auto

 

You can create the file in notepad, then save it with a .bat extension. Then run the batch file and it will run your bot.

  • Like 1
Link to post
Share on other sites

I'm running 5.0.13 at the moment.

 

I actually got it to work by moving all the code into an Onload event - not the best solution because I can't edit that code now as it runs each time I open the ubot file and as part of the code is to close the program, well, you see what I mean!

 

So if I subscribe to updates and get latest version, you reckon the auto switch thing should work?

Link to post
Share on other sites

I'm running 5.0.13 at the moment.

 

I actually got it to work by moving all the code into an Onload event - not the best solution because I can't edit that code now as it runs each time I open the ubot file and as part of the code is to close the program, well, you see what I mean!

 

So if I subscribe to updates and get latest version, you reckon the auto switch thing should work?

 

Yes, It think it was added with 5.1.3 or something like that. 

But it works in the current version as well. 5.7.1

 

And I wouldn't use 5.0x to be honest... 

 

Dan

  • Like 2
Link to post
Share on other sites

I use this

 

http://ubotdev.com/free-plugin-advanced-shell

 

This is the function that i use to restart a bot in U4 and U5.7(I think) :)

 

define Restart Program {
    comment("restarts and runs automatically providing
mode is set to auto")
    plugin command("Advanced Shell.dll""shell batch hidden""cd {$special folder("Application")}
start {$replace regular expression($find regular expression($plugin function("File Management.dll""$get current app"), "(?<=\\\\).*\\.exe"), ".*\\\\.*\\\\", $nothing)} /auto""Yes")
    comment("just in case above does not close bot")
    plugin command("close bot.dll""Exit Program")
}

 

You need the file management plugin http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/

to get current app name, so whatever the bot name will be it takes that name and opens compiled bot

 

The Exit Program plugin(close bot.dll)

http://www.ubotstudio.com/forum/index.php?/topic/12765-free-free-plugin-close-bot-command/

 

but you can certainly use with out functions.

 

plugin command("Advanced Shell.dll""shell batch hidden""cd \"put bot folder path here\"
start \"your bot naeme.exe\" /auto""Yes")

 

the quotes are for the spaces and don't forget the trailing \ on the folder path

e.g. "C:\programs files\my bot\"

 

 

how to kill a program and all it's subs
plugin command("Advanced Shell.dll""shell batch hidden""taskkill /IM notepad.exe /T""Yes")

 

 

any questions on that just open a command prompt and type

taskkill /?

 

or

set(#taskkill$plugin function("Advanced Shell.dll""$shell batch hidden""taskkill /?"), "Global")

 

Can us e taskkill instead of close bot plugin

 

CD

  • Like 1
Link to post
Share on other sites

Thanks for all the advice.

 

I've upgraded to the latest version and it works with the \auto argument.

 

Hopefully this thread will also help others struggling with this issue :)

Link to post
Share on other sites
  • 11 months later...

This thread is a year old at this point but I decided to go ahead and put in my 2-cents since I faced the same issue today.

 

I built a little bot that simply backs up some folders in my documents folder.

 

( a little back story)

 

I have had pure hell over the years using backups... Every single program i ever bought to do back ups for me failed at some point along the way, OR when i needed the backup because my computer had completely died, I couldn't remember what program I had used and the back ups were always encrypted or at least in some unreadable format to me.

 

So, I had a crash-scare this evening and decided I just needed a simple little solution that ubot could handle just fine. I wanted the backup process to be simple and accessible in the event of an emergency.

 

So I built the bot to backup those folders onto an internal drive that is only used for backups, and then I made it zip those files and then move the zip file over to an external hard drive.

 

Bottom line, it gives me 2 backup copies of those files, and both are easily accessible in the event of total hd failure on the main drive.

 

So I used task scheduler to set it up to run the program once per day... The only problem was that i needed it to auto-run

 

So, I just put my 'run' define into the "On Load" so that now, when my task scheduler opens the file, it immediately begins the backup.

 

After the whole backup process completes, the actual bot gui will open up.

 

I could have did a little more and had it close after it finished, but decided instead that it was a good idea to allow it to go ahead and open up... This way I get a visual reminder each day the the software ran,

Link to post
Share on other sites

Havnt tried this in a long time since I was a beginner but worked fine,I made a Ubot/phone app,that sent messages back and forward,

 

I just click run in Ubot,and it read a file in my dropbox,and depending on the message in a dropbox file,it would do a task,blank wait 10 seconds and check again,start,do start function etc

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...