Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias pwg {
- if !$window(@pwg) {
- window -Cdfp +nt @PWG -1 -1 640 480
- window -hdfp +L @PWGBUF -1 -1 640 480
- hmake pwg 100
- hadd pwg xpos 0
- hadd pwg ypos 0
- hadd pwg acell 0
- hadd pwg acelu 0
- hadd pwg acelr 0
- hadd pwg aceld 0
- pwguf
- }
- else window -a @PWG
- }
- alias -l pwguf {
- if $window(@PWG) {
- drawrect -fnr @PWG $rgb(20,0,40) 1 0 0 640 480]
- drawrect -fnr @PWGBUF 0 1 0 0 640 480
- var %i 1, %a, %p, %d, %b
- while %i <= 4 {
- var %p $iif(%i & 1,xpos,ypos), %a $gettok(acell acelu acelr aceld,%i,32), %d $gettok(37 38 39 40,%i,32)
- var %h $istok($hget(pwg,keyval),%d,32), %b $gettok(-48 -48 640 480,%i,32), %n $gettok(640 480 -48 -48,%i,32)
- if !%h && $hget(pwg,%a) > 0 { hdec pwg %a }
- if %h || $hget(pwg,%a) > 0 {
- if %h && $hget(pwg,%a) < 32 { hinc pwg %a }
- if $hget(pwg,%p) $iif(%i < 3,<,>) %b { hadd pwg %p %n }
- $iif(%i < 3,hdec,hinc) pwg %p $hget(pwg,%a)
- }
- inc %i
- }
- drawrect -enr @PWGBUF $rgb(140,90,170) 16 $hget(pwg,xpos) $hget(pwg,ypos) 48 48
- drawtext -nr @PWGBUF 16777215 fixedsys -11 20 20 >> $hget(pwg,acell) : $hget(pwg,acelu) : $hget(pwg,acelr) : $hget(pwg,aceld)
- drawcopy -nt @PWGBUF 0 0 0 640 480 @PWG 0 0
- drawdot @PWG
- drawdot @PWGBUF
- .timerpwguf -m 1 40 pwguf
- }
- else hfree -w pwg
- }
- on *:KEYDOWN:@PWG:37,38,39,40:hadd pwg keyval $addtok($hget(pwg,keyval),$keyval,32)
- on *:KEYUP:@PWG:37,38,39,40:hadd pwg keyval $remtok($hget(pwg,keyval),$keyval,32)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement