Jump to content

help with background mode please?


 Share

Recommended Posts

Hey guys, i'm interested in creating a program to help me with a really boring task in a game, as you can see in the program it's WOW. I'm trying to make it so the program clicks the button "6" every 4.5sec. That's working great, but i was wondering if there was a way to make it so autoit clicks "6" in the World of Warcraft screen instead of clicking 6 in whatever window is in front. Here's my script:

$win_title = "World of Warcraft" 
WinActivate($win_title, "") 
WinSetOnTop($win_title, "", 0) 
Sleep(1000) 

HotKeySet("{PAUSE}", "EndScript") 


$i = 0 
$win_title = "World of Warcraft"
While $i <= 10 
Send("{6}")
Sleep(4500)
WEnd

Func EndScript() 
$exit = MsgBox(4, "Ender", "Exit the Bot?") 
If $exit = 6 Then 
Exit 
EndIf 
EndFunc

Again i'm just trying to make it so autoit will press "6" in the WOW window when, say, internet explorer is on top. Thanks again

edit: wrong code, sorry, was a different one, but still same problem = /

Edited by Lbessy
Link to comment
Share on other sites

ok, i tried

controlsend("{6}")
but it came up with

controlsend("{6}")

^ERROR

Error: Incorrect number of parameters in function call

is there a special way to use controlsend? i looked at http://www.autoitscript.com/autoit3/docs/functions/ControlSend.htm but i couldn't figure out what to put for the "text", "controlID", and the "flag", could you shoot me a sample that might work for this? Thank you.

Link to comment
Share on other sites

I usually just use "" for text. controlid is the id of the control your sending to (found with autoit window info tool). flag is just 1=send characters raw, 0=send special characters(plus and shift and stuff). you don't need to specify a parameter for the flag if you want the default option.

Edit: you should only have to specify the text parameter if there are multiple windows with the same name, so that autoit knows which one to use.

Edited by Hawkwing

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

hey, i used the Autoit Window Info tool, but when i looked for the ControlID it didn't show up, i thought i might be doing somthing wrong so i moused over the internet page and then all the Info got filled up, but when i moused over the Game, it all wend away. Is there anyway to use Controlsend or any other command you can think of that might work without the ControlID?

Link to comment
Share on other sites

WOOT, tried it without the controlID, flag, and text, just "" in place of those, and it worked, looks like the only thing you really need is the Window title, and some "" to fill in the spaces of the missing items. Thanks dude.

Link to comment
Share on other sites

you could either use that, or this as a longer re-example

;replace in your first post:
Send("{6}")

;with:
if Winactive("World Of Warcraft") then Send("{6}")


;or you could have it so that it sends multiple keys too this way:
if Winactive("World Of Warcraft") then 
    Send("{6}")
    Send("{9}")
    Send("{2}")
endif
Edited by Suirad
Link to comment
Share on other sites

Well, yes, that would work, but since this topic is titled help with background mode please? I didn't get the impression that he wanted to have to activate the window.

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

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