Sign in to follow this  
Followers 0
alinashul

Need help with the menu

2 posts in this topic

#1 ·  Posted (edited)

ok hello to all ... i have a big problem ... with the menu ... ok i got the main menu ... and i cant press the buttons .. here is the code ... need help :

#include <Guiconstants.au3>
$gui = GUICreate ("Quantum's lossbot",500,400)
$background = GUICtrlCreatePic ("quantum's lossbot.jpg",0,0,500,400)
GUISetState (@SW_SHOW)
$Button_1 = GUICtrlCreateButton  ("Delay",120,50,100)
$Button_2 = GUICtrlCreateButton ("Game mode select",250,50,100)
$Button_3 = GUICtrlCreateButton ("D3scene.com navigator",170,100,120)
GUISetState ()
While 1
    $msg = GUIGetMsg ()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg =  $Button_1
;here goes the delay 
        Case $msg = $Button_2
;here goes the $Button_2 game mode select
        Case $msg = $Button_3

in this i have 2 big problems : in $Button_1 ... when i press it ... i need to a apear something like a input box .... or in his right side how do i put a rectangular blanck where u can imput text/a number (something like u can see here on this forum , when u press New Topic and after apears the TOPIC TITLE and u can tipe the topic name in the blank space,or in TOPIC Description)?and what u write here (when u press the button in inputbox or something / or in a blanck space ) need to go here in the Sleep ($delay) :

While 1
    If $stop = 1 Then
        If WinActivate ( "Warcraft III" ) Then
            $coord = PixelSearch(0,90,63,145,1579032);checks to see if in chat channel
            If Not @error Then
                Send ($search)
            EndIf
            $coord = PixelSearch(370,0,427,20,7575205); checks if ingame
            If Not @error Then
                Sleep [color="#9ACD32"]($delay)[/color];put's the dalay that u set
                Send ($leavemenu); send's the hotkey's that u set
                Sleep (4000)
                Send ($leavegame); send's the keystrokes that u set
                Sleep (3100)
                Send ("{enter}"); send enter to leave the score table
            EndIf
        EndIf
    EndIf
WEnd

how do i do it ?

2nd . my secound problem is with the $Button_3 when i press it ... i wanna to open this script code :

#include <GUIConstants.au3>

$oIE = ObjCreate("Shell.Explorer.2")

GUICreate ( "D3scene.com", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2, BitOr($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$GUIActiveX         = GUICtrlCreateObj      ( $oIE,      10, 40 , 600 , 500 )
$GUI_Button_Home    = GuiCtrlCreateButton   ("Home",    230, 540, 100,  30)
$GUI_Button_Stop    = GuiCtrlCreateButton   ("Stop",    330, 540, 100,  30)

GUISetState ()  ;Show GUI

$oIE.navigate("http://www.d3scene.com/forum")

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $GUI_Button_Home
            $oIE.navigate("http://www.d3scene.com/forum")
        Case $msg = $GUI_Button_Stop
            $oIE.Stop
    EndSelect
    
Wend

GUIDelete ()

Exit

how do i do it ? this must be connected to the $Button_3 in the main menu ...

So i thought that this could go like this : this is the code of the menu ... and of the explorer (the explorer )

#include <Guiconstants.au3>
$gui = GUICreate ("Quantum's lossbot",500,400)
$background = GUICtrlCreatePic ("quantum's lossbot.jpg",0,0,500,400)
GUISetState (@SW_SHOW)
$Button_1 = GUICtrlCreateButton  ("Delay",120,50,100)
$Button_2 = GUICtrlCreateButton ("Game mode select",250,50,100)
$Button_3 = GUICtrlCreateButton ("D3scene.com navigator",170,100,120)
GUISetState ()
While 1
    $msg = GUIGetMsg ()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg =  $Button_1
;here goes th delay 
        Case $msg = $Button_2
;here goes the $Button_2 game mode select
        Case $msg = $Button_3
            #include <GUIConstants.au3>; explorerul

            $oIE = ObjCreate("Shell.Explorer.2")

            GUICreate ( "D3scene.com", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2, BitOr($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
            $GUIActiveX         = GUICtrlCreateObj      ( $oIE,      10, 40 , 600 , 500 )
            $GUI_Button_Home    = GuiCtrlCreateButton   ("Home",    230, 540, 100,  30)
            $GUI_Button_Stop    = GuiCtrlCreateButton   ("Stop",    330, 540, 100,  30)

            GUISetState ()  ;GUI

            $oIE.navigate("http://www.d3scene.com/forum")

         ; Waiting for user to close the window
            While 1
                $msg = GUIGetMsg()
    
                Select
                    Case $msg = $GUI_EVENT_CLOSE
                        ExitLoop
                    Case $msg = $GUI_Button_Home
                        $oIE.navigate("http://www.d3scene.com/forum")
                    Case $msg = $GUI_Button_Stop
                        $oIE.Stop
                EndSelect
            Wend
            GUIDelete ()
            Exit
    EndSelect
WEnd
do
    $msg = GUIGetMsg()
    
until $msg = $GUI_EVENT_CLOSE

what did i do wrong ? plz help me thx

Edited by alinashul

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello!

1-st problem, try this:

#include <Guiconstants.au3>

$gui = GUICreate ("Quantum's lossbot",500,400)

$background = GUICtrlCreatePic ("d:\wallpaper\Game\0027.bmp",0,0,500,400)
GUICtrlSetState(-1, $GUI_DISABLE)

$input = GUICtrlCreateInput("", 120, 30, 100, 17, BitOR($ES_AUTOHSCROLL, $ES_CENTER))
GUICtrlSetState(-1, $GUI_HIDE)

$Button_1 = GUICtrlCreateButton  ("Delay",120,50,100)
$Button_2 = GUICtrlCreateButton ("Game mode select",250,50,100)
$Button_3 = GUICtrlCreateButton ("D3scene.com navigator",170,100,120)

GUISetState ()

While 1
    $msg = GUIGetMsg ()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg =  $Button_1
            If BitAND(GUICtrlGetState($input), $GUI_HIDE) Then
                GUICtrlSetState($input, $GUI_SHOW)
            Else
                If GUICtrlRead($input) <> '' Then
                    GUICtrlSetData($input, '')
                    Delay()
                EndIf
                GUICtrlSetState($input, $GUI_HIDE)
            EndIf
            
;here goes the delay 
        Case $msg = $Button_2
;here goes the $Button_2 game mode select
        Case $msg = $Button_3
        EndSelect
    WEnd
    
Func Delay()
    ConsoleWrite("@@ (6) : DELAYED")
EndFunc

From help:

If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control : GuiCtrlSetState(-1,$GUI_DISABLE).

Edited by rasim

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