cowsmanaut Posted July 1, 2004 Share Posted July 1, 2004 (edited) ok so I wanted a tool that could help me and my fellow faculty to keep control of the class. As well as aid in regular functions. Like creating logins for students, loading programs, displaying images, locking the desktop (so they don't sit and do something else during a lecture), minimize all windows (like email and web surfing.. again to promote class attention). Anyway, this is the teacher's end of the tool. I have annother script I'm mostly done that I'll post later which is the slave program that sits there and waits for the INI file to arrive and do the functions. so.. here it is.. I'm sure somethings can be reduced to make it more simplified. feel free to post corrections or ideas. expandcollapse popup#include <GUIConstants.au3> ;CREATE NEW GUI GuiCreate( "Capilano College", 400, 300) GUICreateEx( -1,) GuiShow() WinSetOnTop("Capilano College", "find file", 1) Opt("GuiNotifyMode",1) $A="-1" $B="-1" $C="-1" $D="-1" $E="-1" $F="-1" $G="-1" $H="-1" $I="-1" $J="-1" $K="-1" $L="-1" $M="-1" $N="-1" $O="-1" $P="-1" $Q="-1" $R="-1" $S="-1" $T="-1" $U="-1" $V="-1" $W="-1" $X="-1" $Y="-1" $Z="-1" $ZA="-1" $ZB="-1" $ZC="-1" $ZD="-1" $ref=GUISetControl("button", "Find Image", 0, 10, 200, 30, 0x1000);$A $refb=GUISetControl("button", "Find File", 200, 10, 200, 30, 0x1000);$B $Minput=GUISetControl("edit", "type message here", 5, 195, 220, 70) GUISetControl( "group", "Functions", 5, 50, 130, 140) $log=GUISetControl("checkbox", "Create Login", 15, 70, 100,20);$C $mess=GUISetControl("checkbox", "Send Message", 15, 90, 100,20);$D $prog=GUISetControl("checkbox", "Load Program", 15, 110, 100,20);$E $lock=GUISetControl("checkbox", "Lock Desktop", 15, 130, 100,20);$F $imag=GUISetControl("checkbox", "Display Image", 15, 150, 100,20);$G $mini=GUISetControl("checkbox", "Minimize All", 15, 170, 100,20);$H GUISetControl( "group", "Computers", 230, 50, 160, 245) $01=GUISetControl("checkbox", "DIGI01", 240, 70, 50,20);$I $02=GUISetControl("checkbox", "DIGI02", 240, 90, 50,20);$J $03=GUISetControl("checkbox", "DIGI03", 240, 110, 50,20);$K $04=GUISetControl("checkbox", "DIGI04", 240, 130, 50,20);$L $05=GUISetControl("checkbox", "DIGI05", 240, 150, 50,20);$M $06=GUISetControl("checkbox", "DIGI06", 240, 170, 50,20);$N $07=GUISetControl("checkbox", "DIGI07", 240, 190, 50,20);$O $08=GUISetControl("checkbox", "DIGI08", 240, 210, 50,20);$P $09=GUISetControl("checkbox", "DIGI09", 240, 230, 50,20);$Q $10=GUISetControl("checkbox", "DIGI10", 240, 250, 50,20);$R $11=GUISetControl("checkbox", "DIGI11", 240, 270, 50,20);$S $12=GUISetControl("checkbox", "DIGI12", 310, 70, 50,20);$T $13=GUISetControl("checkbox", "DIGI13", 310, 90, 50,20);$U $14=GUISetControl("checkbox", "DIGI14", 310, 110, 50,20);$V $15=GUISetControl("checkbox", "DIGI15", 310, 130, 50,20);$W $16=GUISetControl("checkbox", "DIGI16", 310, 150, 50,20);$X $17=GUISetControl("checkbox", "DIGI17", 310, 170, 50,20);$Y $18=GUISetControl("checkbox", "DIGI18", 310, 190, 50,20);$Z $19=GUISetControl("checkbox", "DIGI19", 310, 210, 50,20);$ZA $20=GUISetControl("checkbox", "DIGI20", 310, 230, 50,20);$ZB $21=GUISetControl("checkbox", "DIGI21", 310, 250, 50,20);$ZC $22=GUISetControl("checkbox", "DIGI22", 310, 270, 50,20);$ZD $button=GUISetControl("button", "done", 5,270) GUISetControlEx(-1, $gui_focus) ; SET FOCUS TO DONE BUTTON $note = "Hold down Ctrl or Shift to choose multiple files." $var = "find image" $file = 0 $varb = "find file" $fileb = 0 ;START CHECKING BUTTONS While 1 $msg = GuiMsg(0) if $msg = -3 then Exit If $msg = $ref Then ; OPEN IMAGE WINDOW $file= FileOpenDialog($note, "C:\Windows\", "Images (*.jpg;*.bmp)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Else $var = Stringright($file, 8) msgbox (0, "message", $var) EndIf GUIWrite($ref,0,$var) ; IMAGE BUTTON SHOWS NEW TEXT elseIf $msg = $refb Then ; OPEN FILE WINDOW $fileb= FileOpenDialog($note, "C:\Windows\", "files (*.exe)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Else $varb = Stringright($fileb, 8) msgbox (0, "message", $varb) EndIf GUIWrite($refb,0,$varb) ; FILE BUTTON SHOWS NEW TEXT EndIf ; TOGGLE BUTTON VALUES WHEN PRESSED if $msg = $log then $C=$C*"-1" if $msg = $mess then $D=$D*"-1" if $msg = $prog then $E=$E*"-1" if $msg = $lock then $F=$F*"-1" if $msg = $imag then $G=$G*"-1" if $msg = $mini then $H=$H*"-1" if $msg = $01 then $I=$I*"-1" if $msg = $02 then $J=$J*"-1" if $msg = $03 then $K=$K*"-1" if $msg = $04 then $L=$L*"-1" if $msg = $05 then $M=$M*"-1" if $msg = $06 then $N=$N*"-1" if $msg = $07 then $O=$O*"-1" if $msg = $08 then $P=$P*"-1" if $msg = $09 then $Q=$Q*"-1" if $msg = $10 then $R=$R*"-1" if $msg = $11 then $S=$S*"-1" if $msg = $12 then $T=$T*"-1" if $msg = $13 then $U=$U*"-1" if $msg = $14 then $V=$V*"-1" if $msg = $15 then $W=$W*"-1" if $msg = $16 then $X=$X*"-1" if $msg = $17 then $Y=$Y*"-1" if $msg = $18 then $Z=$Z*"-1" if $msg = $19 then $ZA=$ZA*"-1" if $msg = $20 then $ZB=$ZB*"-1" if $msg = $21 then $ZC=$ZC*"-1" if $msg = $22 then $ZD=$ZD*"-1" If $msg = $button Then exitloop; IF YOU PRESS DONE ALL THIS INFORMATION IS STORED AND WE MOVE ON Wend ;START DOING SOMETHING USEFULL (makes the INI file) $message = guiread($Minput) If $H=1 then IniWrite ("C:\au3_tool\command.ini", "mini", "key", "1") If $C=1 then IniWrite ("C:\au3_tool\command.ini", "login", "key", "1") If $D=1 then IniWrite ("C:\au3_tool\command.ini", "message", "key", $message) If $E=1 then IniWrite ("C:\au3_tool\command.ini", "prog", "key", $fileb) If $F=1 then IniWrite ("C:\au3_tool\command.ini", "lock", "key", "1") If $G=1 then IniWrite ("C:\au3_tool\command.ini", "image", "key", $file) ;WHO DO I SEND THIS TO? (copy file to the requested computers on the network) if $I=1 then FileCopy("C:\au3_tool\*.ini", "\\digi01\c$\au3_test\*.*") if $J=1 then FileCopy("C:\au3_tool\*.ini", "\\digi02\c$\au3_test\*.*") if $K=1 then FileCopy("C:\au3_tool\*.ini", "\\digi03\c$\au3_test\*.*") if $L=1 then FileCopy("C:\au3_tool\*.ini", "\\digi04\c$\au3_test\*.*") if $M=1 then FileCopy("C:\au3_tool\*.ini", "\\digi05\c$\au3_test\*.*") if $N=1 then FileCopy("C:\au3_tool\*.ini", "\\digi06\c$\au3_test\*.*") if $O=1 then FileCopy("C:\au3_tool\*.ini", "\\digi07\c$\au3_test\*.*") if $P=1 then FileCopy("C:\au3_tool\*.ini", "\\digi08\c$\au3_test\*.*") if $Q=1 then FileCopy("C:\au3_tool\*.ini", "\\digi09\c$\au3_test\*.*") if $R=1 then FileCopy("C:\au3_tool\*.ini", "\\digi10\c$\au3_test\*.*") if $S=1 then FileCopy("C:\au3_tool\*.ini", "\\digi11\c$\au3_test\*.*") if $T=1 then FileCopy("C:\au3_tool\*.ini", "\\digi12\c$\au3_test\*.*") if $U=1 then FileCopy("C:\au3_tool\*.ini", "\\digi13\c$\au3_test\*.*") if $V=1 then FileCopy("C:\au3_tool\*.ini", "\\digi14\c$\au3_test\*.*") if $W=1 then FileCopy("C:\au3_tool\*.ini", "\\digi15\c$\au3_test\*.*") if $X=1 then FileCopy("C:\au3_tool\*.ini", "\\digi16\c$\au3_test\*.*") if $Y=1 then FileCopy("C:\au3_tool\*.ini", "\\digi17\c$\au3_test\*.*") if $Z=1 then FileCopy("C:\au3_tool\*.ini", "\\digi18\c$\au3_test\*.*") if $ZA=1 then FileCopy("C:\au3_tool\*.ini", "\\digi19\c$\au3_test\*.*") if $ZB=1 then FileCopy("C:\au3_tool\*.ini", "\\digi20\c$\au3_test\*.*") if $ZC=1 then FileCopy("C:\au3_tool\*.ini", "\\digi21\c$\au3_test\*.*") if $ZD=1 then FileCopy("C:\au3_tool\*.ini", "\\digi22\c$\au3_test\*.*") the computers names are related to our one classroom and will be altered for other classes in our department as they can be for those of you who might find other uses for this. enjoy Edited July 1, 2004 by cowsmanaut Link to comment Share on other sites More sharing options...
Guest Jock_of_all_Nations Posted January 27, 2005 Share Posted January 27, 2005 Hi - did you ever finish the slave version of this script as I would be very interested in using it at the school where I work. Cheers, Jock. Link to comment Share on other sites More sharing options...
Insolence Posted January 28, 2005 Share Posted January 28, 2005 Why not just copy it to ONE file on a shared disc, if you have it? Just add seperate categories: [digi21] Command [digi22] Command I made something similar to this, much less 'feature filled' though. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
ryeguy Posted January 28, 2005 Share Posted January 28, 2005 Read the help section about arrays and "for" loops. Link to comment Share on other sites More sharing options...
CyberSlug Posted January 28, 2005 Share Posted January 28, 2005 (edited) Try this.... Note that this example uses the updated GUI syntax, so you need the latest beta version of AutoItexpandcollapse popup#include <GUIConstants.au3> ;CREATE NEW GUI GUICreate("Capilano College", 400, 300) GUISetState(@SW_SHOW) WinSetOnTop("Capilano College", "find file", 1) $ref = GUICtrlCreateButton("Find Image", 0, 10, 200, 30, 0x1000) $refb = GUICtrlCreateButton("Find File", 200, 10, 200, 30, 0x1000) $Minput = GUICtrlCreateEdit("type message here", 5, 195, 220, 70) $SelectAll = GUICtrlCreateButton("Select All", 140, 60, 80, 20) $UnSelectAll = GUICtrlCreateButton("UnSelect All", 140, 100, 80, 20) $ToggleAll = GUICtrlCreateButton("Toggle All", 140, 140, 80, 20) GUICtrlCreateGroup("Functions", 5, 50, 130, 140) $log = GUICtrlCreateCheckbox("Create Login", 15, 70, 100, 20) $mess = GUICtrlCreateCheckbox("Send Message", 15, 90, 100, 20) $prog = GUICtrlCreateCheckbox("Load Program", 15, 110, 100, 20) $lock = GUICtrlCreateCheckbox("Lock Desktop", 15, 130, 100, 20) $imag = GUICtrlCreateCheckbox("Display Image", 15, 150, 100, 20) $mini = GUICtrlCreateCheckbox("Minimize All", 15, 170, 100, 20) GUICtrlCreateGroup("Computers", 230, 50, 160, 245) Dim $checkbox[22] ; First column of checkboxes For $i = 0 To 10 $checkbox[$i] = GUICtrlCreateCheckbox("DIGI" & PadZero($i + 1), 240, 70 + 20 * $i, 60, 20) Next ; Second colum of checkboxes For $i = 11 To 21 $checkbox[$i] = GUICtrlCreateCheckbox("DIGI" & ($i + 1), 310, 70 + 20* ($i - 11), 60, 20) Next $button = GUICtrlCreateButton("done", 5, 270) GUICtrlSetState(-1, $gui_focus) $note = "Hold down Ctrl or Shift to choose multiple files." $var = "find image" $file = 0 $varb = "find file" $fileb = 0 ;START CHECKING BUTTONS While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit;quit program Case $msg = $button ExitLoop;process results below... Case $msg = $SelectAll For $i = 0 To 21 GuiCtrlSetState($checkbox[$i], $GUI_CHECKED) Next Case $msg = $UnSelectAll For $i = 0 To 21 GuiCtrlSetState($checkbox[$i], $GUI_UNCHECKED) Next Case $msg = $ToggleAll For $i = 0 To 21 If GuiCtrlRead($checkbox[$i]) = $GUI_CHECKED Then GuiCtrlSetState($checkbox[$i], $GUI_UNCHECKED) Else GuiCtrlSetState($checkbox[$i], $GUI_CHECKED) EndIf Next Case $msg = $ref;OPEN IMAGE WINDOW $file = FileOpenDialog($note, "C:\Windows\", "Images(*.jpg;*.bmp)", 1 + 4) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $var = StringRight($file, 8) MsgBox(0, "message", $var) EndIf GUICtrlSetData($ref, $var); IMAGE BUTTON SHOWS NEW TEXT Case $msg = $refb;OPEN FILE WINDOW $fileb = FileOpenDialog($note, "C:\Windows\", "files(*.exe)", 1 + 4) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $varb = StringRight($fileb, 8) MsgBox(0, "message", $varb) EndIf GUICtrlSetData($refb, $varb); FILE BUTTON SHOWS NEW TEXT EndSelect WEnd ;START DOING SOMETHING USEFUL (makes the INI file) $message = GUICtrlRead($Minput) If GUICtrlRead($log) = $GUI_CHECKED Then IniWrite("C:\au3_tool\command.ini", "mini", "key", "1") If GUICtrlRead($mess) = $GUI_CHECKED Then IniWrite("C:\au3_tool\command.ini", "login", "key", "1") If GUICtrlRead($prog) = $GUI_CHECKED Then IniWrite("C:\au3_tool\command.ini", "message", "key", $message) If GUICtrlRead($lock) = $GUI_CHECKED Then IniWrite("C:\au3_tool\command.ini", "prog", "key", $fileb) If GUICtrlRead($imag) = $GUI_CHECKED Then IniWrite("C:\au3_tool\command.ini", "lock", "key", "1") If GUICtrlRead($mini) = $GUI_CHECKED Then IniWrite("C:\au3_tool\command.ini", "image", "key", $file) ;WHO DO I SEND THIS TO? (copy file to the requested computers on the network) For $i = 0 To 21 If GUICtrlRead($checkbox[$i]) = $GUI_CHECKED Then FileCopy("C:\au3_tool\*.ini", "\\digi" & PadZero($i+1) & "\c$\au3_test\*.*") Next ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func PadZero($num);converts numbers like "3" to "03" If $num <= 9 Then Return "0" & $num EndFunc ;==>PadZero Edited January 28, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now