150 likes | 266 Views
MURT 102. Instructor: Richard Latimer. Motivation. Minesweeper Example http://www.youtube.com/watch?v=5bOP5CO_By0 Apps I downloaded You can search for things by doing a domain search “site: http://www.autoitscript.com/forum/ “. Motivation: Thing I’ve Done.
E N D
MURT 102 Instructor: Richard Latimer
Motivation • Minesweeper Example • http://www.youtube.com/watch?v=5bOP5CO_By0 • Apps I downloaded • You can search for things by doing a domain search “site:http://www.autoitscript.com/forum/ “
Motivation: Thing I’ve Done • Create an app for my grandma to sign her into email • Create a program that notifies me if someone drops a class • An Auction Template Application • http://auctiontemplates.site90.net/moondownload.html
Why Are You here? • Name • Have you programmed before? • What are you looking to learn? • Email me this info
Let’s Download Everything • http://www.autoitscript.com/autoit3/downloads.shtml • Download AutoIt – Self Extractor • Installing using the option that runs the code when clicked.
Interesting Thoughts/Tips • You Create Programs in ordinary text files. • We are going to use an IDE, Interactive Development Environment, to make things easier to read • When saving, file extension ends in .au3 • AutoIt let’s you create actually Executable Applications • How to Quit AutoIt Script
Motivation: AutoIt Example • Once you Installed AutoIt, go into your Start Menu, locate AutoIt and go to the following folder: • Examples -> GUI -> Advanced • Try these examples: • Rotate.au3 • Zoom.au3
Let’s Code Our First Program Msgbox(0, "Title", "My Content") • Type the above code into the SciTE IDE, click F5 to run • To find definition go to Google and type • “site:autoitscript.com msgbox” • Try playing with MsgBox flags you found in the documentation on Google
Variables • $x = 5, 10 ; The value stored in variable “x” is 5. • Variable can be named anything. • Math is easy: • $x = 5 + 10 • $a = $a + $b
Strings • $aString = “MURT 102 will be my favorite class”; • $bString = ‘MURT 102 will be my favorite class’; • $cString = ‘MURT 102 will be my “favorite” class’; • $dString = “Corn” & “Dog”
Combining Info $name = Inputbox("Input", "What's the name of ur favorite person?", "G-Unit") $myString = "My favorite person is " & $name msgbox(0,"Title", $myString) • Take the time to look up how this stuff works. Look at the provided examples
Let’s look up ClipGet/ClipPut • http://www.autoitscript.com/autoit3/docs/functions/ClipGet.htm
Let’s Look Up How Send Works • Google “Send” Function • Test the “Send” Examples in Docs • Compare Sending Data versus Pasting Data
First Program • Motivation: • People are Hungry • Class is Right before Dinner • I like giving away Candy • https://spreadsheets.google.com/ccc?key=0Aiww3aOXJFp0dERZOF9KWGZpMFdoekcyelFralNQZUE&hl=en&authkey=CMP6490N
Run("C:\Program Files\Internet Explorer\iexplore.exe") WinWaitActive("[CLASS:IEFrame]") sleep(100) Send("{TAB}") sleep(100) Clipput("https://spreadsheets.google.com/ccc?key=0Aiww3aOXJFp0dERZOF9KWGZpMFdoekcyelFralNQZUE&hl=en&authkey=CMP6490N") Send("^v") sleep(100) SEND("{ENTER}")