Jump to content

GUI buttons not showing up?


Recommended Posts

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)
Link to comment
Share on other sites

$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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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