html5 - VBScript alternative/conversion? -
i have piece of code long time ago , trying integrate html5. it's written in vbscript, no longer supported, , want change understood modern browsers. part of hta file, in works fine in html5 except script. appreciated.
the code:
</style> <font color="#ff0000" size="+3"><marquee>marquee text here</marquee></font> <script language="vbscript"> public n, itimerid, mytitle, colnum, carset redim m(1,1) redim speccar(64) speccar(0)="‰" speccar(1)="ƒ" : speccar(11)="ω" : speccar(21)="λ" : speccar(31)="φ" speccar(2)="γ" : speccar(12)="α" : speccar(22)="μ" : speccar(32)="ψ" speccar(3)="δ" : speccar(13)="β" : speccar(23)="ν" : speccar(33)="ω" speccar(4)="θ" : speccar(14)="δ" : speccar(24)="ξ" : speccar(34)="™" speccar(5)="λ" : speccar(15)="ε" : speccar(25)="π" : speccar(35)="←" speccar(6)="ξ" : speccar(16)="ζ" : speccar(26)="ρ" : speccar(36)="↑" speccar(7)="π" : speccar(17)="η" : speccar(27)="ς" : speccar(37)="→" speccar(8)="σ" : speccar(19)="ι" : speccar(29)="τ" : speccar(39)="↔" speccar(10)="ψ" : speccar(20)="κ" : speccar(30)="υ": speccar(40)="√" speccar(41)="∞" : speccar(46)="∴" : speccar(51)="≥" : speccar(56)="♣" speccar(42)="∠" : speccar(47)="≈" : speccar(52)="⊕" : speccar(57)="♥" speccar(43)="∩" : speccar(48)="≠" : speccar(53)="⊥" : speccar(58)="♦" speccar(44)="∪" : speccar(49)="≡" : speccar(54)="◊" : speccar(59)="œ" speccar(45)="∫" : speccar(50)="≤" : speccar(55)="♠" : speccar(60)="†" speccar(61)="†": speccar(62)="€" : speccar(63)="œ" : speccar(64)="š" sub window_onload() n = 48 colnum = 100 carset = 1 redim m(colnum,1) ' set random number first character ' written on screen each column ' (div). useful avoid ' column start @ same place i=1 colnum randomize '---this formula doesn't accept variables m(i,0) = int(n*rnd) '--- m(i,0) contains number of character written t = "" '--- fill column white space j=1 n t = t & " <br>" next m(i,1) = t '--- m(i,1) contains html of column next itimerid = window.setinterval("progress", 300) end sub sub progress i=1 colnum l = split(m(i,1), "<br>") '--- split each character in column cpos = m(i,0) '--- position of character written on screen @ time '--- write random ascii or character array randomize if int(carset) = 1 l(cpos) = "<span style=""color:greenyellow"">" & chr( 32 + int(223*rnd) ) & "</span>" carset = carset +0.25 elseif int(carset) = 2 l(cpos) = "<span style=""color:greenyellow"">" & speccar( int(64*rnd) ) & "</span>" carset = 1 end if '--- scale down dark previous characters y = -1 j = cpos-1 cpos-11 step -1 tempj = j if j < 0 '--- when start top, darken characters @ bottom j = ubound(l) +j +1 end if y = y + 1 select case y case 0 color="lawngreen" case 1 color="lawngreen" case 2 color="limegreen" case 3 color="limegreen" case 4 color="forestgreen" case 5 color="forestgreen" case 6 color="green" case 7 color="green" case 8 color="darkgreen" case 9 color="darkgreen" case 10 color="" end select clj = l(j) if instr(1, clj, "<span", 1) > 0 '--- isolate character span tag clj = left(clj, instrrev(clj, "<") - 1) clj = mid(clj, instr(clj, ">") + 1) end if if color <> "" '--- set span color style if necessary l(j) = "<span style=""color:" & color & """>" & clj & "</span>" else l(j) = clj end if j = tempj next t = join(l, "<br>") m(i,1) = t '--- m(i,1) contains html of column cpos = cpos +1 if cpos > ubound(l) cpos = 0 end if m(i,0) = cpos '--- m(i,0) contains number of character written id("col" & i).innerhtml = t '--- show result column on screen next end sub sub exitmatrix window.clearinterval(itimerid) '---you must clear intervals before leaving window.close end sub function id(o) set id = document.getelementbyid(o) end function </script>
Comments
Post a Comment