K3STROS

Help, Acting up

2 posts in this topic

Not too sure what i havent done properly at this point i have been going over it for a while. I'm also new to this. I want when i click a button on the "Settings" GUI ex. The first button, i want it to open a MsgBox(0), which it already does but then it does not give me any time to click a location to record my XY coordinates into the variable.

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

HotKeySet('{ESC}', "Terminate")

Global $Point = MouseGetPos()
Global $xyTEL1
Global $xyBOOTEL2
Global $xyITM
Global $xyEMPINV
Global $xyCLOBAN
Global $xyBox1
Global $xyBox2
Global $xyBox5


#Region ### START Koda GUI section ###

$Start_Exit_GUI = GUICreate("----", 228, 194, 398, 222) ; Opens GUI with start/exit buttons
GUISetBkColor(0x0000FF)

$Start_Botton = GUICtrlCreateButton("START", 0, 0, 227, 89, $WS_GROUP) ; Start button
GUICtrlSetFont(-1, 28, 400, 0, "Absolute Zero")
GUICtrlSetColor(-1, 0xFF00FF)
GUICtrlSetBkColor(-1, 0x00FF00)

$Exit_Button = GUICtrlCreateButton("EXIT", 0, 96, 227, 97, $WS_GROUP) ; Exit butto
GUICtrlSetFont(-1, 28, 400, 0, "Absolute Zero")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0xFF0000)

$ExitLabel = GUICtrlCreateLabel("ESC", 100, 160, 26, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0xFF0000)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Start_Botton ; What happens when Start button is clicked
            Settings()

        Case $Exit_Button ; What happens when Exit or F2 button is clicked/pressed
            Terminate()

    EndSwitch
WEnd


Func Settings()

$Settings = GUICreate("SETTINGS", 436, 315, 271, 221)
GUISetBkColor(0x0000FF)
$Settings_Label1 = GUICtrlCreateLabel("Since this is Beta0.1 Things have to be set manually.", 0, 0, 429, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF00FF)
$Setting_Label2 = GUICtrlCreateLabel("Simply follow the prompts", 106, 32, 216, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF00FF)
$Settings_BUTBAN = GUICtrlCreateButton("----", 160, 104, 121, 33, $WS_GROUP)
$Settings_BUTITE = GUICtrlCreateButton("----", 160, 144, 121, 33, $WS_GROUP)
$Settings_BUTEMP = GUICtrlCreateButton("----", 160, 184, 121, 33, $WS_GROUP)
$Setting_BUTINVTAB = GUICtrlCreateButton("----", 160, 64, 121, 33, $WS_GROUP)
$Settings_BUTX = GUICtrlCreateButton("----", 160, 224, 121, 33, $WS_GROUP)
$Setting_Button_Start = GUICtrlCreateButton("----", 184, 288, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Settings_BUTBAN
            T1_Button()

        Case $Settings_BUTITE
            ITELOC_Button()

        Case $Settings_BUTEMP
            EMPINV_Button()

        Case $Setting_BUTINVTAB
            SelectInvBoxes()

        Case $Settings_BUTX
            CLOINV_Button()

;       Case $Setting_Button_Start ;;NO CODE
;           Start()   

    EndSwitch
WEnd


EndFunc

Func Terminate()
    Exit 1
EndFunc

Func Start()
    While 1

    Call(BankTeller())
        Sleep (Random (90,200,1))

    Call(EmptyInventory())
        Sleep (Random (90,200,1))

    Call(TakeAskesBones())
        Sleep (Random (90,200,1))

    Call(CloseInventory())
        Sleep (Random (90,200,1))

    Call(SpreadBury())
         Sleep (Random (90,200,1))

    WEnd

EndFunc


Func T1_Button()

    MsgBox(0, "----", "----")

    $xyTEL1 = MouseGetPos()

    MsgBox(0, "----","----")

    Call(T2)

EndFunc

Func T2()

    MsgBox(0, "----" "----")

    $xyBOOTEL2 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc

Func ITELOC_Button()

    MsgBox(0, "----" "----")

    $xyITM = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc


Func EMPINV_Button()

    MsgBox(0, "----", "----")

    $xyEMPINV = MouseGetPos()

    MsgBox(0, "----","----")

EndFunc


Func CLOINV_Button()

    MsgBox(0, "----", "----")

    $xyCLOBAN = MouseGetPos() ; Sets the position for the X  to close your bank

    MsgBox(0, "----", "----")

EndFunc


Func SELINVBOX_Button()

    MsgBox(16, "----", "----")

    Call(INVBOX1_POS())

    Call(INVBOX2_POS())

    Call(INVBOX3_POS())

EndFunc


Func INVBOX1_POS()

    MsgBox(0, "----", "----")

    $xyBox1 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc


Func INVBOX2_POS()

    MsgBox(0, "----", "----")

    $xyBox2 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc


Func INVBOX3_POS()

    MsgBox(0, "----", "----")

    $xyBox5 = MouseGetPos()

    MsgBox(0, "----", "----")

EndFunc

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It is hard to help address your "specific" symptom when the code that you posted is not runnable...

edit: If you are trying to automate a Web page or app then there may be better alternatives than mouseclick...

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
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

  • Similar Content

    • DagSa
      By DagSa
      Try to find a solution for help files to my autoit executable.
      Its installed from simple XP-POS cash computers to desktop with windows 7, 8, 10.
      The compiled AutoIt program itself work everywhere, but the help file??
      I need a help file called from from the program and I don't really know what working best in all OS platforms.
      1. A wordfile is helpful enough, but word is not installed everywhere.
      2. RTF is very big files with pictures.
      3. I could save it as pdf, but not all have it either.
      4. Tried  .MHT file, but downside is browser could cover hole screen if browser closed this way. I have not found any way to resize it to specific size when open up.
      5. Use of IE.au3 lib. Well it could open mht files ,but always got question about use it as default browser or not. Think this also make IE browser lose control so I could not resize.
      6. Look at making a  .CHM file, but I don't think its the future do use that format. (.hlp is no no and old)

      Any tips of do it in autoit or make a call to open up in some nice format working everywhere.
       
    • au3leecher
      By au3leecher
      Hellow everybody,
      I tryed to manipulate a game called "Assault Cube" which is a easy beginning in coding. I run the code but the wished value doesn't change, i don't understand why.
      The Pointers are fine, I checked that the pointers don't change every time while restart the game.
      My Code:
      <snip>
      _____________________________________________________________________________________________________________________________________________________________________________________________
      Checklist:
      The Offsets are 18C & 4
      In Cheat Engine: ("ac_client.exe"+0010F418) <- Pointer
      4 Bytes = 'dword'
       
    • geekyworld
      By geekyworld
      Hi. I want to read the help file on my Kindle ebook reader (to protect my eyes). Is it available in Kindle or epub format? I tried converting it myself but the results were not very good.
      --Thanks!
    • JustinZandee
      By JustinZandee
      I need a random string generator which creates 15 letters/numbers.
      How can I make that?
    • StudioMaker
      By StudioMaker
      Hey anyone knows how i can have a inputbox that is connected to an HotKeySet? Like if u put in like "a" in the inputbox it sets the hotkey to "a"?