NewNinja Posted May 7, 2012 Share Posted May 7, 2012 I am trying to make a text based adventure game, but I want to add cheat codes to it, so you just type in the code and it gives you a bonus or something. That is why I needed to know how to do it. I will just say the problem again. I wanted it to concatenate x amount of any letter you type to a string whilst the program is running. Sorry if it bothers you for me to remake the topic :/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2012 Moderators Share Posted May 7, 2012 NewNinja, A simple question - in this game do you intend to have some form of input or edit control into which you type and then press a button/Enter key to start parsing the text, or are you looking to read all the user keypresses without them ever being displayed on screen? M23 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 Link to comment Share on other sites More sharing options...
NewNinja Posted May 7, 2012 Author Share Posted May 7, 2012 (edited) Well I want it that people will not know that you can cheat on it, I think that is what some of the fun is. I just need something which will be able to read what the user types in then it anaylses the whole string to see if it has the cheat code in. If you think someone is going to use the code as a key logger you can just message it to me? Edited May 7, 2012 by NewNinja Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2012 Moderators Share Posted May 7, 2012 NewNinja, That does not answer the question I asked. What code have you got so far to read the user's input? M23 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 Link to comment Share on other sites More sharing options...
NewNinja Posted May 7, 2012 Author Share Posted May 7, 2012 (edited) Here is all of my code so far $run = True $Main = GUICreate("Adventure Game", 250, 100) $character_setup = GUICtrlCreateInput("Replace this text with you adventurer's name", 10, 10, 230, 20) $cheatcodestring = "" $start = GUICtrlCreateButton("Start the Adventure!", 10, 40, 230, 30) GUISetState(@SW_SHOW, $main) while $run = True Switch GUIGetMsg() Case - 3 Exit EndSwitch ; Then the code for recognizing the cheatcode goes here if $cheatcodestring = "super" Then EndIf WEnd Edited May 7, 2012 by NewNinja Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2012 Moderators Share Posted May 7, 2012 NewNinja,And how will you proceed during the game? Will the user always type into that GUI or some other input control? How are you filling that $cheatcodestring variable? I am trying very hard to find a reason not to lock this thread and you are not being very helpful. M23 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 Link to comment Share on other sites More sharing options...
NewNinja Posted May 8, 2012 Author Share Posted May 8, 2012 sorry for the late reply, It is just going to be a series of text boxes with two buttons which will change the outcome. The user must choose the right options to get the successful outcome. After typing in your name you are only going to be clicking buttons. Could you explain what you mean by filling the $cheatcodestring variable? sorry :s Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 8, 2012 Moderators Share Posted May 8, 2012 NewNinja, Could you explain what you mean by filling the $cheatcodestring variable?You start off with an empty variable: $cheatcodestring = "" and later in the script check it: if $cheatcodestring = "super" Then So the question is - How do you get a value into that variable? If you are going to parse the content of your "series of text boxes" then there is no problem at all. If you are looking to intercept keystrokes made when no such "text box" is on the screen then you have a problem because that would require keylogger-type code which is one of the real no-noes here. Is that clear enough to get a clear answer from you? M23 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 Link to comment Share on other sites More sharing options...
ZacUSNYR Posted May 8, 2012 Share Posted May 8, 2012 I don't think he knows how and that's what he is asking heh. 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