lightbar_code
% This code is (c)1997 Nathan Hyatt. Feel free to use this code in your
% work. If you release a module using this code or a modified version
% of this code, you MUST include the full source and give credit where credit
% is due. I suggest we all release our source code so we can help each other
% and promote the use of Iniquity BBS Software.
% -sect[tric.inc.dms]
% This is my own lightbar procedures. NateDogg of Demonic wrote some good
% lightbar procedures, but this code is smaller and faster.
{
@str<1> ch % character to read keystrokes
@int y % y position variable
@bool done % boolean to check if esc was pressed
proc matrix { % writes unselected menu items
setfore[5]
gotoxy[31,15] sout["|07 ascii "]
gotoxy[31,16] sout["|07 modding "]
gotoxy[31,17] sout["|07 coder "]
}
proc hlmatrix { % writes highlighted menu items
if y=15 then {
gotoxy[31,15] sout["|15 ascii "]
}
if y=16 then {
gotoxy[31,16] sout["|15 modding "]
}
if y=17 then {
gotoxy[31,17] sout["|15 coder "]
}
}
clrscr
done=false % assign done to false before repeating
y=15 % give y an initial variable of 15 (y pos. of first choice)
repeat {
matrix
hlmatrix
ch=strup[inkey] % get input
if (ch=#72) then { % up arrow
if y>15 then y=y-1 else y=17 % move y accordingly
} else
if (ch=#80) then { % down arrow
if y<17 then y=y+1 else y=15 % move y accordingly
} else
if (ch=#13) then { % enter key
if wherey=15 then out["ascii"] % replace these with your own procs
if wherey=16 then out["modding"]
if wherey=17 then out["coder"]
} else
if (ch=#27) then done=true % when user hits esc, done will become true
} until done % stop repeating when done=true
clrscr
}
lightbar_code.txt · Last modified: by admin
