View unanswered posts | View active topics It is currently May 20th, '13, 11:15




Reply to topic  [ 5 posts ] 
 sending inputs in minimized window... hard for beginners? 
Author Message

Joined: Sep 26th, '10, 10:06
Posts: 122
Post sending inputs in minimized window... hard for beginners?
Hi, im trying to learn scripting for a game i play,
i decided to try Autoit seems simple enough for a beginner
then i encountered a PROBLEM
it seems that sending input in an inactive window is impossible(?) for Autoit
if its not a window app(something about controlID)

my question is
will it be hard to do it on with macromonkey for a newbie?

oh and what do i have to look for if i want to record chat from games(chats not coming from me) or possibly assign variables to it?
i just dont know where to start on that one.

for key input i began with Send("{key}") in Autoit
check HP or mobs with pixel
but i have no idea where to start with getting chat logs

anyway this is what i made so far with autoit, i was supposed to paste it in their forums
but it seems they are not open to game automation T_T
this script could already locate, target and attack already with help of Pixel Search
still working on autopots though, the game's HP bar changes color to different shade of red

Code:
WinWaitActive ( "Forsaken World" )
HotKeySet("t","tee")
Opt("MouseCoordMode", 0) ;****is this the right place for this Opt

While 1;****dunno why i need this but it wont work without it
Sleep(100)
WEnd

Func tee();Start of Bot
$o = 0
Do   ;First I check minimap for mobs
Opt("MouseCoordMode", 0)
$left = 1294  ;minimap coordinates
$right = 1294
$top = 640
$bottom = 640
   For $i = 0 to 65 Step 1 ;*****i made this For so the pixel search would start at the my desired center and find the CLOSEST mob
      $coord = PixelSearch( $left - $i, $top + $i, $right + $i, $bottom - $i, 0xF8F5FF)
      If Not @error Then ;******the game got a autowalk function from the minimap after i get the coord i will move to positon by mouseclick
         MouseClick("left", $coord[0], $coord[1], 1, 0)
         $findtarget = 0
         Do
            Send("{TAB}")    ;****Tab is the game Target key in the game  so here i would send tab until i find one mob
                        ;****i use Pixel search not sure if there is better alternative
            $attack = PixelSearch( 235, 92, 348, 98, 0xA81C33, 20 )
            If Not @error Then
               $findtarget = 1         
               ExitLoop
            EndIf
            Sleep(500)
         Until $findtarget = 1
      
      $attacking = 1      
      Do
         $HPpot = PixelGetColor( 190, 104)           ;**** here the script is supposed to check HP/MP but i cant get it to work,
                              ;*****since the game HP bar changes color to burning red when
         If Not $HPpot == 854803 Then      ;*****under attack i cant get a stable pixel on any HP bar spot
            Send("9")
         EndIf
         $MPpot = Hex(PixelGetColor( 119, 105))
         If Not $MPpot == 2242884 Then
            Send("8")
         EndIf
         Send("1")      ;the game got Skill queue and not that long CD so i just send my hotkeys to it
         Send("2")
         Send("3")
         Sleep(1200)
         $stopatt = PixelSearch( 235, 92, 348, 98, 0xA81C33, 20 )    ;here i check if the mob is still there
         If @error Then
            $attacking = 0
         EndIf
      Until $attacking = 0         
      ExitLoop
      EndIf   
   Next
   $o = $o + 1
Until $o = 19

EndFunc


Nov 3rd, '11, 16:03
Profile
Site Moderator
User avatar

Joined: Aug 18th, '09, 03:32
Posts: 1201
Post Re: sending inputs in minimized window... hard for beginners
FYI it will be hard to get such support on AutoIt do to their stance on game hacking.

Read my response on here: viewtopic.php?f=38&t=809
Basically two generic methods that you can try.
You have to experiment.

Some times there are issues to troubleshoot.
Like with SW:TOR the inputs come into a second process spawned by the first.
You have to wait till the actual screen process is running.

Some times you can and others you can't send inputs to minimized windows.
A lot of games will watch Windows "active" and "focus" messages and ignore inputs when it's not the application in focus.
Usually the solution involves some reverse engineering.

As I stated elsewhere you might have to reverse where the target (be it a game or not) handles it's inputs.
Usually there is some kind of queue or something. Ideally you will find this function and then from an injected/loaded DLL or using a remote thread send inputs to such a function directly.
Then you would bypass the whole input gathering/polling thing.


Nov 4th, '11, 20:58
Profile

Joined: Sep 26th, '10, 10:06
Posts: 122
Post Re: sending inputs in minimized window... hard for beginners
if my script can run normally but not able to send inputs in minimized window
is it possible to use VM to make it possible... i was thinking that even if i minimized the VM window it should still be active in the VM space? or not?



:::EDIT
Luckily my game and my script worked on VMware.
although Character models are missing on VMware im like invisible man, but that is good enough for me atm


Question though how can i make game graphics simple something similar to reqbot option
that blocks pixel shader of directX
i researched abit about it but im stuck with 3d Analyze (looking at description it should have disabled textures although im not sure if that is what i want though)

when i saw your WOT article i think that is what i want to learn, but just for simply purpose of flagging NPC/MOB/Items...


Nov 5th, '11, 15:20
Profile
Site Moderator
User avatar

Joined: Aug 18th, '09, 03:32
Posts: 1201
Post Re: sending inputs in minimized window... hard for beginners
So you got it to work by having the window in focus in a VM?
If so a solution but not so good because the VM will take a lot of resources.

I do that using DirectX hooks. Intercepting one or more of the shader load functions, etc.
Same thing can be done to force a game into windowed mode, etc.

Another way to do some of these things is patch the client.
Usually at run time using a DLL.
You will have to do some reverse engineering.


Nov 9th, '11, 03:14
Profile

Joined: Sep 26th, '10, 10:06
Posts: 122
Post Re: sending inputs in minimized window... hard for beginners
i found this http://tuts4you.com/download.php?view.2876 from one of the sites you link
i might have more question after reading those :think:


Nov 9th, '11, 16:41
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Based on design by STSoftware, modded by Sirmabus Copyright© 2009-2011