ludocus Posted June 9, 2008 Posted June 9, 2008 (edited) I made this, because.... I was interested! Well.. it's very simple but (I think) very usefull .Here it is:expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.0 Author: ludocus Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt('TrayMenuMode', 1) Opt('OnExitFunc', '_exit') $seconde = ('0.043859649122807017543859649122807'/3600) $c = TrayCreateItem('Calculate..') $e = TrayCreateItem('Exit.......') $timer = TimerInit() While 1 sleep(100) $tMsg = TrayGetMsg() Switch $tMsg case $c _energie() Case $e Exit EndSwitch WEnd func _exit() $time = Round((TimerDiff($timer)/1000)) $cash = $time*$seconde msgbox ( 32, 'Calculate energy', 'This program was running for '&$time&' seconds'&@CRLF&'the energie cost of that is: '&$cash) Exit EndFunc func _energie() $time = Round((TimerDiff($timer)/1000)) $cash = $time*$seconde msgbox ( 32, 'Calculate energy', 'This program was running for '&$time&' seconds'&@CRLF&'the energie cost of that is: '&$cash) EndFuncEnjoyComments are welcome Edited June 10, 2008 by ludocus
James Posted June 9, 2008 Posted June 9, 2008 (edited) Has this actually been tested? Also, it's "energy". Edited June 9, 2008 by Jiim Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Nbanonimous Posted June 9, 2008 Posted June 9, 2008 ima test it now dude that is frickin SWEET Best Free Undetectable Proxies!www.CPUMod.netwww.CellFoneTrader.comwww.TindoraFarms.com
ludocus Posted June 9, 2008 Author Posted June 9, 2008 @Jiim yep, tested and it workes great! @Nblufire12 thnx
James Posted June 9, 2008 Posted June 9, 2008 @Jiimyep, tested and it workes great! Accurate too? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Kip Posted June 9, 2008 Posted June 9, 2008 I don't think that 1 minute will cost 0.80 cent. If so my father would be a millionar. 1 = 0.80 60 = 48.00 48.00 * 7 (that's how long my computer is on) = 336 euros per day. in a week that would be 3252 euros, and in a year 122,304 euros. (a little bit too much) Thats a lot for one computer. (And we have three computers in our house) MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
newbiescripter Posted June 9, 2008 Posted June 9, 2008 I don't believe this. if you look at it ca. 80 seconds will cost 1 euro. there is 86400 secs in a day this means that it will cost 86400 / 80 = 1080 euros pr. day for me to have my computer turned on. and that is insane
Kip Posted June 9, 2008 Posted June 9, 2008 I don't believe this.if you look at it ca. 80 seconds will cost 1 euro. there is 86400 secs in a day this means that it will cost 86400 / 80 = 1080 euros pr. day for me to have my computer turned on. and that is insane You copycat MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
ludocus Posted June 9, 2008 Author Posted June 9, 2008 lol, maybe ur right, I did some research.. prob. not trustable..
sandin Posted June 10, 2008 Posted June 10, 2008 if you could find a way to read PC's power voltage you'll get more accurate readings, not all PCs waste same amount of energy. P.S. and not all countries has the same energy costings (you can make this like input on first start of your prog. "1kw = xx euros" xx = editable ) P.S.S. I like the idea of the prog, it would be cool if you could make it more accurate good luck Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
ludocus Posted June 10, 2008 Author Posted June 10, 2008 im sory... I forgot to do seconds in stead of millie seconds, Edited main post. It works all good now
ludocus Posted June 10, 2008 Author Posted June 10, 2008 there was still something wrong.. Edited it again. Now works great! I'm sorry...
HeffeD Posted June 10, 2008 Posted June 10, 2008 if you could find a way to read PC's power voltage you'll get more accurate readings, not all PCs waste same amount of energy.Yep. Pretty useless to try and put a price on energy usage based only on time running... In other words, you need to take into account the wattage of the power supply, amount of peripherals being used, type of software being run, etc... Running a CPU under full load conditions is going to draw a lot more current than a CPU basically idling. If you are playing a 3D video game, your CPU and your graphics card are going to be working much harder than if you are running a word processing application. (higher current draw, more wattage burned, therefore higher cost) A simple 'timer' for both situations just doesn't cut it...It's a bit like calculating gas consumption based purely on mileage, but not taking into account the vehicle doing the driving. It should be obvious that per mile, a small hybrid vehicle driving on a flat road is going to burn far less fuel than a large pickup pulling a fifth-wheel trailer (large recreational trailer) up a hill. Per mile, you're looking at a huge different in actual energy used! Looking at mileage without taking into consideration the actual engine size, load size, and even operating conditions gives you zero indication of the actual cost of the energy used...
James Posted June 10, 2008 Posted June 10, 2008 Most Vista PC's have the ability to change the mode in which it runs as well. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ludocus Posted June 11, 2008 Author Posted June 11, 2008 true... but my thingie is just about what your computer spends on energy..if you have your computer on stand by or something it's less.. of course..but this is between lowest and max (kwh)..and of course the price per kwh changes for every house...but as I said this is about what people pay for a kwh.. ( 0,22 / kWh)I am dutch and I got my knowledge about this subject here: http://www.milieucentraal.nl/pagina?onderwerp=Computers570 hours (active use) is 114 kwh wich costs: 25,-2184 hours (stand-by) is 175 kwh wich costs: 38,-6006 hours (sleeping) is 48 kwh wich costs: 11,-of course I could use the cpu usage to try to get the price..but I just did it this way.. the about cost of energy for your computer..but thanks for replieing
C2C Posted July 1, 2008 Posted July 1, 2008 I think the main variable in the computers consumption of electrical current is the monitor (and the muscle graphic cards) depending on size and simple background color depends how much your monitor (which I think is the main energy leech) will use electricity. About the background color: Apparently on a CRT monitor ALL white screen means large energy consumption. Because of the way they function black is just not "drawing anything" but on LCD TFT monitors black color just means that every transitor is powered/lit but so are the "dimmers/blockers" => more energy. As for the power supply i dont think that IT on its own has a lot to do with consumption for instance i have 450W UPS and it was working just fine while i had my old graphics card and monitor but i still had a 750W power supply, but now when the power goes out it works for like 1s and then wham => graphics card + larger monitor make it go So to sum it all up Ludocus program does the average but if you would like to pinpoint it down (a bit) i think the graphics card and monitor should be taken in to consideration. Ill try to find some comparative chart or something on how much energy those cost so maybe we can make something of it. Good job keep it up bro ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
FireFox Posted November 17, 2008 Posted November 17, 2008 (edited) Hello Ludocus, I've found fine your script so I make little script with your script for have cash cost in real time an exemple here : #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Opt('TrayOnEventMode', 1) Opt('TrayMenuMode', 1) Opt('GuiOnEventMode', 1) TrayCreateItem("Quit") TrayItemSetOnEvent(-1,"_Exit") $TIMER = TimerInit() $SEC=('0.043859649122807017543859649122807'/3600) $win=GUICreate("Ca$h Timer <d3montools>",260,80,-1,-1,$WS_CAPTION,BitOr($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW)) $TIME=GUICtrlCreateLabel("TIMER : STARTING...",5,5,250,30) GUICtrlSetFont(-1,20) $CASH=GUICtrlCreateLabel("CASH : STARTING...",12,45,250,30) GUICtrlSetFont(-1,20) GUISetState() While 1 sleep(250) GUICtrlSetData($TIME,"TIMER : "&Round((TimerDiff($timer)/1000))) If Round((TimerDiff($timer)/1000))<10 Then GUICtrlSetData($CASH,"CASH : < 0.00012 ") Else $CASHSL=StringLeft(Round((TimerDiff($timer)/1000))*$SEC,7) GUICtrlSetData($CASH,"CASH : "&$CASHSL&" ") EndIf WEnd Func _Exit() Exit EndFunc And final version with count cash off all process and clock with hour,min,sec expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Opt('TrayOnEventMode', 1) Opt('TrayMenuMode', 1) Opt('GuiOnEventMode', 1) TrayCreateItem("Ca$h") TrayItemSetOnEvent(-1, "_SHOW") TrayCreateItem("") TrayCreateItem("Quit") TrayItemSetOnEvent(-1, "_Exit") TraySetToolTip("Ca$h...") $TIMER = TimerInit() $SEC = ('0.043859649122807017543859649122807' / 3600) $win = GUICreate("Ca$h Timer <d3montools>", 260, 80, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW)) GUISetOnEvent($GUI_EVENT_CLOSE, "_HIDE") $TIME = GUICtrlCreateLabel("TIMER : STARTING...", 5, 5, 250, 30) GUICtrlSetFont(-1, 20) $CASH = GUICtrlCreateLabel("CASH : STARTING...", 12, 45, 250, 30) GUICtrlSetFont(-1, 20) GUISetState() While 1 Sleep(250) If Round((TimerDiff($TIMER) / 1000)) < 60 Then GUICtrlSetData($TIME, "TIMER : " & Round((TimerDiff($TIMER) / 1000)) & " SEC") ElseIf Round((TimerDiff($TIMER) / 1000)) > 60 _ And Round((TimerDiff($TIMER) / 1000)) < 3600 Then $MIN = Round((TimerDiff($TIMER) / 1000)) / 60 $MINT = StringLeft($MIN, 5) GUICtrlSetData($TIME, "TIMER : " & $MINT & " MIN") ElseIf Round((TimerDiff($TIMER) / 1000)) > 3600 Then $HOUR = Round((TimerDiff($TIMER) / 1000)) / 3600 $HOURT = StringLeft($HOUR, 5) GUICtrlSetData($TIME, "TIMER : " & $HOURT & " HOUR") EndIf $PC = ProcessList() $CASHT = StringLeft(Round((TimerDiff($TIMER) / 1000)) * $PC[0][0] * $SEC, 7) GUICtrlSetData($CASH, "CASH : " & $CASHT & " ") TraySetToolTip(GUICtrlRead($TIME) & @CRLF & GUICtrlRead($CASH)) WEnd Func _Exit() Exit EndFunc ;==>_Exit Func _HIDE() GUISetState(@SW_HIDE, $win) EndFunc ;==>_HIDE Func _SHOW() GUISetState(@SW_SHOW, $win) EndFunc ;==>_SHOW Have fun ^^ Edited November 17, 2008 by FireFox
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now