dragonheard Posted July 24, 2012 Posted July 24, 2012 well i am trying to make a script that does the following: starts when you boot up my/the users computer asks you if you are allowed to use it if you click yes you can proceed and the script stops(sometime ill make you put a password in hehehe) if you click no it will just shutdown your pc i got the msgbox and startup working but i dont know what the values of yes or no are so when i type if yes then shutdown it doesnt do anything and when i type else msgbox (1,"so you don't","so your not allowed to use it? GOODBYE") it doesnt show up either when you click anything else then yes. can anyone please tell me what to type at the IF *value* thanks, dragonheurt
Kidney Posted July 24, 2012 Posted July 24, 2012 set the msgbox to a variable. the variable will tell you which button was pressed. check the help file under msgbox for the return values.
dragonheard Posted July 24, 2012 Author Posted July 24, 2012 (edited) how to put yes and no into different variables? because i do know how to make one but is there a command wich does the same as if returnvalue or something since that doesnt exist? Edited July 24, 2012 by dragonheard
tes5884 Posted July 24, 2012 Posted July 24, 2012 how to put yes and no into different variables? $var = MsgBox(1, "", "Click OK if you have permission to enter...") If $var = 1 Then MsgBox(0, "", "You're in!") ElseIf $var = 2 Then MsgBox(0, "", "Get Lost!") Shutdown(1) EndIf Something like this.. www.tspitz.com
Kidney Posted July 24, 2012 Posted July 24, 2012 $msg = MsgBox(4, "Title", "Text") ;this is a message box that displays a 'Yes' and 'No' If $msg = 6 Then MsgBox(0, "Return", "You pressed 'Yes'") If $msg = 7 Then MsgBox(0, "Return", "You pressed 'No'")
dragonheard Posted July 24, 2012 Author Posted July 24, 2012 thanks a lot both of you works like a charm hehehe i got one last question (for now lool) is there any way to keep it on top so when you try to click outside it you'll get the well known DUNG sound?
tes5884 Posted July 24, 2012 Posted July 24, 2012 Dunno, beyond my limited knowledge.. muttley www.tspitz.com
Moderators JLogan3o13 Posted July 24, 2012 Moderators Posted July 24, 2012 (edited) One of the options for MsgBox is setting the top-most attribute (look at the second to the last option in the help file). Regarding playing the sound, you would have to script that yourself. At that point, it may be better to create your own "msgbox" GUI that you can better control. Edit 1,000 posts, yay me Edited July 24, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
water Posted July 24, 2012 Posted July 24, 2012 how to put yes and no into different variables?because i do know how to make onebut is there a command wich does the same as if returnvalue or something since that doesnt exist?Dragonheard,based on the questions you ask I would suggest that you start reading some AutoIt tutorials (click on Wiki at the top of each page). This will teach you the basics of the language.The questions you will ask then will show us that you have put some effort in learning the language and we will be happy to help you. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Â
dragonheard Posted July 24, 2012 Author Posted July 24, 2012 Dunno, beyond my limited knowledge.. muttleyhahaha lolOne of the options for MsgBox is setting the top-most attribute (look at the second to the last option in the help file). Regarding playing the sound, you would have to script that yourself. At that point, it may be better to create your own "msgbox" GUI that you can better control.Edit 1,000 posts, yay me hmm thanks ima try that and with the DUNG sound i mean the windows sound xD windows does it when you get an error lolDragonheard,based on the questions you ask I would suggest that you start reading some AutoIt tutorials (click on Wiki at the top of each page). This will teach you the basics of the language.The questions you will ask then will show us that you have put some effort in learning the language and we will be happy to help you.i did and ill allways do but i like learning from doing it myself its how i learned vars and color clicking i also read the help files from scite i was just asking since i couldnt find it...thanks for the reply and tip though =)
Attckdog Posted July 24, 2012 Posted July 24, 2012 (edited) Are you using the scite editor ? I really suggest using it. Also get really used to using the built in help files. They are fantastic and almost everything has a great example at the bottom.Just saw your other thread, I hope you aren't working on childish scripts to annoy people. Sigh. Edited July 24, 2012 by Attckdog A true renaissance man
dragonheard Posted July 25, 2012 Author Posted July 25, 2012 Are you using the scite editor ? I really suggest using it. Also get really used to using the built in help files. They are fantastic and almost everything has a great example at the bottom.Just saw your other thread, I hope you aren't working on childish scripts to annoy people. Sigh.yepp i am using the scite editor because it really helps its much easierand the help files r awesome too i read em almost everyday loland about the spam script it wasnt really to annoy anyone i wanted to learn how to make a gui and seems a spammer can use one..
Mechaflash Posted July 25, 2012 Posted July 25, 2012 (edited) and about the spam script it wasnt really to annoy anyone i wanted to learn how to make a gui and seems a spammer can use one..Even an intelligent app developer can too If you're using SciTe and you utilize the help file... there shouldn't be a need to ask all of these silly questions as both features (yes&no buttons + the set on top attribute) are documented in the msgbox() function and is easily understandable. Edited July 25, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Â
dragonheard Posted July 25, 2012 Author Posted July 25, 2012 i got it working allready, yes i did ask about the $var thingy because i didnt know about that im not a pro doing this as a job ima newb trying to learn it and even u mecha forgot to declare your variables....
Mechaflash Posted July 25, 2012 Posted July 25, 2012 and even u mecha forgot to declare your variables....Whutchu talkin' 'bout Willis? Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Â
Kidney Posted July 25, 2012 Posted July 25, 2012 as long as you understand the concept. this concept of return values is a constant thing in many languages so its good to learn it as soon as you can. if there isnt anymore questions we can mark this as resolved instead of attacking each other
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