Jump to content

Can anyone tell me the reverse of this command?


Liberty
 Share

Recommended Posts

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? :P

Any kind of hints would be really apreciated. :D

Link to comment
Share on other sites

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? :P

Any kind of hints would be really apreciated. :)

:D:):D

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..:)

Link to comment
Share on other sites

Hmm i'm not sure if i get what you mean :P 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:

CODE
WinWaitActive("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 :D

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

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

I tried replacing WinWaitActive with WinActivate like this:

CODE
WinActivate("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 :P

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 by Liberty
Link to comment
Share on other sites

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

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

Posted Image

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 :P

Link to comment
Share on other sites

Doesnt seem to have those details

Posted Image

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 :P

The problem is that the "if" statement has no matching "endif" prior to the "Until"

CODE
autoitsetoption( "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)

endif

until $var <> 0

As far as the lack of information available from the AutoItWindowInfo Tool, I am not sure how to help you with that...

Edited by improbability_paradox
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...