Jump to content

For some reason this new window does not pop up.


Recommended Posts

Okay...

I am in the process of designing a HUGE script, and I do not think you need to see the whole entire thing to understand my problem. My problem is that when $start is clicked, $miniwin is not created.

$start = GUICtrlCreateButton("Start Macro", 86, 16, 75, 25, 0)oÝ÷ Ù«­¢+Ù]¡¥±Ä($ÀÌØíµÍôU%Ñ5Í ¤(%M±Ð($%
ÍÀÌØíµÍôÀÌØíÍÑÉÐ($$%5­5¥¹¥]¥¸ ¤($$%Õ¹MÑÉÐ ¤($$$%%ÀÌØíÉÍÝ¥ÐôÄQ¡¸($$$$%1¥¹± ÅÕ½ÐíÕѽMÝ¥ÐÅÕ½Ðì¤($$$%¹%($$$%%ÀÌØíÉݽ±ôÄQ¡¸($$$$%1¥¹± ÅÕ½ÐíÕѽ]½±ÅÕ½Ðì¤($$$%¹%($$$%1¥¹± ÅÕ½ÐíÑѬÅÕ½Ðì¤($$%¹Õ¹oÝ÷ Ù«­¢+ÙÕ¹5­5¥¹¥]¥¸ ¤($ÀÌØíµ¥¹¥Ý¥¸ôU%
ÉÑ ÅÕ½Ðí!½±å5ɼMÉ¥ÁÐáÕÑ¥½¸ÅÕ½Ðì°ÈÐÔ°ÄÄÜ°ÌÀÌ°ÈÄä¤(%U%MÑ%½¸ ÅÕ½Ðí¡´¹¥¼ÅÕ½Ðì¤($ÀÌØíÍÑÉÑѸôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíMÑÉÐÅÕ½Ðì°ÈÀ°ÄÀ°ÜÔ°ÈÔ°À¤($ÀÌØíÍѽÁѸôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíMѽÀÅÕ½Ðì°ÄÐÀ°ÄÀ°ÜÔ°ÈÔ°À¤($ÀÌØíÉÑÕɹѸôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíIÑÕɸѼ!4ÅÕ½Ðì°ÈÀ°ÜÀ°ÜÔ°ÈÔ°À¤($ÀÌØíá¥ÑѸôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðíá¥ÐÅÕ½Ðì°ÄÐÀ°ÜÀ°ÜÔ°ÈÔ°À¤(%U%MÑMÑÑ¡M]}M!=°ÀÌØíµ¥¹¥Ý¥¸¤(%]¥¹MÑQÉ¹Ì ÀÌØíµ¥¹¥Ý¥¸°ÅÕ½ÐìÅÕ½Ðì°ÄÜÔ¤(%]¡¥±Ä($$ÀÌØíµÍôU%Ñ5Í ¤($%M±Ð($$%
ÍÀÌØíµÍôÀÌØíÍÑÉÑѸ($$$%MÑÉÐ ¤($$$%Mݥѡ=¹= ¤($$%
ÍÀÌØíµÍôÀÌØíÍѽÁѸ($$$%MѽÀ ¤($$$%Mݥѡ=¹= ¤($$%
ÍÀÌØíµÍôÀÌØíÉÑÕɹѸ($$$%Iµ­U$ ¤($%¹M±Ð(%]¹)¹Õ¹

Why is this window ^^^^^ not showing?

edit: all the other events in the script work fine, it's just this one.

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

  • Developers

Okay...

I am in the process of designing a HUGE script, and I do not think you need to see the whole entire thing to understand my problem. My problem is that when $start is clicked, $miniwin is not created.

$start = GUICtrlCreateButton("Start Macro", 86, 16, 75, 25, 0)oÝ÷ Ù«­¢+Ù]¡¥±Ä($ÀÌØíµÍôU%Ñ5Í ¤(%M±Ð($%
ÍÀÌØíµÍôÀÌØíÍÑÉÐ($$%5­5¥¹¥]¥¸ ¤($$%Õ¹MÑÉÐ ¤($$$%%ÀÌØíÉÍÝ¥ÐôÄQ¡¸($$$$%1¥¹± ÅÕ½ÐíÕѽMÝ¥ÐÅÕ½Ðì¤($$$%¹%($$$%%ÀÌØíÉݽ±ôÄQ¡¸($$$$%1¥¹± ÅÕ½ÐíÕѽ]½±ÅÕ½Ðì¤($$$%¹%($$$%1¥¹± ÅÕ½ÐíÑѬÅÕ½Ðì¤($$%¹Õ¹

Why is this window ^^^^^ not showing?

edit: all the other events in the script work fine, it's just this one.

This will never work because it will error out . You cannot have a Func...EndFunc inside a Select...EndSelect

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Okay, I thought about that and that is why I removed the MakeMiniWin. I thought just removing one thing would fix that one thing. Thanks!

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Wait.. I removed all the functions from While loops and it still doesn't work. I tried just using Call("MakeMiniWin") but that didn't work either.. I don't get it! Maybe GUIs cannot be created by functions?

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Bump.. someone please help me! This is an urgent-level program that needs to be done soon.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Whole script? I have no idea at what levels the variables have been declared at. I therefore don't know if they will work over different functions and it really is just easier for us if you post the whole thing, or at least the includes, the variable declarations, the GUI creation, the entire main loop, the functions called in the main loop(that are giving you a problem), and sub functions called by those functions(the ones that are giving you a problem).

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Okay, sure.. but it's pretty long. :whistle:

Edit: Bolded the parts that I posted before. I also edited things a bit since the last time I posted... still doesn't work though.

; HM 1.0.1 BY SOMEONE
; DO NOT EDIT AND/OR REDISTRIBUTE UNDER YOUR NAME!! DOING SO IS AGAINST FEDERAL AND GLOBAL LAW AND YOU WILL BE SEVERELY PUNISHED!

#include <GUIConstants.au3>
#include <IE.au3>
#include <Timer.au3>
#include <Constants.au3>

#comments-start
Do not insert things to determine whether it is supposed to be done. Just put in what would be done if the user wanted it. The choices of the user will be decided later
on.

Swift: 10 minutes
Wolf: 2 minutes

DO NOT FORGET: IN HOLYMACRO PRO I NEED TO ADD IN THE AUTO-RECONNECT FEATURE!!!

f7fbfa
eef0ef

Func AutoReconnect()
    $Disconnected = PixelGetColor(648, 568)
    If $Disconnected = "f7fbfa" Or "eef0ef" Then
        $state = "disconnected"
    Else
        $state = "online"
    EndIf
EndFunc
    
#comments-end

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

TraySetIcon("hm.ico")

TraySetToolTip("HolyMacro! Free Version")

$traypro = TrayCreateItem("Get Pro")
TrayItemSetState(-1, $TRAY_ENABLE)
TrayItemSetOnEvent($traypro, "Pro")
$trayexit = TrayCreateItem("Exit")
TrayItemSetState(-1, $TRAY_ENABLE)
TrayItemSetOnEvent($trayexit, "ExitHM")
$traymacromenu = TrayCreateMenu("Macro")
$traystart = TrayCreateItem("Start", $traymacromenu)
TrayItemSetState(-1, $TRAY_ENABLE)
TrayItemSetOnEvent($traystart, "Start")
$traystop = TrayCreateItem("Stop", $traymacromenu)
TrayItemSetState(-1, $TRAY_DISABLE)
TrayItemSetOnEvent($traystop, "Stop")

Func AutoSwift()
    $swiftkey = IniRead("hmoption.ini", "Preferences", "swiftkey")
    While 1
        Send($swiftkey)
        _Timer(60000)
    WEnd
EndFunc

Func AutoMP()
    $mpcheck = PixelGetColor(186, 28)
    $mpfull = PixelGetColor(264, 28)
    While 1
        If $mpcheck = "000000" & $readmpstyle = "sit" Then
            Send("c")
            If $mpfull = "4758e4" Then
                Send("c")
            Else
                ContinueLoop
            EndIf
        EndIf
        If $mpcheck = "000000" & $readmpstyle = "pot" Then
            Do
                Send($readmpslot)
                _Timer(5000)
                ;Avoid lag messing up the script
                $readmppotamt -= 1
            Until $mpcheck = "4758e4"
        EndIf
        If $mpcheck = "000000" & $readmpstyle = "both" Then
            If $readmppot > 0 Then
                Send($readmpslot)
                
            ElseIf $readmppot = 0 Then
                Send("c")
                If $mpfull = "4758e4" Then
                    Send("c")
                Else
                    ;Find out TimerInit instead of ContinueLoop.. because ContinueLoop will just send C again, as it will not have healed by the time it gets to the front of the loop again.
                EndIf
            EndIf
        EndIf
    WEnd
EndFunc

Func AutoHP()
    $hpcheck = PixelGetColor(213, 11)
    $hpfull = PixelGetColor(263, 10)
    While 1
        If $hpcheck = "000000" & $readhpstyle = "sit" Then
            Send("c")
            If $hpfull = "f1362d" Then
                Send("c")
            ElseIf $mpfull = "000000" Then
                ContinueLoop
            EndIf
        EndIf
    WEnd
    While 1
        If $hpcheck = "000000" & $readhpstyle = "pot" Then
            Do
                Send($readhpslot)
                _Timer(5000)                            ; To avoid lagging problems.. Without this script may think it is out of potions when it still has some left
                $readhppotamt -= 1
            Until $hpcheck = "f1362d"
        EndIf
    WEnd
EndFunc

Func AutoWolf()
    $wolfkey = IniRead("hmoption.ini", "Preferences", "wolfkey")
    While 1
        Send($wolfkey)
        _Timer(12000)
    WEnd
EndFunc

Func Attack()
    Send($readkey1)
    _Timer(1000)
    Send($readkey2)
    _Timer(1000)
    Send($readkey3)
    _Timer(1000)
EndFunc

Func AutoRespawn1280x1024()
    $deadcheck1 = PixelGetColor(616, 486)
    $deadcheck2 = PixelGetColor(498, 488)
    While 1
        If $deadcheck1 = "ffffff" Or $deadcheck2 = "ffffff" Then
            ;You are dead!
            MouseClick("", 638, 564)    ;Press okay
        Else
            ; Do nothing.. just wait
        EndIf
        _Timer(1000)
    WEnd
EndFunc

Func RemakeGUI()
    $HolyMacro = GUICreate("HolyMacro - Free Version", 268, 79, 193, 115)
    GUISetIcon("hm.ico")
    $start = GUICtrlCreateButton("Start Macro", 86, 16, 75, 25, 0)
    $menufile = GUICtrlCreateMenu("File")
    $menufilerestart = GUICtrlCreateMenuItem("Restart", $menufile)
    $menufileexit = GUICtrlCreateMenuItem("Exit", $menufile)
    $menuedit = GUICtrlCreateMenu("Edit")
    $menueditoptions = GUICtrlCreateMenuItem("Edit Macro Options..", $menuedit)
    $menuhelp = GUICtrlCreateMenu("Help")
    $menuhelphelp = GUICtrlCreateMenuItem("HolyMacro! Help me!", $menuhelp)
    $menuhelpupgrade = GUICtrlCreateMenuItem("Upgrade to Pro", $menuhelp)
    $menuhelpabout = GUICtrlCreateMenuItem("About", $menuhelp)
    GUISetState(@SW_SHOW)
    GUIDelete($miniwin)
EndFunc

Func AutoRespawn1024x768()
    ;will be sent out with HM 1.1 update
EndFunc

Func AutoRespawn800x600()
    ;will be sent out with HM 1.2 or maybe later update.. sigh
EndFunc

Func ExitHM()
    Exit
EndFunc

$loader = GUICreate("HolyMacro - Free Version", 350, 75, -1, -1, $WS_POPUP)
GUISetState(@SW_SHOW)
$progress = GUICtrlCreateProgress(16, 8, 318, 17)
GUICtrlSetData($progress, 0)

; Runs on each startup
$updatelbl = GUICtrlCreateLabel("Checking For Updates", 120, 40, 107, 17)
InetGet("http://hometown.aol.com/sandman85048/hm/update.ini", "update.ini")
$updateurl = IniRead("update.ini", "Updates", "latest", "")
If $updateurl = ("http://hometown.aol.com/sandman85048/hm/update.exe") Then
    InetGet($updateurl, "update.exe")
    Run("update.exe")
EndIf
GUICtrlSetData($progress, 33)
GUICtrlDelete($updatelbl)
$verifylbl = GUICtrlCreateLabel("Verifying Client Data", 120, 40, 99, 17)
$readchanged = IniRead("hmoption.ini", "Settings", "changed", "")
If $readchanged = 0 Then
    MsgBox(0, "Uh-oh!", "You haven't set up your options yet! HM will not work correctly if these options are not changed.")
    Run("Option.exe")
    Exit
EndIf
$readswift = IniRead("hmoption.ini", "Preferences", "autoswift", "")
$readwolf = IniRead("hmoption.ini", "Preferences", "autowolf", "")
$readkey1 = IniRead("hmoption.ini", "Macro", "key1", "")
$readkey2 = IniRead("hmoption.ini", "Macro", "key2", "")
$readkey3 = IniRead("hmoption.ini", "Macro", "key3", "")
$readmp = IniRead("hmoption.ini", "Preferences", "mp", "")
$readmpstyle = IniRead("hmoption.ini", "Preferences", "mpstyle", "")
$readmppotamt = IniRead("hmoption.ini", "Preferences", "mppotamt", "")
$readmpslot = IniRead("hmoption.ini", "Preferences", "mpslot", "")
$readhp = IniRead("hmoption.ini", "Preferences", "hp", "")
$readhpstyle = IniRead("hmoption.ini", "Preferences", "hpstyle", "")
$readhppotamt = IniRead("hmoption.ini", "Preferences", "hppotamt", "")
$readhpslot = IniRead("hmoption.ini", "Preferences", "hpslot", "")
GUICtrlSetData($progress, 66)
GUICtrlDelete($verifylbl)
$initlbl = GUICtrlCreateLabel("Initiating Client", 136, 40, 72, 17)
GUICtrlSetData($progress, 100)
GUICtrlDelete($initlbl)
GUIDelete($loader)

$HolyMacro = GUICreate("HolyMacro - Free Version", 268, 79, 193, 115)
GUISetIcon("hm.ico")
[b]$start = GUICtrlCreateButton("Start Macro", 86, 16, 75, 25, 0)[/b]
$menufile = GUICtrlCreateMenu("File")
$menufilerestart = GUICtrlCreateMenuItem("Restart", $menufile)
$menufileexit = GUICtrlCreateMenuItem("Exit", $menufile)
$menuedit = GUICtrlCreateMenu("Edit")
$menueditoptions = GUICtrlCreateMenuItem("Edit Macro Options..", $menuedit)
$menuhelp = GUICtrlCreateMenu("Help")
$menuhelphelp = GUICtrlCreateMenuItem("HolyMacro! Help me!", $menuhelp)
$menuhelpupgrade = GUICtrlCreateMenuItem("Upgrade to Pro", $menuhelp)
$menuhelpabout = GUICtrlCreateMenuItem("About", $menuhelp)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            $exitmsg = MsgBox(4, "Uh-oh!", "Are you sure you want to exit?")
            If $exitmsg = 6 Then
                Exit
            ElseIf $exitmsg = 7 Then
                GUISetState(@SW_SHOW, $HolyMacro)
            EndIf
        Case $msg = $menueditoptions
            Run("option.exe")
            GUISetState(@SW_MINIMIZE)
        Case $msg = $menuhelpupgrade
            Func Pro()
                _IECreate("http://hometown.aol.com/sandman85048/hm/getpro.htm")
            EndFunc
            Pro()
        Case $msg = $menufileexit
            $exitmsg = MsgBox(4, "Uh-oh!", "Are you sure you want to exit?")
            If $exitmsg = 6 Then
                Exit
            ElseIf $exitmsg = 7 Then
                GUISetState(@SW_SHOW, $HolyMacro)
            EndIf
    EndSelect
WEnd

$active = 0

Func SwitchOnOff()
    If $active = 0 Then
        GUICtrlSetState($startbtn, $GUI_DISABLE)
        GUICtrlSetState($stopbtn, $GUI_ENABLE)
        TrayItemSetState($traystart, $TRAY_DISABLE)
        TrayItemSetState($traystop, $TRAY_ENABLE)
        $active = 1
    ElseIf $active = 1 Then
        GUICtrlSetState($start, $GUI_ENABLE)
        GUICtrlSetState($stop, $GUI_DISABLE)
        TrayItemSetState($traystart, $TRAY_ENABLE)
        TrayItemSetState($traystop, $TRAY_DISABLE)
        $active = 0
    EndIf
EndFunc     

;Main Macro Execution starts here. Be careful what you edit, hacker.

$stop = ""

[b]Func MakeMiniWin()
    $miniwin = GUICreate("HolyMacro Script Execution", 245, 117, 303, 219)
    GUISetIcon("hm.ico")
    $startbtn = GUICtrlCreateButton("Start", 20, 10, 75, 25, 0)
    $stopbtn = GUICtrlCreateButton("Stop", 140, 10, 75, 25, 0)
    $returnbtn = GUICtrlCreateButton("Return to HM", 20, 70, 75, 25, 0)
    $exitbtn = GUICtrlCreateButton("Exit", 140, 70, 75, 25, 0)
    GUISetState(@SW_SHOW, $miniwin)
    WinSetTrans($miniwin, "", 175)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $startbtn
                Start()
                SwitchOnOff()
            Case $msg = $stopbtn
                Stop()
                SwitchOnOff()
            Case $msg = $returnbtn
                RemakeGUI()
        EndSelect
    WEnd
EndFunc[/b]

Func Start()
    If $readswift = 1 Then
    AdLibEnable("AutoSwift")
    EndIf
    If $readwolf = 1 Then
        AdLibEnable("AutoWolf")
    EndIf
    AdLibEnable("Attack")
EndFunc

Func Stop()
    If $readswift = 1 Then
        AdLibDisable("AutoSwift")
    EndIf
    If $readwolf = 1 Then
        AdLibDisable("AutoWolf")
    EndIf
    AdLibDisable("Attack")
    SwitchOnOff()
EndFunc

[b]While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $start
            Start()
            $miniwin = GUICreate("HolyMacro Script Execution", 245, 117, 303, 219)
            GUISetIcon("hm.ico")
            $startbtn = GUICtrlCreateButton("Start", 20, 10, 75, 25, 0)
            $stopbtn = GUICtrlCreateButton("Stop", 140, 10, 75, 25, 0)
            $returnbtn = GUICtrlCreateButton("Return to HM", 20, 70, 75, 25, 0)
            $exitbtn = GUICtrlCreateButton("Exit", 140, 70, 75, 25, 0)
            GUISetState(@SW_SHOW, $miniwin)
            WinSetTrans($miniwin, "", 175)
            While 1
                $msg = GUIGetMsg()
                Select
                    Case $msg = $startbtn
                        Start()
                        SwitchOnOff()
                    Case $msg = $stopbtn
                        Stop()
                        SwitchOnOff()
                    Case $msg = $returnbtn
                        RemakeGUI()
                EndSelect
            WEnd
        Case $msg = $stop
            Stop()
    EndSelect
WEnd[/b]

I wasn't kidding! :P

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

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