AutoHotkey Community

It is currently May 26th, 2012, 12:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: September 16th, 2008, 1:02 am 
Offline

Joined: September 2nd, 2008, 4:41 pm
Posts: 19
Basically, I want to know how to make a program (macro for a game) that is still working even if I'm doing something else(internet or whatever). I know it is possible, but i don't know with AHK.

Also, I need to say that my actual macro uses click and pixelsearch, and I dunno if it makes a problem(for AHK).

Still, I see everyday the same macro running(not mine) and it works without any problem.

PS: I probably made lots of mistakes, since I'm french and I'm 17 years old.
If you really don't understand, ask me.

Thanks in advance.

_________________
Oh shit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 1:48 am 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
Probly not. Usualy you need teh window to be active. So the game will play itself but must be active.

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 2:30 am 
Offline

Joined: September 2nd, 2008, 4:41 pm
Posts: 19
Ok. Do you have an idea how to do this without AHK then?

Thanks.

_________________
Oh shit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 3:01 am 
if your macro was written in AHK AND you have the source/code of the macro then you could remove any IfWinActive or #IfWinActive line to make the macro work on any window
if not then you are out of luck


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 11:31 am 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
In theory It IS posible. YOu can have a macro running and do other things on your computer. Problem is a game macro, usualy needs the game to be active. Which restricts what you can do.

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 4:07 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Especially with PixelSearch and Click. Click must have the window active, or it will activate the window on its own. Pixel search must be able to see the color on screen... Without anything covering it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2008, 9:42 pm 
Offline

Joined: September 2nd, 2008, 4:41 pm
Posts: 19
Yeah... but you guys know another program like AHK taht could make it?

Thanks for answering

_________________
Oh shit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2008, 9:46 pm 
PixelSearch and ImageSearch both need the target to be visible. You could use the GDI+ library to copy the window, and do a pixel/imagesearch on that. Not easy, but doable.

HTH
________________________________________________________
New here? Please, before you post...
1. Read the tutorial and try the examples. -> 2. Take a look at the command list to get an idea of what you could do. -> 3. Create your script. Consult the documentation and the FAQ if you get stuck. -> 4. Search the forum if you need help or examples, method 1 (forum), method 2 (site), method 3 (Google). -> 5. Post your code on the forum in the "Ask for Help" section if you still run into problems (but read this first). -> 6. There is more AHK on autohotkey.net and the Wiki and there is an AHK IRC chat.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2008, 5:28 am 
Offline

Joined: March 19th, 2007, 5:12 pm
Posts: 29
RawRee wrote:
Yeah... but you guys know another program like AHK taht could make it?

Like AHK? No

Another programming language? Probably. Do it in either C, C++ or Assembly. Write a program that reads the GDI screen buffer and searches for the pixel you need. Add in the code for the events to be sent to that Applications event loop. Probably have to do some memory diving.

Bottom line, it won't be easy, but you would learn a good deal about writing low level software hooks if you did it. A few weeks with a couple of good books on Windows memory management and low level device manipulation should do the trick.

If you know someone else who is doing that, ask them how they did it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2008, 4:24 pm 
Offline

Joined: September 2nd, 2008, 4:41 pm
Posts: 19
Ok, lol i just didn't understand a word of what you said :shock:

I guess I'm more noob than i thought I was.(If it is possible to say it like this :P)

Can you explain me how to do so :D ?

I'll probably go to university in programming in about 2 years so I'm interested because I don't know that much about programming.

_________________
Oh shit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2008, 4:35 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
C, C++, or Assembler... Probably not your best place to start if you've never programmed before. I think the best thing to do is to work with AHK a little... Get the basics of Loops, If's, and a concept of what "Syntax" is. Then maybe move into something like "Python", which is still somewhat simple to learn, but more challenging than AHK... If you can learn a lot of that, then maybe you can attempt C++ (Skip "C", because it gives about the same as C++, but C++ will be a bit easier to use.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2008, 4:52 pm 
1. memory read monster/player's x,y location
2. compare it with the center value x,y where ur character is
3. then do a controlclick (thats if the game allow controlclicks)

character memory address location should not be hard to find, since it is usually fixed
but then the problem is reading monster/player's x,y location
depends on ur game, if they are fixed with the starting memory address value, then at least u can grab 5-10 and compare the values to decide which one to click

anyhow, u will need to check with cheatengine about the memory locations,
well lastly, if u have no idea what i am talking about, just forget it


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2008, 10:48 pm 
Offline

Joined: September 17th, 2008, 7:34 pm
Posts: 12
You could always try to run the game and the AHK script in some sort of a virtual machine. That way it will be completely separate from the rest of your OS.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2008, 1:43 pm 
Offline

Joined: September 2nd, 2008, 4:41 pm
Posts: 19
Quote:
C, C++, or Assembler... Probably not your best place to start if you've never programmed before. I think the best thing to do is to work with AHK a little... Get the basics of Loops, If's, and a concept of what "Syntax" is. Then maybe move into something like "Python", which is still somewhat simple to learn, but more challenging than AHK... If you can learn a lot of that, then maybe you can attempt C++ (Skip "C", because it gives about the same as C++, but C++ will be a bit easier to use.)

Thanks, I'll continue working with AHK for a bit than :wink: .

Quote:
You could always try to run the game and the AHK script in some sort of a virtual machine. That way it will be completely separate from the rest of your OS.


Tell me more :D
That's exactly what I want to do. :D

_________________
Oh shit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2008, 3:42 pm 
Offline

Joined: September 17th, 2008, 7:34 pm
Posts: 12
To be honest, I've looked into what is available for virtualization software, but I have not actually used one yet. I've heard that this is pretty good, so you could give it a try. I believe that you want to clone your current OS to make a VM, and then run the game/ahk script from inside of the VM.

Good luck, and let me know how it works.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Morpheus, RUBn, SKAN, sks, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can 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:
Powered by phpBB® Forum Software © phpBB Group