Sign in to follow this  
Followers 0
hoocrax

GUICtrlCreateInput entered value executed in script ?

8 posts in this topic

#1 ·  Posted (edited)

Hello all !,

So im up with this small script that makes a few clicks .. till now this was based on only 2 resolutions and created problems for many others who things like extra toolbars in their browsers etc. So I came up with this idea in which i would let the user enter the pixel coordinates himself/herself so the script runs perfectly according to their resolution.. So i set up few GUICtrlCreateInput boxes to enter the coordinates.

Now , In the same thing i have the script that moves mouse with fixed time intervals and Mouseclick to certain pixels and in the preivous version i set in the values and it dint actually work out for the others..

So what i want to do is i want something like ( MouseClick("left", 799,475) this is set by me but i want it in such a way that instead of 799,475 , it clicks on the location based on the values entered by the user.

IMAGE: Posted Image

So i even made the GUI and inserted the main script ( with fixed x/y mouse coord on clicks , but actually need the script to use the ones entered in the GUICtrlCreateInput box.. ) and is it possible that the same can be done for send("") and If SleepCheck(14580000) Then ExitLoop ? (instead of 145800 the user can enter his own value ).

CODE :

#include <GUIConstantsEx.au3>

   GUICreate("slb", 500, 700)
   GUICtrlCreateLabel("SLB-SkyLab Bot v 1.1", 20, 10)
   GUICtrlCreateLabel("Skylab button coord", 8, 40)
   $coord1 = GUICtrlCreateInput("", 200, 40, 100)
   GUICtrlCreateLabel("Transport module coord", 8, 70)
   $coord2 = GUICtrlCreateInput("", 200, 70, 100)
    GUICtrlCreateLabel("Promerium/Resource text box coord", 8, 100)
   $coord3 = GUICtrlCreateInput("", 200, 100, 100)
    GUICtrlCreateLabel("Send button coord", 8, 130)
   $coord4 = GUICtrlCreateInput("", 200, 130, 100)
    GUICtrlCreateLabel("Sent/Recieved notification OK cord", 8, 160)
   $coord5 = GUICtrlCreateInput("", 200, 160, 100)
   GUICtrlCreateLabel("Enter Values below only if u dont have bot running that sells cargo ", 8, 190)
    GUICtrlCreateLabel("Start Client coord", 8, 220)
   $coord6 = GUICtrlCreateInput("", 200, 220, 100)
    GUICtrlCreateLabel("Start Game coord", 8, 250)
   $coord7 = GUICtrlCreateInput("", 200, 250, 100)
    GUICtrlCreateLabel("Sell raw material button coord", 8, 280)
   $coord8 = GUICtrlCreateInput("", 200, 280, 100)
    GUICtrlCreateLabel("SELL button for promerium/resource", 8, 310)
   $coord9 = GUICtrlCreateInput("", 200, 310, 100)
   GUICtrlCreateLabel("SELL button for promerium/resource", 8, 310)
    GUICtrlCreateLabel("MUST ENTER VALUES !!!", 8, 340)
   $coord10 = GUICtrlCreateInput("", 200, 370, 100)
    GUICtrlCreateLabel("Enter promerium/resource amount", 8, 370)
    $coord11 = GUICtrlCreateInput("", 200, 400, 100)
    GUICtrlCreateLabel("Enter time taken for reource to be transfered", 8, 400)
    GUICtrlCreateLabel("Formula : resource/1000 * 60 + 3 * 60000 (for premium)", 8, 420)
    GUICtrlCreateLabel("Formula : resource/1000 * 120 + 3 * 60000 (for non premium)", 8, 440)
    GUICtrlCreateLabel("Example : For premium mebmber, 4000 promerium it is 4000/1000 * 60  3 * 60000 = 14580000", 8, 460)


$startbutton = GUICtrlCreateButton("START", 370, 160, 100)
$stopbutton = GUICtrlCreateButton("STOP", 370, 190, 100)
$exitbutton = GUICtrlCreateButton("EXIT", 370, 220, 100)

GUISetState(@SW_SHOW)

While 1

    $msg = GUIGetMsg()

    Select
        Case $msg = $startbutton
            While 1
                If SleepCheck(1000) Then ExitLoop;exits loop if a stop code was returned from SleepCheck Function
                WinSetState("[TITLE:www.DarkOrbit.com]", "", @SW_MAXIMIZE)  
                sleep(300)
                MouseClick("left", 799,475)
                sleep(500)
                MouseClick("left", 816,191) 
                sleep(3000)
                MouseClick("left", 401, 637)
                MouseClick("left", 442, 641)
                Send("4000")
                MouseClick("left", 546, 649)
                sleep(4500)
                MouseClick("left", 801,476)
                sleep(1000)
                MouseClick("left", 1028,269)
                sleep(4000)
                MouseClick("left", 792,698)
                sleep(5000)
                MouseClick("left", 1359,100)
                sleep(1500)
                MouseClick("left", 1001,399)
                MouseClick("left", 1001,399)
                sLeep(2000)
                Send("!{F4}")
                If SleepCheck(14580000) Then ExitLoop
            WEnd
        Case $msg = $GUI_EVENT_CLOSE
            GUIDelete()
            ExitLoop
    EndSelect
WEnd

Func SleepCheck($sleeptime)
    $timerInit = TimerInit();grabs your a starting point for your timer
    Do
        $msg = GUIGetMsg();polls to see if the stop button has been pressed
        If $msg = $stopbutton Then Return(1);If stopbutton has been pressed will return 1 for a stop code
        Sleep(10); a very small sleep function to reduce CPU overload...increase if it is still taking up to much CPU
    Until TimerDiff($timerInit) >= $sleeptime;checks to see if the sleep time has elapsed from your initial point
    Return(0)
EndFunc
Edited by hoocrax

Share this post


Link to post
Share on other sites



One of the requirements to post in this forum is passing the Reading and Comprehension Skills test.

Click here to take the test


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

One of the requirements to post in this forum is passing the Reading and Comprehension Skills test.

Click here to take the test

And what exactly have I violated???

Share this post


Link to post
Share on other sites

hoocrax,

And what exactly have I violated???

How about the very first thing mentioned! ;)

- Do not discuss any of the following:
    - Automating games...

Now tell me your script does not do that. :huh2:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I'm sorry but it seems that you have failed the Comprehension portion of the test.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

George,

Not sure about the Reading part either! :huh2:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

oh.. Ok i understood what i violated..

So can you atleast help me on how to

like ( MouseClick("left", 799,475) this is set by me but i want it in such a way that instead of 799,475 , it clicks on the location based on the values entered.

Dont temme in regard to this , atleast help me on how to put something like a reference ??

Share this post


Link to post
Share on other sites

I've warned you already on this topic and issue.

You've disregarded.

Thread locked.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0