Metropoli BBS
VIEWER: pwa-cmr1.pps MODE: TEXT (ASCII)
string len_of_lightbar, lightbar_color, prompt(13), getkeys, key
string tokenone, tokentwo, tokenthree, tokenfour, tokenfive, tokensix
integer ascii, counter, temp, start_x, start_y, cur_x, cur_y, i
boolean quit

if (!(tokcount()<>0)) goto No_Tokens_Found
        getkeys=tokenstr()
          tokenize Getkeys
            gettoken tokenone
            gettoken tokentwo
            gettoken tokenthree
            gettoken tokenfour
            gettoken tokenfive
            gettoken tokensix
        newline
        cls
        kbdstuff "R "+tokenone+" "+tokentwo+" "+tokenthree+" "+tokenfour+" "+tokenfive+" "+tokensix
        end

:No_Tokens_Found
        counter = 1
        print "@CLS@@POFF@"

fopen 1, ppepath() + "pwa-cmr1.cfg", O_RD, S_DN
     fget 1, len_of_lightbar
     fget 1, start_x
     fget 1, start_y
     fget 1, lightbar_color
     fget 1, prompt(1)
     fget 1, prompt(2)
     fget 1, prompt(3)
     fget 1, prompt(4)
     fget 1, prompt(5)
     fget 1, prompt(6)
     fget 1, prompt(7)
     fget 1, prompt(8)
     fget 1, prompt(9)
     fget 1, prompt(10)
     fget 1, prompt(11)
     fget 1, prompt(12)
     fget 1, prompt(13)
fclose 1

If (exist(ppepath()+"pwa-cmr1.top")) dispfile ppepath()+"pwa-cmr1.top",defs

for i = 1 to 13
        ansipos start_x , start_y + (i-1)
        println (prompt(i)) + space(len_of_lightbar - len(stripatx(prompt(i))))
next

quit = FALSE
ansipos start_x , start_y
print lightbar_color + stripatx(prompt(1)) + space(len_of_lightbar - len(stripatx(prompt(1))))+"@X0F"
cur_x = start_x
cur_y = start_y

    while (quit == FALSE) do
        key = inkey()
        ascii = asc(key)
        if (key = chr(13)) then
            quit = TRUE
            defcolor
            gosub PrintQuit
        elseif (key = "UP" | key = "8") then
            if (!cur_y = start_y) then
                dec cur_y
                if (!cur_y = start_y) ansipos cur_x, cur_y -1
                if (!cur_y = start_y) println prompt(counter-2) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter-2))))
                ansipos cur_x, cur_y
                println lightbar_color + stripatx(prompt(counter-1)) + space(len_of_lightbar - len(stripatx(prompt(counter-1))))+"@X0F"
                ansipos cur_x, cur_y + 1
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos cur_x +len_of_lightbar, cur_y
                dec counter
            else
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                counter = 13
                cur_y = start_y + 12
                ansipos cur_x, cur_y
                print lightbar_color + stripatx(prompt(counter)) + space(len_of_lightbar - len(stripatx(prompt(counter))))+"@X0F"
            endif
        elseif (key = "DOWN" | key = "2" | key = " ") then             'Pressed Down
            if (!cur_y = start_y + 12) then
                inc cur_y
                ansipos cur_x, cur_y - 1
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos cur_x, cur_y
                println lightbar_color + stripatx(prompt(counter+1)) + space(len_of_lightbar - len(stripatx(prompt(counter+1)))) + "@X0F"
                if (!cur_y = start_y + 12) ansipos cur_x, cur_y + 1
                if (!cur_y = start_y + 12) println prompt(counter + 2) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter+ 2))))
                ansipos cur_x +len_of_lightbar, cur_y
                inc counter
            else
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                counter = 1
                cur_y = start_y
                ansipos cur_x, cur_y
                print lightbar_color + stripatx(prompt(counter)) + space(len_of_lightbar - len(stripatx(prompt(counter))))+"@X0F"
            endif
        elseif (upper(key) = "A") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y
                println lightbar_color + stripatx(prompt(1)) + space(len_of_lightbar - len(stripatx(prompt(1)))) + "@X0F"
                newlines 13
                kbdstuff "R;A"+chr(13)
                end
        elseif (upper(key) = "B") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 1
                println lightbar_color + stripatx(prompt(2)) + space(len_of_lightbar - len(stripatx(prompt(2)))) + "@X0F"
                newlines 12
                kbdstuff "R;ALL"+chr(13)
                end
        elseif (upper(key) = "C") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 2
                println lightbar_color + stripatx(prompt(3)) + space(len_of_lightbar - len(stripatx(prompt(3)))) + "@X0F"
                newlines 11
                kbdstuff "R;F"+chr(13)
                end
        elseif (upper(key) = "D") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 3
                println lightbar_color + stripatx(prompt(4)) + space(len_of_lightbar - len(stripatx(prompt(4)))) + "@X0F"
                newlines 10
                kbdstuff "R;FROM"+chr(13)
                end
        elseif (upper(key) = "E") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 4
                println lightbar_color + stripatx(prompt(5)) + space(len_of_lightbar - len(stripatx(prompt(5)))) + "@X0F"
                newlines 9
                kbdstuff "R;N"+chr(13)
                end
        elseif (upper(key) = "F") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 5
                println lightbar_color + stripatx(prompt(6)) + space(len_of_lightbar - len(stripatx(prompt(6)))) + "@X0F"
                newlines 8
                kbdstuff "R;S"+chr(13)
                end
        elseif (upper(key) = "G") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 6
                println lightbar_color + stripatx(prompt(7)) + space(len_of_lightbar - len(stripatx(prompt(7)))) + "@X0F"
                newlines 7
                kbdstuff "R;TO"+chr(13)
                end
        elseif (upper(key) = "H") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 7
                println lightbar_color + stripatx(prompt(8)) + space(len_of_lightbar - len(stripatx(prompt(8)))) + "@X0F"
                newlines 6
                kbdstuff "R;TS"+chr(13)
                end
        elseif (upper(key) = "I") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 8
                println lightbar_color + stripatx(prompt(9)) + space(len_of_lightbar - len(stripatx(prompt(9)))) + "@X0F"
                newlines 5
                kbdstuff "R;U"+chr(13)
                end
        elseif (upper(key) = "J") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 9
                println lightbar_color + stripatx(prompt(10)) + space(len_of_lightbar - len(stripatx(prompt(10)))) + "@X0F"
                newlines 4
                kbdstuff "R;USER"+chr(13)
                end
        elseif (upper(key) = "K") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 10
                println lightbar_color + stripatx(prompt(11)) + space(len_of_lightbar - len(stripatx(prompt(11)))) + "@X0F"
                newlines 3
                kbdstuff "R;WAIT"+chr(13)
                end
        elseif (upper(key) = "L") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 11
                println lightbar_color + stripatx(prompt(12)) + space(len_of_lightbar - len(stripatx(prompt(12)))) + "@X0F"
                newlines 2
                kbdstuff "R;Y"+chr(13)
                end
        elseif (upper(key) = "M") then
                ansipos cur_x, cur_y
                println prompt(counter) + "@X0F" + space(len_of_lightbar - len(stripatx(prompt(counter))))
                ansipos start_x , start_y + 12
                println lightbar_color + stripatx(prompt(13)) + space(len_of_lightbar - len(stripatx(prompt(13)))) + "@X0F"
                newline
                kbdstuff "R;YA"+chr(13)
                end
        elseif (key = chr(27)) then
                cls
                end
        endif
    endwhile

:PrintQuit
        if (counter = 1) then
            cls
            kbdstuff "R;A"+chr(13)
        elseif (counter = 2) then
            cls
            kbdstuff "R;ALL"+chr(13)
        elseif (counter = 3) then
            cls
            kbdstuff "R;F"+chr(13)
        elseif (counter = 4) then
            cls
            kbdstuff "R;FROM"+chr(13)
        elseif (counter = 5) then
            cls
            kbdstuff "R;N"+chr(13)
        elseif (counter = 6) then
            cls
            kbdstuff "R;S"+chr(13)
        elseif (counter = 7) then
            cls
            kbdstuff "R;TO"+chr(13)
        elseif (counter = 8) then
            cls
            kbdstuff "R;TS"+chr(13)
        elseif (counter = 9) then
            cls
            kbdstuff "R;U"+chr(13)
        elseif (counter = 10) then
            cls
            kbdstuff "R;USER"+chr(13)
        elseif (counter = 11) then
            cls
            kbdstuff "R;WAIT"+chr(13)
        elseif (counter = 12) then
            cls
            kbdstuff "R;Y"+chr(13)
        elseif (counter = 13) then
            cls
            kbdstuff "R;YA"+chr(13)
        else
            cls
            end
        endif
        end
        
[ RETURN TO DIRECTORY ]