Jump to content

Recommended Posts

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]

Link to post
Share on other sites
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 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]

Link to post
Share on other sites
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


; 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 ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  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 APIErrorLog.au3 UDF - A logging Library *

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

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 stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"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"
:naughty:  :ranting:, 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: 2021-03-17

Link to post
Share on other sites

mLipok, I made it! but it is not exactly what I wanted

; 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

 

Link to post
Share on other sites
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 :P

 

@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?

#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]

Link to post
Share on other sites

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.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to post
Share on other sites
  • 4 weeks later...

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.

  • Similar Content

    • By Jemboy
      Recently I was working on a script with icons using GuiCtrkCreatIcon.
      I decided to change the sub folder name of the icons to a more meaning name, however made a typo.

      I tested the .exe on my test computer and it worked flawlessly (because both icon folder where on my test computer) 😁
      But after I installed the script on the intended computers , I got chaos!😵
      Zooming into the problem, I discovered, that because the icons could not be found, the ControlID were returned with a value of 0
      and thus played havoc within the GuiGetMsg() switch/case statement.
      I have been able to reproduce this  (see example)
      #include <GUIConstantsEx.au3> ;============================================================================================================ ; PLEASE, do not save this example in the example folder: C:\Program Files (x86)\AutoIt3\Examples\Helpfile ;============================================================================================================ Example() Func Example() GUICreate(" My GUI Icons", 250, 250) $Icon1 = GUICtrlCreateIcon("shell32.dll", 10, 20, 20) $Icon2 = GUICtrlCreateIcon(@ScriptDir & '\Extras\horse.ani', -1, 20, 40, 32, 32) $Icon3 = GUICtrlCreateIcon("shell32.dll", 7, 20, 75, 32, 32) GUISetState(@SW_SHOW) ;$Icon2 = -1 ; ==> When this line is uncommented the script "works", so -1 could be a potential fix. ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Icon2 Beep (500,500) EndSwitch WEnd GUIDelete() EndFunc ;==>Example If you save the above script outside the Autoit example folder and run it, it will keep beeping because GuiCtrlCreatIcon did not find horse.ani and return $Icon2=0.
      At the moment GUICtrlCreateIcon () only returns the conntrolID on success and 0 on failure.
      I would like to propose a return of -1 on failure, so a existing and working script won't go awry when the icon can not be found.
       
    • By abberration
      Software Installer
      version 1.2 - Jan 2, 2021
      Hello, everyone!
      Today, I present to you a new version of Software Installer. This script is designed to be used on CDs/DVDs/USB drives where you put software in a folder (called Software) and you can select multiple software and it will automate installing your selected software one after another with little to no interaction. To do this, you simply need to configure each software with a silent switch (most software have one or more). You can put your software in categories to organize them on the main GUI.
      Screenshot:

      The major new things concerning this project:
      Added a Detect button, where the software tries to detect what kind of installer is used, saving you from having to find out on your own. It's not perfect, but it detects many common installer types. Added a Installers.db file for installers that were not created by the most common methods (Inno Setup, NSIS, etc). I will continue to add to this file. If you have any that you find that you would like to contribute, please PM. I would very much appreciate your help. This version searches for all subfolders now and shows .exe and .msi files that you may not want to see on the main screen. Therefore, I have added the option to "Hide This Item On Main GUI". Added the ability to install up to 2 software before and up to 2 software or registry entries after installing your selected software. This will allow you to install things like service packs, DotNet, etc. (prerequisites). And it will allow you to apply your licensing information through registry entries or patches/updates. If you want the full package (source code, compiled .exe (both 32/64 bit), changelog, installers.db, icon, etc.), you can download it here:
      https://www.filefactory.com/file/2o2enxmm73qo/Software_Installer_v.1.2.zip
      I have a lifetime account at FileFactory, so the link should never die and you do NOT need an account or pay them money to download. Simply choose the free/slow download option. The file is small and will still download fairly quickly. If you have trouble downloading it, PM me. I have the previous versions of this script, but they are inferior to this version, so if you want the older versions, PM me and I will provide them.
      If you just want the bare minimum, the script, installers.db and changelog are attached on this forum below.
      Enjoy!
      Software Installer.au3 Installers.db Changelog.pdf
    • By kellariluukku
      Hey.
      Is there anything that does the same thing as this?
       
      Namely I'm talking about detecting when something has changed on screen.
      The FastFind library is crashing without any errors after running:
      FFSnapShot($left, $top, $right, $bottom, 0) FFSnapShot($left, $top, $right, $bottom, 1) $diff = FFLocalizeChanges(0, 1) And then trying to overwritite the old snapshot (0 or 1).
      If I use always different snapshot numbers its using too much memory and will eventually crash my pc.
      I tried downloading older versions but they're not working and the author is inactive.
       
      It takes 2 snapshots and compares them returning the area that has changed very quickly (left, top, right ,bottom).
      Can anyone help me do this?
      Looping PixelGetColor would require a bunch of extra code to my purpose and its not as efficient...
       
      Thanks
       
       
    • By coronatuss
      Hello everyone,
      Im developing an script to check the size of all .jpg stored in windows folder.
      The problem is that it doesn´t work properly with rotated images. 
      With _GDIPlus_ImageGetWidth() and _GDIPlus_ImageGetHeight()  I get the Width and Height of images as if they had not been rotated, and I need to know how they are rotated (orientation and grades).
      Any help is welcome! If more info is needed, please tell. 😁
    • By nacerbaaziz
      good morning autoit team
      please i need your help
      am trying to make an program that work with hotkeys
      it function is to change the volume to the current application
      e.g when i select the vlc window by using this hotkey i will be able to change the vlc volume with out changing the system volume.
       am able to get the process handle and the process name of the window
      but when am trying to get or set the volume i does not succeded
      i tried to search in this forums but no result.
      can you please guide me to do that.
      am waiting for your answers
      thanks in advanced
×
×
  • Create New...