strate Posted January 31, 2006 Share Posted January 31, 2006 (edited) How do I make a script that will capture a users input without any GUI's or input boxes. I need to make a program that the user will scan a bar-code and then the script will do the desired action. The script has to have virtually no user interaction besides scanning the bar-code. The bar-code will contain a user ID number and nothing else. This is for tracking cycle times and finding the "bad apples" on our production floor. Is this even possible? EDIT: the scan gun I will be testing this with inserts a CR at the end of the input. I can write a script for this out. I need help with it if it is used at a terminal that doesn't insert the scan gun. A GUI is okay I just don't want the user to have to interact such as clicking buttons and such. Edited January 31, 2006 by strate INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 31, 2006 Share Posted January 31, 2006 HI, sorry I must admit, I don´t get your problem. Maybe you could check whether a file is there or something else. You can build a loop and check whether a specific thing has changed. Perhaps, you can write your intention in prose (text, words), so that I can understand a bit more the details. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2006 Developers Share Posted January 31, 2006 As far as I understand, a Barcodegun really emulates keystrokes, so why not use a gui with an Edit control on it that has the focus. All you need to do is to check the content of the Edit control for the right string ... 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 More sharing options...
strate Posted January 31, 2006 Author Share Posted January 31, 2006 Below is how it will be completed when using the scan gun that emulates a CR. #include 'GUIConstants.au3' HotKeySet('{ENTER}','Transfer_CR') GUICreate("User Scan:", 320, 30, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 100, -1, 0x0) $INPUT_DATA = GUICtrlCreateInput("", 10, 5, 250, 20) $Btn_Continue = GUICtrlCreateButton("Continue", 265, 5, 50, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() MsgBox(0,'User Scan Notice','User Closed Out of Program') ExitLoop Case $msg = $Btn_Continue GUIDelete() MsgBox(0,'User Scan Notice','Scan Closed Correctly') ExitLoop EndSelect WEnd Exit Func Transfer_CR() ControlClick('User Scan:','','Button1') EndFuncI want the user to scan one bar-code. I want this to be the easiest program for the most computer illiterate person. How can I do this with a scan gun that doesn't send the CR? INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
strate Posted January 31, 2006 Author Share Posted January 31, 2006 As far as I understand, a Barcodegun really emulates keystrokes, so why not use a gui with an Edit control on it that has the focus.All you need to do is to check the content of the Edit control for the right string ...This would work but every loop it would have to pull an array out of a file and search it for the string. The file one day could possibly be 4000 lines and that may take longer than I would like. Has a cycle like this ever been timed? INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
seandisanti Posted January 31, 2006 Share Posted January 31, 2006 This would work but every loop it would have to pull an array out of a file and search it for the string. The file one day could possibly be 4000 lines and that may take longer than I would like. Has a cycle like this ever been timed?times will vary, worst case scenario you can time it yourself with TimerInit() and TimerDiff() one second, i'll make a little gui for you and i'll time test it. It really should be nothing noticable. also, you don't necessarily have to load the file every time, but give me a few and i'll have somethign for you to think about. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2006 Developers Share Posted January 31, 2006 This would work but every loop it would have to pull an array out of a file and search it for the string. The file one day could possibly be 4000 lines and that may take longer than I would like. Has a cycle like this ever been timed?I would make that 2 seperate processes (Programs) when theres no need to wait for the answer after a scan:Task 1: only receiving input and making that available to another process by using and INI or other file.Task 2: Scan for file updates and process them in batch... 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 More sharing options...
seandisanti Posted January 31, 2006 Share Posted January 31, 2006 I would make that 2 seperate processes (Programs) when theres no need to wait for the answer after a scan:Task 1: only receiving input and making that available to another process by using and INI or other file.Task 2: Scan for file updates and process them in batch...good idea. i was just about to ask why there had to be any searching, i mean is this to verify that the barcode scanned is valid? or is it to check a status, like in/out/in/out of a shift with lunch? Link to comment Share on other sites More sharing options...
strate Posted January 31, 2006 Author Share Posted January 31, 2006 The searching.... I want it so that if a new badge number is scanned it will know that. I only need it to search after a scan is completed. So it knows if it needs to create a new user file or not. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
strate Posted January 31, 2006 Author Share Posted January 31, 2006 Further in detail about the program... Here at work we use a document that after a bunch of data is entered it will tell us if we made rate. The document is very inacurate and tells us nothing at all really. What I have been asked to do is recreate it. It will know who (badge number) does what such as quality, forklift driver, and line cordinator. It will time many different processes. For instance, when the line leader scans in it will show they are about to start a job. When quality scans in it will show that the job has been started. When the line leader scan again it will show they stopped for some reason. If a quality tech is the next to scan it will show that they stopped due to quality. Then the time frame from when the line leader scanned to the time the quality tech scanned will show how long the production line has stopped. Same thing with forklifts. It will show us where we might need more man power or we need to look at our processes. Production: Each user has a badge with a barcode of their employee number on it. When the user scans it will log who else they are working with. After a period of time it might show a user that might not be working hard. Production Runs: We have about 7500 different product lines and each one will take a different amount of time to pack. It will log the the length of time, each time, you did a certain product. After a couple times it will average it out. It will alert the supervisor then that a line might need a little "encouragement". Sorry if none of that makes any sense. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
strate Posted February 1, 2006 Author Share Posted February 1, 2006 Nobody? INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
seandisanti Posted February 1, 2006 Share Posted February 1, 2006 Nobody?i should have something for you today, but unfortunately my own job is being kind of demanding today Link to comment Share on other sites More sharing options...
strate Posted February 3, 2006 Author Share Posted February 3, 2006 i should have something for you today, but unfortunately my own job is being kind of demanding todayWork fasinates me, I can sit and stare at it for hours. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... 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