Dialog Designer

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
nadda
Newbie
Posts: 7
Joined: Fri Oct 29, 2004 3:15 am

Dialog Designer

Post by nadda » Fri Oct 29, 2004 6:30 pm

Hey, I having problems quite understanding the dialog designer...First is there any kind of instructions on where to start when making a dialog window?

I wanted to know if there is any way to have speed options in the dialog? Like a scroll down bar, (i seen that in the designer but im not sure how to use it) so they coud select "Fast as can be" ".05 wait between each click" ".1 wait between each click" ect. ect. So the option they would select would take them to a different label in the script. Just let me know if thats possible and if it is could you either tell me how in the dialog designer or post a example script.

I also wanted to know how i could program it in the auto to recongize different window screen sizes. So say I make a program for a game and the game opens in two different sizes randomly, how could i get it to recongize each different window size and continue off from that sizes Label so the mousemovements still work crrectly.

Thanks for the help, much appreciated :)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 29, 2004 9:56 pm

No time for examples now, but quick answers for you:
First is there any kind of instructions on where to start when making a dialog window?
Check the help under Dialog
speed options in the dialog?
Not sure of meaning, but you can have a combo box that user can choose from. Funciton of combo box would be to get variables needed for speed in other parts of script.

So the option they would select would take them to a different label in the script
Yes, based on results of combo box, control can be directed to any other label in the script.
how i could program it in the auto to recongize different window screen sizes.
Use GetActiveWindow>window_title,X,Y[,Width,Height] to provide the values of the windows on the screen. SetFocus, GetActiveWindow. Can then do calculations based on x,y and width,height.
so the mousemovements still work crrectly.
Consider using MouseMoveRel> commands. Or Maximize Window (WindowAction>1) first, or use Keys for navigation vs. mouse movements if possible.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

nadda
Newbie
Posts: 7
Joined: Fri Oct 29, 2004 3:15 am

Post by nadda » Mon Nov 01, 2004 5:16 pm

speed options in the dialog?
Not sure of meaning, but you can have a combo box that user can choose from. Funciton of combo box would be to get variables needed for speed in other parts of script.

So the option they would select would take them to a different label in the script
Yes, based on results of combo box, control can be directed to any other label in the script.
Yeah, what im trying to do is have a combobox (i guess) with different speeds in which the script will run. I wanted to have two different speeds, just the regular speed Macro Scheduler goes on its own and a slower speed for people with slower computers so the script could still run for them without it skipping on them..

I'm just not exactly sure on how to add two different options in the combobox. I read the help file for dialog but that didnt help me too much. I think they need more/better examples in the help file.

Thanks Bob keep up the good work!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Nov 01, 2004 5:46 pm

You can set a variable for the Wait command. Insert WAIT> commands through the script to control the speed

\\From the combo box, choices are Normal, Slower, Slowest in %Combo%

Let>Delay=0
If %Combo%=Normal,Start
If %Combo%=Slower,Slower

Label>Slowest
Let>Delay=%Delay%+5
Goto>Start

Label>Slower
Let>Delay=%Delay%+2

Label>Start
Wait>%Delay%

DoStuff......
Wait>%Delay%

Do More Stuff......
Wait>%Delay%
.....
.....
.....
Label>End
Suggest using Input> vs. making a Dialog if that is the only value you need. Input can default to Normal or any other value if you want.. Would need to put checks in with Input to loop back and ask again if any invalid value is entered.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

nadda
Newbie
Posts: 7
Joined: Fri Oct 29, 2004 3:15 am

Post by nadda » Tue Nov 02, 2004 3:46 am

Wow Bob it took me a minute to look at the code to see what you were saying but if you are saying what i think you are and i can do it like that than you are the man!!!! seriously that is off the hook. I couldnt thank you enough.

But im still just curious on this...
\\From the combo box, choices are Normal, Slower, Slowest in %Combo%
How do you add that to the dialog script so people could choose between those 3 on the combo box?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Nov 02, 2004 5:20 am

If you use a Dialog as defined by Macro Scheduler, then see the Help section for using Combo Boxes.

If you use Input>, then you can list the acceptable values in the Prompt, and check values are valid like this:
Label>Begin
Input>Combo,Please enter Normal or Slower or Slowest in this box,Normal
If>%Combo%=Normal,Start
If>%Combo%=Slower,Slower
If>%Combo%=Slowest,Slowest
MessageModal>Your entry was not valid
Goto>Begin
Put this code at the beginning of the earlier script sample I provided..
You can change the values in the script to make slower/faster. You could also use Input to have a value put in directly as a number to add to Delay vs. having it hard coded. This would give you the most flexibility to have the speed user defined. Could also use fractions vs. hardcoded integers. That is probably the route I would take, having the user enter a number from 0 to some max and adding that value to Delay at the beginning.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

nadda
Newbie
Posts: 7
Joined: Fri Oct 29, 2004 3:15 am

Post by nadda » Tue Nov 02, 2004 7:22 am

Bob Hansen wrote:If you use a Dialog as defined by Macro Scheduler, then see the Help section for using Combo Boxes.
Ok, thanks for showing me the input> possibility if all else fails i can just use that but I would rather use the combo box on the dialog. Other than the html help file I have not seen any other help for combo boxes, could you please show me where the help section for combo boxes are?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Nov 02, 2004 7:53 am

There is a whole section on dialogs in the help file in the "Command Reference" section and then, remarkably, "Dialogs".
MJT Net Support
[email protected]

nadda
Newbie
Posts: 7
Joined: Fri Oct 29, 2004 3:15 am

Post by nadda » Tue Nov 02, 2004 10:16 am

Other than the html help file I have not seen any other help for combo boxes, could you please show me where the help section for combo boxes are?
:roll: Seeing as how I read that help file and still do not understand I feel whoever created it failed to explain or show examples enough. So I was wondering if there happened to be any other "tutorial" type files for creating Combo Boxes.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Nov 02, 2004 11:04 am

There are three dialog examples in the help file.

Have you checked out the samples? There are two dialog examples which come with the product and several here on these forums. Try searching for "dialog".

The dialog designer creates the code for the dialog for you. Open the editor, click on dialog designer and create the dialog. Close, save and PASTE to the editor and the dialog code is pasted in.

If you don't have the new calculator sample you can get it here:
http://www.mjtnet.com/forum/viewtopic.php?t=1159
MJT Net Support
[email protected]

nadda
Newbie
Posts: 7
Joined: Fri Oct 29, 2004 3:15 am

Post by nadda » Mon Nov 08, 2004 2:55 am

how i could program it in the auto to recongize different window screen sizes.

Use GetActiveWindow>window_title,X,Y[,Width,Height] to provide the values of the windows on the screen. SetFocus, GetActiveWindow. Can then do calculations based on x,y and width,height.
Ok Bob, I have the width and height values now all i need to figure out is how to get them to work in the script.

The bigger window is ~ Width = 790 Height = 590
The smaller window is ~ Width = 790 Height = 470

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Nov 08, 2004 5:22 am

Have no idea of what you want to do with Window sizes.

I have provided you with the commands earlier to get the sizes.

Suggest you make a flow chart of what you are trying to do. Then write your Macro Scheduler script using the Help and sample scripts, Then debug as necessary, using the logs and Single Stepping with the Watch List. If still having troubles a that point, then submit your script here where any bnumber of users will be willing and able to help you.

But you will find that the best help available is for those who make an effort to learn the program and do their own scripts. Many of us end users, like yourself, have limited time to help, and our time is best used by looking at exceptions vs. doing free work for others who will not put in their own effort.

Looking forward to see your work efforts.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts