Mattii1626865607 Posted December 29, 2017 Share Posted December 29, 2017 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 Link to comment Share on other sites More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 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 More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 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 More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 It should type the current date. I will try this when I am back at my PC tomorrow. Mick Link to comment Share on other sites More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 It should type the current date. I will try this when I am back at my PC tomorrow. Mick Thank you. <3 Link to comment Share on other sites More sharing options...
hastegag Posted December 29, 2017 Share Posted December 29, 2017 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 More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 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 More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 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 More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 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 More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 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 More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 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 More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 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 More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 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 More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 That is a Tilde key, {`} Link to comment Share on other sites More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 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 More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 Odd, I can close the CS:GO console window with it, but cannot open it with the script. The record part works though. I will do a bit of research and find out why this doesn't work Link to comment Share on other sites More sharing options...
Mattii1626865607 Posted December 29, 2017 Author Share Posted December 29, 2017 with the macros of cue i can open the console. if is one way to mix macro and openning programs it should work Link to comment Share on other sites More sharing options...
micky2171 Posted December 29, 2017 Share Posted December 29, 2017 Don't think thats possible :/ I think your just going to have to open the console and then click the button. Unless anyone else on this forum can help you. Link to comment Share on other sites More sharing options...
hastegag Posted December 30, 2017 Share Posted December 30, 2017 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 More sharing options...
Mattii1626865607 Posted December 30, 2017 Author Share Posted December 30, 2017 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 More sharing options...
hastegag Posted December 31, 2017 Share Posted December 31, 2017 https://gamebanana.com/scripts/6883 https://gamebanana.com/threads/206913 Maybe you can write a script to rename the demo files once they are recorded? Like on button press, take the recorded demo and rename it so the bind does not overwrite it? dunno Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.