Sign in to follow this  
Followers 0
raedts

Skip a "module"

2 posts in this topic

I am making a program that cleans your pc.

This program is made out of "Modules" there by i mean that there are 4 different programs separated by a line (;--------------------- easycleaner --------------------- etc).

Now i am making a menu with check boxes so the user can select what modules to be run.

Is there some kind of Goto command so when the program comes to a module which the user did deactivate it just goes to the next module?

This is the code of the menu.

#include <GUIConstants.au3>

$sluitccleaner = 0
GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 366, 125) 
GUISetIcon ("CI2.ico")
GUISetState(@SW_SHOW)
GuiCtrlCreatePic("logo.jpg",0,0, 366,125)
;SoundPlay ( "DATA\sound\cleanit2.wav",1)
;SoundPlay ( "DATA\sound\version.wav",1)
GUIDelete()

Opt("GUIOnEventMode", 1)  
$mainwindow = GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 400, 250) 
Guisetbkcolor (16777215)
GUISetIcon ("CI2.ico")
GuiCtrlCreatePic("head.jpg",0,0, 400,75)
Guictrlcreatelabel ("Version 0.55 BETA", 2, 235)

$start = GUICtrlCreateButton("", 300, 90,100,50, $BS_BITMAP)
$stop = Guictrlcreatebutton("", 300,150,100,50, $BS_BITMAP)
Guictrlsetimage($start, "DATA\afbeeldingen\start.bmp")
Guictrlsetimage($stop, "DATA\afbeeldingen\stop.bmp")
GUICtrlCreateLabel ("Modules", 50,80)
$easycleaner = GUICtrlCreateCheckbox ( "Easycleaner", 20, 100) 
$ccleaner = GUICtrlCreateCheckbox ( "CCleaner", 20, 120) 
$tweaknow = GUICtrlCreateCheckbox ( "Tweaknow Regcleaner", 20, 140) 
$ntregoptimizer = GUICtrlCreateCheckbox ( "Nt Regoptimizer", 20, 160) 
Guictrlsetstate($easycleaner, $GUI_CHECKED)
Guictrlsetstate($ccleaner, $GUI_CHECKED)
Guictrlsetstate($tweaknow, $GUI_CHECKED)
Guictrlsetstate($ntregoptimizer, $GUI_CHECKED)

$men = "stop"


GUICtrlSetOnEvent($start, "start")
Guictrlsetonevent($stop, "stop")
GUISetState(@SW_SHOW)

While 1
  Sleep(1000) ; Idle around
  if $men = "start" then exitloop
WEnd

Func start()
   $men = "start"
EndFunc

Func stop()
   exit
EndFunc
GUIDelete()

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I am making a program that cleans your pc.

This program is made out of "Modules" there by i mean that there are 4 different programs separated by a line (;--------------------- easycleaner --------------------- etc).

Now i am making a menu with check boxes so the user can select what modules to be run.

Is there some kind of Goto command so when the program comes to a module which the user did deactivate it just goes to the next module?

This is the code of the menu.

#include <GUIConstants.au3>

$sluitccleaner = 0
GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 366, 125) 
GUISetIcon ("CI2.ico")
GUISetState(@SW_SHOW)
GuiCtrlCreatePic("logo.jpg",0,0, 366,125)
;SoundPlay ( "DATA\sound\cleanit2.wav",1)
;SoundPlay ( "DATA\sound\version.wav",1)
GUIDelete()

Opt("GUIOnEventMode", 1)  
$mainwindow = GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 400, 250) 
Guisetbkcolor (16777215)
GUISetIcon ("CI2.ico")
GuiCtrlCreatePic("head.jpg",0,0, 400,75)
Guictrlcreatelabel ("Version 0.55 BETA", 2, 235)

$start = GUICtrlCreateButton("", 300, 90,100,50, $BS_BITMAP)
$stop = Guictrlcreatebutton("", 300,150,100,50, $BS_BITMAP)
Guictrlsetimage($start, "DATA\afbeeldingen\start.bmp")
Guictrlsetimage($stop, "DATA\afbeeldingen\stop.bmp")
GUICtrlCreateLabel ("Modules", 50,80)
$easycleaner = GUICtrlCreateCheckbox ( "Easycleaner", 20, 100) 
$ccleaner = GUICtrlCreateCheckbox ( "CCleaner", 20, 120) 
$tweaknow = GUICtrlCreateCheckbox ( "Tweaknow Regcleaner", 20, 140) 
$ntregoptimizer = GUICtrlCreateCheckbox ( "Nt Regoptimizer", 20, 160) 
Guictrlsetstate($easycleaner, $GUI_CHECKED)
Guictrlsetstate($ccleaner, $GUI_CHECKED)
Guictrlsetstate($tweaknow, $GUI_CHECKED)
Guictrlsetstate($ntregoptimizer, $GUI_CHECKED)

$men = "stop"
GUICtrlSetOnEvent($start, "start")
Guictrlsetonevent($stop, "stop")
GUISetState(@SW_SHOW)

While 1
  Sleep(1000); Idle around
  if $men = "start" then exitloop
WEnd

Func start()
   $men = "start"
EndFunc

Func stop()
   exit
EndFunc
GUIDelete()
there is no GOTO. just use conditions:

if GuiCtrlRead($Program1Checkbox) = $GUI_CHECKED Then InstallIt(1)
if GuiCtrlRead($Program2Checkbox) = $GUI_CHECKED Then InstallIt(2)
if GuiCtrlRead($Program3Checkbox) = $GUI_CHECKED Then InstallIt(3)
Func InstallIt($NoGoTo)
Select 
Case $NoGoTo = 1
      run(@temp& "\prog1\setup.exe)
Case $NoGoTo = 2
      run(@temp& "\prog2\setup.exe)
Case $NoGoTo = 3
      run(@temp& "\prog3\setup.exe)
EndSelect
EndFunc
Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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