Godownage Posted December 9, 2005 Share Posted December 9, 2005 Can soemone tell me a code on how i can keep a window open even if they click off the window? I'm making a bot for diablo ii and i want to put a code in my bot if they click off the screen it will bring the window back up so it doesn't error on them, open any other programs, etc. Link to comment Share on other sites More sharing options...
t0ddie Posted December 9, 2005 Share Posted December 9, 2005 lets see the code. heres an easy solution while 1 if not winactive("Diablo II") then winactivate("Diablo II") endif wend Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Godownage Posted December 9, 2005 Author Share Posted December 9, 2005 Do Sleep (5000) Send("{ENTER}") Sleep (1000) Send("{!}" & "Bot has been running:: " & $Loops & ", ::Minute(s)." & "{!}") Send("{ENTER}") Sleep (54000) $Loops = $Loops + 1 Until $Loops = -1 Exit Thats my code, and i wanted it if somehow say a AOL messege pops up, it would bring back up the D2 window so nothing is harmed or whatever. Link to comment Share on other sites More sharing options...
DoctorX Posted December 9, 2005 Share Posted December 9, 2005 Might also want to check out the WinSetOnTop() function. -DRX Link to comment Share on other sites More sharing options...
Godownage Posted December 9, 2005 Author Share Posted December 9, 2005 How would i use it in my while loop, at the begining or end? I'm completely puzzled on this part of my coding. Link to comment Share on other sites More sharing options...
DoctorX Posted December 9, 2005 Share Posted December 9, 2005 How would i use it in my while loop, at the begining or end? I'm completely puzzled on this part of my coding.Outside the loop, before you enter your Do/While loop. It may or may not work for you, what it will do is force the window to remain always on top, but that may not mean it is always active. Also, if another window pops up that also has a "always on top" attribute, it may override your window. -DRX Link to comment Share on other sites More sharing options...
Godownage Posted December 9, 2005 Author Share Posted December 9, 2005 Yeah didn't work for me, if i click off my screen it just sits there, or it works once. Link to comment Share on other sites More sharing options...
Godownage Posted December 9, 2005 Author Share Posted December 9, 2005 (edited) I used t0ddie's little script he gave me, and it seems to work fine for me, before it types every time it checks to make sure d2 is active.Do Sleep (5000) if not winactive("Diablo II") then winactivate("Diablo II") endif Send("{ENTER}") Sleep (1000) Send("{!}" & "Bot has been running:: " & $Loops & ", ::Minute(s)." & "{!}") Send("{ENTER}") Sleep (54000) $Loops = $Loops + 1 Until $Loops = -1 Exit Thank you all! Edited December 9, 2005 by Godownage Link to comment Share on other sites More sharing options...
DoctorX Posted December 9, 2005 Share Posted December 9, 2005 Cool. I was just about to suggest that. -DRX 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