 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
cjsmile999
Joined: 29 Jun 2009 Posts: 35
|
Posted: Mon Jan 11, 2010 1:53 pm Post subject: IP Comare |
|
|
Hello Everyone,
I'm trying to compare my current IP address. I think I found a few scripts others have wrote, but I believe they are outputting it to a file first. I would like to compare without outputting it to a file. I though I could you the below script, but it doesn't seem to be working. What am I doing wrong?
| Code: |
{
if (A_IPAddress1 or A_IPAddress2 or A_IPAddress3 or A_IPAddress4) = "10*.*.*.*"
msgbox, Good to Go
else
msgbox, Error
}
Msgbox, %A_IPAddress1%`n%A_IPAddress2%`n%A_IPAddress3%`n%A_IPAddress4%
|
|
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1651 Location: Denmark
|
Posted: Mon Jan 11, 2010 2:03 pm Post subject: |
|
|
If doesn't support such syntax, try this:
| Code: | pattern := "10\d{0,1}.\d{1,3}.\d{1,3}.\d{1,3}"
If (RegExMatch(A_IPAddress1, pattern, match) || RegExMatch(A_IPAddress2, pattern, match)
|| RegExMatch(A_IPAddress3, pattern, match) || RegExMatch(A_IPAddress4, pattern, match))
MsgBox Good to go
Else
MsgBox Error
|
_________________ RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2 |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Mon Jan 11, 2010 2:42 pm Post subject: |
|
|
use if var in matchlist | Code: | matchlist.= A_IPAddress1 "," A_IPAddress2 "," A_IPAddress3 "," A_IPAddress4
If IP in %matchlist%
MsgBox Yay |
_________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
cjsmile999
Joined: 29 Jun 2009 Posts: 35
|
Posted: Mon Jan 11, 2010 3:30 pm Post subject: |
|
|
Thanks guys I knew you would have the answers !!!! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|