954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Automatically type...?!

Hi,

i need to type some commands at a specific time of day in the console of counter strike to connect to a server automatically...

i just need a way to type in the cs console... i can take care of the rest...

if anyone has any idea on how to do this plzz tell me even if you are not sure if it works and even if it works for a similar purpose ...


Thank you very very much...

Dell XPS
Junior Poster in Training
85 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

Well if you want a wild guess.
How about using process with RedirectStandardInput
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardinput.aspx

or maybe SendKeys.

waynespangler
Posting Pro in Training
461 posts since Dec 2002
Reputation Points: 84
Solved Threads: 58
 

i tried send keys...

in cs you hit "`" for the console to open and i wrote

Sendkeys(key.oem8)

but it doesnt work

any ideas?

Dell XPS
Junior Poster in Training
85 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

I don't know about your game but this works for my game of Casino Empire.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ID As Integer
        Dim pr As New Process
        Dim p() As Process = Process.GetProcesses
        For Each pr In p
            If pr.MainWindowTitle.ToString = "Casino Empire" Then
                ID = pr.Id
                Exit For
            End If
        Next
        AppActivate(ID)
        Sleep(7000)
        For x As Int16 = 1 To 10
            My.Computer.Keyboard.SendKeys("{RIGHT}")
        Next
    End Sub

The sleep is in there to give me time to bring up the game. I don't know why the AppActivate doesn't.
I would use this with a NotifyIcon program and keep it in the tray so when it is triggered then it is not taking up desktop space.

waynespangler
Posting Pro in Training
461 posts since Dec 2002
Reputation Points: 84
Solved Threads: 58
 

ok ill try it out

Dell XPS
Junior Poster in Training
85 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

thank you waynespangler, your method works fine...

its just that i cant set the focus to the console within the game before it writes those commands...

any ideas
thnx anyway

Dell XPS
Junior Poster in Training
85 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You