arkstudios Posted December 29, 2011 Posted December 29, 2011 (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 December 29, 2011 by arkstudios
Beege Posted December 29, 2011 Posted December 29, 2011 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. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
arkstudios Posted December 29, 2011 Author Posted December 29, 2011 (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 December 29, 2011 by arkstudios
arkstudios Posted December 29, 2011 Author Posted December 29, 2011 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.
Beege Posted December 29, 2011 Posted December 29, 2011 Try this For $i = 0 to 1000 $padded_Number = StringFormat('%04i', $i) ConsoleWrite($padded_Number & @LF) Next Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
arkstudios Posted December 29, 2011 Author Posted December 29, 2011 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
Beege Posted December 29, 2011 Posted December 29, 2011 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 Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
arkstudios Posted December 29, 2011 Author Posted December 29, 2011 (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 December 29, 2011 by arkstudios
arkstudios Posted December 29, 2011 Author Posted December 29, 2011 got the URL finder to work, now all I need is the whole numbers
Beege Posted December 29, 2011 Posted December 29, 2011 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 Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now