Ability to do basic maths

Here you are welcome to post Push2Run feature requests
Post Reply
SimplyAName
Posts: 4
Joined: Mon Dec 03, 2018 7:55 pm

Ability to do basic maths

Post by SimplyAName »

Currently, I am trying to make a card which allows me to put my computer to sleep after a set amount of minutes.
I am trying to do the below as the command takes it in milliseconds but have found no way doing it without just saying the amount of millisecond which isn't the most fun math. So some ability to just do simple addition and multiplication etc would be awesome. Could have it set to only work in between two symbols to stop errors happening eg: ?24*100?
Copy of card having problem with maths
Copy of card having problem with maths
P2RCard.PNG (18.44 KiB) Viewed 2983 times
Thanks and great work so far. Can't wait to see it develop even further :D
RobLatour
Site Admin
Posts: 1003
Joined: Mon Feb 19, 2018 11:43 am

Re: Ability to do basic maths

Post by RobLatour »

I haven't tested it (as I'm a little pressed for time right now), but you should be able to create a simple .bat file to do the math.

For example, create the file:
sleep.bat

and in it include the following (as per your example):

set /a Milli= %1 * 6000
e:
cd "My Downloads"
nircmd-x64.exe cmdwait %Milli% standby

and in the Push2Run card, open the sleep.bat file, remembering to put the $ in the parameters field on your push2run card.

Please let me know if this works for you.
SimplyAName
Posts: 4
Joined: Mon Dec 03, 2018 7:55 pm

Re: Ability to do basic maths

Post by SimplyAName »

A little bit of tweaking needed but work great overall thanks :D
Post Reply