Thread overview | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 12, 2014 Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
/Long/ story short, I want to pretty much make a macro using this program. I don't really have time to explain in further detail at the moment, but /no/ macro program out there will do what I'm trying to do. I want to basically make it so that when I press a hotkey, it'll send an in game chat message. Here's my code for the popular program AutoHotKey. [code] Numpad0 & Numpad1:: Send {k down} Sleep 1 Send {k up} SendInput We're losing Alpha{!} SendInput {Enter} Return [/code] That's a small sample of my script, but the only thing that would change with the rest of my script would be the message sent and the keybind to press it. Basically what it's doing is listening for my hotkey to be pressed (in this particular example it's numpad 0 + numpad 1 for the message, "We're losing Alpha!", and so on and so forth for the rest of the numbers.) and then activating the chat button in game (in this particular examle it's k for team chat), then sending the actual message as quickly as possible, and sending it. Works perfectly in BF4, but PB (PunkBuster), the default anti cheat system that BF4 uses will kick me if the admins have that setting enabled. I've been wanting to learn full on programming for a while, and I've heard a lot of things about D and how it's a pretty good starting point, and how it has a huge potential to expand you into anything. Plus it's supposed to be pretty efficient and the next big thing in the programming world, so there's that. Just for the record, I don't have a lot of experience with programming. I've done it years ago (had an instructor for a Boy Scout Merit Badge class), but I didn't even know which language I was typing in. I assume it was Python, but I can't be sure. Whatever I make I want it to be somewhat compatible with Linux eventually. I just want to start with a binary .exe, but I do want my code to be compatible with Linux if I choose to compile it for Linux at a later date. I don't think this should be an issue, but I just wanted to throw this out there. I'm not sure which libraries I need for this, but as far as I know I just need the following: Keybind listener/hotkey Keyboard emulating/low level chat producing library something that /wont/ be picked up as a hack/cheat by /ANYTHING/. I don't think this should be that hard to make, but D doesn't really have much documentation out there as far as I can tell, so I figured this would be the best place to put this. The sooner the better please. Thanks for any/all help I receive. |
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Casey Attachments: | On Wed, 12 Nov 2014 04:56:39 +0000 Casey via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote: D has nothing to do with your task, WinAPI does. and you'll need alot of expirience in reverse engineering, 'cause f... punkbuster shits it's pants almost for anything. it's a rootkit, and very badly written one. what you have to do is to fight with rootkit, making it think that it is still functional. so learn assembler, x86 archtecture, winapi, windows driver development, nt kernel internals and so on. and don't even dream that it will be portable. |
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On Wednesday, 12 November 2014 at 08:02:06 UTC, ketmar via
Digitalmars-d-learn wrote:
> On Wed, 12 Nov 2014 04:56:39 +0000
> Casey via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
>
> D has nothing to do with your task, WinAPI does. and you'll need alot
> of expirience in reverse engineering, 'cause f... punkbuster shits it's
> pants almost for anything. it's a rootkit, and very badly written one.
> what you have to do is to fight with rootkit, making it think that it
> is still functional. so learn assembler, x86 archtecture, winapi,
> windows driver development, nt kernel internals and so on.
>
> and don't even dream that it will be portable.
That isnt entirely true. Ive made macros in C# for APB:R with
punkbuster, albeit an older version and they worked just fine.
If you want to go that way you will need InputSimulator from
codeplex.
For D i cant help as i dont know any library that allows you to
take control over mouse and keyboard. In fact i think ill give
this a go at some point.
|
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Casey | On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote: also, you came to the right place. PB is extremely paranoid and even more so about autohokey, so if you program your own native macro, its not very likely it will catch it. |
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On Wednesday, 12 November 2014 at 08:02:06 UTC, ketmar via Digitalmars-d-learn wrote:
> On Wed, 12 Nov 2014 04:56:39 +0000
> Casey via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
>
> D has nothing to do with your task, WinAPI does. and you'll need alot
> of expirience in reverse engineering, 'cause f... punkbuster shits it's
> pants almost for anything. it's a rootkit, and very badly written one.
> what you have to do is to fight with rootkit, making it think that it
> is still functional. so learn assembler, x86 archtecture, winapi,
> windows driver development, nt kernel internals and so on.
>
> and don't even dream that it will be portable.
I don't need to do this I'm pretty sure... I just need to write something that will send the chat messages as described in my first post. I don't need to rootkit PunkBuster, it's not trying to ban programs that send chat messages.... It's simply trying to ban macro programs like AutoHotKey. AHK can be used to make no recoil scripts, so they added an option so that server owners can choose to kick those players /if they want to/.
Again, I'm writing a simple program to send chat messages at a lowish level once a hotkey/keybind has been pressed. All it needs is to add a delay in between the chat key presses (Like *chat key* down, then 1 ms later, chat key up)(Forgot to mention that last night), typing my actual message as quickly as possible, then to send the message.
In other words, it needs to recignise my keybind, press the chat button down, then up with a small delay in between, send my message and press enter.
PB nor any other program should find this as a cheating program. It's not a cheat at all. It's not a mod, hack, nor advantage that others can't do. It's not unfair, it's not too good, it's just something simple that I'm trying to make work. It doesn't need a GUI, it just needs what I've described above. No rootkits, nothing like that afaik. If it's not a hack/cheat, PB isn't going to look at it like it is one (hopefully).
Thank you for your interest and reply.
|
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Israel | On Wednesday, 12 November 2014 at 19:29:26 UTC, Israel wrote:
> On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote:
>
> also, you came to the right place. PB is extremely paranoid and
> even more so about autohokey, so if you program your own native
> macro, its not very likely it will catch it.
I didn't see your replies at first... Thanks for your interest.
If D isn't the right language, I can go with something else like C++ or python. It's just got to have something that can send low level chat messages, or emulate actual keyboard presses so that I won't have issues with other games. (/NOT/ C# simply because Micro$oft makes it and I try to avoid their stuff as much as possible).
I chose D simply because I've heard it's got a lot of potential and it's somewhat similar to C++, yet easyish to learn. I'm up for anything, but I figured that if I went with D or C++ I'd be jumping right into it, so that would give me the most experience. I thought this shouldn't be too hard to make, but I just can't find anything that does the job 'm looking for.
|
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Casey | On Wednesday, 12 November 2014 at 19:43:49 UTC, Casey wrote: > On Wednesday, 12 November 2014 at 19:29:26 UTC, Israel wrote: >> On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote: >> >> also, you came to the right place. PB is extremely paranoid and >> even more so about autohokey, so if you program your own native >> macro, its not very likely it will catch it. > > I didn't see your replies at first... Thanks for your interest. > > If D isn't the right language, I can go with something else like C++ or python. It's just got to have something that can send low level chat messages, or emulate actual keyboard presses so that I won't have issues with other games. (/NOT/ C# simply because Micro$oft makes it and I try to avoid their stuff as much as possible). > > I chose D simply because I've heard it's got a lot of potential and it's somewhat similar to C++, yet easyish to learn. I'm up for anything, but I figured that if I went with D or C++ I'd be jumping right into it, so that would give me the most experience. > I thought this shouldn't be too hard to make, but I just can't find anything that does the job 'm looking for. Its not that D "isnt" the right language its just that it isnt "yet". There are few libraries that allow you to take control over the mouse and keyboard without too much hassle and reading through documentation. I did find this a couple days ago. http://code.dlang.org/packages/de_window It might be what you need but im not entirely sure if its input simulation is across all programs. |
November 12, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Israel | On Wednesday, 12 November 2014 at 23:35:33 UTC, Israel wrote:
> On Wednesday, 12 November 2014 at 19:43:49 UTC, Casey wrote:
>> On Wednesday, 12 November 2014 at 19:29:26 UTC, Israel wrote:
>>> On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote:
>>>
>>> also, you came to the right place. PB is extremely paranoid and
>>> even more so about autohokey, so if you program your own native
>>> macro, its not very likely it will catch it.
>>
>> I didn't see your replies at first... Thanks for your interest.
>>
>> If D isn't the right language, I can go with something else like C++ or python. It's just got to have something that can send low level chat messages, or emulate actual keyboard presses so that I won't have issues with other games. (/NOT/ C# simply because Micro$oft makes it and I try to avoid their stuff as much as possible).
>>
>> I chose D simply because I've heard it's got a lot of potential and it's somewhat similar to C++, yet easyish to learn. I'm up for anything, but I figured that if I went with D or C++ I'd be jumping right into it, so that would give me the most experience.
>> I thought this shouldn't be too hard to make, but I just can't find anything that does the job 'm looking for.
>
> Its not that D "isnt" the right language its just that it isnt
> "yet".
> There are few libraries that allow you to take control over the
> mouse and keyboard without too much hassle and reading through
> documentation.
>
> I did find this a couple days ago.
> http://code.dlang.org/packages/de_window
> It might be what you need but im not entirely sure if its input
> simulation is across all programs.
I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume Ptyhon or C++ would be good choices, any chance you can recommend a forum for these or something? It's hard to find any documentation on what I am looking for.
Thanks.
|
November 13, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Casey | On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote:
>
> I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume Ptyhon or C++ would be good choices, any chance you can recommend a forum for these or something? It's hard to find any documentation on what I am looking for.
>
> Thanks.
I tried to test out that de_window library but it doesnt work out
of the box.
The guy who created it though does post in this forum so maybe if
he magically finds this thread he can help you and me out.
|
November 13, 2014 Re: Basically want to make a macro script | ||||
---|---|---|---|---|
| ||||
Posted in reply to Israel | On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote:
> On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote:
>
>>
>> I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume Ptyhon or C++ would be good choices, any chance you can recommend a forum for these or something? It's hard to find any documentation on what I am looking for.
>>
>> Thanks.
>
> I tried to test out that de_window library but it doesnt work out
> of the box.
>
> The guy who created it though does post in this forum so maybe if
> he magically finds this thread he can help you and me out.
That would be nice. I'll see if there's a way to PM him about it. Do you have any other programming language recommendations in case this doesn't work out?
|
Copyright © 1999-2021 by the D Language Foundation