This powerful utility lets you write scripts within Lotto Sorcerer. For a detailed explanation of what you can do with scripts, please see the Lotto Sorcerer User's Guide, Appendix A: LS Script Introduction. For tutorials, see Appendix B: LS Script Tutorials. And for the Programmer's Reference Guide, see Appendix C: LS Script Programmer's Reference Guide.
How to Invoke
Use the menu item "Utilities > Scripting Laboratory" .
- Enter or load a script into the Source Code window.
- Click the "Run" button to execute the script.
Window Controls - "Source Code" Tab
"Source Code" Text Area
This is where you can type or edit the script's source code.
Clicking this button opens up a file selector, allowing you to save your script. It is strongly recommended that you save your scripts with a ".bas" extension.
"Save As" button
Clicking this button opens up a file selector, allowing you to save your script under a different name. Again, it is strongly recommended that you save your scripts with a ".bas" extension.
Use this to load an existing script.
This will clear the Source Code text area.
This clears all variables from memory, clears the Source Code text area,
the Output text field on tab 2 of the Scripting Laboratory, and the Grid
on tab 3 of the Scripting Laboratory.
Clicking this executes the script.
Saving, Loading and Running Encrypted Scripts
With the Scripting Laboratory, you can save, load and run two different types of encrypted scripts:
The first type, "Encrypted Scripts" can be run by anyone with Lotto Sorcerer's Scripting Laboratory. However, anyone loading this type of encrypted script cannot view the source code.
- Encrypted Scripts
- Keyed Encrypted Scripts
The second type, "Keyed Encrypted Scripts" can only be run by someone who knows the password. No feedback is given to the user if the person enters the wrong password; the script will simply not work, and will present error messages.
Important: in both types of scripts, the source code is never visible and cannot be made visible. If you save a script as an encrypted file (either type), you should save an unencrypted version of the script for your own use.
To save or load encrypted scripts, right-click (Windows) or control-click (Mac) in the Source Code text field. You will be presented with a contextual (popup) menu, with four choices:
"Load Encrypted Source File"
You will be presented with a file selector. Choose the encrypted source file. The source code will not be displayed, but you will be able to run it.
"Load Keyed Encrypted Source File"
You will be presented with a file selector. Choose the encrypted source file. You will then be prompted for the password (4 digits). There is no feedback if you entered the wrong password. The symptom of entering a wrong password is that the script will not run.
If you enter the password correct, the source code will not be displayed, but you will be able to run it.
"Save As Encrypted Source File"
This opens up a file selector, allowing you to save the source code as an encrypted file. It is strongly recommended that you use the ".ebas" file extension.
"Save As Keyed Encrypted Source File"
This opens up a file selector, allowing you to save the source code as an encrypted file. You will be prompted for a password. Enter carefully, there is no verification.
It is strongly recommended that you use the ".ebas" file extension.
The encryption method used is to be considered low-level encryption. It will keep most prying eyes away, but it is not unbreakable code.
Window Controls - "Output" Tab
This tab is for displaying text results from the script, using the PRINT keyword within the script. Be sure to review the documentation for this command in the Programmer's Reference Guide in the Lotto Sorcerer User's Guide.
Once you have data in the Output tab, you have three controls available:
This opens up a standard file selector, allowing you to save the contents of the Output text area to a text file.
This copies the contents of the Output text area to the System Clipboard.
This clears the Output text area.
Window Controls - "Grid" Tab
This is another way to output data from your script. You can control the number of columns, names of the columns, the widths of the columns and the alignment of the columns. Methods are described in the Programmer's Reference Guide and shown in the third example in the LS Script Tutorial (both of which are in the Lotto Sorcerer User's Guide).
This opens up a standard file selector, allowing you to save the contents of the Grid as a tab-delimited text file.
This invokes a file selector, allowing you to save the grid as a Microsoft Excel spreadsheet.
This clears the Grid.
Window Controls - "Graphics" Tab
The graphics tab lets you create your own column, pie, line, area, xy (scatter), bar charts and much more. Methods are described in the Programmer's Reference Guide and shown in the fourth example in the LS Script Tutorial.
After the grid is populated with data from your script, you have one control available:
This invokes a file selector, allowing you to save the canvas in several different image formats.
Window Controls - "Batch" Tab
The Batch tab lets you run multiple scripts, sequentially, in a process known as batch processing. Furthermore, it give you the ability to run dynamic batches... i.e., batches where you can alter the batch while the batch is running (by using the AppendBatchLine command.
Not only can you run scripts you specify, you can also invoke another batch file. However, if you do so, the batch file must be the last item on the list, because, once this line is invoked, the batch list is cleared and populated with the contents of the batch you invoked. The above screenshot shows three scripts (with the ".bas" extension), followed by one batch file (with the ".bat" extension).
What can you do with batch processing? One possibility would be automating the process where Lotto Sorcerer can run suggestions with different settings, and checking to see which setting yields the best result (most number of wins). To do this manually, you would have to adjust the settings in the Projection Parameters tab in the main window; run the suggestions; check the suggestions to see how many suggestions resulted in wins; go back and adjust the parameters again, run the suggestions again, and so forth. But with batch processing, this process can be completely automated. The entire process would take hours, or even days to run, but it would be able to be run unattended.
There are a few important points to remember when doing batch processing:
Any scripts used must not have any interactive elements in them, where the script stops, waiting for user input. Examples of "interactive elements" would be:
- A message box, which waits until the user clicks a button
- A dialog box with a popup menu, which waits until the chooses an item
- A file selector, which waits until the user chooses a file. If any of your scripts require the ability to read and/or write files, do not use the GetFile or SaveFile functions, which open up a file selector; use ReadFile or WriteFile instead, which reads and writes files programmatically, without user interaction.
The delay setting is absolutely critical. The delay is the third column in the Batch tab. This delay does not refer to the delay between scripts, but the delay that the batch processor will wait until launching the next script. If you have a script that takes a long time (for example, suggestion generation), you must make sure that the delay is long enough so that the script can finish.
Scripts and batches must be located in the default location. Scripts
that are invoked within the batch file must be located in the "Scripts" folder of the "Lotto Sorcerer v9 Files" folder (which is located in your "Documents" folder. Batch files invoked from within the batch must be located in the "Batch Files" folder.
Only standard (non-encrypted) scripts can be used in a batch.
"Add Script" Button
This button is at the far bottom-left corner of the window. Click this, and a file selector will open. Choose the script to add to the list.
"Add Batch" Button
This button located at the bottom of the window, second from the left. Click this, and a file selector will open. Choose the batch to add to the list. Only one batch file can exist in the batch list, and it must be the last item on the list.
"Delete Item" Button
This button located at the bottom of the window, third from the left. Choose an item in the batch list that you want to delete, then click this button to delete the item from the list.
This button loads in a previously saved batch list.
"Save Item" Button
This button lets you save the current file list as a batch file.
This button clears the batch file list.
This button executes the batch. The progress of the batch will be shown to the left of the Execute button. To prematurely quit the running batch, just close the Scripting Laboratory window.