This is for those who are using
THOMSON TG784n router and
JDownloader for its auto reconnection for new IP's. Not sure if this happens to everyone, but I found out after testing and some googling in which this router will not work properly with Jdownloader's LiveHeader reconnection script (including Raw Mode). Initially I tried to use batch file to run telnet command, and realized that the batch will not work once you get into telnet mode (as it requires keyboard input) and thus; I've resorted to another method.
You'll need several tools / applications for this to work, be noted that it is best to be used only when you are idle from the computer, since this is just a very basic script.
GUIDE FOR AUTO RECONNECTION SCRIPT WITH THOMSON TG784NSTEP 1a: Prepare the script below and save it as
reconnection.ahkQUOTE
Run, cmd
Sleep, 3000
WinWait, Administrator: C:\Windows\system32\cmd.exe,
IfWinNotActive, Administrator: C:\Windows\system32\cmd.exe, , WinActivate, Administrator: C:\Windows\system32\cmd.exe,
WinWaitActive, Administrator: C:\Windows\system32\cmd.exe,
Send, cd /d{SPACE}{SHIFTDOWN}c;{SHIFTUP}\{ENTER}cd{SPACE}{SHIFTDOWN}c;{SHIFTUP}\{SHIFTDOWN}w{SHIFTUP}indows\winsxs\amd64{SHIFTDOWN}-{SHIFTUP}microsoft-windows-telnet-client{SHIFTDOWN}-{SHIFTUP}31bf3856ad364e35{SHIFTDOWN}-{SHIFTUP}6.1.7600.16385{SHIFTDOWN}-{SHIFTUP}none{SHIFTDOWN}-{SHIFTUP}1426830c3ebb712d{ENTER}
Sleep, 2000
Send, telnet{SPACE}192.168.1.254{ENTER}
Sleep, 3000
Send, {SHIFTDOWN}a{SHIFTUP}dministrator{ENTER}
Sleep, 2000
Send, yourpasswordhere{ENTER}
Sleep, 5000
Send, ppp{SPACE}ifdetach{ENTER}
Sleep, 2500
Send, e{SHIFTDOWN}i{SHIFTUP}nternet{ENTER}
Sleep, 10000
Send, ppp{SPACE}ifattach{ENTER}
Sleep, 2500
Send, e{SHIFTDOWN}i{SHIFTUP}nternet{ENTER}
Sleep, 10000
Send, exit{ENTER}
Sleep, 3000
Send, {ENTER}
WinWait, Administrator: C:\Windows\system32\cmd.exe,
IfWinNotActive, Administrator: C:\Windows\system32\cmd.exe, , WinActivate, Administrator: C:\Windows\system32\cmd.exe,
WinWaitActive, Administrator: C:\Windows\system32\cmd.exe,
Send, exit{ENTER}
STEP 1b: Modify the script if necessary
You will only have to modify the green highlighted parts. If the location of telnet.exe is same as I posted above, you need not to make any modifications to it. By default, the script connects to the default router IP (192.168.1.254) with the ID of 'Administrator' and PW of 'yourpasswordhere'. Modify accordingly.
If you need to make modifications but unsure of how, you can either use
AutoScriptWriter (recorder) that came with AutoHotkey or PM/reply here.
STEP 2: Attach the script to JDownloader Reconnection Script.
- Go to 'Settings'
- Click 'Reconnections' and select 'External' tab
- Select the saved .ahk file. Alternatively, you can compile the .ahk file (right click --> Compile Script) and use the compiled .exe file instead
- Check 'Use special executer for Windows'
- Under 'Showcase' below, click 'Change IP' to test if the script works or not.
- If it doesn't; first try to run the script OUTSIDE of the Jdownloader and ensure that the script works, if it does not, somewhere is wrong with the script.
- If it works outside of Jdownloader but not when attached to Jdownloader, ensure that the script runs exactly as it is when it is executed outside of JDownloader; if not, check everything again.
SUMMARY: Basically, you can create the script in any other preferred language of yours. The main concept behind this is to:
- Launch Command Prompt (Telnet must be enabled as a Windows Feature) and type the following
- telnet 192.168.1.254
- enter your Username (e.g. Administrator)
- enter your Password (e.g. 12345)
- ppp ifdetach
- enter the interface name (default is eInternet)
- ppp ifattach
- enter the interface name (default is eInternet)
- type exit to quit telnet session
- press any key to back to command prompt
- type exit to quit command prompt window (IMPORTANT! I have tried to leave it as it is but the script will not work properly on 2nd iteration)
Hopefully this guide *CAN* help someone out there and if there's anything that I have missed out, mistakes or errors; feel free to inform me!
Thanks!