Jump to content

Find Current URL


Recommended Posts

Hey everyone, I've been boggling my mind around these 2 questions for about a week, I'm sure I could find the answer if I just knew what to look for but I don't :)

The 1st one I need is

if "current website" <> $savedsite then ; < I can not figure out how to make this work.

The other is a number generator, I've got the basic part down $pop = $pop +1 however, I need the number to start at "0000" not "0" is there anyway I can make pop go up like 0001 0002 0003... 0010 0011 < sequence?

Thanks to anyone that reads.

Edited by arkstudios
Link to comment
Share on other sites

Look at StringFormat() function for the pop question. The example in the help doc gives exactly what you want as far as padding a number with zero's.

Link to comment
Share on other sites

Forgive me, but the StringFormat help section is really really overwhelming, maybe it's because it's late but I can clearly see that %d allows me to add the 0 padding on my digit, but I have absolutely zero idea how to write it out in my program because the example is so vague.

Link to comment
Share on other sites

Link to comment
Share on other sites

Try this

For $i = 0 to 1000
$padded_Number = StringFormat('%04i', $i)
ConsoleWrite($padded_Number & @LF)
Next

$pop = InputBox ("Starting Point","Example 0000")

How about for when the user picks the variable at the start, and it's not static? You see my program works just fine as long as you start at 1000, but I would like the user to start at 0000

Link to comment
Share on other sites

User the number() function. If they enter "0002" it will return 2.

$pop = InputBox ("Starting Point","0000")
$pop = Number($pop);

Use _IEPropertyGet() to retreive the URL of IE.

$URL =  _IEPropertyGet($oIE, "locationurl")
If $URL <> "www.google.com"; or whaterver
Link to comment
Share on other sites

User the number() function. If they enter "0002" it will return 2.

$pop = InputBox ("Starting Point","0000")
$pop = Number($pop);

Use _IEPropertyGet() to retreive the URL of IE.

$URL =  _IEPropertyGet($oIE, "locationurl")
If $URL <> "www.google.com"; or whaterver

That's my problem, I need it to return 0002. I'm still having problems with the IEPropertyGet also. Edited by arkstudios
Link to comment
Share on other sites

That's my problem, I need it to return 0002. I'm still having problems with the IEPropertyGet also.

$pop needs to be a real number in order to add to it. 0002 is not a real number. When you write $pop to notepad you can format what you write to be "0002", but you cant actually set to be that.

Notice how I keep $pop as a real number, and only format $pop as im writing it.

$pop = InputBox("Starting Point", "0000")
$pop = Number($pop)
$oIE = _IECreate("http://www.google.com")
While 1
_IENavigate($oIE, "http://www.autoit.com")
Send(StringFormat('%04i',$pop))
$URL = _IEPropertyGet($oIE, "locationurl")
If $URL <> "http://www.autoit.com" Then
  WinActivate("Untitled - Notepad")
  Send(StringFormat('%04i',$pop))
EndIf
$pop += 1; increase pop by 1
WEnd
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...