Jump to content

My many questions


Recommended Posts

Hello AutoIT Forums!

I have now for a few days coded with AutoIt, and I feel really good about it. It helps me with, among other things, school projects and just generally on the desktop.

I have received a lot of help, and I learn something new every day! I've made this thread to ask all my questions, so I don't have to make a new thread each time.

Questions as of 04-05-2013 [2]

Clicking a button with only a value and input type? [Not answered]

I have a button with this HTML Code:

<input type="submit" value="Continue">

I would like to make script that automaticly clicks on this button. How can i do so?

Use minutes instead of milliseconds? [Answered by OliverA]

Is it possible to use minutes for sleep (or anything that does the same) instead of writing the milliseconds?

For example:

While 1
Sleep(2min)
If WinActive("[CLASS:Notepad]") Then
WinKill("[CLASS:Notepad]")
EndIf
WEnd

Edit live HTML on IE webpage? [Researching]

Is it possible to edit the HTML of a IE page, without having to refresh it? Like if you would "inspect element" on Chrome and then edit it, it wouldn't require any refresh.

For example:

We have this button in HTML:

<input type="submit" value="Continue">

We would like to add an ID to it, so we can use the ObjGetId command. What would the autoit code be for this? (Heres the concept code)

Local $readHTML = _IEDocReadHTML($oIE)
_IEDocWriteReplaceHTML ($readHTML, "<input type="submit" value="Continue">", "<input type="submit" ID="THENEWID" value="Continue">")

Edited by SuitUp

[center][font=courier new', courier, monospace]T H E + I M M O R T A L[/font][/center][center][font=courier new', courier, monospace]Feel like helping? Answer My Many Questions[/font][/center]

Link to comment
Share on other sites

The code should look somewhat like this

#include <IE.au3>

$S_Link = ""
$oIE = _IECreate($S_Link, 0, 0) ;InVisible
$oInputs = _IETagNameGetCollection($oIE, "input")

Local $oInput_Req

For $oInput In $oInputs

If $oInput.value = "Continue" And $oInput.id = $oInput.name And $oInput.type = "submit" Then

$oInput_Req = $oInput
ExitLoop

EndIf

Next

_IEAction($oInput_Req, "click")
It would be more helpful if you could give the link of the webpage and mention the usage of this script

Regards :)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

  • Moderators

SuitUp,

How about sticking to just the one thread at a time? I have now merged them - do not open a third. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Check this out - I'm assuming you know about Arrays, if not learn them first.

#include <Array.au3>

;Assuming the INI file to be "Test.ini" in the scriptdir. Let the Section name be "Grocery"
$aRead = IniReadSection("Test.ini", "Grocery")
;$aRead is a 2D array with $aRead[$i][1] = Value of key $i, where $i is any whole number.
;Make the Array 1D since _ArrayToString supports 1D Array and we are only interested in Col 1.
$aRead = Array2D_To1D($aRead, 1)

$String = _ArrayToString($aRead, "") ;Make the string from the 1D-Array
;We are only monitoring the values of the keys, if found we would execute the if statement

;Now here is the Regex
If StringRegExp($String, "Milk|Can|Chocolate|Grocery|Arla|Haribo|Sodavand|Kakao|Ketchup|Blandinger|Shop|Madkurven") Then
;....Your Functions go here
EndIf

Func Array2D_To1D($2DArray, $iCol)

$iUbound = UBound($2DArray)
Local $aRet[$iUbound]

For $i = 0 To $iUbound - 1
$aRet[$i] = $2DArray[$i][$iCol]
Next

Return $aRet
EndFunc ;==>2DArray_To1D
Regards :) Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Thread has been updated!
  • Old posts (by me) was deleted.
  • The thread has been renamed.
  • 3 new questions has been asked.
Edited by SuitUp

[center][font=courier new', courier, monospace]T H E + I M M O R T A L[/font][/center][center][font=courier new', courier, monospace]Feel like helping? Answer My Many Questions[/font][/center]

Link to comment
Share on other sites

It's easy to make 200 question, it's better to read the help

Do you want to use minute instead of millisecond?

On the help of Sleep

5 second = 5000ms, so:

1 sec = 1000ms

60sec ( 1 minute is 60 sec... ) x 1000 = 60000

Math is not an opinion, so:

MinuteSleep(5)

Func MinuteSleep($delay)
Sleep($delay * 60000)
EndFunc
Edited by OliverA

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

It's easy to make 200 question, it's better to read the help

Do you want to use minute instead of millisecond?

On the help of Sleep

5 second = 5000ms, so:

1 sec = 1000ms

60sec ( 1 minute is 60 sec... ) x 1000 = 60000

Math is not an opinion, so:

MinuteSleep(5)

Func MinuteSleep($delay)
Sleep($delay * 60000)
EndFunc

My questions are only asked, if i have searched for them first in the read. I couldn't manage to find anything to do with sleep in minutes, therefor i asked. Also I didn't ask for a explanation on how to multiply, i know that very well thank you.

I would like to thank you for posting the function tho, i didn't know you could use * inside Sleep.

[center][font=courier new', courier, monospace]T H E + I M M O R T A L[/font][/center][center][font=courier new', courier, monospace]Feel like helping? Answer My Many Questions[/font][/center]

Link to comment
Share on other sites

Your IE questions have been answered already.

<IE.au3> has access functions for Internet Explorer.

Read up about it capabilities in the help file (the help file has working examples).

Google IE DOM and innerHtml for your how to adjust web content.

Link to comment
Share on other sites

You have search about ms in minute? I don't think, first result:

And really you don't know you can user operator in a variable or a function? Listen me, read the help you lack of basic kwoledge, then you can answer by yourself and if you can't the forum is here.

http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm

I'M QUIT FROM THIS FORUM!

It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.

From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself.

In what way? It's easy...just search on google

For that people, wish you the best way,

Oliver Astone

Link to comment
Share on other sites

Your IE questions have been answered already.

<IE.au3> has access functions for Internet Explorer.

Read up about it capabilities in the help file (the help file has working examples).

Google IE DOM and innerHtml for your how to adjust web content.

My question about clicking the button, does not work with the script PhoenixXL posted. I can't tell why, but i believe it's because there isn't enough information about the button, so that it can click it.

but thanks for the tips, will search right away :-)

[center][font=courier new', courier, monospace]T H E + I M M O R T A L[/font][/center][center][font=courier new', courier, monospace]Feel like helping? Answer My Many Questions[/font][/center]

Link to comment
Share on other sites

  • Moderators

SuitUp,

In future please do not delete the original questions and replace them with new ones. :naughty:

Otherwise the responses you got to the first set make no sense to anyone reading this later - remember that this forum is a resource for others, not just you. Just open a new thread for each new set of questions. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@SuitUp ... have a real close look at the search results for "IE click" in the help file.

If you are unable to understand the IE click examples ... then there are people that may help you here.

Note: you need to have a basic understanding of the IE DOM ... otherwise all we will be doing is feeding you script which you will not be able to modify for your needs.

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...