Jump to content

Woring plan


Recommended Posts

I have a working plan in my head but I dont know how to make a script from it.

I have really tried it, but I failed.

This is the plan:

1.)Getting information from a window.

2.)form out actions and commands with the information that the window gave.

3.)Update the GUI to show information and actions that the script did.

And he must do that like 1~10 times a sec.

I know how I must make a GUI with buttons that are connected with actions if you press it.

But I down know how to swith all the actions (but I think that you must do something with: "Func()")

Maby someone can give me tips and hints to make a working script :(

Thanks,

Jeanpierre

Link to comment
Share on other sites

1.)Getting information from a window.

2.)form out actions and commands with the information that the window gave.

3.)Update the GUI to show information and actions that the script did.

This is pretty much the entire purpose of every script in AutoIT :(

Anyway if you're a little more specific what information you're receiving from the window and what actions and commands you need to complete we should be able to help.

Do you want to click buttons? Type out a command line command? Change/manipulate windows?

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Link to comment
Share on other sites

Yes I know how to write the sub-scrips but I dont know how to combine them to one script.

Here is one sub script:

Do
    $stage = PixelSearch(102, 33, 215, 33, 0x1C160B, 10)
Until $stage <> @error

$stage = $stage[0] - 102
$stage = ($stage/113)*100
MsgBox(0, "stage in %", $stage)

This sub-script gives info on what stage you are.

And it must do more things but that isn't relative.

Then it must perform actions like Send("{SPACE}") in the current active window.

Then it must set information like $stage in: $stage2 = GUICtrlCreateInput("", 0, 0, 50, 10).

But I dont know how to put it in a right loop or something.

This I used in a prev. script but that dont work ofcourse :(

;--> De GUI
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $hookButton
            hookButton()
        Case $msg = $unhookButton 
            unhookButton()
        Case $msg = $nuconnectorButton 
            nuconnectorButton()
        Case $msg = $startButton 
            startagButton()
        Case $msg = $updateButton 
            updateButton()
        Case $msg = $selecthookButton 
            selecthookButton()
        Case $msg = $selectnuconnectorButton 
            selectnuconnectorButton()
        Case $msg = $selectagButton 
            selectagButton()
        Case $msg = $exitButton 
            exitButton()
        Case $msg = $startsroButton()
            startsroButton()
        Case $msg = $selectsroButton()
            selectsroButton()
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
Wend
;<-- De GUI
Edited by Jeanpierre92
Link to comment
Share on other sites

Then it must set information like $stage in: $stage2 = GUICtrlCreateInput("", 0, 0, 50, 10).

GuiCtrlSetData() Should work for that however if you just need the user to be able to see that info on the QUI you might want to use. GuictrlcreateLabel.

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Link to comment
Share on other sites

Yes thanks I know how that all works. But I dont know how I must switch between all these windows and functions :(

I have tried to make a simple window like this:

GUICreate("My GUI", 100, 100, 100, 100)
GuiSetState(@SW_SHOW)
$stage2 = GUICtrlCreateInput("", 0, 0, 50, 10)
GUICtrlSetData($stage2, $stage)

But that failed, there didn't came a GUI without the loop :)

So I dont ask for codes or write long scripts for me, but only the working plan, in what kind of way must I script this?

Jeanpierre

Edited by Jeanpierre92
Link to comment
Share on other sites

GUICreate("My GUI", 100, 100, 100, 100)
GuiSetState(@SW_SHOW)
$stage2 = GUICtrlCreateInput("", 0, 0, 50, 10)
GUICtrlSetData($stage2, $stage)

While 1

Sleep (50)

Wend

The GUI only exsist as long as your script runs. When you script runs out of things to "do" it exits and the gui is destroyed. I have added a while loop that will keep your program running indefinitely you will have to eventually change this but it may help you understand.

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

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