Jump to content

Can this be done?


Recommended Posts

Ok so i am a complete noob at autoit (just started it tonight). I am wanting to make a folow bot for wow. I run 2 separate instances of wow on my computer one maximized other minimized. I have a few problems....some times the stuff i send to the "bot" it misses certian characters...usualy the first one. But the biggest problem is i dont know how to get it to send the commands to the minimized wow, or how to get autoit to tell the diff between the 2 windows(they seem to have the same name).Lol so i know the scripting is probably a complete hack job but here is the code i have so far.. ANY help at all would be greatly appreciated. Thanks in advance.

HotKeySet("{F8}", "_TAssist")
HotKeySet("{F9}", "_PAttk")
HotKeySet("{F10}", "_Cast")
HotKeySet("{F11}", "_Follow")
HotKeySet("{Delete}", "_Exito")
AutoItSetOption("WinTitleMatchMode", 4) 
Global $handle = WinGetHandle("classname=GxWindowClassD3d") 
Global $TAssistRun = 0
Global $FollowRun = 0
Global $PAttkRun = 0
Global $CastRun = 0
Global $ExitoRun = 0

While 1
     Sleep(100)
WEnd

Func CLOSEClicked()
  Exit
EndFunc

Func _Follow()
     $FollowRun = Not $FollowRun
          If Not $FollowRun Then Return
          ControlSend($handle, "", "", "{ENTER}")
          Opt("SendKeyDelay", 50)
          ControlSend($handle, "", "", " /Target Dunkelheit")
      Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "{Enter}")
      Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "{Enter}")
          Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "/Follow")
      Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "{Enter}")
          Opt("SendKeyDelay", 10)
 EndFunc

Func _TAssist()
     $TAssistRun = Not $TAssistRun
          If Not $TAssistRun Then Return
          ControlSend($handle, "", "", "{ENTER}")
          Opt("SendKeyDelay", 50)
          ControlSend($handle, "", "", " /Target Dunkelheit")
      Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "{Enter}")
      Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "{Enter}")
          Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "/Assist")
      Opt("SendKeyDelay", 50)
      ControlSend($handle, "", "", "{Enter}")
          Opt("SendKeyDelay", 10)
 EndFunc

Func _PAttk()
     $PAttkRun = Not $PAttkRun
          If Not $PAttkRun Then Return
          ControlSend($handle, "", "", "`")
          Opt("SendKeyDelay", 20)
 EndFunc

Func _Cast()
     $CastRun = Not $CastRun
          If Not $CastRun Then Return
          ControlSend($handle, "", "", "{ENTER}")
          Opt("SendKeyDelay", 20)
          ControlSend($handle, "", "", " /Cast Curse of Agony(Rank 6)")
      Opt("SendKeyDelay", 20)
      ControlSend($handle, "", "", "{Enter}")
          Opt("SendKeyDelay",1000)
      ControlSend($handle, "", "", "{Enter}")
      Opt("SendKeyDelay", 20)
          ControlSend($handle, "", "", "/Cast Corruption(Rank 7)")
          Opt("SendKeyDelay",20)
      ControlSend($handle, "", "", "{Enter}")
      Opt("SendKeyDelay", 20)
 EndFunc

Func _Exito()
     $ExitoRun = Not $ExitoRun
          If Not $ExitoRun Then Return
          Exit
EndFunc

Assist.AU3

Edited by malkathorn
Link to comment
Share on other sites

I'm doing something very similar too.

1) Lookup WinList, ie. Global $handles = WinList("classname=GxWindowClassD3d")

2) The commands will work with hidden windows. Don't start the second window minimized, hide it with your script. So you need to go back to where you took the start of your bot, and see how to *hide* and *show* the window. (http://www.edgeofnowhere.cc/viewtopic.php?t=305097&start=0)

3) Why are you using Opt("SendKeyDelay", 50) instead of Sleep(50000)?

Link to comment
Share on other sites

I'm doing something very similar too.

1) Lookup WinList, ie. Global $handles = WinList("classname=GxWindowClassD3d")

2) The commands will work with hidden windows. Don't start the second window minimized, hide it with your script. So you need to go back to where you took the start of your bot, and see how to *hide* and *show* the window. (http://www.edgeofnowhere.cc/viewtopic.php?t=305097&start=0)

3) Why are you using Opt("SendKeyDelay", 50) instead of Sleep(50000)?

1/2) Will do.

3) cause i havent coded anything in 5 or 6 years and just started scripting with autoit tonight, and dont really know all the options i have yet.

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