Liberty Posted December 22, 2006 Share Posted December 22, 2006 I'm trying to get this script going and i know the way to get it so it only works when i have a desired window open is WinWaitActive but what do i do if i want my script to only run for a window that i'm not selecting, for example if i wanted it to do my script for Notepad (and only notepad) whilst i'm actually clicked on the mozila browser window? Any kind of hints would be really apreciated. Link to comment Share on other sites More sharing options...
NELyon Posted December 22, 2006 Share Posted December 22, 2006 If i understand right, you might be able to ControlSend/ControlClick in the notepad, and that works inactive Link to comment Share on other sites More sharing options...
Uten Posted December 22, 2006 Share Posted December 22, 2006 but what do i do if i want my script to only run for a window that i'm not selecting, for example if i wanted it to do my script for Notepad (and only notepad) whilst i'm actually clicked on the mozila browser window? Any kind of hints would be really apreciated. but what do i do if i want my script to only run for a window that i'm not selecting,As in interactive? You don't select it with a click but it becomes active without your interaction?for example if i wanted it to do my script for Notepad (and only notepad)ControlSend, ControlClick, WinActivate..whilst i'm actually clicked on the mozila browser window?The script that was only for notepad??? Or are you working in the browser at the same time as the script is working in notepad?uhh, this is probably to much for my little head.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Liberty Posted December 22, 2006 Author Share Posted December 22, 2006 Hmm i'm not sure if i get what you mean those were just examples anyway, i guess i'll post the thing that i'm actually doing. Even with the new cross server battlegrounds on the game world of warcraft my server still has huuuuuge waiting times for the battlegrounds, something to do with there not being many of the opposite faction, anyway i have a autojoining mod so i don't miss the battle and i saw an old thing on here that mentions how to stop you from getting flagged afk (and hit with a huge 15 minute debuff so you can't rejoin!) it goes like this: CODEWinWaitActive("World of Warcraft") HotKeySet("{PAUSE}", "Start") HotKeySet("!{PAUSE}","Quit") TogglePause() func Start() HotKeySet("{PAUSE}") HotKeySet("{PAUSE}", "TogglePause") ToolTip('AntiAFK started.',0,0) While 1 Send("{SPACE}") Sleep(Random(120000,240000)) WEnd EndFunc Func TogglePause() ToolTip('AntiAFK Stopped.',0,0) HotKeySet("{PAUSE}") HotKeySet("{PAUSE}", "Start") While 1 sleep(100) WEnd EndFunc func Quit() Exit EndFunc i tried to use it and when i went to browse the internet while i wait for the que my script doesnt seem to be in effect. I tested it by making the value for Sleep(Random(120000,240000)) into Sleep(Random(1,8)) and my charactor is just doing nothing when i'm not clicked on world of warcraft and jumping repeatedly when i am in world of warcraft So i'm pretty much looking for a way to browse the web while keeping my charactor active. Link to comment Share on other sites More sharing options...
Liberty Posted December 23, 2006 Author Share Posted December 23, 2006 Wow did i lose the crowd when i mentioned World of Warcraft, it hit page three and didnt get any more replys. Well this thing works as it is but it isnt very sophisticated, i just thought i could get some help with jazzing it up, i guess i'll just leave the game window open and use something other than my computor while i wait for the que. Link to comment Share on other sites More sharing options...
Liberty Posted December 23, 2006 Author Share Posted December 23, 2006 (edited) I tried replacing WinWaitActive with WinActivate like this: CODEWinActivate("World of Warcraft") HotKeySet("{PAUSE}", "Start") HotKeySet("!{PAUSE}","Quit") TogglePause() func Start() HotKeySet("{PAUSE}") HotKeySet("{PAUSE}", "TogglePause") ToolTip('AntiAFK started.',0,0) While 1 Send("{SPACE}") Sleep(Random(120000,240000)) WEnd EndFunc Func TogglePause() ToolTip('AntiAFK Stopped.',0,0) HotKeySet("{PAUSE}") HotKeySet("{PAUSE}", "Start") While 1 sleep(100) WEnd EndFunc func Quit() Exit EndFunc and it just ended up putting spaces in on the page i was searching in mozilla, although i did forget to capitolize the 'A' in Winactivate so i guess that could have been the problem, although i can't test it out right at this second I also tried replacing WinWaitActive with ControlSend but i guess that isnt how you do it because trying to run the script after doing so crashes it :S Edited December 23, 2006 by Liberty Link to comment Share on other sites More sharing options...
improbability_paradox Posted December 23, 2006 Share Posted December 23, 2006 Your problem isn't so much with the WinWaitActive, but the fact that the command Send("{SPACE}") doesn't have a way to target the World of Warcraft App. I can't really help you much, because I do not play WOW, but I can tell you that what you will probably need to do is change the Send to a ControlSend. I cannot format the command correctly for you as I do not have WOW, but if you do a little research you can probably figure out what needs to be done. ControlSend("World of Warcraft","", is the beginning. you will need to use the AutoItWindowInfo tool to get the ControlID or ClassNameNN that you need to send the keystrokes to. Link to comment Share on other sites More sharing options...
Liberty Posted December 24, 2006 Author Share Posted December 24, 2006 is the beginning. you will need to use the AutoItWindowInfo tool to get the ControlID or ClassNameNN that you need to send the keystrokes to. Doesnt seem to have those details Try this at the beginning of your script Do autoitsetoption( "WinTitleMatchMode", 2) $var = WinExists("World of Warcraft", "") If $var = 0 Then Msgbox(0, "", "Window Not Found") ; you can remove this line once its working Sleep(4000) continueloop until $var = 1 If you get the msg saying window not found then use the autoit window info tool to get the correct title for that window also, Improbability is correct to press a button on your screen use the autoit window info tool to get the controlID ControlSend( "World of Warcraft", "", ControlID Goes Here) That is if the button your trying to click does not already have focus When i try to run that in the script it says Error: until $var=1 Error "Until" statement with no matching "Do" statement No matter what i try to do i can't fix it Link to comment Share on other sites More sharing options...
improbability_paradox Posted December 24, 2006 Share Posted December 24, 2006 (edited) Doesnt seem to have those detailsWhen i try to run that in the script it says Error: until $var=1 Error "Until" statement with no matching "Do" statementNo matter what i try to do i can't fix it The problem is that the "if" statement has no matching "endif" prior to the "Until" CODEautoitsetoption( "WinTitleMatchMode", 2)Do$var = WinExists("World of Warcraft", "")If $var = 0 Then Msgbox(0, "", "Window Not Found") ; you can remove this line once its working Sleep(4000)endifuntil $var <> 0As far as the lack of information available from the AutoItWindowInfo Tool, I am not sure how to help you with that... Edited December 24, 2006 by improbability_paradox Link to comment Share on other sites More sharing options...
Outshynd Posted December 24, 2006 Share Posted December 24, 2006 I don't think you can send input to a WoW window without it being active. If you really want to try, download a program that can monitor system messages received by a window (Spy++ or Winspector Spy) and see how it reacts to keyup and keydown messages. You can google search for ways to send input to minimized windows if you need help. Once you figure out how the game reacts to windows messages, you can then use PostMessage to place properly formatted windows messages in its message queue. It's far more complicated than all of that and it probably won't work anyway, but it's a place to start. 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