Sign in to follow this  
Followers 0
kcd-clan

if,push,exit dont work help

15 posts in this topic

Why dont this work

$Button_11 = GuiCtrlCreateButton("Exit", 210, 260, 60, 20)

if $button_11="" Then
    exit
Elseif
    Exit
EndIf

Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()

Share this post


Link to post
Share on other sites



Why dont this work

$Button_11 = GuiCtrlCreateButton("Exit", 210, 260, 60, 20)

if $button_11="" Then
    exit
Elseif
    Exit
EndIf

<{POST_SNAPBACK}>

because you code is wrong! Check the help file sample or the forum for "GUICtrlCreateButton" to get an idea how all this works.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This is the scripts.

#include <GuiConstants.au3>


GuiCreate("KCD Bot's Setup", 300, 300,(@DesktopWidth-300)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)


$Label_1 = GuiCtrlCreateLabel("Diablo 2 Location", 20, 20, 90, 20)
$Input_2 = GuiCtrlCreateInput("C:\Program Files\Diablo II", 120, 20, 160, 20)
$Label_3 = GuiCtrlCreateLabel("Account Name", 20, 50, 90, 20)
$Input_4 = GuiCtrlCreateInput("Account", 120, 50, 160, 20)
$Label_5 = GuiCtrlCreateLabel("Password", 20, 80, 90, 20)
$Input_6 = GuiCtrlCreateInput("Password", 120, 80, 160, 20)
$Combo_8 = GuiCtrlCreateCombo("------------------Bot------------------", 120, 110, 160, 21)
$Combo_8 = GUICtrlSetData(-1,"D2 gSpam it|D2 Chat It","------------------Bot------------------")
$Label_9 = GuiCtrlCreateLabel("Bot2Run", 20, 110, 90, 20)
$Button_10 = GuiCtrlCreateButton("Save", 120, 260, 60, 20)
$Button_11 = GuiCtrlCreateButton("Exit", 210, 260, 60, 20)
GUICtrlSetOnEvent ( $Button_11, "q" )
$Button_12 = GuiCtrlCreateButton("Run", 30, 260, 60, 20)
$Label_13 = GuiCtrlCreateLabel("Message", 20, 140, 90, 20)
$Input_14 = GuiCtrlCreateInput("Message 1", 120, 140, 160, 20)
$Label_15 = GuiCtrlCreateLabel("Message 2", 20, 170, 90, 20)
$Label_16 = GuiCtrlCreateLabel("Message 3", 20, 200, 90, 20)
$Label_17 = GuiCtrlCreateLabel("Message 4", 20, 230, 90, 20)
$Input_18 = GuiCtrlCreateInput("Message 2", 120, 170, 160, 20)
$Input_19 = GuiCtrlCreateInput("Message 3", 120, 200, 160, 20)
$Input_20 = GuiCtrlCreateInput("Message 4", 120, 230, 160, 20)
$Label_21 = GuiCtrlCreateLabel("http://d2.rr.nu By Kcd-Clan", 80, 285, 200, 25)

Func save()
    
EndFunc

Func q()
    Exit
EndFunc


GuiSetState()

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
Edited by kcd-clan

Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()

Share this post


Link to post
Share on other sites

This is the scripts.

