Fubb Posted February 12, 2009 Share Posted February 12, 2009 New to the community here, and pretty much a n00b at AutoIt, but i had aidea for an extremely simple game. It'll be based on the day the recon aircraft flying over Cuba discovered the launch site, thus begining the Cuban Missile Crisis. As the President, you will have to be consaulted by ministers about the current situation. They'll give you an option, and youll get to rpely "Yes" or "No". If one says "Yes" then youll have a different string of questions coming for you then if you said no, because, well, if you said "no" certain things wouldn't have happened. Well, each "yes" or "No" will advance time on a certain interval, e.g one may advance time by 1 hour, 1 day, 5hours, 30 minutes, so on so forth, andyou choices will decide whether or not the Cuban |Missile crisis will have a good ending for you, those dang Commies', or everyone, or...No one. (Boom) And depending on your choices you'll get certain points, and at the end youll get them totalled, and ya.... So. I can't do this with a simple "Msgbox", so heres the first issue. I need a GUI. I've never made a GUI. Hazah. Also the last time i used actual functions was like....oh gosh....probably atleast 6 months ago by now, because i had a big time of "Not using AutoIT" in summer, so im fairly rusty. Being to lazy to search for tutorials doesn't help either. yay Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
spudw2k Posted February 12, 2009 Share Posted February 12, 2009 Why can't you use a msgbox? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
FireFox Posted February 12, 2009 Share Posted February 12, 2009 @Fubb Welcome to autoit forum Dont forget to : -Search on forum and helpfile before posting -Read FAQs now Look at MsgBox ; TimerInit ; TimerDiff Its kind simple Cheers, FireFox. Link to comment Share on other sites More sharing options...
Fubb Posted February 12, 2009 Author Share Posted February 12, 2009 (edited) Well, as i said, im basically a n00b. Explain what i could do in the message box, so if I said "Yes" a different string would come up, and if I said "no" a different string would come up. EDIT: Also i want to use pictures in it if possible, which is where the GUI would come in handy, no? Edited February 12, 2009 by Fubb Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
FireFox Posted February 12, 2009 Share Posted February 12, 2009 @Fubb How to use helpfile : Q20 in FAQs (Sticky on this forum) $choice = MsgBox(32, "Yes/No", "Ok or Cancel ?") If $choice = 1 Then MsgBox(64, "Yes/No", "Ok Clicked !") ElseIf $choice = 2 Then MsgBox(64, "Yes/No", "Cancel Clicked !") EndIf Cheers, FireFox. Link to comment Share on other sites More sharing options...
Fubb Posted February 12, 2009 Author Share Posted February 12, 2009 in this, choice 1 is "Ok" and 2 is cancel? Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
FireFox Posted February 12, 2009 Share Posted February 12, 2009 @Fubb $GUI = GuiCreate("GUI", 200, 200) GuiCtrlCreatePic("yourpath.ext", 5, 5) GuiSetState(@SW_SHOW, $GUI) While 1 ;start loop (script wont exit until exit function or ExitLoop) Sleep(250) ;always repeated WEnd Cheers, FireFox. Link to comment Share on other sites More sharing options...
FireFox Posted February 12, 2009 Share Posted February 12, 2009 in this, choice 1 is "Ok" and 2 is cancel?Yup, now please read what I told you...Cheers, FireFox. Link to comment Share on other sites More sharing options...
Bert Posted February 12, 2009 Share Posted February 12, 2009 You admit you are lazy.... You admit you are new.... You seem you want to learn... Then simply take AutoIt 1 2 3. The link is in my signature. By the time you take it, you will be so much farther along, and you will save yourself a bunch of time. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Fubb Posted February 12, 2009 Author Share Posted February 12, 2009 well problem is i can only get on at school and my friends laptop (which im not installing AutoIt to it) but its on my actual computer, only problem is.....it died on saturday. Motherboard burnt. Thankgod, that thing was 8 years old, but luckily our 500GB internal harddrive is FINE but we were supposed to have our new PC by tommorrow so i could have my autoit on it, but now its not goona come til NEXT week. A similar story to the Fallout 3 i ordered 4 weeks ago. Still hasn't come in. It was supposed to be in by the end of Week 2. :\ Canada must be like, the epicenter of slow delivery. Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
Fubb Posted February 13, 2009 Author Share Posted February 13, 2009 Okee Dokee, im back at school, and am going to start creation of the game. You'll know if i have problems Cause ill let you know. :] Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
StrategicX Posted February 13, 2009 Share Posted February 13, 2009 Wow, I like this idea of a simple game Nice idea mate! I suggest using InputBox() instead of a message box, But thats just me... a msgbox will work the same.. But if you start to learn some more and wanted to go into bigger answers inputbox() would be the way to go! well good luck mate, Im eager to see this finished project and if you need anymore help with anything dont hesitate to ask or PM me *WoW Dev Projects: AFK Tele Bot development journalSimple Player Pointer Scanner + Z-Teleport*My Projects: coming soon.Check out my WoW Dev wiki for patch 3.0.9!http://www.wowdev.wikidot.com Link to comment Share on other sites More sharing options...
CodyBarrett Posted February 13, 2009 Share Posted February 13, 2009 OR you can use GUI, its relatively easy goin g just when a button is pressed hide and unhide labels, use timerinit() and timediff() its not really hard i made a simple point and clieck game my self check my sig but yeah WELCOME TO THE FORUMS FUBB! but really use the helpfile its your best friend [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Fubb Posted February 13, 2009 Author Share Posted February 13, 2009 *Sigh* I guess I have no choice. This isn't liek the good ole' days where the coders coded by themselves, no help, no help files, or nothing... *cough*not that I would know*cough* Actually I guess it's a good thing we've turned into a global community on relying on the intellegiance (spelling?) of others in order for our selves to "Rise to the top" So. Yes. Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
CodyBarrett Posted February 13, 2009 Share Posted February 13, 2009 i know im a terrible speller lol... but yeah thats why the forums are here [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
StrategicX Posted February 13, 2009 Share Posted February 13, 2009 ^^ What he said...The AutoIT help file is the best info. Ive every come across for the a scripting language... seriously its straight to the point and you can search a specific function with no bullshit + whats related to it... Try to do that with MSDN...(lolz) youll get like a google search a bunch of crap your not even looking for.. But seriously just use the search section for any questions you might have about certain functions. Thats how I learned *WoW Dev Projects: AFK Tele Bot development journalSimple Player Pointer Scanner + Z-Teleport*My Projects: coming soon.Check out my WoW Dev wiki for patch 3.0.9!http://www.wowdev.wikidot.com Link to comment Share on other sites More sharing options...
SpookMeister Posted February 13, 2009 Share Posted February 13, 2009 (edited) Here is a structure you could use... it ONE way you could do it. Global $q = "This is the first question", $answers = "" While 1 $response = MsgBox(3, "Question #" & StringLen($answers) + 1, $q) If $response = 2 Then Exit _NextQ($response) WEnd Func _NextQ($i_response) $answers &= $i_response Select Case $answers = "6" $q = "This is the question I want to ask if you chose YES" Case $answers = "7" $q = "This is the question I want to ask if you chose NO" Case $answers = "66" $q = "This is the question I want to ask if you chose YES-YES" Case $answers = "67" $q = "This is the question I want to ask if you chose YES-NO" Case $answers = "76" $q = "This is the question I want to ask if you chose NO-YES" Case Else MsgBox(16, "Error", "Unexpected sequence of answers:" & @CRLF & $answers) Exit EndSelect EndFunc ;==>_NextQ [edit] tweaked code just a little [/edit] Edited February 13, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Fubb Posted February 13, 2009 Author Share Posted February 13, 2009 one problem with that code that ihave is, the 6 is yes, the 7 is no, but ill eventually get into confusingly long seqeunces, and in turn will then have to have things like 6676776767766 or some such nonsense. Is there a way to do it a different way? Also, some questions will require only a "Continue" button. How do I make it so i put just that into the Case $answers code? Or... Also, it has come to my attention lately that, Laptops without mice, suck :[ I cannot wait until our nw pc comes in... Current Projects:"Cuban Missile Crisis" Decisions Game, -----------------------------------------------"I have got a lovely bunch of Coconust""Nuts*""Damn the songs ruined now" ~TheChosen Link to comment Share on other sites More sharing options...
CodyBarrett Posted February 13, 2009 Share Posted February 13, 2009 like i said this would be easyer if you used GUIcreate() and butons and lables.... [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
SpookMeister Posted February 13, 2009 Share Posted February 13, 2009 one problem with that code that ihave is, the 6 is yes, the 7 is no, but ill eventually get into confusingly long seqeunces, and in turn will then have to have things like 6676776767766 or some such nonsense. Is there a way to do it a different way? [snip] You could make it "slightly" more readable by replacing 6 and 7 with Y and N respectively: Global $q = "This is the first question", $answers = "" While 1 $response = MsgBox(3, "Question #" & StringLen($answers) + 1, $q) If $response = 2 Then Exit _NextQ($response) WEnd Func _NextQ($i_response) If $i_response = 6 Then $i_response = "Y" Else $i_response = "N" EndIf $answers &= $i_response Select Case $answers = "Y" $q = "This is the question I want to ask if you chose YES" Case $answers = "N" $q = "This is the question I want to ask if you chose NO" Case $answers = "YY" $q = "This is the question I want to ask if you chose YES-YES" Case $answers = "NY" $q = "This is the question I want to ask if you chose NO-YES" Case $answers = "NYY" $q = "This is the question I want to ask if you chose NO-YES-YES" Case $answers = "NYYN" MsgBox(0, "Question 5 Part 1", "First part of next question") MsgBox(0, "Question 5 Part 2", "Second part of next question") $q = "This is the last part of the question I want to ask if you chose NO-YES-YES-NO" Case Else MsgBox(16, "Error", "Unexpected sequence of answers") Exit EndSelect EndFunc ;==>_NextQ I don't know if that is any less confusing when you have to write the appropriate question for every possible permutation... but that's what your looking at any way you go as far as I can see. You should be able to see the way I included the continuation question you asked in the section of code under NYYN. -Spook [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] 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