Jump to content

help? checkboxes not working?


Golbez
 Share

Recommended Posts

im trying to make a way that i can easly make accounts on my ftp server with out having to open the ftp software.

i got most of it all there but the check boxs and radio buttons arnt working.. what did i do wroung? i cant figure it out..

i thought that they return 1 if its true (checked) o if its false(unchecked)

Opt("GUIOnEventMode", 1)
#include <GUIConstants.au3>
$filename = "C:\Documents and Settings\Ray Smith\Desktop\Test.ini"

$Menu = GUICreate("", 202, 583, 297, 109)
$Group1 = GUICtrlCreateGroup("Account", 8, 0, 185, 41, $BS_CENTER)
$input2 = GUICtrlCreateInput("", 16, 16, 169, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Miscellaneous", 8, 232, 185, 305, $BS_CENTER)
$Group4 = GUICtrlCreateGroup("Misc ", 16, 248, 169, 97)
$Checkbox1 = GUICtrlCreateCheckbox("Enable Account", 24, 264, 153, 25, BitOR($BS_CHECKBOX,$BS_AUTOCHECKBOX,$BS_LEFT,$WS_TABSTOP))
$Checkbox3 = GUICtrlCreateCheckbox("Allow NO'OP Command", 24, 312, 153, 25)
$Checkbox16 = GUICtrlCreateCheckbox("By-Pass User Limit", 24, 288, 113, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("Files", 16, 352, 169, 73)
$Checkbox6 = GUICtrlCreateCheckbox("Show Relative Path", 24, 368, 153, 25)
$Checkbox7 = GUICtrlCreateCheckbox("Hide Hidden Files/Dirs", 24, 392, 153, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group6 = GUICtrlCreateGroup("Commands", 16, 432, 169, 97)
$Checkbox8 = GUICtrlCreateCheckbox("User Can See Who's On", 24, 448, 153, 25)
$Checkbox9 = GUICtrlCreateCheckbox("User Can Chat With Others", 24, 472, 153, 25)
$Checkbox10 = GUICtrlCreateCheckbox("User Can Change Password", 24, 496, 153, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Password", 8, 48, 185, 41, $BS_CENTER)
$Input1 = GUICtrlCreateInput("", 16, 64, 169, 21, BitOR($ES_CENTER,$ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group7 = GUICtrlCreateGroup("Access", 8, 96, 185, 129, $BS_CENTER)
$Radio1 = GUICtrlCreateRadio("Music", 16, 112, 49, 17)
$Radio2 = GUICtrlCreateRadio("Software", 72, 112, 65, 17)
$Radio3 = GUICtrlCreateRadio("All", 144, 112, 41, 17)
$Group8 = GUICtrlCreateGroup("Files", 16, 128, 81, 89, $BS_CENTER)
$Checkbox2 = GUICtrlCreateCheckbox("Read", 24, 144, 65, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Write", 24, 160, 65, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Delete", 24, 177, 57, 15)
$Checkbox11 = GUICtrlCreateCheckbox("Append", 24, 192, 57, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group9 = GUICtrlCreateGroup("Directories", 104, 128, 81, 89, $BS_CENTER)
$Checkbox12 = GUICtrlCreateCheckbox("Make", 112, 144, 65, 17)
$Checkbox13 = GUICtrlCreateCheckbox("List", 112, 160, 65, 17)
$Checkbox14 = GUICtrlCreateCheckbox("Delete", 112, 176, 65, 17)
$Checkbox15 = GUICtrlCreateCheckbox("+Subdirs", 112, 192, 65, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Create Account", 8, 544, 105, 33, 0)
    GUICtrlSetTip(-1, "This Creates the Account.")
    GUICtrlSetOnEvent(-1, "MakeAccount")
$Button2 = GUICtrlCreateButton("Exit", 120, 544, 73, 33, 0)
GUICtrlSetTip(-1, "This Exits the Program.")
    GUICtrlSetOnEvent(-1, "Terminate")
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $Menu)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func MakeAccount()
    ;   Access
    ;radio1 = music  
    ;radio2 = software  
    ;radio3 = all
        If $Radio1 = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents\My Music\")
        ElseIf $Radio2 = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents\My Isos\")
            IniWrite($filename, $input2, "Dir1", "F:\My Documents\My Downloads\")
        ElseIf $Radio3 = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents") 
        EndIf
        
    ;   Account
    ;input1 = password
        IniWrite($filename, $input2, "Pass", $input1)
    ;input2 = account
        IniWrite($filename, $input2, "Login", $input2)

    ;   Files   ;Attr0=RW-AMLSK
    ;box2 = read
    ;box4 = write
    ;box5 = delete
    ;box11 = append

    ;   Dirs
    ;box12 = make
    ;box13 = list
    ;box14 = delete
    ;box15 = +subdirs

    ;   Misc
    ;box1 = enable account
        If $Checkbox1 = 1 then 
            IniWrite($filename, $input2, "Enabled", "1")
        else 
            IniWrite($filename, $input2, "Enabled", "0")
        EndIf
    ;box3 = allow NO'OP Command
        If $Checkbox3 = 1 then 
            IniWrite($filename, $input2, "AllowNoop", "1")
        else 
            IniWrite($filename, $input2, "AllowNoop", "0")
        EndIf
    ;box16 = By-Pass User Limit
    If $Checkbox16 = 1 then 
            IniWrite($filename, $input2, "By-Pass_MaxUser","1")
        else 
            IniWrite($filename, $input2, "By-Pass_MaxUser","0")
    EndIf
    
    ;   Commands
    ;box6 = Show Relative Path
        If $Checkbox6 = 1 then 
            IniWrite($filename, $input2, "RelativePath", "1")
        else 
            IniWrite($filename, $input2, "RelativePath", "0")
        EndIf
    ;box7 hide hidden files/dirs
        If $Checkbox7 = 1 then 
            IniWrite($filename, $input2, "Hide Hidden Files", "1")
        else 
            IniWrite($filename, $input2, "Hide Hidden Files", "0")
        EndIf
    ;box8 = use can see whos on
        If $Checkbox8 = 1 then 
            IniWrite($filename, $input2, "EnableSITEWHO", "1")
        else 
            IniWrite($filename, $input2, "EnableSITEWHO", "0")
        EndIf
    ;box9 = user can chat
        If $Checkbox9 = 1 then 
            IniWrite($filename, $input2, "EnableSITECHAT", "1")
        else 
            IniWrite($filename, $input2, "EnableSITECHAT", "0")
        EndIf
    ;box10 = use can change pass
        If $Checkbox10 = 1 then 
            IniWrite($filename, $input2, "AllowChangePassword", "1")
        else 
            IniWrite($filename, $input2, "AllowChangePassword", "0")
        EndIf
    
    IniWrite($filename, $input2, "Home-Ip", "-= All IP Homes =-")
    IniWrite($filename, $input2, "MaxConPerIp", "1")
    IniWrite($filename, $input2, "TimeOutEnabled", "1")
    IniWrite($filename, $input2, "TimeOut", "60")
    IniWrite($filename, $input2, "MaxUsers","0")
    IniWrite($filename, $input2, "RatioMethod", "0")
    IniWrite($filename, $input2, "RatioUp", "1")
    IniWrite($filename, $input2, "RatioDown","1")
    IniWrite($filename, $input2, "RatioCredit","0")
    IniWrite($filename, $input2, "MaxSpeedRcv", "512")
    IniWrite($filename, $input2, "MaxSpeedSnd", "512")
    IniWrite($filename, $input2, "QuotaCurrent","0")
    IniWrite($filename, $input2, "QuotaMax","0")
    IniWrite($filename, $input2, "Stat_Login","")
    IniWrite($filename, $input2, "Stat_LastLogin","")
    IniWrite($filename, $input2, "Stat_LastIP","")
    IniWrite($filename, $input2, "Stat_KBUp","")
    IniWrite($filename, $input2, "Stat_KBDown","")
    IniWrite($filename, $input2, "Stat_FilesUp","")
    IniWrite($filename, $input2, "Stat_FilesDown","")
    IniWrite($filename, $input2, "Stat_FailedUp","")
    IniWrite($filename, $input2, "Stat_FailedDown","")
EndFunc
Func Terminate()
    Exit
EndFunc
Edited by Golbez
Link to comment
Share on other sites

  • Developers

what do you mean?

i just want it for new users.. not to edit old ones

for example:

If GUICtrlRead($Radio1) = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents\My Music\")
        ElseIf GUICtrlRead($Radio2) = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents\My Isos\")
            IniWrite($filename, $input2, "Dir1", "F:\My Documents\My Downloads\")
        ElseIf GUICtrlRead($Radio3) = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents") 
        EndIf

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

for example:

If GUICtrlRead($Radio1) = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents\My Music\")
        ElseIf GUICtrlRead($Radio2) = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents\My Isos\")
            IniWrite($filename, $input2, "Dir1", "F:\My Documents\My Downloads\")
        ElseIf GUICtrlRead($Radio3) = 1 then 
            IniWrite($filename, $input2, "Dir0", "F:\My Documents") 
        EndIfoÝ÷ Ûú®¢×²y¨m©ñËZ®×ë,x0Øb¶'âêÞv+hºÛazxjg­¢,¶Ø^+Ã*.v'b´ûr~ò¢êázZg{
®zËb¢z$²^uëÞ¯+axºÛ(ëbë0éâ¦ëbØ^ºÇ«©Ø"½ë
Link to comment
Share on other sites

  • Developers

yeah thanx... i started messing with it. i figured it out then i came to post then i saw you did it :P ty for your help :shocked:

new question: ok.. so i fixxed everything but sometimes when i put in the username it gives = O

how do i fix that?

You need to do a GuiCtrlRead() for ALL controls to retrieve the content, else you have the control handle.

:(

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

You need to do a GuiCtrlRead() for ALL controls to retrieve the content, else you have the control handle.

:shocked:

i did..

it give me the same thing..

it only happens when the input2(login) is the same. anyway to fix that?

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