Jump to content
Sign in to follow this  
Chrisaster

Sending commands to a Source game console

Recommended Posts

Chrisaster

I'm pretty new to AutoIt, and I've made a few programs, however I've come across a problem when making a program to send commands to a Source (e.g. GMod, Counter Strike:Source) console. I made a program to send the commands you type in the input box to the console, however it uses a ControlSend function which is unreliable as it assumes the client is in a position where the console is availible, and also assumes the console is not already open. I was wondering if it would be possible to send commands directly to the game but I have no idea what to search and where to start going about this.

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
FireFox

@Chrisaster

Send() function ?

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Chrisaster

@Chrisaster

Send() function ?

Cheers, FireFox.

FireFox,

Thanks for the quick reply, however I was wondering if it would be possible to use functions other than Send or ControlSend to send commands to the clients console. So the command is actually 'injected' into the game using a third party program.

Edited by Chrisaster

Share this post


Link to post
Share on other sites
AgentSmith15

FireFox,

Thanks for the quick reply, however I was wondering if it would be possible to use functions other than Send or ControlSend to send commands to the clients console. So the command is actually 'injected' into the game using a third party program.

Any injected DLL will get you detected by VAC and get you Perma banned. I highly suggest you not to try and take that route.

What is the exact problem? I use the code below to limit how fast AutoIt types, so it's for the most part always correct. If you want to ensure that nothing gets messed up you can lock the keyboard till you get to the end of the send.

Opt("SendKeyDelay", 20)
Opt("SendKeyDownDelay", 5)

Share this post


Link to post
Share on other sites
Chrisaster

Any injected DLL will get you detected by VAC and get you Perma banned. I highly suggest you not to try and take that route.

What is the exact problem? I use the code below to limit how fast AutoIt types, so it's for the most part always correct. If you want to ensure that nothing gets messed up you can lock the keyboard till you get to the end of the send.

Opt("SendKeyDelay", 20)
Opt("SendKeyDownDelay", 5)
AgentSmith,

This program is designed for Garry's Mod and responds to key presses such as Ctrl+F simulating a bind press. However this is slow and not 100% reliable. In Garry's Mod VAC is stated as enabled, however it is not (No idea why).

And about:

Opt("SendKeyDelay", 20)

Opt("SendKeyDownDelay", 5)

I give the user an option to set the key stroke delay.

Edited by Chrisaster

Share this post


Link to post
Share on other sites
Chrisaster

HLSW is a good example of a program having the capability to do this.

Edited by Chrisaster

Share this post


Link to post
Share on other sites
Bam

I believe steam has no thoughts of inforcing any rules for Gmod, why? simple thiers so maney addons for the game and people alrdy have contraptions that can kill u from farther then u see with a 95% chance of a head shot no mater what. thiers aimbots alrdy in the game ever hear of smartsnap? Ever 1 SHOULD have it (so help full <3) lol and its an aimbot...

But for ur problem I dont have an idea sorry :lmao: but it sounds like it could be realy helpfull :)

Edited by Bam

Share this post


Link to post
Share on other sites
FireFox

@Chrisaster

I can't get the control of console and its apparently not a window...

I think the last way is to using this :

ControlSend("Counter-Strike Source",'','',"something to write in console")

Cheeers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Chrisaster

Well I guess I'll have to stick with that then :)

Thanks for the help!

Edited by Chrisaster

Share this post


Link to post
Share on other sites
Bam

When hosting a dedicated server off a pc it has a window u can type commands into and if u want to do users commands i believe u can do like "ulx cexec "username" "command";requires ulx :)

other then that idk, u might be able to open the command window on a dedicated server remotly.

Share this post


Link to post
Share on other sites
Jack023

I know it's an old thread but I needed it too and find a solution!

To send commanda to a game let it:

FileWrite(sourcegame/cfg/test.cfg) <-- example

Then bind a button ingame like:

Bind "kp_end" "exec test"

Then you send:

Send("{NUMPAD1}")

After that

FileDelete("sourcegame/cfg/test.cfg")

So the full code is like:

FileWrite(sourcegame/cfg/test.cfg) <-- example

Send("{NUMPAD1}")

FileDelete("sourcegame/cfg/test.cfg")

You can also make a txtfile with all the commanda you want send then filereadline, filewrite thenthe same..

And instead of send you can use ControlSend too so you cando it out of the game!

No problem and have a good day!

Share this post


Link to post
Share on other sites
Jos

I know it's an old thread but I needed it too and find a solution!

-snip-

No problem and have a good day!

Just don't when you know and read our current forumrules around Game bots.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×