Help - Search - Members - Calendar
Full Version: need help with a macro
AC Tools Everything Macro > AC Tool Macros > Macro Development
Wirefox
Hi. I'm new at this and trying to make a macro for a game. It's very basic just a few clicks over time, i got that part down. What i can't get it to do is when game disconnects to recognize it, pause the loop, click on the pop up msg and relog. Then resume the loop. Is what i need to do even possible? I've been playing around with IsGrey command but no luck.
So far i got:
Loop 20
MousePos 225, 786 // Task bar position of the client
delay 1000
LeftClick
delay 1000
MousePos 572, 600 // Position of Commander Icon
delay 1000
LeftClick
delay 1000
MousePos 699, 134 // Position of Recruit Button
delay 1000
LeftClick
delay 1000
MousePos 712, 665 // Positon of Close button
delay 1000
LeftClick

delay 7320000

End


Thanx alot in advance
Bear
QUOTE(Wirefox @ Aug 18 2009, 10:29 PM) *
Hi. I'm new at this and trying to make a macro for a game. It's very basic just a few clicks over time, i got that part down. What i can't get it to do is when game disconnects to recognize it,

delay 7320000


I'd say this is why your getting Disconnected, your Delay is 2 hours and 2 minutes.. Most games will label a player as AFK in about 5 minutes.

Edit: Fixed typo, typing in the dark. blink.gif
Wirefox
This delay is to repeat the loop every 2 hours. The game it self usually doesn't time out. I had periods of 4-5 days staying online without dropping, but some ppl dc every few hours.
Ahk
Create an object from the disconnection message and test for it when you need to. If it is a traditional window you may be able to detect it using IsWindow, or using If {ActiveWindow} <> GameTitleHere.

Wirefox
I been trying the IsWindow command, but when it closes the pop up disconnect window, it doesn't reload the client. what's wrong with this?


CODE

MousePos 259, 788 // Position of actool. This will minimize the window
delay 1000
LeftClick
delay 5000

IsWindow Galaxy Online

Loop 20000



MousePos 405, 134 // First planet
delay 1000 // This delay is needed in case game is slow
LeftClick
delay 1000
Keys m
delay 1000
Keys e
delay 5000
Keys c
delay 1000
Keys {Esc}
delay 1000

MousePos 584, 178 // 2nd planet
delay 1000 // This delay is needed in case game is slow
LeftClick
delay 1000
Keys m
delay 1000
Keys e
delay 5000
Keys c
delay 1000
Keys {Esc}
delay 1000



delay 30000 // This is delay to restart the loop

End
Else

Keys {space} // preses ok in disconnect/crash popup window
Keys @ {F4} // closing the client
delay 1000
MousePos 1162, 19 //Position of GO icon on the desktop
delay 5000
DoubleClick //This will start GO
delay 1000
MousePos 824, 562 //Position of Enter Button on Launcher
delay 1000
LeftClick
delay 10000
Keys a //This is password one letter per line
Keys a
Keys a
Keys a
Keys a
Keys a
Keys a
Keys a
Keys a
delay 60000
Keys h
delay 1000
Keys {up} //The following commands will bring your window position to the start point
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {Left}
delay 1000
Continue


End
DaMOB
CODE
procedure cmdISWINDOW;
begin
  bElse[iInIf] := GetWindowHandle(sLineData, False) = 0;
end;
My Delphi is rusty as hell but I think this function will not work for your needs (I don't know your game) because the game might not close the window but instead hide it. Basically that IsWindow is just looking through the system to see if the title you gave it has a windows handle. Another thing, since I don't know your game, is that a sub window might be a child or might not be (hidden in other words) like EQ2. It opens a shit load of windows that have no handles.

So, if you are trying to use IsWindow on the main game's window (it looks like you are) it will always come back true, or at least it should, unless your game closes the game itself taking the window with it.

Basically I would do what Ahk says and stay away from that command. I don't know how programmer savvy you are but here is a good read on that command -> http://www.wintask.com/onlinehelp/Language...indowHandle.htm
Wirefox
DaMOB your code doesn't work in ACTool, or am i just this noobish?




Then i also tried IsGrey command for color recog, but no luck there ether.

CODE

MousePos 261, 846 // Position of actool. This will minimise the window
delay 1000
LeftClick
delay 5000


IsGrey 557, 469 //Cord of Grey area in disconnect window

Keys {right}
delay 1000
Keys {space} // preses ok in disconnect/crash popup window
delay 1000
MousePos 416, 851 // closing the client
delay 1000
RightClick
delay 1000
MousePos 453, 840
delay 1000
LeftClick
delay 1000
MousePos 1100, 20 //Position of GO icon on the desktop
delay 1000
DoubleClick //This will start GO
delay 1000
MousePos 764, 596 //Position of Enter Button on Launcher
delay 1000
LeftClick
delay 10000
Keys a //This is your password one letter per line
Keys a
Keys a
Keys a
Keys a
Keys a
Keys a
Keys a
Keys a
delay 60000
Keys h
delay 1000
Keys {up} //The following commands will bring your window position to the start point
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {up}
Keys {Left}
delay 1000
Continue



Else

Loop 20000

MousePos 405, 137 // First planet
delay 1000 // This delay is needed in case game is slow
LeftClick
delay 1000
Keys m
delay 1000
Keys e
delay 5000
Keys c
delay 1000
Keys {Esc}
delay 1000

MousePos 585, 186 // 2nd planet
delay 1000 // This delay is needed in case game is slow
LeftClick
delay 1000
Keys m
delay 1000
Keys e
delay 5000
Keys c
delay 1000
Keys {Esc}
delay 1000



delay 30000 // This is dalay to restart the loop

End

End




i attached an img of window i get
DaMOB
QUOTE(Wirefox @ Aug 26 2009, 04:24 PM) *
DaMOB your code doesn't work in ACTool, or am i just this noobish?
That code is pure Delphi code and is the routine ACTool is using when you call that IsWindow command. I was using it to show what ACTool does when you call it not to be cut and pasted into your macro (remember I am used to talking to and with other programmers so I take it for granted that everyone understands Delphi, C++, C, Perl, Basic).

The screen cap you showed is of a MSGBOX and as such doesn't have a title to IsWindow with. If that box is always right where the screen cap shows it your only choice is to do what Ahk mentioned.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.