Hey,pepes
OK.... been working quite a while on this and thought I should ask for some help. I have no problem writing a script to open console and send commands and close console when done, but whenever and underscore "_" is written in script, it becomes a dash "-" in the console:
sv_everything_1
becomes
sv-everything-1
Current solution: Write script without "_" and add 5 second pause. Ample time to hold LShift and key and type "_" before it continues
---------------------------------------------
$F1::
{
Send, ``
Sleep, 100
Send, s
Sleep, 100
Send, v
Sleep, 5000 ;pause here to hold LShift and type "_" prior to script continuing
Send, e
Sleep, 100
Send, v
Sleep, 100
Send, e
Sleep, 100
Send, r
Sleep, 100
Send, y
Sleep, 100
Send, t
Sleep, 100
Send, h
Sleep, 100
Send, i
Sleep, 100
Send, n
Sleep, 100
Send, g
Sleep, 2000 ;pause here to type "_" (shorter pause, because my fingers are already on the necessary keys)
Send, 1
Send, {enter}
sleep, 100
Send, ``
}
---------------------------------------------
The above is works perfectly..... but is awkward during gameplay. Research has suggested "?" or "/" in place of underscore, but no go
Thanks for any help, Eric
PS. The Game is Painkiller: Recurring Evil and this code command gives all kinds of really crazy weapons to kill the badies
PPS. I just remembered... I have another game in which this type of script DOES allow the "_" character.... so this issue is game specific,
but maybe somebody knows a trick <--- so jelly of beard
[solved] Underscore becomes dash in console Topic is solved
[solved] Underscore becomes dash in console
Last edited by Evil-e on 22 Oct 2018, 09:55, edited 1 time in total.
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask
Re: Underscore becomes dash in console
if the game allows it, u can try pasting the command in:
Code: Select all
Send ``
ClipSaved := Clipboard
Clipboard := "sv_whatever"
Send ^v{Enter}``
Clipboard := ClipSaved
Re: Underscore becomes dash in console
You could try Send {Text}.
Code: Select all
SendInput, {Text}abc_def ;note: {Text} requires AHK v1.1.27+
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Underscore becomes dash in console
Thank you both for rapid response time
OK.... I am running AHK v1.1.30, so we good there.
This is what I tried without success
---------------------------------------------------------
$F1::
{
Send, ``
sleep, 100
SendInput, {Text}sv_everything_1 ;tried with & without a space after {text}
Send, {enter}
sleep, 100
Send, ``
}
return
----------------------------------------------------------
When the above is tried, the console is opened then closed and get a "game saved" message. BUT, regardless of what key I program to send this code, I get that same "game saved" message.
when I copied sv_everything_1 to clipboard and ran this script...
----------------------------------------------------------
$F1::
{
Send ``
ClipSaved := Clipboard
Clipboard := "sv_everything_1"
Send ^v{Enter}``
Clipboard := ClipSaved
Send, ``
}
return
----------------------------------------------------------
.... I got no results at all Probably the syntax is incorrect, as I have never tried this option
Eric
BTW..... I am able to "paste" this code when I use the tilde key to open console, key ENTER and it works perfectly fine. No doubt I am
writing swags code incorrectly
OK.... I am running AHK v1.1.30, so we good there.
This is what I tried without success
---------------------------------------------------------
$F1::
{
Send, ``
sleep, 100
SendInput, {Text}sv_everything_1 ;tried with & without a space after {text}
Send, {enter}
sleep, 100
Send, ``
}
return
----------------------------------------------------------
When the above is tried, the console is opened then closed and get a "game saved" message. BUT, regardless of what key I program to send this code, I get that same "game saved" message.
when I copied sv_everything_1 to clipboard and ran this script...
----------------------------------------------------------
$F1::
{
Send ``
ClipSaved := Clipboard
Clipboard := "sv_everything_1"
Send ^v{Enter}``
Clipboard := ClipSaved
Send, ``
}
return
----------------------------------------------------------
.... I got no results at all Probably the syntax is incorrect, as I have never tried this option
Eric
BTW..... I am able to "paste" this code when I use the tilde key to open console, key ENTER and it works perfectly fine. No doubt I am
writing swags code incorrectly
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask
Re: Underscore becomes dash in console
maybe its a matter of timing, split the Send commands into individual ones and add Sleep in between, or adjust A_KeyDelay and restore it back to its original values when ure done sending:
Code: Select all
$F1::
{
DelaySaved := A_KeyDelay
SetKeyDelay 100
ClipSaved := Clipboard
Clipboard := "sv_everything_1"
Send ``^v{Enter}``
Clipboard := ClipSaved
SetKeyDelay % DelaySaved
}
return
Re: Underscore becomes dash in console Topic is solved
Hmmmm.... i tried your idea here and nothing happened. So, I then opened console via tilde key and "paste" the text and it works just fine.
Regardless of the "context" in which I try to send text with an underscore, the result is a dash in its place
This is clearly an issue with how this game handles console commands. I even tried tinkering with adding this to the Target line of short-cut and did not work. What I can do is just copy this line to clipboard and open console, paste, close console and will work just fine...... but what's the fun in that
The question I need to ask: is there an alternate way to type an underscore character? Maybe some computer programmer out
there knows something?
[solved! FEMALE CANINES]
My new code....
--------------------------------------------------------------------------
$F1::
{
Send, `` ;All weapons & ammo: sv_everything_1
Sleep, 20
Send, sv
Sleep, 20
Send, {LShift down}
Sleep, 20
Send, _
Sleep, 20
Send, {LShift up}
Sleep, 20
Send, everything
Sleep, 20
Send, {LShift down}
Sleep, 20
Send, _
Sleep, 20
Send, {LShift up}
Sleep, 20
Send, 1
Send, {enter}
sleep, 20
Send, ``
}
return
----------------------------------------------------------------------------------
This works flawlessly and only took 24 hours
Many thanks to all input, as it each of it gave clues to resolving the mystery of the ages that has plagued mankind for millennium
Regardless of the "context" in which I try to send text with an underscore, the result is a dash in its place
This is clearly an issue with how this game handles console commands. I even tried tinkering with adding this to the Target line of short-cut and did not work. What I can do is just copy this line to clipboard and open console, paste, close console and will work just fine...... but what's the fun in that
The question I need to ask: is there an alternate way to type an underscore character? Maybe some computer programmer out
there knows something?
[solved! FEMALE CANINES]
My new code....
--------------------------------------------------------------------------
$F1::
{
Send, `` ;All weapons & ammo: sv_everything_1
Sleep, 20
Send, sv
Sleep, 20
Send, {LShift down}
Sleep, 20
Send, _
Sleep, 20
Send, {LShift up}
Sleep, 20
Send, everything
Sleep, 20
Send, {LShift down}
Sleep, 20
Send, _
Sleep, 20
Send, {LShift up}
Sleep, 20
Send, 1
Send, {enter}
sleep, 20
Send, ``
}
return
----------------------------------------------------------------------------------
This works flawlessly and only took 24 hours
Many thanks to all input, as it each of it gave clues to resolving the mystery of the ages that has plagued mankind for millennium
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask
Who is online
Users browsing this forum: No registered users and 48 guests