Jump to content

_GetIP Is not working like it should


scorpiox73
 Share

Go to solution Solved by JohnOne,

Recommended Posts

I agree and have sometimes wondered why such a shaky and unreliable method resides in a standard UDF.

I suppose it is easy to update though.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I was going to remove it a while back, but it's kind of cemented as part of the UDFs now.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I will take an in depth look with the captures tomorrow.  Ive really only watched my GET requests, and those are indistinguishable from any other.  And, would modifying the header in the event a script relying on a 3rd party service suddenly stops working be standard troubleshooting?  I cant say I have ever seen that recommended.

I'm all for the "We follow EULAs" rule, but i have to think banning a language is an unlikely eventuality.  Though, it makes me want to go write some snort rules and see what i can break.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

John i still have the same problem the script is not getting that the ip is changed but when i try the 2 above sites "http://www.myexternalip.com/raw", "http://icanhazip.com"] they give the correct ip meanwhile the script is giving me the previous ip wich is wrong.

I'm using the _ExtIP() and i check every 10 minutes.

I wonder is there a line to add to _ExtIP() to get it to flush all variables ?

Something like to make it behave as is starting for the first time that returns the corect ip.

Thank you again for any help.

Link to comment
Share on other sites

Does this work?

It just swaps ip func and changes it each time.

$CurrentIP = "127.0.0.0"
TrayTip("Start IP : ", $CurrentIP, 2)
Sleep(2000)

While 1
    $NewIP = _GetVar()
    TrayTip("My IP : ", $NewIP, 2)
    Sleep(2000)

    If $NewIP <> $CurrentIP Then

        TrayTip("IP Changed : ", $NewIP, 2)
        Beep(500, 200)
        Sleep(2000)
#cs
        If ProcessExists("xxxxxxx.exe") Then
            TrayTip("Closing xxxxxx : ", "Closing xxxxxxx", 2)
            Sleep(2000)
            ProcessClose("xxxxxxx.exe")
        EndIf
#ce
;       TrayTip("Waiting Time : ", "Waiting Time To Open xxxxxxx", 2)

;       Sleep(10000)

;       TrayTip("Opening xxxxxxxx", "Opening xxxxxxx", 2)
;       Local $iPID = Run("C:\Users\Master\Desktop\xxxxxxx\xxxxxxx.exe")

        $CurrentIP = $NewIP

    EndIf

    TrayTip("Loop Waiting", "Waiting 1 Seconds...", 2)
    Sleep(1000)
WEnd

Func _GetVar()
    Local Static $CurrentIP = "127.0.0.0"
    Local Static $add1 = 0
    $add1 += 1
    If $add1 > 10 Then Exit
    $CurrentIP = StringTrimRight($CurrentIP, 1) & String($add1)
    ConsoleWrite($CurrentIP & @LF)
    Return $CurrentIP
EndFunc

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

The above script yes it works

Results :

127.0.0.1
127.0.0.2
127.0.0.3
127.0.0.4
127.0.0.5
127.0.0.6
127.0.0.7
127.0.0.8

etc

 

I realy cant understand why the normal script is not working....Going crazy. The script seems ok (i cant find errors) browsers return the normal ip the function seems to get stuck and shows the first ip...

 

Edit : The strange thing is that every time i run the scipt the ip is correct (so if i run and stop the script 10 times every 20 secs (and at the same time i change the ip manual from ie) the results are correct

Edited by scorpiox73
Link to comment
Share on other sites

 

Does this work?

It just swaps ip func and changes it each time.

$CurrentIP = "127.0.0.0"
TrayTip("Start IP : ", $CurrentIP, 2)
Sleep(2000)

While 1
    $NewIP = _GetVar()
    TrayTip("My IP : ", $NewIP, 2)
    Sleep(2000)

    If $NewIP <> $CurrentIP Then

        TrayTip("IP Changed : ", $NewIP, 2)
        Beep(500, 200)
        Sleep(2000)
#cs
        If ProcessExists("xxxxxxx.exe") Then
            TrayTip("Closing xxxxxx : ", "Closing xxxxxxx", 2)
            Sleep(2000)
            ProcessClose("xxxxxxx.exe")
        EndIf
#ce
;       TrayTip("Waiting Time : ", "Waiting Time To Open xxxxxxx", 2)

;       Sleep(10000)

;       TrayTip("Opening xxxxxxxx", "Opening xxxxxxx", 2)
;       Local $iPID = Run("C:\Users\Master\Desktop\xxxxxxx\xxxxxxx.exe")

        $CurrentIP = $NewIP

    EndIf

    TrayTip("Loop Waiting", "Waiting 1 Seconds...", 2)
    Sleep(1000)
WEnd

Func _GetVar()
    Local Static $CurrentIP = "127.0.0.0"
    Local Static $add1 = 0
    $add1 += 1
    If $add1 > 10 Then Exit
    $CurrentIP = StringTrimRight($CurrentIP, 1) & String($add1)
    ConsoleWrite($CurrentIP & @LF)
    Return $CurrentIP
EndFunc

John thank you for your help.

Ihave done it throu your _Extip and by creating a php file in my webpage the gives me the ip as the other providers.

Strangely my php always return the right ip every time so i solved it by that way.

Thank you again with all my heart.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...