Jump to content
Corsair Community

Macro help.


Mattii1626865607

Recommended Posts

You can do this with a simple VBS script.

 

Firstly, create a TimeNow.VBS file anywhere on your computer and put this in it:

 

set wshshell = wscript.CreateObject("wScript.Shell")

wshshell.sendkeys Date

 

 

Then, set the button to open the file as a program in Corsair Utility Engine.

After that, click the button and watch the magic happen! :D

 

Mick

Link to comment
Share on other sites

You can do this with a simple VBS script.

 

Firstly, create a TimeNow.VBS file anywhere on your computer and put this in it:

 

set wshshell = wscript.CreateObject("wScript.Shell")

wshshell.sendkeys Date

 

 

Then, set the button to open the file as a program in Corsair Utility Engine.

After that, click the button and watch the magic happen! :D

 

Mick

 

I try this, nothing happen

Link to comment
Share on other sites

As a note, the VBS seems to work fine from within a console window. Otherwise it does not appear to save anywhere other than to be echo'd. You could powershell pipe it and then have it in the clip, but there's got to be better solutions.

 

 

https://answers.microsoft.com/en-us/windows/forum/windows_vista-hardware/f12-date-stamp/32743213-3b64-46eb-9e11-5cfaeab195c2?db=5&auth=1

 

That may or may not be helpful. You can also use a .bat file saved out with the following code:

@ECHO ON
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
    set dow=%%i
    set month=%%j
    set day=%%k
    set year=%%l
)
set datestr=%month%-%day%-%year%
echo %datestr%|clip
END

you may need to adjust the above or you can use autohotkey with:

Timestamps

Link to comment
Share on other sites

While a bat file will work, it will also bring up an annoying popout window everytime you click the script.

 

I managed to get my original script working by telling Corsair to open the program using WScript.

 

Where you select 'Run the following program' in the Corsair Utility Engine, set it to this:

C:\Windows\System32\wscript.exe "C:\path\to\your\time.vbs"

 

Mick

Link to comment
Share on other sites

While a bat file will work, it will also bring up an annoying popout window everytime you click the script.

 

I managed to get my original script working by telling Corsair to open the program using WScript.

 

Where you select 'Run the following program' in the Corsair Utility Engine, set it to this:

C:\Windows\System32\wscript.exe "C:\path\to\your\time.vbs"

 

Mick

 

Thanks bro. Now is working.

Some questions, the script can change the format of date that do not use "/" and how can you add some constant example "record 29122017jb \n"

Link to comment
Share on other sites

You can change:

wshshell.sendkeys Date

 

To:

wshshell.sendkeys Day(Date) & Month(Date) & Year(Date)

 

Just swap the Day, Month, Year around if you need to change the format

 

To add strings to it, just put an & next to it then double quotes.

E.g.

wshshell.sendkeys "My String" & Day(Date) & Month(Date) & Year(Date) & "My String"

 

Mick

Link to comment
Share on other sites

You can change:

wshshell.sendkeys Date

 

To:

wshshell.sendkeys Day(Date) & Month(Date) & Year(Date)

 

Just swap the Day, Month, Year around if you need to change the format

 

To add strings to it, just put an & next to it then double quotes.

E.g.

wshshell.sendkeys "My String" & Day(Date) & Month(Date) & Year(Date) & "My String"

 

Mick

Thanks you!

Link to comment
Share on other sites

This is working

set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.sendkeys "record " & Day(Date) & Month(Date) & Year(Date) & Hour(Time) & Minute(Time) & Second(Time) & "JB"

the output is something like that "record 29122017132045JB"

now i need enter to the console on a game with "|" write that "record 29122017132132JB" and "ENTER"

i try this, but It does not work as expected

set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.sendkeys "{|}" & "record " & Day(Date) & Month(Date) & Year(Date) & Hour(Time) & Minute(Time) & Second(Time) & "JB" & "{ENTER}"

Link to comment
Share on other sites

Are you sure the console key is | and not something like \ or `

 

You could try adding a delay between the console key and the command using:

WScript.Sleep 400

 

E.g.

set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.sendkeys "{|}"
WScript.Sleep 400
wshshell.sendkeys "record " & Day(Date) & Month(Date) & Year(Date) & Hour(Time) & Minute(Time) & Second(Time) & "JB" & "{ENTER}"

 

Mick

Link to comment
Share on other sites

Are you sure the console key is | and not something like \ or `

 

You could try adding a delay between the console key and the command using:

WScript.Sleep 400

 

E.g.

set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.sendkeys "{|}"
WScript.Sleep 400
wshshell.sendkeys "record " & Day(Date) & Month(Date) & Year(Date) & Hour(Time) & Minute(Time) & Second(Time) & "JB" & "{ENTER}"

 

Mick

is the one on the left of the "1" and below "ESC". what key should that be?

Link to comment
Share on other sites

set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.sendkeys "{|}"
WScript.Sleep 400
wshshell.sendkeys "record " & Day(Date) & Month(Date) & Year(Date) & Hour(Time) & Minute(Time) & Second(Time) & "JB" & "{ENTER}"

i tried with "{\}" "{`}" and "{|}". none work.

it output "`record 29122017134256JB" but in the game does not enter the console

Link to comment
Share on other sites

What game is this for? I just thought you wanted it “in general”

 

Either way you might be able to run a sequential second action with a delay inside of cue triggering this vbs

 

There are no in game scripts like “bind a dostuff” ?

 

Recording seems like a bindable game command?

Link to comment
Share on other sites

What game is this for? I just thought you wanted it “in general”

 

Either way you might be able to run a sequential second action with a delay inside of cue triggering this vbs

 

There are no in game scripts like “bind a dostuff” ?

 

Recording seems like a bindable game command?

 

Counter Strike 1.6.

You can bind stuff.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...