rockofclay Posted December 17, 2005 Report Posted December 17, 2005 I have been a long time user of azureus up to about 2 months ago when I changed to utorrent. I have been using dyndns to report my hostname to the trackers, but have not been able to do so now that I have switched to utorrent. Due to a crappy ISP I am behind a transparent proxy (tpg.com.au) and I was hoping if this feature could be implemented, or at least someone could show me a workaround.
Firon Posted December 17, 2005 Report Posted December 17, 2005 The only thing you can do for now is update your IP manually in that box, until the feature is implemented (it's been asked for before)
rockofclay Posted December 17, 2005 Author Report Posted December 17, 2005 I am new to c++ but I was wondering if anyone could point me to a way of doing it myself using an external program to manipulate utorrent?
foxyshadis Posted December 18, 2005 Report Posted December 18, 2005 0. Schedule task to start a script/program to:1. Find IP; if it's unchanged, quit.2. Look for utorrent process, if it's running close it.3. Open utorrent config file (settings.dat), and modify the setting for net.bind_ip. Don't forget the length!4. Save config.5. Reopen utorrent, which will automatically restart your torrents.I can give you detailed directions in a dozen languages, but this is the basic idea. C++ is a very bad idea for this, but if you're familar with it you may want to try jscript. Otherwise I'd suggest python/php.
rockofclay Posted December 18, 2005 Author Report Posted December 18, 2005 thanks a bunch, good idea on the config file
Firon Posted December 18, 2005 Report Posted December 18, 2005 Or you could just make it change the IP through the GUI. Basically, to simulate you doing it manually. Would be better since it wouldn't have to restart the client every so often...
rockofclay Posted December 18, 2005 Author Report Posted December 18, 2005 how would I do that? send the keys, what happens if someone is typing at the time of update? I can't use Jscript, because I want it to run without a virtual machine, I don't know pearl or python, and the only other language I know that is suitable, apart form c++, is vb, which I am most comfortable with. Any suggestions? BTW what is utorrent written in?
Animorc Posted December 18, 2005 Report Posted December 18, 2005 foxyshadis: I believe the field IP to report to tracker is not the same as net.bind_ip, but the same idea is still possible. Just a typo I suppose
1c3d0g Posted December 18, 2005 Report Posted December 18, 2005 Rockofclay: I suggest reading the FAQ thoroughly, many things are answered in there. :|http://www.utorrent.com/faq.php#How_can_.C2.B5Torrent_be_so_small_and_so_fast.3F
rockofclay Posted December 18, 2005 Author Report Posted December 18, 2005 done, sorry 1c3d0g, i guess I'm impatient, but if anyone could help me by pointing to some good tutes or such for the GUI controlling without keyboard interaction I would be VERY thankfull. I am new to this but I am willing to contribute.
Firon Posted December 18, 2005 Report Posted December 18, 2005 You could combine AutoITX.dll and a visualbasic script to make it press keys and stuff for you. Dunno if it's possible to make it not do anything if the pc is in use.
Inf Posted December 18, 2005 Report Posted December 18, 2005 Oh, come on ppl. Changing config files and restarting ?! Scripting by sending GUI messages ?! It should take 10 minutes for the developer to implement this feature, and i am sure, eventually he will, and that would be the right way to do it.
foxyshadis Posted December 19, 2005 Report Posted December 19, 2005 I like firon's idea a lot more than mine. For tools to work with GUI, google "windows macro" or "windows automation" and you'll find a lot. I use keytext at work, but you'd probably still have to combine it with some scripting language to detect and pass in the new IP with that.
Firon Posted December 19, 2005 Report Posted December 19, 2005 Like I said, AutoITX.dll combined with a visual basic script He said he knew VB, and VBS is pretty similar to it. It's a dumbed down VB.
rockofclay Posted December 19, 2005 Author Report Posted December 19, 2005 Done, it works, thanks for the pointers. Built it in vbScript but I didn't use autoitx.dll, but instead I just used sendkeys, along with the Blockinput user32 api call to make sure typing doesn't interrupt it.
foxyshadis Posted December 19, 2005 Report Posted December 19, 2005 Could you post it, or a link to it? It might be very useful for other people who need to automate utorrent that way, they can just be pointed to yours with advice to change the field depending on what they need. =D
DreadWingKnight Posted December 19, 2005 Report Posted December 19, 2005 Not all trackers will accept a hostname for the ip= field.
rockofclay Posted December 19, 2005 Author Report Posted December 19, 2005 Heres the code.Things to note1: utorrent is in c:\program files2: c:\ip.txt must exist for this to work3: you must install dynamicwrapper to be able to call the blockinput function4: this would go nicely scheduled in task manager5: if you use alternative upload rate while downloading, use another tab key in therehere goes:Dim UserWrap Set UserWrap = CreateObject("DynamicWrapper")const URL = "http://xml.showmyip.com/"'discover wan ip and compare to fileDim System, FSO, fs1, oldipSet fso = CreateObject("Scripting.FileSystemObject")Set fs1 = fso.OpenTextFile("c:\ip.txt", 1)oldip = fs1.readlinefs1.Closeset xmldoc = CreateObject("Microsoft.XMLDOM")xmldoc.async=falsexmldoc.load(URL)for each x in xmldoc.documentElement.childNodes if x.NodeName = "ip" then myip = x.text end ifnextif (oldip = myip) Thenelse Set fso = CreateObject("Scripting.FileSystemObject") Set fs1 = fso.OpenTextFile("c:\ip.txt", 2) fs1.Write myip fs1.Close ' Call Blockinput(), first register the API function UserWrap.Register "USER32.DLL", "BlockInput","i=l" ' now call the function and freeze keyboard/mouse UserWrap.BlockInput True 'Send The Keys Into utorrent Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "c:\progra~1\uTorrent.exe" WshShell.AppActivate "µTorrent" Wscript.Sleep 1500 WshShell.SendKeys "{ESC}{ESC}{ESC}" Wscript.Sleep 10 WshShell.SendKeys "^p" Wscript.Sleep 1000 WshShell.SendKeys "n" Wscript.Sleep 100 WshShell.SendKeys "{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}" Wscript.Sleep 10 WshShell.SendKeys "^a" WshShell.SendKeys "{DEL}" Wscript.Sleep 10 WshShell.SendKeys myip WshShell.SendKeys "{ENTER}" 'unlock and return to normal status UserWrap.BlockInput Falseend if
Recommended Posts
Archived
This topic is now archived and is closed to further replies.