home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carsten's PPE Collection
/
Carstens_PPE_Collection_2007.zip
/
T
/
TWRL_100.ZIP
/
TWIRL.PPS
< prev
Wrap
Text File
|
1995-05-29
|
4KB
|
136 lines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TwirlyPrompt PPE v1.0 by Criminal [PiL]
; Last updated 5-28-95
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Procedure Declarations
declare procedure Initialize()
declare procedure TwirlyInput()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Global Variable Declarations
string twirly_input, twirl, prompt, color, failsafe, cmd_line
int x, y, cycle, min_length, max_length, color_cycle, start_height, page_len
int input_length, twirl_type, a, b
boolean done, hot_key
byte ascii, user_cmd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Main program body
Initialize()
TwirlyInput()
kbdstuff upper(twirly_input)
END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialize program variables
procedure Initialize()
getuser
hot_key = FALSE
cmd_line = tokenstr()
tokenize cmd_line
print ""
if (!getx()=1) newline
prompt = ppepath() + gettoken()
input_length = s2i(gettoken(),10)
twirl_type = s2i(gettoken(),10)
if (input_length = -1) hot_key = TRUE
if (input_length > 255) input_length = 255
if (input_length < 1) input_length = 1
dispfile prompt, defs+lang
print ""
twirly_input=""
if ((twirl_type>4) | (twirl_type<1)) then
time time
for a = 1 to random((u_timeon() + sec(time) + hour(time)) * 3.14)+3
b = random((u_timeon() + sec(time) + hour(time)) * 6.66)+1
next a ; gen random number seed
twirl_type = random(2)+1
endif
select case (twirl_type)
case 1
twirl = "│/─\"
case 2
twirl = "░▒▓█▓▒"
case 3
twirl = "▌▀▐▄"
case 4
twirl = ""
endselect
cycle = 0
color_cycle = 1
color = "@X08" ; edit this to change color of spinner
done = FALSE
page_len = u_pagelen()
x = getx()
y = gety()
start_height = y
min_length = x
max_length = 80
endproc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Get input, twirl cursor for fun
procedure TwirlyInput()
while (!done) do
cycle = cycle + 1
if (cycle>len(twirl)) cycle=1
ansipos x,y
print color + mid(twirl,cycle,1)
ansipos x,y
ascii=asc(inkey())
if (ascii = 27) then
ansipos x,y
print " "
endif
if (ascii = 13) done = TRUE
if (ascii = 8) then
if (len(twirly_input)>=1) then
ansipos x,y
print " "
twirly_input = left(twirly_input,len(twirly_input)-1)
x=x-1
if (x=0) then
x=79
y=y-1
if (y<1) y=1
endif
select case (twirly_input)
case 79-x
y = start_height
case (79*2)-x
y = start_height + 1
case (79*3)-x
y = start_height + 2
end select
endif
else
if ((!ascii=0) & (len(twirly_input)<input_length)) then
twirly_input=twirly_input+chr(ascii)
ansipos x,y
defcolor ; change this to 'print "@Xnn"' if you want diff. color input
print chr(ascii)
x=x+1
if (x=80) then
y=y+1
x=1
if (y>page_len) then
failsafe=scrtext(1,1,80,TRUE)
newline
if (!scrtext(1,1,80,TRUE)=failsafe) start_height = start_height - 1
endif
endif
endif
endif
if ((len(twirly_input)>0) & (hot_key)) done = TRUE
endwhile
ansipos x-1,y
print " "
ansipos x-1,y
print ""
endproc