momar33 Posted December 19, 2013 Posted December 19, 2013 (edited) I have a poker timer program that has a feature to add a re-buy. Currently the re-buy is just used to calculate the number of chips at the table and pot size. I am trying to add functionality to keep track of who did the re-buy.I have added functionality to add players names, which get saved to an array. What I would like the "Add Re-buy" button to do is bring up a second gui with a button for each player currently in the game. Since the number of players changes, I am using a for loop to create the buttons. The problem comes when I try to determine which button was pressed. I am using GUIOnEventMode. Since I don't know how many buttons there will be, I can't create functions for each of the buttons. Instead what I am trying to do is have one Function that all buttons call. This seems to work fine, if i want all the buttons to do the same thing. Is there a way I can use my single function (RebuyAdded) to determine which of the buttons was pressed? Here is the code for my secondary Gui:<snip> Edited December 20, 2013 by Melba23 Code removed
Moderators Melba23 Posted December 20, 2013 Moderators Posted December 20, 2013 (edited) momar33,I am surprised that as a member of such long standing you appear not to have read the Forum rules. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. M23Edit: A PM exchange has cleared the OP from any wrongdoing - the script is an aid to a real-life card game with flesh-and-blood players and cardboard cards - but I am leaving the lock in place. The answer to the OP's problem is, of course, @GUI_CtrlId - and the answer to not getting your thread locked unnecessarily is to avoid using the "G-word" when you post. Edited December 20, 2013 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts