Jump to content

Recommended Posts

Posted

Hello,

As the tittle says i need some math help to calculate percentage.

This is my script

#include <GUIConstantsEx.au3>
$s = 58985480
$ts = Round($s / 1000)
$ds = 57603
$i = 0
Do
    $sec = @SEC
    $bs = 1500
    While @SEC = $sec
    WEnd
    $cs = $ds
 $ts = Round($ts - (($cs - $bs) /100))
 $ps = Round($ts / $s * 100000)
    ConsoleWrite($ts & @CRLF & $ps &"%" & @CRLF)
Until $i = 100

$ps is the percentage. What the script does is: It has a specific number and every sec that number gets lowered.

I have managed getting it percentage and count it but my problem is that is the wrong way.

It has to rise from 0% to 100%. Now it is the oposite. It is 100% and as the number gets lowered it gets too.

Any kind of help appretiated

I feel nothing.It feels great.

Posted

Hell yes!

You know dude? When mind gets stuck, that means i need a beer :D

The problem with sleep add is that is would change the diff from 1 sec to 1,1 and that would change my entire script after some seconds or minutes

I feel nothing.It feels great.

Posted (edited)

I assume there's a timer or something somewhere then? Because in what you posted above you only use seconds so a few (or hundreds) of milliseconds wouldn't make any difference.

Edited by AdmiralAlkex
Posted (edited)

Yes there is. And it could run for minutes or even hours. Anyway i added 10ms sleep.

Saw the script running better after a while :D

Edited by ileandros

I feel nothing.It feels great.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...