Jump to content

Scripts stops when clicking any button


Recommended Posts

Hey guys.

So recently I wanted to update my old script to a newer version. I've been running it with a gui and never had any issues with it.

However with this new code I cant seem to understand why the script is just closing whenever I click a button. I basically just needs it to run the openmla function on $button1.

 

The openmla function worked before adding the gui, but I cant figure out where I am missing the error. Need a pair of fresh eyes on it! :)

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ImageSearch.au3>
#Include <File.au3>
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>

#Region ### START Koda GUI section ### Form=
Global $Form1_1 = GUICreate("Form1", 609, 416, 199, 108)
Global $Pic1 = GUICtrlCreatePic("C:\Users\allan\Desktop\Autoit\FaceCom\background.bmp", 0, -17, 625, 432)
GUICtrlSetState($Pic1, $GUI_DISABLE)
Global $url1 = GUICtrlCreateInput("url1", 40, 76, 121, 21)
Global $url2 = GUICtrlCreateInput("url2", 40, 108, 121, 21)
Global $url3 = GUICtrlCreateInput("url3", 40, 140, 121, 21)
Global $url4 = GUICtrlCreateInput("url4", 40, 172, 121, 21)
Global $Radio1 = GUICtrlCreateRadio("", 184, 76, 17, 17)
Global $Radio2 = GUICtrlCreateRadio("", 184, 108, 17, 17)
Global $Radio3 = GUICtrlCreateRadio("", 184, 140, 17, 17)
Global $Radio4 = GUICtrlCreateRadio("", 184, 172, 17, 17)
Global $cmt1 = GUICtrlCreateRadio("", 344, 295, 17, 17)
Global $cmt2 = GUICtrlCreateRadio("", 344, 263, 17, 17)
Global $cmt3 = GUICtrlCreateRadio("", 344, 231, 17, 17)
Global $cmt4 = GUICtrlCreateRadio("", 456, 295, 17, 17)
Global $cmt5 = GUICtrlCreateRadio("", 456, 263, 17, 17)
Global $cmt6 = GUICtrlCreateRadio("", 456, 231, 17, 17)
Global $Numbercmt = GUICtrlCreateInput("Comments", 136, 248, 121, 21)
Global $Input6 = GUICtrlCreateInput("Likes/Hearts", 136, 280, 121, 21)
Global $Button1 = GUICtrlCreateButton("", 15, 335, 115, 49, $BS_BITMAP)
GUICtrlSetImage(-1, "C:\Users\allan\Desktop\Autoit\FaceCom\start.bmp", -1)
Global $Button2 = GUICtrlCreateButton("", 151, 335, 115, 49, $BS_BITMAP)
GUICtrlSetImage(-1, "C:\Users\allan\Desktop\Autoit\FaceCom\stop.bmp", -1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $Button1
            Global $i = GUICtrlRead($Numbercmt)+1
            Global $Likes = GUICtrlRead($Input6)
            openmla()
            
        Case $Button2
            Terminate()

    EndSwitch
WEnd


HotKeySet("{Esc}", "Terminate")
HotKeySet("{F1}", "openmla")
HotKeySet("{F2}", "comment")
HotKeySet("{F3}", "reaction")
HotKeySet("{F4}", "openurls")

#Region Variables

Global $a = @DesktopWidth / 2
Global $b = 10
Global $x = 1
Global $y = 1
Global $i = 10
Global $cmt = 0
Global $MLA = 285
Global $Likes = 10
Global $Likecount = 0
Global $cmtfile = "test.txt"
#EndRegion


Func openmla()
    While $i > $cmt
    WinActivate("Multilogin - 4.5.3 Fire")
    ToolTip("waiting", $a, $b, "Finding MLA session", 1, 1)
    Sleep(10)
   mouseclick("left",1812, $MLA ,1,10) ; Open MLA profile
   Sleep(1000)
   $MLA=$MLA+40
   ToolTip("", $a, $b, "Profile loading", 1, 1)
   sleep(1000)
   ExitLoop
    Wend
EndFunc

 

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