Nbanonimous Posted December 18, 2007 Share Posted December 18, 2007 hey guys im total newb at this but uh someone gave me this $Cd = DriveGetDrive ( "CDROM" ) If @Error Then MsgBox(0, "Critical Failure", "An important piece of equipment is missing" & @CRLF & _ "Code execution is aborted") Exit Else If CDTray($Cd[1], "Open") Then MsgBox(0,'CD Test', 'The tray should be open') Else MsgBox(0, 'Oooops!', "Houston....We have a problem") EndIf EndIf How do i make a loop making the CD drive pop out 8 times after he pushes it back in 8 times so everytime it goes back in, it pushes out, 8 times Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com Link to comment Share on other sites More sharing options...
Nahuel Posted December 18, 2007 Share Posted December 18, 2007 I'm very curious to know why you want to do this I don't think it's possible to know to know if the tray is open or closed with the built-in functions. But, it is possible if it has a CD inside. Using DriveStatus() should return NOTREADY if it's open or it has no CD inside and READY when it has media in it. So, this is my try: Instert a CD first, wait till it loads (light should stop blinking) and then run the script. It will open the CD tray and pause. When you close it again and the CD loads, it will open it again. It should do this 4 times. Set the counter to whatever number you want. I'm not sure if it will be good for you, but this is all I can do. Perhaps a more experienced user can come up with something better $Cd = DriveGetDrive("CDROM") If @error Then MsgBox(0, "Critical Failure", "An important piece of equipment is missing" & @CRLF & _ "Code execution is aborted") Exit Else $i=1 Do Sleep(700) $status=DriveStatus($Cd[1]) If $status="READY" Then $i+=1 If CDTray($Cd[1], "Open") Then MsgBox(0, 'CD Test', 'The tray should be open') Else MsgBox(0, 'Oooops!', "Houston....We have a problem") EndIf EndIf Until $i=4 EndIf Link to comment Share on other sites More sharing options...
Nbanonimous Posted December 18, 2007 Author Share Posted December 18, 2007 nope doesnt work wont even open once lol Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com Link to comment Share on other sites More sharing options...
weaponx Posted December 18, 2007 Share Posted December 18, 2007 There are better ways to eff with people than opening and closing the cd tray. Link to comment Share on other sites More sharing options...
corey822 Posted December 18, 2007 Share Posted December 18, 2007 CODE; Open the CD tray on drive E: then D: CDTray("E:", "open") sleep(4000) cdtray("E:", "close") Sleep(4000) CDTray("D:", "open") Sleep(4000) CDTray("D:", "close") try that it opens the drives on mine waits so long then closes them if u want u can add something in there to check if cd in there if not then it can open if does then play but i havnt got that far C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake Link to comment Share on other sites More sharing options...
Nbanonimous Posted December 18, 2007 Author Share Posted December 18, 2007 (edited) it only opens once lol Edited December 18, 2007 by Nblufire12 Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com Link to comment Share on other sites More sharing options...
Aceguy Posted December 18, 2007 Share Posted December 18, 2007 prolly open once coz i take a long time to set the drive up (get it ready for reading). so 4secs is prolly no enough. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Aceguy Posted December 18, 2007 Share Posted December 18, 2007 CDTray("g:", "open") Sleep(4000) CDTray("g:", "close") sleep(10000) CDTray("g:", "open") Sleep(4000) CDTray("g:", "close") SEE 10 Seconds.... this works for me [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Nbanonimous Posted December 19, 2007 Author Share Posted December 19, 2007 (edited) danggg its sooo slow and aceguys urs wont work EDIT ahh I dont have a "G" CD rom but its slowww Edited December 19, 2007 by Nblufire12 Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com Link to comment Share on other sites More sharing options...
DW1 Posted December 19, 2007 Share Posted December 19, 2007 try writing something useful, instead of annoying.... you may get more help that way AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Nahuel Posted December 19, 2007 Share Posted December 19, 2007 Dude, nobody is going to give you an answer if you don't make it clear for everyone. What exactly do you want to do? Doing it the way Aceguy suggested will open the CD tray, wait 4 seconds, close it, wait 10 seconds, open it, wait 4 seconds and close it again. Change the g: to whatever letter your cd-drive has. And like weaponx said, There are better ways to eff with people than opening and closing the cd tray. Link to comment Share on other sites More sharing options...
weaponx Posted December 19, 2007 Share Posted December 19, 2007 (edited) Instead of cluttering the forums with nonsense, just punch your friend / enemy in the face, say MERRY X-MAS BEEYOTCH and call it a day. Better yet, punch yourself in the face. EDIT AGAIN. Whos the Grinch now? Edited December 19, 2007 by weaponx Link to comment Share on other sites More sharing options...
DW1 Posted December 19, 2007 Share Posted December 19, 2007 Instead of cluttering the forums with nonsense, just punch your friend in the face, say MERRY X-MAS BEEYOTCH and call it a day. Better yet, punch yourself in the face.That is awesome... funniest thing I have seen on the forums in a long time AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Nbanonimous Posted December 19, 2007 Author Share Posted December 19, 2007 is there a way to detect when its pushed back in so then it opens again then repetes so it gets on their nerves Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com Link to comment Share on other sites More sharing options...
DW1 Posted December 19, 2007 Share Posted December 19, 2007 what is wrong with: While 1 CDTray("D:", "open") Sleep(500) WEnd AutoIt3 Online Help Link to comment Share on other sites More sharing options...
sumkid Posted December 19, 2007 Share Posted December 19, 2007 try this... While 1 Sleep (800) CDTray("D:", "open") Sleep (100) CDTray("E:", "open") WEnd that will continue to open it. when someone tried to close it it will open again before its closed. if you want it so theres no little icon at the bottom do this: #NoTrayIcon While 1 Sleep (800) CDTray("D:", "open") Sleep (100) CDTray("E:", "open") WEnd this is kinda pointless if your using it to get on someones nerves though. Link to comment Share on other sites More sharing options...
DW1 Posted December 19, 2007 Share Posted December 19, 2007 this is the dumbest prank prog ever... @sumkid, It will not re open before it has closed... it will close>read>reopen... quite a delay but why the CD tray.... there are so many better ways to piss somebody off AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Nevin Posted December 19, 2007 Share Posted December 19, 2007 ffs. You're putting so much effort into something that isn't even that funny. Just have it wait 30 seconds or something, you know he probably closed it by then. Or just have it close itself and open itself randomly, then he's gonna be confused. It's not even that original of a way to mess with someone on a PC. It's about as original as taking a dump in the toilet tank so when someone flushes it comes out in the bowl. Link to comment Share on other sites More sharing options...
GEOSoft Posted December 19, 2007 Share Posted December 19, 2007 this is the dumbest prank prog ever...@sumkid, It will not re open before it has closed... it will close>read>reopen... quite a delaybut why the CD tray.... there are so many better ways to piss somebody offYou're right. The first time I did this it was advertised as a free drink holder from Coca Cola. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Nbanonimous Posted December 20, 2007 Author Share Posted December 20, 2007 i have no clue how do u repeat it 10 times lol Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com Link to comment Share on other sites More sharing options...
Recommended Posts