Jump to content

Get IP?


rawrr
 Share

Recommended Posts

Im making a tray icon that gives you your IP when you hover over it. Can anyone help me with the command to give your ip?

This is very useful to me because I need my IP a lot. So, please, help me. =] Thanks!

P.S. Im new. =] Well ive been registered, but I didn't do anything basically yet.

Link to comment
Share on other sites

Theres 2 Different IP Functions :)

#Include <INet.au3> ; Include For Function _GetIP 
$IP_Address_1 = _GetIp ()
MsgBox (0, "Notice", "Your IP Address Is : " & $IP_Address_1,0) 
; Or 
$IP_Address_2 = @IPAddress1
MsgBox (0, "Notice", "Your IP Address Is : " & $IP_Address_2,0) ; This One Is Different From The Other One...

P.S. For Any Other Help You Can Add Me On MSN... :) -- 'maxell225@hotmail.com'

Latest Projects :- New & Improved TCP Chat

Link to comment
Share on other sites

Hehe. Thanks I just figured that out when I typed IP in the script. =] Thanks.

EDIT: How about the hover part? I have to right click to get it. =[ lol

look at the TraySetOnEvent() function

specialID= $TRAY_EVENT_MOUSEOVER = -11

Then use ToolTip() or TrayTip() to display the IP, or clipput() to put it in the clipboard, or whatever.

Link to comment
Share on other sites

#include <INet.au3>
#NoTrayIcon

Opt("OnExitFunc", "_Exit")
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

Global $IP_Address

_Get_IP()

$Tray_GetIP = TrayCreateItem("Get IP")
TrayItemSetOnEvent(-1, "_Get_IP")
TrayCreateItem("")
$Tray_Exit = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "_Exit")

TraySetState()

While 1
    TraySetToolTip("IP Address : " & $IP_Address)
    Sleep(50)
WEnd

Func _Get_IP()
    $IP_Address = _GetIP()
EndFunc   ;==>_Get_IP

Func _Exit()
    Exit
EndFunc   ;==>_Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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...