rafi Posted September 17, 2010 Report Share Posted September 17, 2010 and will it be activated if the per torrent function was defined ? before/after? A checkbox in the torrent properties might be added to control that. Both are useful, abd the format should be the same. Link to comment Share on other sites More sharing options...
Spartakus Posted September 17, 2010 Report Share Posted September 17, 2010 Here is how I did it:Created a test.cmd@echo offecho D:%1 N:%2 S:%3 L:%4 T:%5 M:%6 I:%7pauseAdd this line to both fields in µTorrent:C:\test.cmd "%D" "%N" "%S" "%L" %T "%M" %IAs Firon previously stated, this function is for power users and a power user should be able to retrieve this info by themselves. I did. Link to comment Share on other sites More sharing options...
Bommy Posted September 21, 2010 Report Share Posted September 21, 2010 Brilliant looking function, nice one guys.Is it possible to use the second box to run a program when a torrent switches from Seeding to Finished? Link to comment Share on other sites More sharing options...
Ultima Posted September 22, 2010 Report Share Posted September 22, 2010 Not specifically from seeding to finished, but it should call on finish. Link to comment Share on other sites More sharing options...
Firon Posted September 22, 2010 Report Share Posted September 22, 2010 It will run on every state change, so you can just capture it and wait for the state to be finished. Link to comment Share on other sites More sharing options...
Contempo Posted October 1, 2010 Report Share Posted October 1, 2010 Hey, great feature, thanks for putting it in. I'm having problems with it triggering though. I have the following on state change...X:\scru\batch.bat %S "%D"batch.bat contains...@echo off IF (%1)==(5) ( X:\scru\scru.exe %2 *) ELSE ( echo nothing)now this all works, except the batch file doesn't get triggered unless I go, stop + start... so if the RSS filter matches a torrent, downloads it, it completes, changes state to seeding, but utorrent doesn't run the batch file. Guess what I'm saying is, its not recognising there is a change of state when it finishes a download, goes to queue seeding then seeding. Hope that makes sense...btw. SCRU is great, been using if for ages, thanks Spartacus. Link to comment Share on other sites More sharing options...
Spartakus Posted October 2, 2010 Report Share Posted October 2, 2010 Contempo: You say you have X:\scru\batch.bat %S "%D" in the field "state change"I think you should move the command into the field "finishes" Link to comment Share on other sites More sharing options...
Contempo Posted October 2, 2010 Report Share Posted October 2, 2010 oh wow, as simple as that... completely eliminates the need for my batch file as well haha, I didn't realise Finished was triggered at the end of a download, thought it was only triggered when you hit stop on the torrent... now I have X:\scru\scru "%D" * on the finished trigger and it works a treat, thanks heaps! Link to comment Share on other sites More sharing options...
zquack Posted October 18, 2010 Report Share Posted October 18, 2010 Using 2.2 build 22538.When a torrent finishes Downloading and switches state to Seeding, should it fire the "Run this program when a torrent finishes" box then or only when it's completed the required seeding goal when the status will actually change to Finished. I understand that by using the "changes state" box and clicking Stop on a torrent will cause it to fire, but it also fires on any other state change and I only need/want to fire my batch file when the torrent hits 100% downloaded as random command windows opening and closing is rather annoying if you're using the computer at the time. Link to comment Share on other sites More sharing options...
Contempo Posted October 18, 2010 Report Share Posted October 18, 2010 Using 2.2 build 22538.When a torrent finishes Downloading and switches state to Seeding, should it fire the "Run this program when a torrent finishes" box then or only when it's completed the required seeding goal when the status will actually change to Finished. I understand that by using the "changes state" box and clicking Stop on a torrent will cause it to fire, but it also fires on any other state change and I only need/want to fire my batch file when the torrent hits 100% downloaded as random command windows opening and closing is rather annoying if you're using the computer at the time.When a torrent reaches 100% it goes from downloading -> finished -> seeding. So the Run on Finished command does go through when download reaches 100%. Link to comment Share on other sites More sharing options...
zquack Posted October 18, 2010 Report Share Posted October 18, 2010 Hmm, it doesn't seem to be working for me. Just ran a test and it doesn't seem to be firing when the state changes from Downloading at 100% to Seeding either. *sigh* Link to comment Share on other sites More sharing options...
Contempo Posted October 18, 2010 Report Share Posted October 18, 2010 put notepad.exe in run on finish see if its triggered.... Link to comment Share on other sites More sharing options...
zquack Posted October 18, 2010 Report Share Posted October 18, 2010 put notepad.exe in run on finish see if its triggered....Just tried that, and nothing happened. Putting it in the changes state box and hitting start/stop makes it trigger 3 times as I would expect however. Link to comment Share on other sites More sharing options...
zquack Posted October 19, 2010 Report Share Posted October 19, 2010 Just removed the settings folder and installed the new RC of 2.2 and it works as it should. My old settings must be screwed up somehow. Link to comment Share on other sites More sharing options...
rakkhi Posted October 19, 2010 Report Share Posted October 19, 2010 Thanks for adding this feature guys, been wanting it for a while now.With the iphone and Apple TV it really is a must have.If you are a fan of Handbreak (http://sourceforge.net/projects/handbrake/ ) really good open source video conversion toolLittle script to convert files to Apple TV format:"C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "%D\%F" -t 1 -c 1 -o "%D\%F.m4v" -f mp4 -4 -X 624 --loose-anamorphic -e x264 -q 20 -a 1,1 -E faac,ac3 -6 dpl2,auto -R 48,Auto -B 160,auto -D 0.0,0.0 -x cabac=0:ref=2:me=umh:b-adapt=2:weightb=0:trellis=0:weightp=0 -v 1And iPhone 4 format:"C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "%D\%F" -t 1 -c 1 -o "%D\%F.m4v" -f mp4 -X 320 -l 240 -e x264 -q 20 -a 1 -E faac -6 dpl2 -R 48 -B 128 -D 0.0 -x cabac=0:ref=2:me=umh:bframes=0:subq=6:8x8dct=0:trellis=0:weightb=0 -v 1Just replace the directory path for the handbreak exe if you have changed it. Works well for me. Thanks again, keep up the good work Link to comment Share on other sites More sharing options...
comaxauto Posted March 12, 2011 Report Share Posted March 12, 2011 I love the global "run program on torrent state change" feature. Thanks so much for adding it!I have one small issue with it.If I add a torrent and have the Start torrent option selected, I get two events: 12/Queued and 6/Downloading. This is exactly what I expect.However, if I add a torrent and have the Start torrent option unselected, no events occur! I would have expected at least one event: 13/Stopped.Could you please update this feature to fire an event when torrents are added as unstarted. Thanks! Link to comment Share on other sites More sharing options...
blop Posted September 19, 2011 Report Share Posted September 19, 2011 hm would it be possible to somehow announce it on irc when torrent finishes?perhaps in some combination with irc script + run program option.. it would be a nice featurebest would be a script for xchat since it support python, perl and other scripting languages, but any client should do.. Link to comment Share on other sites More sharing options...
akevit Posted January 9, 2012 Report Share Posted January 9, 2012 Not sure if it's better I create my own thread but for the life of me I can't get utorrent to write to a text file. I just want a simple torrent log that shows a list of torrents that have been downloaded.In uTorrent I have C:\Users\mrcomputer\Documents\UtorrentLogs\log.bat %L %N(Note: I've also tried combinations with and without quotes -- Are these necessary? Edit: Ok I see the point of the quotes they are necessary is the output is going to contain spaces)Then in log.bat I have: @echo offecho %1\%2 >> uTorrentLog.txtThe program executes but the log file does not get written. I have tested this just using the run command: C:\Users\mrcomputer\Documents\UtorrentLogs\log.bat Label TorrentName And this works just fine. I'm not sure how else to do this. I'm guessing one of three things is happening:1. I'm not using the right syntax in uTorrent2. The variables are not being pushed to the bat file the way I would expect them to3. uTorrent doesn't have permission to write to the directoryEDIT: Ok so I've tested this with just a simple bat file and that works: @echo offecho 1: %1 2: %2pauseThe CMD window pops up with the correct information. So what is the correct way to get this to write to a text file? I've tried running uTorrent as an administrator and that didn't work either. Is there another way?EDIT2: Ok I have this working now. In the bat file I needed to provide the full path to the text file I wanted to log to. Link to comment Share on other sites More sharing options...
rafi Posted January 9, 2012 Report Share Posted January 9, 2012 this one works for me: cmd.exe /c d:\log.cmd %S %FMake sure you give full absolute path to the output file echo 1: %1 2: %2 >> d:\out.txt Link to comment Share on other sites More sharing options...
akevit Posted January 9, 2012 Report Share Posted January 9, 2012 this one works for me: cmd.exe /c d:\log.cmd %S %FMake sure you give full absolute path to the output file echo 1: %1 2: %2 >> d:\out.txtThanks. Yeah yours is a little simpler, but mine is working so I'll just keep it. The key thing I was missing was the absolute path to the output file, one I added that I was good to go. Link to comment Share on other sites More sharing options...
akevit Posted January 9, 2012 Report Share Posted January 9, 2012 I also went one step further and created a python script I call at the end of the bat file to replace the quotations that get inserted. Bat file: (log.bat)@echo offecho %date% %time% %1\%2 >> "C:\Users\mrcomputer\Documents\My Dropbox\Dropbox Torrents\uTorrentLog.txt"python "C:\Users\mrcomputer\Documents\My Dropbox\Dropbox Torrents\clean.py"Python script: (clean.py)import fileinputimport sysdef replaceAll(file,searchExp,replaceExp): for line in fileinput.input(file, inplace=1): if searchExp in line: line = line.replace(searchExp,replaceExp) sys.stdout.write(line)replaceAll("C:\Users\mrcomputer\Documents\My Dropbox\Dropbox Torrents\uTorrentLog.txt","\"","")Sample uTorrentLog.txt output:Sun 01/08/2012 23:07:41.46 Other\Magda Herzberger's Book Previews - Tales of the Magic Forest Sun 01/08/2012 23:09:52.46 HD Movies\Magda Herzberger's Book Previews - If You Truly Love Me Link to comment Share on other sites More sharing options...
janullrich Posted March 26, 2012 Report Share Posted March 26, 2012 I really hope somebody can help me as I am banging my head against the wall at the moment.All I want to do is launch a script when a torrent is FINISHED (which is to say has downloaded and then seeded to the appropriate ratio). If I try and launch it from the "Run on Finished State" box the script doesn't run even if I just put notepad in there. It will only run from the "Run on Changes State" box.The problem is UT goes into the FINISHED stage temporarily (too quick to see) between each stage e.g between Downloading and Seeding.I thought right I'll use the Previous State of the torrent to check whether it was previously Seeding and therefore the Finished is correct or whether it was Downloading and in which case the Finished is incorrect and to exit the script.NOPE. That didn't work because if the torrent is Seeding and then goes into Queued Seed we hit the temporary Finished stage again and triggers the previous state check which it now passes (incorrectly though).Here is the beginning of the script:set State=%1set Kind=%2set Directory=%3set FileName=%4set Title=%5set Label=%6set FilePath=%~7set Previous=%8IF %State%=="Finished" GOTO PREVCHECKIF NOT %State%=="Finished" GOTO END:PREVCHECKIF %Previous%=="5" GOTO OTHERIF %Previous%=="8" GOTO OTHERIF NOT %Previous%=="5" GOTO ENDI am at a loss with what to do. The launch on Finished doesnt appear to work and on change state is next to useless. Can someone please please help me figure out how to get this working.ThanksGaz Link to comment Share on other sites More sharing options...
zicozz1 Posted September 14, 2012 Report Share Posted September 14, 2012 I'm looking to set up a batch script, but I have no idea how to Write batch scripts.Here is what I want to do in "plain English"If label=Movie set state to "Force Start" copy downloaded folder to d:\nedlastinger\ferdig\Rename after 30 days remove and delete .torrentIf label=Movies2 set state to "Force Start" then Remove and Delete .torrentIf %L==Movies %S==8 copy %D to d:\nedlastinger\ferdig\RenameIf %L==Movies2 %S==8 Am I anywhere close to what it should look like? If not what should it look like? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.