x
ChatBox

Please log in with password to access chatbox.
visitor stats
Index | Back | Reply | New Topic

IP Change Automation

Unique IP's only precheck
2008-12-10 12:07
hellowienedit 2009-03-06

In my opinion this batch is only for some freaks. I have more visitors using the simple IP-precheck than searching for an unique IP with every new round of the exchange. Maybe you'll find another purpose for using this variation, so I keep on sharing it.

The possibility to get an already used IP on "heavy exchanging" is still high only using the simple precheck-procedure. So I created a batch, that will check for an unique IP each time, it gets executed by the extension. It's working a easy way:

If no testfile in that IPs will be written exists, one will be created. The following commands read actual IP, disconnect, reconnect and compare if IP is in list. If you get an unused IP it will be written to the file and visits get started. If you get an used IP the connection will be closed and established again till you get a complete new one.

The most easy way to hold the test.txt actually is, to create a scheduled task, that deletes the test-file at server-midnight. It would be a lot more of code to implement the function in the batch as the users live in many different timezones. So anyone can set the time for deletion on his/her own. A simple bat with "del test.txt" in it would do this, called by taskmanager. A new empty test-file gets autocreated at next run ... Let me show you the code (get rid of the pingline if it works good for you):

if not exist test.txt (> test.txt goto again)

:AGAIN
for /F "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IP=%%j
rasphone -h "connectionname"
rasphone -d "connectionname"
for /F "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IPNEW=%%j
for /f %%a in ('find /I "%IPNEW%" test.txt^') do @set T=%%a
If "%T%" LSS "1" goto continue
goto again

:continue
for /F "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IPGOT=%%j
set /A z=z+1
echo %z% - %time% - %IPGOT%>>test.txt


Maybe it makes you fun to compare the ratio between trials and received unique IP's. For this only a few changes are to do, and the best - it works without any need of deleting the testfile for users in MMC-Timezone as we set a "pseudo"-timestamp here. Easy said, new date = new file = new IP-trials! I am shure you are able to modify this for your timezone. If you got everything working till this point you have enough experience to change things to your personal demands. Here is the code:

::Make test file(s)
if not exist %date%-trials.txt echo\ > %date%-trials.txt
if not exist %date%-unique.txt echo\ > %date%-unique.txt

:AGAIN
for /F "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IP=%%j
rasphone -h "connectionname"
rasphone -d "connectionname"
for /F "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IPNEW=%%j
for /f %%a in ('find /I "%IPNEW%" %date%-unique.txt^') do @set T=%%a
set /A x=x+1
echo %x% - %time% - %IPNEW%>>%date%-trials.txt
If "%T%" LSS "1" goto continue
goto again

:continue
for /F "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IPGOT=%%j
set /A z=z+1
echo %z% - %time% - %IPGOT%>>%date%-unique.txt
2009-07-04 06:38
hellowienThe way shown above is far to complicated ... I reduced the whole IP-comparement to 3 lines: reed new IP after reconnect, search for IP in actual date-file and compare, if it was already used this day. So let's go!

:AGAIN
### Your part of reconnect here ###
for /f "tokens=13,*" %%i in ('ipconfig^|find "IP-Ad"') do @set IPNEW=%%j
for /f %%a in ('find /I "%IPNEW%" %date%-unique.txt^') do @set T=%%a
If "%T%" LSS "1" (echo %IPNEW%>>%date%-unique.txt) else (goto AGAIN)

START firefox.exe ....