Yeik Posted March 3, 2008 Share Posted March 3, 2008 (edited) ok, in my script runas any file, I am having issues, if i put it on a shared drive on a LAN, i open it, and it will randomly not open files, it will just act like nothing happened, if i add a debug message box to it, and try again, it works every single time i use it, but pops up an annoying box. I dont know if this is a GUI bug, or a bug in my code after the call is made. Any ideas? Edited March 3, 2008 by Yeik func get_quote() local $quote switch random(1, 3, 1) case 1 $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _ "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _ "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _ "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein" case 2 $quote = '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _ "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)" case 3 $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein" EndSwitch MsgBox(0, "Quote for the moment", $quote & @CRLF) EndFunc get_quote() Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 3, 2008 Moderators Share Posted March 3, 2008 ok, in my script runas any file, I am having issues, if i put it on a shared drive on a LAN, i open it, and it will randomly not open files, it will just act like nothing happened, if i add a debug message box to it, and try again, it works every single time i use it, but pops up an annoying box. I dont know if this is a GUI bug, or a bug in my code after the call is made. Any ideas?Did you try putting variant Sleep() in it where you would have put the MsgBox? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Yeik Posted March 3, 2008 Author Share Posted March 3, 2008 (edited) Did you try putting variant Sleep() in it where you would have put the MsgBox?no i didn't, but what would this do?edit: I just tested it, did the same thing, i tried sleep(1) Edited March 3, 2008 by Yeik func get_quote() local $quote switch random(1, 3, 1) case 1 $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _ "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _ "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _ "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein" case 2 $quote = '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _ "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)" case 3 $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein" EndSwitch MsgBox(0, "Quote for the moment", $quote & @CRLF) EndFunc get_quote() Link to comment Share on other sites More sharing options...
Achilles Posted March 3, 2008 Share Posted March 3, 2008 I don't know if this is just me, but your link brings me to some random post made by Saunders that has nothing to do with RunAs any file My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Yeik Posted March 3, 2008 Author Share Posted March 3, 2008 I don't know if this is just me, but your link brings me to some random post made by Saunders that has nothing to do with RunAs any fileOh, im still getting use to the special item inserts, i fixed it now.note, i also tested the suggested sleep() with sleep(10) and it is still having same issue. func get_quote() local $quote switch random(1, 3, 1) case 1 $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _ "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _ "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _ "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein" case 2 $quote = '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _ "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)" case 3 $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein" EndSwitch MsgBox(0, "Quote for the moment", $quote & @CRLF) EndFunc get_quote() Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 3, 2008 Moderators Share Posted March 3, 2008 no i didn't, but what would this do?edit: I just tested it, did the same thing, i tried sleep(1)Try Sleep(1000) ... I say this because the MsgBox() pauses the script from continuing on to the next part of your script. Maybe you need that delay for the communication to work. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Yeik Posted March 3, 2008 Author Share Posted March 3, 2008 Try Sleep(1000) ... I say this because the MsgBox() pauses the script from continuing on to the next part of your script. Maybe you need that delay for the communication to work.thats odd, with 1000, it works, but with 500 it doesn't. I think i might know what is causing it now though.Seeing as how its running a file from the network, i also kill the cmd process that starts it, so it probably doesn't have time to download the file to the local machine. func get_quote() local $quote switch random(1, 3, 1) case 1 $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _ "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _ "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _ "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein" case 2 $quote = '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _ "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)" case 3 $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein" EndSwitch MsgBox(0, "Quote for the moment", $quote & @CRLF) EndFunc get_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