#include <GuiConstants.au3>
GuiCreate("KCD Bot's Setup", 300, 300,(@DesktopWidth-300)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Label_1 = GuiCtrlCreateLabel("Diablo 2 Location", 20, 20, 90, 20)
$Input_2 = GuiCtrlCreateInput("C:\Program Files\Diablo II", 120, 20, 160, 20)
$Label_3 = GuiCtrlCreateLabel("Account Name", 20, 50, 90, 20)
$Input_4 = GuiCtrlCreateInput("Account", 120, 50, 160, 20)
$Label_5 = GuiCtrlCreateLabel("Password", 20, 80, 90, 20)
$Input_6 = GuiCtrlCreateInput("Password", 120, 80, 160, 20)
$Combo_8 = GuiCtrlCreateCombo("------------------Bot------------------", 120, 110, 160, 21)
$Combo_8 = GUICtrlSetData(-1,"D2 gSpam it|D2 Chat It","------------------Bot------------------")
$Label_9 = GuiCtrlCreateLabel("Bot2Run", 20, 110, 90, 20)
$Button_10 = GuiCtrlCreateButton("Save", 120, 260, 60, 20)
$Button_11 = GuiCtrlCreateButton("Exit", 210, 260, 60, 20)
GUICtrlSetOnEvent ( $Button_11, "q" )
$Button_12 = GuiCtrlCreateButton("Run", 30, 260, 60, 20)
$Label_13 = GuiCtrlCreateLabel("Message", 20, 140, 90, 20)
$Input_14 = GuiCtrlCreateInput("Message 1", 120, 140, 160, 20)
$Label_15 = GuiCtrlCreateLabel("Message 2", 20, 170, 90, 20)
$Label_16 = GuiCtrlCreateLabel("Message 3", 20, 200, 90, 20)
$Label_17 = GuiCtrlCreateLabel("Message 4", 20, 230, 90, 20)
$Input_18 = GuiCtrlCreateInput("Message 2", 120, 170, 160, 20)
$Input_19 = GuiCtrlCreateInput("Message 3", 120, 200, 160, 20)
$Input_20 = GuiCtrlCreateInput("Message 4", 120, 230, 160, 20)
$Label_21 = GuiCtrlCreateLabel("http://d2.rr.nu By Kcd-Clan", 80, 285, 200, 25)

Func save()
    
EndFunc

Func q()
    Exit
EndFunc
GuiSetState()

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

<{POST_SNAPBACK}>

I don't see "Opt ("GUIOnEventMode", 1)" anywhere in your code? Am I wrong? If it's not there, than you need to add it.

"... and the Lord said to John, "Come forth and ye shall receive eternal life," but instead John came fifth and won a toaster."

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If i do that the exit buttion dont work.

If i knew how to remove exit buttion i could put that in there.

<{POST_SNAPBACK}>

It doesn't work when you add Opt ("GUIOnEventMode", 1) because you still don't have a good idle statement.

Try adding

"Sleep (1000)" into your "While... WEnd" statement.

Also... what is that useless "GUISetState" doing before your "While... WEnd" statement?

Both your "GUISetState" and "GUIGetMsg" Are directed at anything.

Edited by Frozenyam

"... and the Lord said to John, "Come forth and ye shall receive eternal life," but instead John came fifth and won a toaster."

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

that useless statement shows the gui, whats uselss is the guigetmsg, and the select in the while if using on event mode a

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>
Opt ("GUIOnEventMode", 1)
GuiCreate("KCD Bot's Setup", 300, 300,(@DesktopWidth-300)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Label_1 = GuiCtrlCreateLabel("Diablo 2 Location", 20, 20, 90, 20)
$Input_2 = GuiCtrlCreateInput("C:\Program Files\Diablo II", 120, 20, 160, 20)
$Label_3 = GuiCtrlCreateLabel("Account Name", 20, 50, 90, 20)
$Input_4 = GuiCtrlCreateInput("Account", 120, 50, 160, 20)
$Label_5 = GuiCtrlCreateLabel("Password", 20, 80, 90, 20)
$Input_6 = GuiCtrlCreateInput("Password", 120, 80, 160, 20)
$Combo_8 = GuiCtrlCreateCombo("------------------Bot------------------", 120, 110, 160, 21)
$Combo_8 = GUICtrlSetData(-1,"D2 gSpam it|D2 Chat It","------------------Bot------------------")
$Label_9 = GuiCtrlCreateLabel("Bot2Run", 20, 110, 90, 20)
$Button_10 = GuiCtrlCreateButton("Save", 120, 260, 60, 20)
$Button_11 = GuiCtrlCreateButton("Exit", 210, 260, 60, 20)
GUICtrlSetOnEvent ( $Button_11, "q" )
$Button_12 = GuiCtrlCreateButton("Run", 30, 260, 60, 20)
$Label_13 = GuiCtrlCreateLabel("Message", 20, 140, 90, 20)
$Input_14 = GuiCtrlCreateInput("Message 1", 120, 140, 160, 20)
$Label_15 = GuiCtrlCreateLabel("Message 2", 20, 170, 90, 20)
$Label_16 = GuiCtrlCreateLabel("Message 3", 20, 200, 90, 20)
$Label_17 = GuiCtrlCreateLabel("Message 4", 20, 230, 90, 20)
$Input_18 = GuiCtrlCreateInput("Message 2", 120, 170, 160, 20)
$Input_19 = GuiCtrlCreateInput("Message 3", 120, 200, 160, 20)
$Input_20 = GuiCtrlCreateInput("Message 4", 120, 230, 160, 20)
$Label_21 = GuiCtrlCreateLabel("http://d2.rr.nu By Kcd-Clan", 80, 285, 200, 25)

GuiSetState()

While 1
    Sleep ( 100 )
WEnd
Exit

Func save()
    
EndFunc

Func q()
    Exit
EndFunc
#endregion --- GuiBuilder generated code End ---


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

#include <GuiConstants.au3>
Opt ("GUIOnEventMode", 1)
GuiCreate("KCD Bot's Setup", 300, 300,(@DesktopWidth-300)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Label_1 = GuiCtrlCreateLabel("Diablo 2 Location", 20, 20, 90, 20)
$Input_2 = GuiCtrlCreateInput("C:\Program Files\Diablo II", 120, 20, 160, 20)
$Label_3 = GuiCtrlCreateLabel("Account Name", 20, 50, 90, 20)
$Input_4 = GuiCtrlCreateInput("Account", 120, 50, 160, 20)
$Label_5 = GuiCtrlCreateLabel("Password", 20, 80, 90, 20)
$Input_6 = GuiCtrlCreateInput("Password", 120, 80, 160, 20)
$Combo_8 = GuiCtrlCreateCombo("------------------Bot------------------", 120, 110, 160, 21)
$Combo_8 = GUICtrlSetData(-1,"D2 gSpam it|D2 Chat It","------------------Bot------------------")
$Label_9 = GuiCtrlCreateLabel("Bot2Run", 20, 110, 90, 20)
$Button_10 = GuiCtrlCreateButton("Save", 120, 260, 60, 20)
$Button_11 = GuiCtrlCreateButton("Exit", 210, 260, 60, 20)
GUICtrlSetOnEvent ( $Button_11, "q" )
$Button_12 = GuiCtrlCreateButton("Run", 30, 260, 60, 20)
$Label_13 = GuiCtrlCreateLabel("Message", 20, 140, 90, 20)
$Input_14 = GuiCtrlCreateInput("Message 1", 120, 140, 160, 20)
$Label_15 = GuiCtrlCreateLabel("Message 2", 20, 170, 90, 20)
$Label_16 = GuiCtrlCreateLabel("Message 3", 20, 200, 90, 20)
$Label_17 = GuiCtrlCreateLabel("Message 4", 20, 230, 90, 20)
$Input_18 = GuiCtrlCreateInput("Message 2", 120, 170, 160, 20)
$Input_19 = GuiCtrlCreateInput("Message 3", 120, 200, 160, 20)
$Input_20 = GuiCtrlCreateInput("Message 4", 120, 230, 160, 20)
$Label_21 = GuiCtrlCreateLabel("http://d2.rr.nu By Kcd-Clan", 80, 285, 200, 25)

GuiSetState()

While 1
    Sleep ( 100 )
WEnd
Exit

Func save()
    
EndFunc

Func q()
    Exit
EndFunc
#endregion --- GuiBuilder generated code End ---

<{POST_SNAPBACK}>

Did you leave the "Exit" below the "While... WEnd" Statement on purpose. I only said that the "GUISetState" was useless, because I've never had to use it in my scripts and they've all worked fine. Wait... are you just showing that "GUISetState()" and leaving out the "@SW_SHOW"? Is that why I'm confused? Edited by Frozenyam

"... and the Lord said to John, "Come forth and ye shall receive eternal life," but instead John came fifth and won a toaster."

Share this post


Link to post
Share on other sites

If you look in the help file, you will see it says that @SW_SHOW is the default flag for GuiSetState.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

#include <GuiConstants.au3>
Opt ("GUIOnEventMode", 1)
GUICreate("KCD Bot's Setup", 300, 300, (@DesktopWidth - 300) / 2, (@DesktopHeight - 300) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")
$Label_1 = GUICtrlCreateLabel("Diablo 2 Location", 20, 20, 90, 20)
$Input_2 = GUICtrlCreateInput("C:\Program Files\Diablo II", 120, 20, 160, 20)
$Label_3 = GUICtrlCreateLabel("Account Name", 20, 50, 90, 20)
$Input_4 = GUICtrlCreateInput("Account", 120, 50, 160, 20)
$Label_5 = GUICtrlCreateLabel("Password", 20, 80, 90, 20)
$Input_6 = GUICtrlCreateInput("Password", 120, 80, 160, 20)
$Combo_8 = GUICtrlCreateCombo("------------------Bot------------------", 120, 110, 160, 21)
$Combo_8 = GUICtrlSetData(-1, "D2 gSpam it|D2 Chat It", "------------------Bot------------------")
$Label_9 = GUICtrlCreateLabel("Bot2Run", 20, 110, 90, 20)
$Button_10 = GUICtrlCreateButton("Save", 120, 260, 60, 20)
$Button_11 = GUICtrlCreateButton("Exit", 210, 260, 60, 20)
GUICtrlSetOnEvent($Button_11, "q")
$Button_12 = GUICtrlCreateButton("Run", 30, 260, 60, 20)
$Label_13 = GUICtrlCreateLabel("Message", 20, 140, 90, 20)
$Input_14 = GUICtrlCreateInput("Message 1", 120, 140, 160, 20)
$Label_15 = GUICtrlCreateLabel("Message 2", 20, 170, 90, 20)
$Label_16 = GUICtrlCreateLabel("Message 3", 20, 200, 90, 20)
$Label_17 = GUICtrlCreateLabel("Message 4", 20, 230, 90, 20)
$Input_18 = GUICtrlCreateInput("Message 2", 120, 170, 160, 20)
$Input_19 = GUICtrlCreateInput("Message 3", 120, 200, 160, 20)
$Input_20 = GUICtrlCreateInput("Message 4", 120, 230, 160, 20)
$Label_21 = GUICtrlCreateLabel("http://d2.rr.nu By Kcd-Clan", 80, 285, 200, 25)

GUISetState()

While 1
    Sleep(1000)
WEnd

Func save()
    
EndFunc  ;==>save

Func q()
    Exit
EndFunc  ;==>q

Func SpecialEvents()
    
    
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
            Exit
            
        Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
            
        Case @GUI_CtrlId = $GUI_EVENT_RESTORE
            
    EndSelect
    
EndFunc  ;==>SpecialEvents

#endregion --- GuiBuilder generated code End ---

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

>"C:\Program Files\AutoIt3\SciTe\CompileAU3\CompileAU3.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\root\Desktop\d2\spam it\test.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

>Running AU3Check...C:\Program Files\AutoIt3\SciTe\Defs\Production\Au3Check\au3check.dat

C:\Documents and Settings\root\Desktop\d2\spam it\test.au3(9,51) : ERROR: syntax error

GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")$Label_1


Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()

Share this post


Link to post
Share on other sites

just move that label to next line, it was a copy and paste error, common sense?


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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