Jump to content

Recommended Posts

Posted (edited)

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
Posted

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.

Posted (edited)

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
Posted

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.

Posted
Posted

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
Posted (edited)

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
Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...