diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2013-11-21 08:33:58 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2013-11-21 08:33:58 +0100 |
commit | 506ca9e9d9d79c1464baf185389a1750e37e9a0a (patch) | |
tree | 57aafae99ab4768783b8d19e849a9003c402447e /tricks/marquee.lua | |
parent | 25d2c96938071f45def98fbdc30cf20a57a71784 (diff) |
old stuff backup
Diffstat (limited to 'tricks/marquee.lua')
-rw-r--r-- | tricks/marquee.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tricks/marquee.lua b/tricks/marquee.lua new file mode 100644 index 0000000..546f374 --- /dev/null +++ b/tricks/marquee.lua @@ -0,0 +1,35 @@ +-- marquee +function Marquee(mString, mDelay) + local length = string.len(mString) + + for i = 1,length+12 do + + local mRight = "" + local mIddle = " " + local mLeft = "" + + -- right + for j = i-5,i do + if j <= 0 then mRight = mRight .. " " end + if j > 0 and j <= length then mRight = mRight .. string.sub(mString, j, j) end + if j > length then mRight = mRight .. " " end + end + -- middle + j = i - 6 + if j > 0 and j <= length then mIddle = string.sub(mString, j , j) end + -- left + for j = i-12,i-7 do + if j <= 0 then mLeft = mLeft .. " " end + if j > 0 and j <= length then mLeft = mLeft .. string.sub(mString, j, j) end + if j > length then mLeft = mLeft .. " " end + end + + + SetRightDigits(mRight) + SetGearDigit(mIddle) + SetLeftDigits(mLeft) + + SLISendReport(1) + SLISleep(mDelay) + end +end |