Sign in to follow this  
Followers 0
LordSlippy

GUI appears for a second, then closes

5 posts in this topic

#1 ·  Posted (edited)

This is just a simple script i'm using to automate a few tasks in a game. (Or at least it will be). I'm currently having some problems though, I run the script, and it appears, then closes. Any help? I can't seem to find the problem.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;    Template AutoIt script.
;
; ----------------------------------------------------------------------------


#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

Global $IniRead_WTG = IniRead("WhereToGo.ini", "Currently at", "Zeplin", 0)
Global $IniRead_WTG = IniRead("WhereToGo.ini", "Currently at", "WindRider", 0)
Global $IniRead_WTG = IniRead("WhereToGo.ini", "Currently at", "InnKeeper", 0)
Global $IniRead_WTG = IniRead("WhereToGo.ini", "Going to", "AuctionHouse", 0)
Global $IniRead_WTG = IniRead("WhereToGo.ini", "Going to", "WindRider", 0)
Global $IniRead_WTG = IniRead("WhereToGo.ini", "Going to", "Zeplin", 0)


$main_Window = GuiCreate("MyGUI", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUISetState(@SW_SHOW)
$GoingTo = GuiCtrlCreateGroup("Where to go", 280, 90, 110, 110)
$GoingToZep = GuiCtrlCreateRadio("Zepln", 290, 110, 90, 20)
$GoingToAH = GuiCtrlCreateRadio("Auction House", 290, 140, 90, 20)
$GoingToWR = GuiCtrlCreateRadio("Wind Rider", 290, 170, 90, 20)
$CurrentlyAt = GuiCtrlCreateGroup("Where you are", 10, 210, 100, 110)
$CurrentlyWR = GuiCtrlCreateRadio("Wind Rider", 20, 230, 80, 20)
$CurrentlyZep = GuiCtrlCreateRadio("Zeplin", 20, 260, 80, 20)
$CurrentlyIK = GuiCtrlCreateRadio("Inn Keeper", 20, 290, 80, 20)
$EditManually = GuiCtrlCreateButton("Edit Manually", 290, 300, 100, 20)
$AutoGo_Pic = GuiCtrlCreatePic("Autogo.bmp", 20, 10, 200, 70)


    
#endregion --- GuiBuilder generated code End ---
Edited by LordSlippy

Share this post


Link to post
Share on other sites



This is just a simple script i'm using to automate a few tasks in a game. (Or at least it will be). I'm currently having some problems though, I run the script, and it appears, then closes. Any help? I can't seem to find the problem.

<{POST_SNAPBACK}>

What did you do with the While-Wend loop that is generated by Guibuilder?

After your GUI is shown, you want to start looping and check which control is worked on..

Check the helpfile for examples...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you

1 more problem

I want it, so when you click the "edit Manually" button it opens of wheretogo.ini so you can edit it.

So I have

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $EditManually
        FileOpen ( "WhereToGo.ini", 1 )
        
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

But it's not working. Is there something im missing?

Edited by LordSlippy

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Open how? Into your GUI, or using another program?

Run(@comspec & " /c notepad wheretogo.ini","",@SW_HIDE)

Edited by Ejoc

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

Open how?  Into your GUI, or using another program?

Run(@comspec & " /c notepad wheretogo.ini","",@SW_HIDE)

<{POST_SNAPBACK}>

Wanted it to open in notepad, thank you.

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