Kronitron Posted April 10, 2016 Posted April 10, 2016 I taught myself how to script and have done some pretty basic stuff so far. I wrote the script below to detect the current orientation of my monitor, then switch it to a different orientation. I'm bored and I've got the day off, so I'd like to tackle a new challenge. Please review the script below to get an idea of my skill level, then suggest something challenging for me to write. Just no API usage. Thanks! $Desktop_Height = @DesktopHeight $Desktop_Width = @DesktopWidth Run("control desk.cpl") WinWaitActive("Screen Resolution") ControlSend("Screen Resolution", "", "", "!o") If $Desktop_Height < $Desktop_Width Then ControlSend("Screen Resolution", "", "", "{Down}") ElseIf $Desktop_Height > $Desktop_Width Then ControlSend("Screen Resolution", "", "", "{Up}") EndIf ControlSend("Screen Resolution", "", "", "!a") WinWaitActive("Display Settings") ControlSend("Screen Resolution", "", "", "!k") WinWaitActive("Screen Resolution") ControlSend("Screen Resolution", "", "", "!{F4}") Exit [post='1192322']Detect and Switch Monitor Orientation[/post]
JohnOne Posted April 10, 2016 Posted April 10, 2016 Learn API usage. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Kronitron Posted April 10, 2016 Author Posted April 10, 2016 39 minutes ago, JohnOne said: Learn API usage. I'm interested, but not today. [post='1192322']Detect and Switch Monitor Orientation[/post]
JohnOne Posted April 10, 2016 Posted April 10, 2016 Ok Write a script to shut your computer down with Mouse/Control clicks. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted April 10, 2016 Posted April 10, 2016 Then run it, and go to the pub. It's your day off. mLipok 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Gianni Posted April 10, 2016 Posted April 10, 2016 here (http://codegolf.stackexchange.com/) you can find a lot of programming challenges, you can try to solve some that you like with AutoIt (and post your solution here...). mLipok 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Kronitron Posted April 10, 2016 Author Posted April 10, 2016 (edited) On 4/10/2016 at 3:25 PM, JohnOne said: Ok Write a script to shut your computer down with Mouse/Control clicks. On 4/10/2016 at 3:26 PM, JohnOne said: Then run it, and go to the pub. It's your day off. JohnOne, that's hilarious. I love it! Challenge accepted, completed, and now I'm off to the pub! ;For Windows 10 MouseClick("primary", 24, 746, 1, 0) Sleep(100) MouseClick("primary", 59, 673, 1, 0) Sleep(100) MouseClick("primary", 43, 589, 1, 0) Exit On 4/10/2016 at 3:41 PM, Chimp said: here (http://codegolf.stackexchange.com/) you can find a lot of programming challenges, you can try to solve some that you like with AutoIt (and post your solution here...). Chimp, I'll try that after I've had a few drinks lol. Should be fun, though maybe impossible. Edited April 18, 2016 by Kronitron I only added two of three quotes the first time around, so an edit was required. Second edit was a mistake: no editing done... [post='1192322']Detect and Switch Monitor Orientation[/post]
Guest Posted April 11, 2016 Posted April 11, 2016 Write a program that tell me how to talk to girl in real-time.
mLipok Posted April 11, 2016 Posted April 11, 2016 1 hour ago, gil900 said: Write a program that tell me how to talk to girl in real-time. This is much easier to write a program that tell you how do not talk to girl. Here is a small example: While 1 MsgBox(0,'Talk','Sex') Wend But as to your concept, this following example is not full working code, and this is only a small part, so you must to work on this : Spoiler expandcollapse popup; some code ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... ; ... MsgBox(0,'Talk','Sex') btw. If you do not want to write the second program, then I have one other wise word to you: Just go and talk with this girl. Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Guest Posted April 11, 2016 Posted April 11, 2016 mLipok, I made it! but it is not exactly what I wanted expandcollapse popup; Trap COM errors so that 'Back' and 'Forward' ; outside of history bounds does not abort script ; (expect COM errors to be sent to the console) #include <GUIConstantsEx.au3> #include <IE.au3> #include <WindowsConstants.au3> Local $oIE = _IECreateEmbedded() GUICreate("How to talk to girl program", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 40, 600, 360) Local $idButton_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) Local $idButton_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) Local $idButton_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) Local $idButton_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) Global $g_idError_Message = GUICtrlCreateLabel("", 100, 500, 500, 30) GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) ;Show GUI _IENavigate($oIE, "www.podbay.fm/show/952917216") _IEAction($oIE, "stop") ; Waiting for user to close the window While 1 Local $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ExitLoop Case $iMsg = $idButton_Home _IENavigate($oIE, "www.podbay.fm/show/952917216") _IEAction($oIE, "stop") _IEAction($oIE, "back") CheckError("Home", @error, @extended) Case $iMsg = $idButton_Back _IEAction($oIE, "back") CheckError("Back", @error, @extended) Case $iMsg = $idButton_Forward _IEAction($oIE, "forward") CheckError("Forward", @error, @extended) Case $iMsg = $idButton_Stop _IEAction($oIE, "stop") CheckError("Stop", @error, @extended) EndSelect WEnd GUIDelete() Exit Func CheckError($sMsg, $iError, $iExtended) If $iError Then $sMsg = "Error using " & $sMsg & " button (" & $iExtended & ")" Else $sMsg = "" EndIf GUICtrlSetData($g_idError_Message, $sMsg) EndFunc ;==>CheckError
TheDcoder Posted April 11, 2016 Posted April 11, 2016 @Kronitron Write code which does not involve mouse clicks & keyboard automation EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
Kronitron Posted April 18, 2016 Author Posted April 18, 2016 On 4/11/2016 at 3:29 AM, gil900 said: On 4/11/2016 at 10:59 AM, TheDcoder said: @Kronitron Write code which does not involve mouse clicks & keyboard automation @TheDcoder Two birds, one stone. Well, two challenges, one script. On 4/11/2016 at 3:29 AM, gil900 said: Write a program that tell me how to talk to girl in real-time. @gil900 Bam, how to talk to a girl in real time (until the conversation begins, that is). Have fun with that. The .exe is attached if you'd like it. Next up, figure out how to convert it to java and use it on android. That should be easy, but I'm not really going to do it. I learned how to use GUIs just for this. It was a perfect challenge. The only problem is that I can't figure out how to make the previous GUI close. I'm guessing it's something in the way the functions are chained together. I tried GUIDelete and WinClose, but they just closed everything down at once. Granted, I only tried them on the first window but if that fails, they all fail imo. Does anyone know how to fix this? expandcollapse popup#include <Constants.au3> #include <GUIConstantsEx.au3> aGUI() Func aGUI() $aGUI = GUICreate("How to talk to a woman", 500, 100) GUICtrlCreateLabel("Please select where to begin", 180, 35) $aGUIb1 = GUICtrlCreateButton("Step 1: Preparation", 70, 60, 180) $aGUIb2 = GUICtrlCreateButton("Step 2: Presentation", 250, 60, 180) GUISetState() WHILE 1 $aGUI = GUIGetMsg() Switch $aGUI Case $GUI_EVENT_CLOSE ExitLoop Case $aGUIb1 bGUI() ExitLoop Case $aGUIb2 cGUI() ExitLoop EndSwitch WEnd EndFunc Func bGUI() $bGUI = GUICreate("Emotional Preparation", 700, 220) GUICtrlCreateLabel("Emotional preparation is key.", 240, 35) GUICtrlCreateLabel("The most important thing to take into consideration is how, yourself, feel. To speak to women well, you MUST feel good. If you feel good then you're 90% of the way there. Next, you need to look good. Then you're ready to talk to a woman. Remember: It's not important what the girl thinks of you. What matters is how you feel about the conversation. Keep that in mind and you’ll have many successful conversations with the opposite sex. And be sure to smile a little bit.", 55, 70, 600, 52) $bGUIb1 = GUICtrlCreateButton("Next: Physical Preparation", 220, 160, 180) GUISetState() WHILE 1 $bGUI = GUIGetMsg() Switch $bGUI Case $GUI_EVENT_CLOSE ExitLoop Case $bGUIb1 bGUIa() ExitLoop EndSwitch WEnd EndFunc Func bGUIa() $bGUIa = GUICreate("Preparation", 800, 220) GUICtrlCreateLabel("A fresh haircut helps, but it isn’t always critical.", 270, 95) GUICtrlCreateLabel("Have you combed your hair?", 270, 120) $bGUIab1 = GUICtrlCreateButton("Yes", 220, 160, 180) $bGUIab2 = GUICtrlCreateButton("No", 400, 160, 180) GUISetState() WHILE 1 $bGUIa = GUIGetMsg() Switch $bGUIa Case $GUI_EVENT_CLOSE ExitLoop Case $bGUIab1 bGUIb() Case $bGUIab2 $1 = MsgBox(4, "You didn't comb your hair?", "You should do that if you can. Shall we proceed anyway?") Select Case $1 = 6 bGUIb() Case $1 = 7 Exit EndSelect ExitLoop EndSwitch WEnd EndFunc Func bGUIb() $bGUIb = GUICreate("Preparation", 800, 220) GUICtrlCreateLabel("Did you brush your teeth this morning?", 270, 120) $bGUIbb1 = GUICtrlCreateButton("Yes", 220, 160, 180) $bGUIbb2 = GUICtrlCreateButton("No", 400, 160, 180) GUISetState() WHILE 1 $bGUIb = GUIGetMsg() Switch $bGUIb Case $GUI_EVENT_CLOSE ExitLoop Case $bGUIbb1 bGUIc() Case $bGUIbb2 $2 = MsgBox(4, "You haven't brushed your teeth?", "You should probably wait to talk to her until you've brushed your teeth. Shall we proceed?") Select Case $2 = 6 bGUIc() Case $2 = 7 Exit EndSelect ExitLoop EndSwitch WEnd EndFunc Func bGUIc() $bGUIc = GUICreate("Preparation", 800, 220) GUICtrlCreateLabel("Clothing isn’t usually critical, but you’re odds of success increase with better dressing habbits.", 270, 95) GUICtrlCreateLabel("Are your clothes presentable?", 270, 120) $bGUIcb1 = GUICtrlCreateButton("Yes", 220, 160, 180) $bGUIcb2 = GUICtrlCreateButton("No", 400, 160, 180) GUISetState() WHILE 1 $bGUIc = GUIGetMsg() Switch $bGUIc Case $GUI_EVENT_CLOSE ExitLoop Case $bGUIcb1 bGUId() Case $bGUIcb2 $3 = MsgBox(4, "You've got a giant stain or clashing clothes?", "You might want to wait until you can change those to approach her. Shall we proceed anyway?") Select Case $3 = 6 bGUId() Case $3 = 7 Exit EndSelect ExitLoop EndSwitch WEnd EndFunc Func bGUId() $bGUId = GUICreate("Preparation", 800, 220) GUICtrlCreateLabel("Shall we move on to the Presentation aspect of talking to women?", 270, 95) GUICtrlCreateLabel("Click Yes to continue or click No to exit.", 270, 120) $bGUIdb1 = GUICtrlCreateButton("Yes", 220, 160, 180) $bGUIdb2 = GUICtrlCreateButton("No", 400, 160, 180) GUISetState() WHILE 1 $bGUId = GUIGetMsg() Switch $bGUId Case $GUI_EVENT_CLOSE ExitLoop Case $bGUIdb1 cGUI() Case $bGUIdb2 Exit ExitLoop EndSwitch WEnd EndFunc Func cGUI() $cGUI = GUICreate("Presentation", 700, 220) GUICtrlCreateLabel("Have fun: Enjoy the moment.", 240, 35) GUICtrlCreateLabel("Just have fun. Enjoy the moment. Enjoy the hello. Enjoy the exchange. Enjoy the departure. And if it leads to another conversation, enjoy that one too. Don’t get too caught up on your performance or results, just enjoy the process. That’s the key to success (along with confidence)!", 55, 70, 600, 52) $cGUIb1 = GUICtrlCreateButton("Next", 220, 160, 180) $cGUIb2 = GUICtrlCreateButton("Exit", 400, 160, 180) GUISetState() WHILE 1 $cGUI = GUIGetMsg() Switch $cGUI Case $GUI_EVENT_CLOSE ExitLoop Case $cGUIb1 cGUIa() Case $cGUIb2 Exit EndSwitch WEnd EndFunc Func cGUIa() $cGUIa = GUICreate("Presentation", 700, 220) GUICtrlCreateLabel("Timing: When and where to approach her.", 240, 35) GUICtrlCreateLabel("You don’t want to try to talk to a girl in a situation that will make her uncomfortable. Dark alleyways, the girls locker room, a funeral, etc.: off limits. You want to find a time where she’ll be comfortable and somewhere she isn’t too busy. You can do it.", 55, 70, 600, 52) $cGUIab1 = GUICtrlCreateButton("Next", 220, 160, 180) $cGUIab2 = GUICtrlCreateButton("Exit", 400, 160, 180) GUISetState() WHILE 1 $cGUIa = GUIGetMsg() Switch $cGUIa Case $GUI_EVENT_CLOSE ExitLoop Case $cGUIab1 cGUIb() Case $cGUIab2 Exit EndSwitch WEnd EndFunc Func cGUIb() $cGUIb = GUICreate("Presentation", 700, 220) GUICtrlCreateLabel("Follow up: What to do after you approach her.", 240, 35) GUICtrlCreateLabel("After your approach you’ve gotta follow up. You can ask them how they are doing or, “how about we catch a movie this weekend”, or you can ask them to tell you about themselves, or you could try asking, “I wonder if your personality is just as beautiful as look”, or you could ask them if they want to hang out some time.", 55, 70, 600, 52) $cGUIbb1 = GUICtrlCreateButton("Next", 220, 160, 180) $cGUIbb2 = GUICtrlCreateButton("Exit", 400, 160, 180) GUISetState() WHILE 1 $cGUIb = GUIGetMsg() Switch $cGUIb Case $GUI_EVENT_CLOSE ExitLoop Case $cGUIbb1 cGUIc() Case $cGUIbb2 Exit EndSwitch WEnd EndFunc Func cGUIc() $cGUIc = GUICreate("Presentation", 700, 220) GUICtrlCreateLabel("Your Style: It takes practice to find.", 240, 35) GUICtrlCreateLabel("For the approach and follow up, there are infinite possibilities. Practice makes perfect. You’ll figure out your style soon enough. If you try really hard you’ll succeed. The more women you talk to the better. Many, many times you’ll face rejection. It’s just the way of the world. But you’ve got to scatter a hundred seeds to get ten to grow. You should enjoy talking to women, pass or fail, simply for how it makes you feel to approach them. The result is irrelevant. Good results will always come in time. Just enjoy each one you talk to.", 55, 70, 600, 52) $cGUIcb1 = GUICtrlCreateButton("Next", 220, 160, 180) $cGUIcb2 = GUICtrlCreateButton("Exit", 400, 160, 180) GUISetState() WHILE 1 $cGUIc = GUIGetMsg() Switch $cGUIc Case $GUI_EVENT_CLOSE ExitLoop Case $cGUIcb1 cGUId() Case $cGUIcb2 Exit EndSwitch WEnd EndFunc Func cGUId() $cGUId = GUICreate("Presentation", 700, 220) GUICtrlCreateLabel("Attitude and timing: A work of art when done right.", 240, 35) GUICtrlCreateLabel("Just remember: you want to be calm, collected, and confident (not cocky). Don’t linger too long. If the conversation drags on she’ll enjoy it less. Sometimes it’s great to talk for twenty minutes, sometimes it’s only great to talk for thirty seconds. If you’re passing in the hallway, keep it brief. If you’re sitting at the lunch table talk for a while. If you have left nothing to say, part ways before the conversation stalls. Knowing when to leave is as important as being calm and confident.", 55, 70, 600, 52) $cGUIdb1 = GUICtrlCreateButton("Next", 220, 160, 180) $cGUIdb2 = GUICtrlCreateButton("Exit", 400, 160, 180) GUISetState() WHILE 1 $cGUId = GUIGetMsg() Switch $cGUId Case $GUI_EVENT_CLOSE ExitLoop Case $cGUIdb1 cGUIe() Case $cGUIdb2 Exit EndSwitch WEnd EndFunc Func cGUIe() $cGUIe = GUICreate("Action!", 700, 220) GUICtrlCreateLabel("Now you're ready!", 240, 70) GUICtrlCreateLabel("Get out there and go do it. Pray to God our Father for success!", 155, 120, 600, 52) $cGUIeb1 = GUICtrlCreateButton("Exit", 220, 160, 180) GUISetState() WHILE 1 $cGUIe = GUIGetMsg() Switch $cGUIe Case $GUI_EVENT_CLOSE ExitLoop Case $cGUIeb1 Exit EndSwitch WEnd EndFunc How to talk to girls.exe [post='1192322']Detect and Switch Monitor Orientation[/post]
iamtheky Posted April 18, 2016 Posted April 18, 2016 You should write a script to mine bitcoin and purchase ladies off the darkweb. I would totally give that example script 5 stars and a like. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Kronitron Posted April 18, 2016 Author Posted April 18, 2016 @iamthekyhahaha no! [post='1192322']Detect and Switch Monitor Orientation[/post]
Guest Posted May 10, 2016 Posted May 10, 2016 Girl Emulator. Much heavier and complex than Playstation 20 emulator. Good luck
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