mIRC Homepage
Posted By: MTech mdx progress bar - 10/08/03 05:36 PM
im trying to make a progress bar for the time and was wondering how i would start this project... i have the progress bar setup and ready but i cant figure out how to do anything else

[edit]
im also thinking about having it so people can select what time measure they want the progress bar to be for....like xxseconds or xxminutes xxhours xxdays
Posted By: Knappen Re: mdx progress bar - 10/08/03 05:47 PM
What do you meen; 'for the time'? I use progressbars to from mdx... If u spessify, I might be able to help u smile
Posted By: MTech Re: mdx progress bar - 10/08/03 05:53 PM
ok disregard everything i said, im am using it to measure one day, say its 12 noon
the progress bar would be here

{||||||||||||------------}
Posted By: Knappen Re: mdx progress bar - 10/08/03 06:20 PM
ok, I see....

I`m sure u have the aliases for the mdx.dll... and the init event...

so what u have to do is make an alias and execute it with a timer... Say every minute...

Code:
.timermdxupdate 0 60 mdxtime

alias mdxtime {
did -a dname did <current time> 1 <max time>
}
  


this should make the progress bar move as you wanted. smile
If not, play around with it, and/or msg me...
Posted By: MTech Re: mdx progress bar - 10/08/03 06:35 PM
ok i got this far
how can i get the current seconds into the day that it is right now?


.timersitime 0 60 sitime

alias sitime { did -a si 18 xxx 1 3600 }

Posted By: Knappen Re: mdx progress bar - 10/08/03 06:42 PM
Im not really good with time identifiers.. But i`ll guess u have to use $ctime or something to do that...
Posted By: MTech Re: mdx progress bar - 10/08/03 06:56 PM
im not sure if this is right, the number is still very huge

$ctime($asctime(mmmm d yyyy 00:00:00))

it seems like $ctime is right if i can get it to return the seconds since the begin of that day
Posted By: pheonix Re: mdx progress bar - 10/08/03 07:01 PM
UNTESTED
alias test {
did -a name id $iif($left($time,2) isnum,$left($time,2) 0 23,$left($time,1) 0 23)
.timer -o 0 $calc(60 * 60) did -a name id $iif($left($time,2) isnum,$left($time,2) 0 23,$left($time,1) 0 23)
}
never used a progress bar but seen other peoples, try that.
Posted By: MTech Re: mdx progress bar - 10/08/03 07:26 PM
nothing happened but i think //did -a si 18 $left($time,2) works,,, ill check back with ya in a few hours to see
Posted By: pheonix Re: mdx progress bar - 10/08/03 07:34 PM
how do you move an mdx progress bar?
did -a name id <Place To Move> <Total Length>??
Posted By: MTech Re: mdx progress bar - 10/08/03 07:38 PM
did -a name id <Place To Move> 0 <Total Length> i belive
Posted By: pheonix Re: mdx progress bar - 10/08/03 07:43 PM
edited^
Posted By: MTech Re: mdx progress bar - 10/08/03 07:44 PM
i belive my litle piece of code works fine
Posted By: pheonix Re: mdx progress bar - 10/08/03 07:48 PM
thats the problem,if it does work: it may work now, when its: 20:48, but what about when its, 2:32 it will try to move to 2: in that progress bar.
Posted By: MTech Re: mdx progress bar - 10/08/03 07:59 PM
whats wrong with that?
Posted By: pheonix Re: mdx progress bar - 10/08/03 08:03 PM
because 2: is not a number in your progress bar, however 20 is.
Posted By: MTech Re: mdx progress bar - 10/08/03 08:34 PM
so make it use 02
Posted By: pheonix Re: mdx progress bar - 10/08/03 08:37 PM
go ahead.....
Posted By: MTech Re: mdx progress bar - 10/08/03 08:40 PM
nah...ill bbl
Posted By: lammkott Re: mdx progress bar - 10/08/03 10:09 PM
The way I'd go about it is by setting the current time in a variable, %ctime, set the range of the progress bar from 1 - 86,400 (1 day in seconds), then just /did the %ctime variable to the progress bar. That way if the time was at 43,200 (12:00pm), the progress bar will be at 50%.
Posted By: MTech Re: mdx progress bar - 10/08/03 10:15 PM
how do i get the time in seconds?
Posted By: lammkott Re: mdx progress bar - 10/08/03 10:18 PM
Sorry, I've made a couple of miscalculations... It's too early in the morning. I realized it after I tried making an example code and ended up with 1,000,000 seconds... confused

Firstly, calculate the hour with: $calc($time(H) * 60 * 60)
Then calculate the minutes with: $calc($time(nn) * 60)
Then finally add it all together: $calc(%hrs + %mins + $time(ss))

This should return the right time now.
Posted By: MTech Re: mdx progress bar - 10/08/03 10:27 PM
my progress bar is full...its 6:25pm...

text "1 0 86400", 18, 388 64 85 20

alias sitime {
if (%si.time == 1) {
if ($dialog(si)) {
set %si.time.now $calc(($time(Hnn) * 60) * 60)
//did -ra si 18 %si.time.now
}
}
else { .timersitime off }
}
Posted By: lammkott Re: mdx progress bar - 10/08/03 10:30 PM
Yeah, I thought that would happen, my mistake.
Posted By: MTech Re: mdx progress bar - 10/08/03 10:39 PM
what about if i use minutes?
Posted By: lammkott Re: mdx progress bar - 10/08/03 10:41 PM
Seconds would be more accurate, but, it's your choice.
Posted By: MTech Re: mdx progress bar - 10/08/03 10:43 PM
ok i think if i went by hours it would be easyer...so i set my dialog for 1 - 24 how can i get the hour that it is now?
Posted By: lammkott Re: mdx progress bar - 10/08/03 10:49 PM
$calc(($time(H) * 60 ) + $time(n))
Posted By: lammkott Re: mdx progress bar - 10/08/03 10:52 PM
Yeah, hours would be a lot easier because you'd only have to return $time(H), although, how would you display the time when it's 13:52? Even though it is almost 2pm, it would still display it as 1pm because that's what the hours read.
Posted By: MTech Re: mdx progress bar - 10/08/03 10:56 PM
thanks smile
© mIRC Discussion Forums