Sign in to follow this  
Followers 0
cdm_Death

Script preparation,

2 posts in this topic

#1 ·  Posted (edited)

Ok, the issue:

I have a dynamic IP address, and it changes rather frequently, which creates an issue with my FTP server...

THE PLAN!

once or twice a day I plan to have it E-mail me the current IP address...

The script's skeleton as of now,

>Determines IP,

@IPAddress1

tylo>

Func _GetIP()

Local $ip, $tmp = @TempDir & "\~ip.tmp"

Local $rnd = "/?rnd1=" & Random(1,65536) & "&rnd2=" & Random(1,65536)

If InetGet("http://checkip.dyndns.org" & $rnd, $tmp) Or _

InetGet("http://www.whatismyip.com" & $rnd, $tmp) Then

$ip = FileRead($tmp, FileGetSize($tmp))

FileDelete($tmp)

$ip = StringRegExp($ip, "([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)", 1)

If @error = 0 Then Return $ip[0]

EndIf

SetError(1)

Return -1

EndFunc;==>_GetIP

>Creat's Text File to that Effect,

>Send's Text File Via E-Mail,

http://www.autoitscript.com/forum/index.ph...c=33498&hl=

EDIT: I need to actual function, this post just calls it... :)

I plan to make this an executable that is timed for twice a day using the standard windows tasks,

I'm thinking there is a work around for the text file itself, but it has been so long since I did any kind of AutoIt script work, I don't remember the exact e-mail commands...

Before you tell me there are sites out there that will host a domain and forward it to a dynamic ip, I know this, that is a method I am looking into, but not yet happy with using...

It seems to me that this script from back when I was writing smaller programs could be used to determine the IP address, but is there an easier way? Is the IP stored anywhere that a function might be able to just call on it? or do I need to use my old

Run>cmd prompt> blah blah> cut+paste function?< @IPAddress1

any input would be great,

also I remember reading a topic that nearly spelled out how to E-mail as a background process... Does anyone know where I might find this old topic?

Much Thanks,

Jake

Edited by cdm_Death

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