Sign in to follow this  
Followers 0
snoopy

Msg box.

10 posts in this topic

ok.. i have the Window ive been working on....

So i am trieng to do, if i press The Credits, Than msgbox will apear with ok in it as the only option and text writen..

and do that if i press on Radio 1 , than it will do asertain click with mouse and Radio 2 , different mouse click but only after Start.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Snoopy\Desktop\Form1.kxf

$Form1 = GUICreate("Form1", 625, 444, 189, 146)

$Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0)

GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")

GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$Exit = GUICtrlCreateButton("Exit", 0, 72, 153, 65, 0)

GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")

GUICtrlSetBkColor(-1, 0xFFFFFF)

GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0)

GUICtrlSetFont(-1, 15, 800, 0, "MS Serif")

GUICtrlSetBkColor(-1, 0xFFFFE1)

$Radio1 = GUICtrlCreateRadio("Jump", 520, 32, 97, 33)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$Radio2 = GUICtrlCreateRadio("Beg", 520, 64, 81, 33)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$Radio3 = GUICtrlCreateRadio("Dance", 520, 96, 81, 41)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$Radio4 = GUICtrlCreateRadio("Rollover", 520, 144, 89, 41)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$Radio5 = GUICtrlCreateRadio("Speak", 520, 192, 81, 41)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$Date1 = GUICtrlCreateDate("2009/01/21 18:17:11", 160, 0, 257, 25)

$Slider1 = GUICtrlCreateSlider(160, 24, 262, 37)

GUISetState(@SW_SHOW)

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

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Radio1

EndSwitch

WEnd

so what am i suppose to do next?

Share this post


Link to post
Share on other sites



@snoopy

so what am i suppose to do next?

Learning autoit and search on forum :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

ok.. i have the Window ive been working on....

So i am trieng to do, if i press The Credits, Than msgbox will apear with ok in it as the only option and text writen..

and do that if i press on Radio 1 , than it will do asertain click with mouse and Radio 2 , different mouse click but only after Start.

so what am i suppose to do next?

I don't think you want Case's for the radio buttons. It looks more to me like you want a Case for $MyButton1 and then you will GuiCtrlRead() each radio button to see if it was checked.

If you don't know how to do that, try out the example script in the help file for GuiCtrlCreateRadio().

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I don't think you want Case's for the radio buttons. It looks more to me like you want a Case for $MyButton1 and then you will GuiCtrlRead() each radio button to see if it was checked.

If you don't know how to do that, try out the example script in the help file for GuiCtrlCreateRadio().

:)

tnx for the tip m8:

is that what you mean?

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Snoopy\Desktop\Form1.kxf

$Form1 = GUICreate("Form1", 625, 444, 189, 146)

$Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0)

GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")

GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$Exit = GUICtrlCreateButton("Exit", 0, 72, 153, 65, 0)

GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")

GUICtrlSetBkColor(-1, 0xFFFFFF)

GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0)

GUICtrlSetFont(-1, 15, 800, 0, "MS Serif")

GUICtrlSetBkColor(-1, 0xFFFFE1)

$MyButton2 = GUICtrlCreateButton("Jump", 520, 32, 100, 30, 0)

$MyButton3 = GUICtrlCreateButton("Beg", 520, 72, 100, 30, 0)

$MyButton4 = GUICtrlCreateButton("Say", 520, 112, 100, 30, 0)

$MyButton5 = GUICtrlCreateButton("Roallover", 520, 160, 100, 30, 0)

GUISetState(@SW_SHOW)

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

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Share this post


Link to post
Share on other sites

tnx for the tip m8:

is that what you mean?

The question is what YOU mean.

Do you want radio buttons or just buttons? The change I proposed would be in your loop where you detect the button hit and perform the selected action. Do you want to respond immediately to clicking on each button, or do you want to make one or more selections on radio buttons and not perform the action(s) until you click 'Go'?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I mean :

1.you choose one of the 5 or 4 radio's

2.you click Start

3.it will do mouse clicks.

4.it will do loops until you press F5

I got the script for the mouse clicks, works perfectly.

But have no idia how to make it work under asertain radio...

thats the quistion.

and how do i make the Credits open a msgbox, i know how to make the msg box but noob with Gui... as you sseee...

Share this post


Link to post
Share on other sites

Study this demo for a while:

#include <GUIConstants.au3>

Global $f_Run = False, $f_AnyChecked = False

Global $Form1 = GUICreate("Form1", 625, 444, 189, 146)
Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0)
GUICtrlSetFont(-1, 15, 800, 0, "MS Serif")
GUICtrlSetBkColor(-1, 0xFFFFE1)
Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0)
Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0)
Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0)
Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $Credits
            MsgBox(64, "Credits", "Credits...")
            
        Case $MyButton1
            HotKeySet("{F5}", "_StopIt")
            $f_Run = True
            While $f_Run
                $f_AnyChecked = False
                If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 1", "CheckBox 1 is checked", 1)
                EndIf
                If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 2", "CheckBox 2 is checked", 1)
                EndIf
                If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1)
                EndIf
                If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1)
                EndIf
                If Not $f_AnyChecked Then ExitLoop
            WEnd
            HotKeySet("{F5}")
    EndSwitch
WEnd

Func _StopIt()
    $f_Run = False
EndFunc

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

so where do i put my mouse click scripts?

for each Rad?

Edited by snoopy

Share this post


Link to post
Share on other sites

so where do i put my mouse click scripts?

for each Rad?

Another gamer tries to get the forum to write his Bot for him...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

@PsaltyDS

I knew that at the beginning, thats why i said to him to go away... :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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
Sign in to follow this  
Followers 0