Sign in to follow this  
Followers 0
aphesia

getip problem

3 posts in this topic

#1 ·  Posted (edited)

#include <reducemem.au3>

#include <Inet.au3>

#RequireAdmin

Opt("WinTitleMatchMode", -2)

$zeit = "08"

$PublicIP = _GetIP()

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

if FileExists("F:\misc\mybrute\hello.txt") Then

FileDelete("F:\misc\mybrute\hello.txt")

EndIf

sleep(10000)

$PublicIP2 = _GetIP()

if $PublicIP = $PublicIP2 Then

MsgBox(0, "AutoIt Example", "IP ERROR")

Exit

EndIf

WinActivate( "vmware")

WinSetState ( "vmware" , "", @SW_MAXIMIZE )

MouseClick("left", 70, 63, 1)

while 1

_ReduceMemory()

if @hour = $zeit Then

if FileExists("F:\misc\mybrute\hello.txt") Then

MouseClick("left", 21, 52, 1)

FileDelete("F:\misc\mybrute\hello.txt")

Shutdown(64)

sleep(2000)

Shutdown(1)

Exit

Else

MouseClick("left", 21, 52, 1)

Shutdown(64)

sleep(2000)

Shutdown(1)

Exit

EndIf

EndIf

if FileExists("F:\misc\mybrute\hello.txt") Then

$PublicIP3 = _GetIP()

FileDelete("F:\misc\mybrute\hello.txt")

MouseClick("left", 21, 52, 1)

sleep(5000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

sleep(10000)

$PublicIP4 = _GetIP()

if $PublicIP3 = $PublicIP4 Then

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

$PublicIP5 = _GetIP()

sleep(2000)

if $PublicIP3 = $PublicIP5 Then

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

$PublicIP6 = _GetIP()

sleep(2000)

if $PublicIP3 = $PublicIP6 Then

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

EndIf

EndIf

EndIf

MouseClick("left", 70, 63, 1)

EndIf

WEnd

so what does this script do?

batch.bat = a script which reconnects my router and gets a new ip.

the mouselicks run/stop a vmware which will do some stuff with a script in autostart.

My problem is, that my router can only be restarted every 1-2 mins. But i want the maxiumum speed out of this script (so not waitng 2 mins if i could already start with a reconnect after1:10 but also dont make a reconnect after 1:30 which wont get a new ip , run my vmware which also wont work cause i need a new ip for succes).

So i did 3 times a IF ip1 = ip2 then wait 10 secs + try reconnect again.

But my problem is, that it doesnt even reconize the if ip = ip then (in the while loop).

When the file exists (created by vmware so main program knows to stop vmware) , it will try to get a new ip. if its not new , wait 1 0secs and try again. The script gets after stopping the vmware no new ip but still runs the vmware (but i told the script to wait until the new ip is done.. well 3 if waits).

anyone sees the problem? :D

Edited by aphesia

Share this post


Link to post
Share on other sites



dont get it.. this must work

if FileExists("F:\misc\mybrute\hello.txt") Then

$PublicIP3 = _GetIP()

FileDelete("F:\misc\mybrute\hello.txt")

MouseClick("left", 21, 52, 1)

sleep(5000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

sleep(10000)

$PublicIP4 = _GetIP()

if $PublicIP3 = $PublicIP4 Then

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

$PublicIP5 = _GetIP()

sleep(2000)

if $PublicIP3 = $PublicIP5 Then

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

$PublicIP6 = _GetIP()

sleep(2000)

if $PublicIP3 = $PublicIP6 Then

sleep(10000)

run( "batch.bat" )

WinWaitClose( "cmd.exe" )

EndIf

EndIf

EndIf

MouseClick("left", 70, 63, 1)

EndIf

but he handles it like the $publicip3 is not $publicip4.. but it is

Share this post


Link to post
Share on other sites

plz isnt there anyone who could help me to fix this problem? :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0