OKScript Status Report #19 June 28, 2002 Dear OKScript User, The OKScript Status Report is sent to OKScript licensees, developers and friends when significant updates have been made to the program. Interesting techniques and applications for the program will also be distributed in the report periodically. To update or be removed from the distribution list please see the links at the bottom of this message or write me at yweare@gte.net. This issue explores the use of some of OKScript's more advanced features to create a button panel that issues customized requests for players to the OKbridge lobby. The technique could be easily adapted to other bridge services. SCRIPTING FOR CUSTOMIZED LOBBY CALLS It's helpful for readers of your player request to the lobby to know a few things about your table. I like to include these details when I issue an ad to the lobby: - scoring type (IMPs or MPs) - number of players - player level (intermediate or advanced) - minimum Lehman level - when (now or after this hand) To dedicate a button to each reasonable combination of these would require an unacceptably large panel. An alternative approach is to have buttons that select a value for each criterion and a button that assembles and issues a player request from these values. The button that issues the request might look something like this: MACRO plural MACRO when MACRO style MACRO lev MACRO leh BUTTON request BLACK OKbridge PUT &Need friendly player%plural% %when% %style%-%lev%-%leh%{enter} Buttons to set and clear values in the macros might look something like this: - clear all the macros BUTTON clear RED LET plural LET when LET style LET lev LET leh - set the macro for making "player" plural BUTTON one BLUE LET plural BUTTON many BLUE LET plural s - set the macro for when you need players BUTTON now GREEN LET when now BUTTON next GREEN LET when after this hand - set the macro to announce scoring style BUTTON MPs PURPLE LET style MPs BUTTON IMPs PURPLE LET style IMPs - set the macro for desired player level BUTTON int RED LET lev INT BUTTON intadv RED LET lev INT/ADV BUTTON adv RED LET lev ADV - set the macro for minimum lehman level BUTTON 45 PURPLE LET leh 45{+} BUTTON 46 PURPLE LET leh 46{+} BUTTON 47 PURPLE LET leh 47{+} BUTTON 48 PURPLE LET leh 48{+} BUTTON 49 PURPLE LET leh 49{+} Add a few NEWLINEs to format the panel and this code performs what we set out to do. A problem that can come up with such a panel is previewing and verifying which choices have been selected. OKScript's status bar and universal button handler features make this easy to include. To add a status bar to (the top of) a button panel place this line of code at the start of your script: PRAGMA statusbar To write the user's selections to the status bar add this code to your script: DO after left MODE status blue %when% player%plural% %style% %lev% %leh% This DO instruction executes the instructions that follow (a MODE instruction in this case) whenever the normal processing of a left button click is completed. This MODE instruction writes the macro values to the status bar. Note that clicking the CLEAR button causes the status bar display to be cleared. Here is the whole script that you can experiment with by selecting it and moving it to OKScript's editor via the clipboard. NEWLINEs have been added so that the panel is wide enough to preview all the selections. PRAGMA statusbar DO after left MODE status blue %when% player%plural% %style% %lev% %leh% MACRO plural MACRO when MACRO style MACRO lev MACRO leh - clear all the macros BUTTON clear RED LET plural LET when LET style LET lev LET leh - set the macro for making "player" plural BUTTON one BLUE LET plural BUTTON many BLUE LET plural s - set the macro for when you need players BUTTON now GREEN LET when now BUTTON next GREEN LET when after this hand NEWLINE - set the macro to announce scoring style BUTTON MPs PURPLE LET style MPs BUTTON IMPs PURPLE LET style IMPs - set the macro for desired player level BUTTON int RED LET lev INT BUTTON intadv RED LET lev INT/ADV BUTTON adv RED LET lev ADV NEWLINE - set the macro for minimum lehman level BUTTON 45 PURPLE LET leh 45{+} BUTTON 46 PURPLE LET leh 46{+} BUTTON 47 PURPLE LET leh 47{+} BUTTON 48 PURPLE LET leh 48{+} BUTTON 49 PURPLE LET leh 49{+} BUTTON REQUEST BLACK OKbridge PUT &Need friendly player%plural% %when% %style%-%lev%-%leh%{enter} For more information, or to offer suggestions or interesting techniques or applications for OKScript, write me at yweare@gte.net, or visit the website at http://home1.gte.net/yweare/index.htm Thank you for supporting the development of OKScript. Michael Mardesich okb://mikezzz