Jump to content

Report Host Name to tracker


rockofclay

Recommended Posts

Posted

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.

Posted

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.

Posted

Or you could just make it change the IP through the GUI. :P

Basically, to simulate you doing it manually. Would be better since it wouldn't have to restart the client every so often...

Posted

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?

Posted

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.

Posted

You could combine AutoITX.dll and a visualbasic script to make it press keys and stuff for you. :P

Dunno if it's possible to make it not do anything if the pc is in use.

Posted

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.

Posted

I like firon's idea a lot more than mine. :P 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.

Posted

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.

Posted

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

Posted

Heres the code.

Things to note

1: utorrent is in c:\program files

2: c:\ip.txt must exist for this to work

3: you must install dynamicwrapper to be able to call the blockinput function

4: this would go nicely scheduled in task manager

5: if you use alternative upload rate while downloading, use another tab key in there

here goes:

Dim UserWrap

Set UserWrap = CreateObject("DynamicWrapper")

const URL = "http://xml.showmyip.com/"

'discover wan ip and compare to file

Dim System, FSO, fs1, oldip

Set fso = CreateObject("Scripting.FileSystemObject")

Set fs1 = fso.OpenTextFile("c:\ip.txt", 1)

oldip = fs1.readline

fs1.Close

set xmldoc = CreateObject("Microsoft.XMLDOM")

xmldoc.async=false

xmldoc.load(URL)

for each x in xmldoc.documentElement.childNodes

if x.NodeName = "ip" then

myip = x.text

end if

next

if (oldip = myip) Then

else

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 False

end if

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...