Infinitex0 Posted February 6, 2006 Share Posted February 6, 2006 (edited) This script is supposed to open an input box and when the right text is input, play a track. InputBox( "music", " ") If $text <> "Eminem" Then MsgBox(4096, "Don't Have", "Sorry don't have that") Else $bLoop = 0 EndIf MsgBox(4096, "Got that", "Here") SoundPlay("C:\Documents and Settings\Administrator\My Documents\My Music\Eminem\The Marshall Mathers LP\07 The Way I Am.wma", 0) But when I type in the text it says -------------------------------------------------------------------------------------------------l l AutoIt Error l l -----------------------------------------------------------------------------------------------l l Line 2 (File "C:\Documents and Settings\Administrator\Desktop\test1.au3"): l l l l If $text <> "Eminem" Then l l If ^ERROR l l l l Error: Variable used without being declared. l l l l ------------ l l l__OK___ l l l------------------------------------------------------------------------------------------------l Any suggestions? P.S. I had a lot of time on my hands. Edited February 6, 2006 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Oxin8 Posted February 6, 2006 Share Posted February 6, 2006 $text=InputBox( "music", " ") You have to tell AutoIt where to put the input. It may be magical, but it's not THAT magical. ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
Faustvii Posted February 6, 2006 Share Posted February 6, 2006 Onix8 is right this will work $text = InputBox( "music", " ") If $text <> "Eminem" Then MsgBox(4096, "Don't Have", "Sorry don't have that") Else $bLoop = 0 EndIf MsgBox(4096, "Got that", "Here") SoundPlay("C:\Documents and Settings\Administrator\My Documents\My Music\Eminem\The Marshall Mathers LP\07 The Way I Am.wma", 0) Link to comment Share on other sites More sharing options...
Infinitex0 Posted February 6, 2006 Author Share Posted February 6, 2006 Thanks, Oxin8. But now I have another problem. The music plays regardless. How could I make the music play only when the right text is inputed? The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Oxin8 Posted February 6, 2006 Share Posted February 6, 2006 Move the "EndIf" to the end. $text = InputBox( "music", " ") If $text <> "Eminem" Then MsgBox(4096, "Don't Have", "Sorry don't have that") Else $bLoop = 0 MsgBox(4096, "Got that", "Here") SoundPlay("C:\Documents and Settings\Administrator\My Documents\My Music\Eminem\The Marshall Mathers LP\07 The Way I Am.wma", 0) EndIf ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
Infinitex0 Posted February 6, 2006 Author Share Posted February 6, 2006 (edited) Thanks, Oxin8, and Nuffilein805 Edited February 6, 2006 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 6, 2006 Share Posted February 6, 2006 here you are $text = InputBox( "music", " ") If $text <> "Eminem" Then MsgBox(4096, "Don't Have", "Sorry don't have that") Else $bLoop = 0 MsgBox(4096, "Got that", "Here") SoundPlay("C:\Documents and Settings\Administrator\My Documents\My Music\Eminem\The Marshall Mathers LP\07 The Way I Am.wma", 0) endif just modified 1 line of script my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
Infinitex0 Posted February 6, 2006 Author Share Posted February 6, 2006 Okay how could I make it so if I input "Eminem" it would play one track but if I input "Eminem2" it would play another track? The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Oxin8 Posted February 6, 2006 Share Posted February 6, 2006 (edited) One option is an "If ElseIf Else EndIf". lol. I'm sure there's a better name somewhere... $text = InputBox( "music", " ") If $text = "Eminem" Then $bLoop = 0 MsgBox(4096, "Got that", "Here") SoundPlay("C:\Documents and Settings\Administrator\My Documents\My Music\Eminem\The Marshall Mathers LP\07 The Way I Am.wma", 0) ElseIf $text = "Eminem2" Then $bLoop = 0 MsgBox(4096, "Got that", "Here") ;Play other song here Else MsgBox(4096, "Don't Have", "Sorry don't have that") EndIf And I think that's your last freebie Check out the help file and some tutorials as most easything things like this will be covered there. Edited February 6, 2006 by Oxin8 ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
Infinitex0 Posted February 6, 2006 Author Share Posted February 6, 2006 THANK YOU Oxin8!!!!!!! You are AWESOME!!!!!!!!!!! The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Oxin8 Posted February 6, 2006 Share Posted February 6, 2006 lol, I try... Now I need to try and go to sleep and survive school on 2.5 hours of it ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus 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