DTC (Download Time Calculator) — File Browser

DTCDownloadTimeCalculatorv1.0 / DTCDownloadTimeCalculatorv1.0 / dtc.ini

dtc.ini — 1.96 KB — Download this file

[script]
n0=;DTC by Shoomy. OBEY
n1=on *:load:{ 
n2=  echo -ta DTC By Shoomy
n3=  echo -ta use /Dtc to activate
n4=  echo -ta And /Dtchelp if you are not too smart
n5=}
n6=alias dtchelp {
n7=  echo -ta DTC Help file
n8=  echo -ta Ok genious, this is not too complicated
n9=  echo -ta Simply write /DTC and then put your filesize in the first box, choose KB\MB\GB from the second box and in the third box put your download speed(kilobytes per second)
n10=  echo -ta Then the result should appear in the forth box, if not, click the CALC! button
n11=  echo -ta For Example: If you put 1 in the first box, choose MB from the second and put 1 in the third box
n12=  echo -ta DTC will calculate how long it will take to download 1MB at 1Kbp\s
n13=  Echo -ta Read the readme DAMN YOU
n14=}
n15=alias DTC {
n16=Dialog -md dtc dtc }
n17=Dialog dtc {  
n18=  Size -1 -1 80 100
n19=  Title "DTC"
n20=  option dbu
n21=  box "Download Time Calculator",1, 1 1 78 98
n22=  button "?",2, 30 41 20 9
n23=  edit "",3, 3 10 74 10
n24=  combo 4, 4 20 25 60,drop
n25=  edit "",6, 3 30 74 10
n26=  edit "",9, 3 50 74 10,read
n27=  button "Calc!",10, 10 70 60 25
n28=}
n29=on *:dialog:dtc:init:0:{
n30=  did -a dtc 4 KB
n31=  did -a dtc 4 MB 
n32=  did -a dtc 4 GB 
n33=}
n34=on *:dialog:dtc:*click:2:{
n35=dtchelp }
n36=on *:dialog:dtc:edit:6:{
n37=  did -r dtc 9
n38=  ddls $didtok(dtc,3,C) $+ $did(dtc,4) $didtok(dtc,6,C)
n39=did -a dtc 9 %result }
n40=on *:dialog:dtc:*click:10:{
n41=  did -r dtc 9
n42=  ddls $didtok(dtc,3,C) $+ $did(dtc,4) $didtok(dtc,6,C)
n43=  did -a dtc 9 %result
n44=}
n45=alias ddls { if ($remove($1-2,$chr(32),k,m,g,b) !isnum) { set %result Error invalid input }
n46=  var %a = $right($1,2),%b = $left($1,-2)
n47=  if (%a == kb) { var %b = $calc(%b * 1024) }
n48=  elseif (%a = mb) { var %b = $calc(%b * 1024 ^ 2) }
n49=  elseif (%a = gb) { var %b = $calc(%b * 1024 ^ 3) }
n50=set %result $duration($calc(%b / ($2 * 1024))) }