Jump to content
Sign in to follow this  
arkstudios

Find Current URL

Recommended Posts

arkstudios

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

Share this post


Link to post
Share on other sites
Beege

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.

Share this post


Link to post
Share on other sites
arkstudios

Thank you so much.

I can't reedit my origional post :)

The code I posted isn't reading right, it should be

if "current site" <> ($oIE, "http://www.google.com") then

^^ I think right?? So confused =(

Edited by arkstudios

Share this post


Link to post
Share on other sites
arkstudios

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.

Share this post


Link to post
Share on other sites
Beege

Try this

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

Share this post


Link to post
Share on other sites
arkstudios

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

Share this post


Link to post
Share on other sites
Beege

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

Share this post


Link to post
Share on other sites
arkstudios

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

Share this post


Link to post
Share on other sites
arkstudios

got the URL finder to work, now all I need is the whole numbers

Share this post


Link to post
Share on other sites
Beege

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.