Jump to content

if, else, msgbox help please


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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 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!

Link to comment
Share on other sites

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?

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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Dunno, beyond my limited knowledge.. muttley

hahaha lol

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 :)

hmm thanks ima try that and with the DUNG sound i mean the windows sound xD windows does it when you get an error lol

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.

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 =)

Link to comment
Share on other sites

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 by Attckdog

A true renaissance man

Link to comment
Share on other sites

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 easier

and the help files r awesome too i read em almost everyday lol

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..

Link to comment
Share on other sites

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 :mellow: 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 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.”

 

Link to comment
Share on other sites

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.”

 

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...