The Corsair User Forums  

Go Back   The Corsair User Forums > Corsair Product Discussion > Corsair Utility Engine (CUE) 1.x and 2.x > CUE 1.x and 2.x SDK

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 12-28-2017, 08:01 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932737
Mattii! Reputation: 10
Default Macro help.

Hi i need to do a macro for the mice Scimitar, I need that when I press a button it put the system date.
Sorry for the English, it's not my native language
  #2  
Old 12-28-2017, 08:26 PM
micky2171 micky2171 is offline
Registered User
micky2171's PC Specs
 
Join Date: Dec 2017
Location: Durham, United Kingdom
Posts: 13
POST ID # = 932741
micky2171 Reputation: 10
Post

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
  #3  
Old 12-28-2017, 10:17 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932758
Mattii! Reputation: 10
Default

Quote:
Originally Posted by micky2171 View Post
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
  #4  
Old 12-28-2017, 10:19 PM
micky2171 micky2171 is offline
Registered User
micky2171's PC Specs
 
Join Date: Dec 2017
Location: Durham, United Kingdom
Posts: 13
POST ID # = 932759
micky2171 Reputation: 10
Default

It should type the current date.

I will try this when I am back at my PC tomorrow.

Mick
  #5  
Old 12-28-2017, 10:24 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932760
Mattii! Reputation: 10
Default

Quote:
Originally Posted by micky2171 View Post
It should type the current date.

I will try this when I am back at my PC tomorrow.

Mick
Thank you. <3
  #6  
Old 12-28-2017, 11:25 PM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 847
POST ID # = 932765
hastegag Reputation: 20
Default

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/...c2?db=5&auth=1

That may or may not be helpful. You can also use a .bat file saved out with the following code:
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

Last edited by hastegag; 12-28-2017 at 11:34 PM. Reason: note RE VBS
  #7  
Old 12-29-2017, 11:33 AM
micky2171 micky2171 is offline
Registered User
micky2171's PC Specs
 
Join Date: Dec 2017
Location: Durham, United Kingdom
Posts: 13
POST ID # = 932852
micky2171 Reputation: 10
Post

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
  #8  
Old 12-29-2017, 11:48 AM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932854
Mattii! Reputation: 10
Default

Quote:
Originally Posted by micky2171 View Post
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"
  #9  
Old 12-29-2017, 11:53 AM
micky2171 micky2171 is offline
Registered User
micky2171's PC Specs
 
Join Date: Dec 2017
Location: Durham, United Kingdom
Posts: 13
POST ID # = 932855
micky2171 Reputation: 10
Post

You can change:
Code:
wshshell.sendkeys Date
To:
Code:
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.
Code:
wshshell.sendkeys "My String" & Day(Date) & Month(Date) & Year(Date) & "My String"
Mick
  #10  
Old 12-29-2017, 12:09 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932861
Mattii! Reputation: 10
Default

Quote:
Originally Posted by micky2171 View Post
You can change:
Code:
wshshell.sendkeys Date
To:
Code:
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.
Code:
wshshell.sendkeys "My String" & Day(Date) & Month(Date) & Year(Date) & "My String"
Mick
Thanks you!
  #11  
Old 12-29-2017, 12:23 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932866
Mattii! Reputation: 10
Default

This is working
Code:
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
Code:
set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.sendkeys "{|}" & "record " & Day(Date) & Month(Date) & Year(Date) & Hour(Time) & Minute(Time) & Second(Time) & "JB" & "{ENTER}"
  #12  
Old 12-29-2017, 12:32 PM
micky2171 micky2171 is offline
Registered User
micky2171's PC Specs
 
Join Date: Dec 2017
Location: Durham, United Kingdom
Posts: 13
POST ID # = 932869
micky2171 Reputation: 10
Post

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:
Code:
WScript.Sleep 400
E.g.
Code:
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
  #13  
Old 12-29-2017, 12:38 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932870
Mattii! Reputation: 10
Default

Quote:
Originally Posted by micky2171 View Post
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:
Code:
WScript.Sleep 400
E.g.
Code:
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?
  #14  
Old 12-29-2017, 12:39 PM
micky2171 micky2171 is offline
Registered User
micky2171's PC Specs
 
Join Date: Dec 2017
Location: Durham, United Kingdom
Posts: 13
POST ID # = 932871
micky2171 Reputation: 10
Default

That is a Tilde key,
Code:
{`}
  #15  
Old 12-29-2017, 12:42 PM
Mattii! Mattii! is offline
Registered User
 
Join Date: Dec 2017
Posts: 10
POST ID # = 932872
Mattii! Reputation: 10
Default

Code:
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
 

Tags
cue, macro, mice, system date

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.