samcro 2 Posted February 28, 2014 Report Share Posted February 28, 2014 Hi guys, Drawing a blank here... I want to be able to create multiple copies of a file. For example, I want to make 10 copies of a text file. How would I go about doing that? I tried implementing different ways but none of them worked. Any help would be appreciated. Thanks! -samcro Quote Link to post Share on other sites
TheBigWeb 40 Posted February 28, 2014 Report Share Posted February 28, 2014 Maybe load the file into a list then loop 10 times and save the list to a file on every loop with a different filename? Quote Link to post Share on other sites
Bot-Factory 602 Posted February 28, 2014 Report Share Posted February 28, 2014 I would probably do it with a shell command. Copy or Xcopy. Take a look at the following pluginhttp://www.ubotstudio.com/forum/index.php?/topic/13798-free-plugin-advanced-shell/ Dan Quote Link to post Share on other sites
UBotDev 276 Posted February 28, 2014 Report Share Posted February 28, 2014 Here is a quick example: set(#CONTENT, $read file("c:\\myfile.txt"), "Global") set(#FILE Number, 1, "Global") loop(10) { save to file("c:\\myfile{#FILE Number}.txt", #CONTENT) increment(#FILE Number) } 1 Quote Link to post Share on other sites
samcro 2 Posted February 28, 2014 Author Report Share Posted February 28, 2014 Here is a quick example: set(#CONTENT, $read file("c:\\myfile.txt"), "Global") set(#FILE Number, 1, "Global") loop(10) { save to file("c:\\myfile{#FILE Number}.txt", #CONTENT) increment(#FILE Number) } @UbotDev.com, that works pretty good thanks! Has anyone done it with images? I tried it with this same code but the images turn out to be corrupted. Thanks Quote Link to post Share on other sites
UBotDev 276 Posted February 28, 2014 Report Share Posted February 28, 2014 @UbotDev.com, that works pretty good thanks! Has anyone done it with images? I tried it with this same code but the images turn out to be corrupted. ThanksAs Dan already mentioned you would use shell command for that. Quote Link to post Share on other sites
UBotDev 276 Posted February 28, 2014 Report Share Posted February 28, 2014 You would do something like: set(#FILE Source Path, "c:\\myfile.jpg", "Global") set(#FILE Number, 1, "Global") loop(10) { set(#RESULT Copy, $plugin function("Advanced Shell.dll", "$shell batch hidden", "copy \"{#FILE Source Path}\" \"c:\\myfile{#FILE Number}.jpg\""), "Global") increment(#FILE Number) } This method should also be more memory friendly. 1 Quote Link to post Share on other sites
samcro 2 Posted March 1, 2014 Author Report Share Posted March 1, 2014 You would do something like: set(#FILE Source Path, "c:\\myfile.jpg", "Global") set(#FILE Number, 1, "Global") loop(10) { set(#RESULT Copy, $plugin function("Advanced Shell.dll", "$shell batch hidden", "copy \"{#FILE Source Path}\" \"c:\\myfile{#FILE Number}.jpg\""), "Global") increment(#FILE Number) } set(#WORKER Id, $find regular expression($plugin function("Command Line Arguments.dll", "$command line arguments"), "(?<=id=)\\d+"), "Global") if($not($comparison(#WORKER Id, ">", 0))) { then { set(#WORKER Id, 67, "Global") set(#WORKER Id, 68, "Global") } else { } } This method should also be more memory friendly. Ok, sounds good, but I don't have your plugin actually. When I went to your site to sign up to download, it won't subscribe me to aweber because they have been receiving a massive DDOS this whole week. Any other way I can get your plugins? You can add me to your list manually if you like. Thanks - samcro Quote Link to post Share on other sites
UBotDev 276 Posted March 1, 2014 Report Share Posted March 1, 2014 Ups, now I noticed I copied too much, so I removed some code. Ok, sounds good, but I don't have your plugin actually. When I went to your site to sign up to download, it won't subscribe me to aweber because they have been receiving a massive DDOS this whole week. Any other way I can get your plugins? You can add me to your list manually if you like. Thanks - samcro You could also use Ubot shell command, but you would need to point it to a batch file instead of entering multiple command line commands in command directly. Yes, you are right...Aweber is down for a few days already. :/ Send me an email via website if you need it, and I'll send you the zip there. Quote Link to post Share on other sites
samcro 2 Posted March 1, 2014 Author Report Share Posted March 1, 2014 Ups, now I noticed I copied too much, so I removed some code. You could also use Ubot shell command, but you would need to point it to a batch file instead of entering multiple command line commands in command directly. Yes, you are right...Aweber is down for a few days already. :/ Send me an email via website if you need it, and I'll send you the zip there. I just sent you an email. Thanks! -samcro Quote Link to post Share on other sites
samcro 2 Posted March 3, 2014 Author Report Share Posted March 3, 2014 @UbotDev.com, just wanted to let you know that I used your Advanced Shell plugin and it works great for this! Thanks again! - samcro Quote Link to post Share on other sites
UBotDev 276 Posted March 3, 2014 Report Share Posted March 3, 2014 @UbotDev.com, just wanted to let you know that I used your Advanced Shell plugin and it works great for this! Thanks again! - samcroNice to hear you solved it! No problem. Quote Link to post Share on other sites
the_way 52 Posted March 11, 2014 Report Share Posted March 11, 2014 Superb read, good ideas here, i'll be trying this with images shortly. Quote Link to post Share on other sites
keyuramins 1 Posted March 11, 2014 Report Share Posted March 11, 2014 Thanks for the share. It really helped. Quote Link to post Share on other sites
brusacco 20 Posted March 11, 2014 Report Share Posted March 11, 2014 How about the "Copy File" command?http://wiki.ubotstudio.com/wiki/Copy_File 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.