Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 262, 327, 192, 124)
- $Input1 = GUICtrlCreateInput("", 96, 72, 121, 21)
- $Input2 = GUICtrlCreateInput("", 96, 104, 121, 21)
- $Input3 = GUICtrlCreateInput("", 96, 136, 121, 21)
- $Label1 = GUICtrlCreateLabel("Channel", 32, 76, 43, 17)
- $Label2 = GUICtrlCreateLabel("Nick", 32, 109, 26, 17)
- $Label3 = GUICtrlCreateLabel("Authname", 32, 140, 52, 17)
- $Button1 = GUICtrlCreateButton("Search", 24, 176, 75, 25, $WS_GROUP)
- $Button2 = GUICtrlCreateButton("create", 144, 176, 75, 25, $WS_GROUP)
- $Edit1 = GUICtrlCreateEdit("", 16, 208, 201, 89)
- GUICtrlSetData(-1, "")
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Global $job=0
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $button1
- $check= GUICtrlRead($input1)&GUICtrlRead($input2)&GUICtrlRead($Input3)
- If $check = "" Then
- MsgBox(0,"Error","You have to give at least one information")
- EndIf
- If GUICtrlRead($input1) Then
- $channel= GUICtrlRead($input1)&".ini"
- $aini= IniReadSectionNames($channel)
- $aSection = IniReadSection($channel, 'section')
- $strForEdit = ''
- $values = ''
- For $i=1 to UBound($aini) -1
- $values = ''
- $strForEdit &= "[" & $aini[$i] & "]" & @CRLF
- $aSection = IniReadSection($channel, $aini[$i])
- For $v = 1 To UBound($aSection) -1
- $values &= $aSection[$v][0] & '=' & $aSection[$v][1] & @CRLF
- Next
- $strforedit &= $values & @CRLF
- Next
- GUICtrlSetData($edit1,$strforedit)
- EndIf
- If GUICtrlRead($input2) Then
- If GUICtrlRead($input1) Then
- $channel= GUICtrlRead($input1)&".ini"
- $name= GUICtrlRead($input2)
- $value= $name & "=" &IniRead($channel,"names",$name,"NO USER FOUND")
- GUICtrlSetData($edit1,$value)
- Else
- MsgBox(0,"Error","You haven't defined a channel")
- EndIf
- EndIf
- If GUICtrlRead($input3) Then
- If GUICtrlRead($input1) Then
- $channel= GUICtrlRead($input1)&".ini"
- $name= GUICtrlRead($input3)
- $value= $name & "=" &IniRead($channel,"auths",$name,"NO USER FOUND")
- GUICtrlSetData($edit1,$value)
- Else
- MsgBox(0,"Error","You haven't defined a channel")
- EndIf
- EndIf
- case $button2
- $check= GUICtrlRead($input1)&GUICtrlRead($input2)&GUICtrlRead($Input3)
- If $check = '' Then
- MsgBox(0,"Error","there is nothing to create")
- EndIf
- If GUICtrlRead($input1) Then
- If Guictrlread($input2) Then
- if GUICtrlRead($input3) Then
- $channel= GUICtrlRead($input1) & ".ini"
- $section= "names"
- $section2= "auths"
- $name= GUICtrlRead($input2)
- $authname= GUICtrlRead($input3)
- $level= InputBox("Level","please define an user level")
- IniWrite($channel,$section,$name,$level)
- IniWrite($channel,$section2,$authname,$level)
- MsgBox(0,"success","New User:"& $name &"("& $authname &") have been created in "& $channel &" with userlevel:" & $level)
- EndIf
- EndIf
- EndIf
- EndSwitch
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement