Jump to content
Sign in to follow this  
Canasian

GUI buttons not showing up?

Recommended Posts

Canasian

My GUI buttons aren't showing up.. why not? Here is my code.

#include <GuiConstants.au3>

Dim $getmess
Dim $guic, $guib
Dim $Cl = True
Dim $Ex = False

HotKeySet("{F10}","Cl")

$guic = GUICreate("My First GUI", 650,400)
$guib = GuiCtrlCreateButton("Start Bot",485,510,30,20)
$exitb = GuiCtrlCreateButton("Exit",785,510,30,20)
$gamebox = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
$creategb = GUICtrlCreateObj($gamebox, 0,0,650,330)

With $gamebox
    .bgcolor = 0x000000
    .Movie = "http://www.flashninjaclan.com/tutorialpages/shootinggame/shootinggame.swf"
    .Loop = True
    .wmode = "Opaque"
EndWith


Func Cl()
    Exit
EndFunc

    
GUISetState()

Do
    $getmess = GUIGetMsg()
    
    If ($getmess = $guib) Then
        MsgBox(0,"Dun dun dun","Woot, it worked!")
    EndIf
    
Until $Ex Or ($getmess = -3)

Share this post


Link to post
Share on other sites
Valuater

$guic = GUICreate("My First GUI", 650,400)

$guib = GuiCtrlCreateButton("Start Bot",485,510,30,20)

$exitb = GuiCtrlCreateButton("Exit",785,510,30,20)

The buttons are off the gui

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
Canasian

$guic = GUICreate("My First GUI", 650,400)

$guib = GuiCtrlCreateButton("Start Bot",485,510,30,20)

$exitb = GuiCtrlCreateButton("Exit",785,510,30,20)

The buttons are off the gui

8)

Hahaha.. good point.. thanks.. hm.. my bad wasn't thinking.. ok so how do i find out where i want to put my buttons? I used the autoit window info to find the mouse position.. but i guess mouse position on the GUI says 510 has nothing to do with the GUI button positions huh..

Does the mouse position have to do with the coordinates of your whole desktop or whatever? but what if you want to just find the mouse position in a game or a GUI? do you have to use WinMove at 0,0 or something just to test?

Edited by Canasian

Share this post


Link to post
Share on other sites
Canasian

I got them there by Winmoving it to 0,0 then i used trial and error to get it how i want it to look lol so i got this.

$guic = GUICreate("Simple Click Bot", 650,400)
$guib = GuiCtrlCreateButton("Start Bot",125,335,120,60)
$exitb = GuiCtrlCreateButton("Exit",425,335,120,60)

I don't want to use Koda.. but how do u find where you want your buttons to show up?

Edited by Canasian

Share this post


Link to post
Share on other sites
Valuater

educated guess combined with trial and error

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Canasian

Bleh another problem.. why doesn't this work?

$exitb = GuiCtrlCreateButton("Exit",425,335,120,60)

$getmess = GUIGetMsg()
    If ($Getmess = $exitb) Then
        Exit
    EndIf

Share this post


Link to post
Share on other sites
Canasian

OMG!!! After an hour or so of messing around trying everything i could think of.. i fixed it by myself!! zomg.. i'm so proud and happy ^_^ woo fixed exit button... and learned to use case and select and or commands =D yay i'm learning. lol

#include <GuiConstants.au3>

Dim $getmess
Dim $guic, $guib
Dim $Cl = True
Dim $Ex = False

HotKeySet("{F10}","Cl")

$guic = GUICreate("Simple Click Bot", 650,400)
$guib = GuiCtrlCreateButton("Start Bot",125,335,120,60)
$exitb = GuiCtrlCreateButton("Exit",425,335,120,60)
$gamebox = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
$creategb = GUICtrlCreateObj($gamebox, 0,0,650,330)


With $gamebox
    .bgcolor = 0x000000
    .Movie = "http://www.flashninjaclan.com/tutorialpages/shootinggame/shootinggame.swf"
    .Loop = True
    .wmode = "Opaque"
EndWith


Func Cl()
    Exit
EndFunc
    
GUISetState()

    While 1
    $getmess = GUIGetMsg()
    Select  
    Case ($getmess = $guib)
        MsgBox(0,"Dun dun dun","Woot, it worked!")
    Case ($getmess = $exitb) Or $getmess = -3
        ExitLoop
    Exit
EndSelect
Wend
Edited by Canasian

Share this post


Link to post
Share on other sites
Valuater

@ 7:30 you posted a problem and 18 minutes later you fixed it... that's pretty good!!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

Use "Koda" to make your gui's.

...

I don't want to use Koda.. but how do u find where you want your buttons to show up?

8)


NEWHeader1.png

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  

×