Draygoes Posted April 16, 2022 Posted April 16, 2022 (edited) I'm editing this post because I've got compounded problems that are officially too much for me to understand. I'm using discord windows. Here's my code. If Not FileExists( "count.ini" ) Then FileWriteLine( "count.ini", "0" ) EndIf HotKeySet("{NUMPADMULT}", "KissAndTell"); * button on the number pad. While 1 Sleep( 10000 ) WEnd Func message() MsgBox(0,"","") EndFunc Func KissAndTell() MsgBox(0, "", "") $count = FileReadLine( "count.ini" ) $count = $count + 1 FileDelete("count.ini") FileWriteLine( "count.ini", $count ) Do WinActivate("bot-testing - Discord") Sleep( 50 ) Until WinActive( "bot-testing - Discord" ) Send("I've thought about you " & $count & " times today!") Send("{ENTER}") EndFunc It gets to "I've thought about you x times today " and stopps for no reason. Just... that's it. It leaves out the exclimation point and everything. Just stops moving. But will open a msgbox. I'm confused. Why isn't this working? EDIT: Side note, ever have a random line of code left over from a previous experiment? I had to remove this. HotKeySet("{SHIFT}1", "message") Edited April 16, 2022 by Draygoes Complete post rewrite. Edited script comment. Removed leftover code. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.
Danp2 Posted April 16, 2022 Posted April 16, 2022 Scripts don't just stop for no reason. 😏 I'm guessing that it's stuck in your Do..Until loop. Add some ConsoleWrites to be sure. Latest Webdriver UDF Release Webdriver Wiki FAQs
Developers Solution Jos Posted April 16, 2022 Developers Solution Posted April 16, 2022 13 minutes ago, Draygoes said: I'm confused. Why isn't this working? Also read the Helpfile on the Send() command and the meaning of an exclamation mark and sending raw. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Draygoes Posted April 16, 2022 Author Posted April 16, 2022 Just now, Danp2 said: Scripts don't just stop for no reason. 😏 I'm guessing that it's stuck in your Do..Until loop. Add some ConsoleWrites to be sure. No, see, how's this for weird. I edited it for browser, happens there too. This actually fires the second message box. MsgBox(0, "", "did it send") Opens! If Not FileExists( "count.ini" ) Then FileWriteLine( "count.ini", "0" ) EndIf HotKeySet("{NUMPADMULT}", "KissAndTell"); * on the numberpad. While 1 Sleep( 10000 ) WEnd Func message() MsgBox(0,"","") EndFunc Func KissAndTell() MsgBox(0, "", "") $count = FileReadLine( "count.ini" ) $count = $count + 1 FileDelete("count.ini") FileWriteLine( "count.ini", $count ) Do Sleep( 50 ) Until WinActive( "bot-testing — Mozilla Firefox" ) Send("I've thought about you " & $count & " times today!") Send("{ENTER}") MsgBox( 0, "", "did it send?" ) EndFunc But for some reason, on discord we end up typing out "I've thought about you x times today ", and stopping right there. I say again, the script runs past that and us sending enter, proven by the fact that it displays the message box after, but discord does not reflect this... Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.
Draygoes Posted April 16, 2022 Author Posted April 16, 2022 5 minutes ago, Jos said: Also read the Helpfile on the Send() command and the meaning of an exclamation mark and sending raw. This was the problem, I didn't even think about it... Thanks man. So, why did sending Alt mess with this? Or did it think it was sending a key combo? like y+alt? I have a feeling i'm not quite undersanding. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.
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