Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias project1 {
- if (!$window(@random)) { window -pdoC @random 0 0 1000 1000 }
- .timerdrawrandom -h 0 30 /drawrandom $1
- unset %time
- inc -c %time
- set %frames 0
- }
- alias drawrandom {
- drawrect -rnf @random $rgb(0,0,0) 1 0 0 1000 1000
- var %random 1
- while (%random < $1) {
- drawdot -rn @random $r(0,16777215) $r(10,30) $r(20,980) $r(20,980)
- inc %random
- }
- inc %frames
- fps
- drawdot @random
- }
- on *:CLOSE:@random: {
- .timerdraw* off
- unset %frames
- unset %time
- }
- alias project2 {
- if (!$window(@random)) { window -pdoC @random 0 0 500 500 }
- if (!$window(@randombuf)) { window -ph @randombuf 0 0 600 600 }
- drawpic @randombuf 5 5 soldiers.png
- .timerdrawrandom -h 0 30 /drawtest
- set %dot.loc.x 200
- set %dot.loc.y 30
- unset %time
- inc -c %time
- set %frames 0
- set %click 1
- set %kills 0
- }
- alias drawtest {
- inc %frames
- drawrect -rnf @random $rgb(0,0,0) 1 0 0 $window(@random).w $window(@random).h
- if ($mouse.win == @random) && ($getside(@random, %dot.loc.x, %dot.loc.y, $mouse.x, $mouse.y)) { drawcopy -t @randombuf $rgb(255,0,255) $calc(10 + (($ifmatch - 1) * 25)) 10 20 20 @random $calc(%dot.loc.x - 10) $calc(%dot.loc.y - 10) }
- else { drawdot -rn @random $rgb(255,255,255) 11 %dot.loc.x %dot.loc.y }
- drawline -rn @random $rgb(255,255,255) 1 0 20 400 100
- drawline -rn @random $rgb(255,255,255) 1 500 120 100 200
- drawline -rn @random $rgb(255,255,255) 1 0 220 400 300
- drawline -rn @random $rgb(255,255,255) 1 500 320 100 400
- ;;; cursor draw ;;;
- if ($mouse.win == @random) {
- drawtext -rn @random $rgb(255,255,255) 10 445 SIDE: $replace($getside(@random, %dot.loc.x, %dot.loc.y, $mouse.x, $mouse.y), 1, NORTH, 2, NORTH-EAST, 3, EAST, 4, SOUTH-EAST, 5, SOUTH, 6, SOUTH-WEST, 7, WEST, 8, NORTH-WEST)
- drawline -rn @random $rgb(0,0,255) 1 %dot.loc.x %dot.loc.y $window(@random).w $calc($window(@random).h / 3) $window(@random).w $calc(($window(@random).h / 3) * 2) %dot.loc.x %dot.loc.y
- drawline -rn @random $rgb(0,0,255) 1 %dot.loc.x %dot.loc.y 0 $calc($window(@random).h / 3) 0 $calc(($window(@random).h / 3) * 2)) %dot.loc.x %dot.loc.y
- drawline -rn @random $rgb(0,0,255) 1 %dot.loc.x %dot.loc.y $calc(($window(@random).w / 3) * 2) 0 $calc($window(@random).w / 3) 0 %dot.loc.x %dot.loc.y
- drawline -rn @random $rgb(0,0,255) 1 %dot.loc.x %dot.loc.y $calc(($window(@random).w / 3) * 2) $window(@random).h $calc($window(@random).w / 3) $window(@random).h %dot.loc.x %dot.loc.y
- }
- ;;; end cursor ;;;
- ;;drawline -rn @random $rgb(255,0,0) 1 $calc(%dot.loc.x - 10) $calc(%dot.loc.y - 5) $calc(%dot.loc.x - 10) $calc(%dot.loc.y + 5) $calc(%dot.loc.x - 5) $calc(%dot.loc.y + 10) $calc(%dot.loc.x + 5) $calc(%dot.loc.y + 10) $calc(%dot.loc.x + 10) $calc(%dot.loc.y + 5) $calc(%dot.loc.x + 10) $calc(%dot.loc.y - 5) $calc(%dot.loc.x + 5) $calc(%dot.loc.y - 10) $calc(%dot.loc.x - 5) $calc(%dot.loc.y - 10) $calc(%dot.loc.x - 10) $calc(%dot.loc.y - 5)
- drawdot @random
- if (%dot.loc.x > $window(@random).w) || (%dot.loc.y > $window(@random).h) {
- set %dot.loc.x 10
- set %dot.loc.y 0
- }
- if ($onpoly(2, 8,500,120,100,200, $calc(%dot.loc.x - 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x - 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x - 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x + 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x + 6), $calc(%dot.loc.y - 12), $calc(%dot.loc.x - 6), $calc(%dot.loc.y - 12))) {
- dec %dot.loc.x 5
- inc %dot.loc.y 1
- }
- elseif ($onpoly(2, 8,0,20,400,100, $calc(%dot.loc.x - 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x - 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x - 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x + 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x + 6), $calc(%dot.loc.y - 12), $calc(%dot.loc.x - 6), $calc(%dot.loc.y - 12))) {
- inc %dot.loc.x 5
- inc %dot.loc.y 1
- }
- elseif ($onpoly(2, 8,0,220,400,300, $calc(%dot.loc.x - 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x - 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x - 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x + 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x + 6), $calc(%dot.loc.y - 12), $calc(%dot.loc.x - 6), $calc(%dot.loc.y - 12))) {
- inc %dot.loc.x 5
- inc %dot.loc.y 1
- }
- elseif ($onpoly(2, 8,500,320,100,400, $calc(%dot.loc.x - 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x - 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x - 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 6), $calc(%dot.loc.y + 12), $calc(%dot.loc.x + 12), $calc(%dot.loc.y + 6), $calc(%dot.loc.x + 12), $calc(%dot.loc.y - 6), $calc(%dot.loc.x + 6), $calc(%dot.loc.y - 12), $calc(%dot.loc.x - 6), $calc(%dot.loc.y - 12))) {
- dec %dot.loc.x 5
- inc %dot.loc.y 1
- }
- else {
- inc %dot.loc.y 5
- }
- fps
- }
- alias project3 {
- if (!$window(@random)) { window -pdoC @random 0 0 500 500 }
- if (!$window(@randombuf)) { window -ph @randombuf 0 0 600 600 }
- drawpic @randombuf 5 5 soldiers.png
- .timerdrawrandom -h 0 30 /project3.draw
- .timerdrawkeys -h 0 1 /project.keys
- set %loc.x 240
- set %loc.y 240
- unset %time
- inc -c %time
- set %frames 0
- set %side 1
- }
- alias project3.draw {
- inc %frames
- if ($mouse.win == @random) { set %side $iif($getside(@random, %loc.x, %loc.y, $mouse.x, $mouse.y), $ifmatch, %side) }
- drawrect -rnf @random $rgb(39,77,33) 1 0 0 $window(@random).w $window(@random).h
- if (%tremor) { drawdot -rn @random $rgb(253,143,77) %tremor %t.x %t.y }
- if (%tremorcool) { drawdot -rn @random $rgb(39,133,88) 100 %t.x %t.y }
- if (%fire) { drawrect -rfn @random $rgb(255,0,0) 1 $drawfire }
- if (%firecool) { drawrect -rfn @random $rgb(33,77,60) 1 $drawfire }
- drawcopy -nt @randombuf $rgb(255,0,255) $calc(10 + ((%side * 25) - 25)) 10 20 20 @random %loc.x %loc.y
- fps
- drawdot @random
- }
- on *:KEYDOWN:@random:*: {
- set %keys $addtok(%keys, $keyval, 46)
- }
- on *:KEYUP:@random:*: {
- set %keys $deltok(%keys, $findtok(%keys, $keyval, 1, 46), 46)
- }
- alias project.keys {
- ;; 48 - 57 | 0 - 9
- if (!%tremorcool) && (49 isin %keys) { drawtremor }
- if (!%firecool) && (50 isin %keys) { drawfire }
- if (87 isin %keys) { dec %loc.y }
- if (65 isin %keys) { dec %loc.x }
- if (83 isin %keys) { inc %loc.y }
- if (68 isin %keys) { inc %loc.x }
- }
- alias drawtremor {
- if (!%tremor) { set %tremor 1 | set %t.x $calc(%loc.x + 10) | set %t.y $calc(%loc.y + 10) }
- inc %tremor
- if (%tremor < 100) { .timertremor -m 1 1 /drawtremor }
- else { set -z %tremorcool 15 | unset %tremor }
- }
- alias drawfire {
- if ($isid) {
- if (%f.side == 5) {
- return %f.x %f.y 20 %f.L
- }
- elseif (%f.side == 1) {
- return %f.x $calc(%f.y - %f.L) 20 %f.L
- }
- elseif (%f.side == 3) {
- return %f.x %f.y %f.L 20
- }
- elseif (%f.side == 7) {
- return $calc(%f.x - %f.L) %f.y %f.L 20
- }
- }
- if (!%fire) { set %fire 50 | set %f.x %loc.x | set %f.y %loc.y | set %f.side %side }
- inc %fire 10
- set %f.L %fire
- if (%fire < 300) { .timerfire -m 1 30 /drawfire }
- else { set -z %firecool 5 | unset %fire }
- }
- alias getside {
- ;;; $getside(@window,Xo,Yo,Xm,Ym)
- ;;; @window = Picture window name
- ;;; Xo - Yo = X and Y object position
- ;;; Xm - Ym = X and Y of mouse position
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; Returns 1 to 8
- ;;; 1 = UP, 3 = RIGHT, 5 = DOWN, 7 = LEFT
- ;;; 2 = UP/RIGHT, 4 = RIGHT/DOWN, 6 = DOWN/LEFT, 8 = LEFT/UP
- ;;; OR
- ;;; 1 = NORTH, 2 = NORTH-EAST, 3 = EAST, 4 = SOUTH-EAST
- ;;; 5 = SOUTH, 6 = SOUTH-WEST, 7 = WEST, 8 = NORTH-WEST
- if ($1) && ($2) && ($3) && (4) && ($5) {
- if ($inpoly($4,$5, $2, $3, $calc(($window($1).w / 3) * 2), 0, $calc($window($1).w / 3), 0)) {
- return 1
- }
- elseif ($inpoly($4,$5, $2, $3, $calc(($window($1).w / 3) * 2), 0, $window($1).w, 0, $window($1).w, $calc($window($1).h / 3))) {
- return 2
- }
- elseif ($inpoly($4,$5, $2, $3, $window($1).w, $calc($window($1).h / 3), $window($1).w, $calc(($window($1).h / 3) * 2))) {
- return 3
- }
- elseif ($inpoly($4,$5, $2, $3, $window($1).w, $calc(($window($1).h / 3) * 2), $window($1).w, $window($1).h, $calc(($window($1).w / 3) * 2), $window($1).h)) {
- return 4
- }
- elseif ($inpoly($4,$5, $2, $3, $calc(($window($1).w / 3) * 2), $window($1).h, $calc($window($1).w / 3), $window($1).h)) {
- return 5
- }
- elseif ($inpoly($4,$5, $2, $3, $calc($window($1).w / 3), $window($1).h, 0, $window($1).h, 0, $calc(($window($1).h / 3) * 2))) {
- return 6
- }
- elseif ($inpoly($4,$5, $2, $3, 0, $calc($window($1).h / 3), 0, $calc(($window($1).h / 3) * 2))) {
- return 7
- }
- elseif ($inpoly($4,$5, $2, $3, 0, $calc($window($1).h / 3), 0, 0, $calc($window($1).w / 3), 0)) {
- return 8
- }
- }
- else { echo -s Error getside }
- }
- alias FPS {
- if (!$window(@FPS)) { !window -k0pdo +L @FPS 300 300 600 90 }
- !tokenize 32 $int($calc(%frames / %time)) %frames %time
- !drawrect -frn @FPS $rgb(0,0,0) 1 0 0 600 100
- !drawtext -rn @FPS $rgb(255,255,255) 10 10 Report:
- !drawtext -rn @FPS $rgb(255,255,255) 10 35 FPS( $+ $1 $+ ):
- !if ($1 isnum 1-25) {
- !drawtext -rn @FPS $rgb(255,0,0) 73 35 $str(|,$1)
- !if ($3 > 20) { drawtext -rn @FPS $rgb(255,0,0) 68 10 FPS to low, contact maker or look for fix. }
- !else { drawtext -rn @FPS $rgb(255,0,0) 68 10 FPS starting up, please wait. }
- }
- !if ($1 isnum 26-35) {
- !drawtext -rn @FPS $rgb(255,0,0) 73 35 $str(|,25)
- !drawtext -rn @FPS $rgb(0,255,0) 273 35 $str(|,$calc($1 - 25))
- !if ($3 > 20) { drawtext -rn @FPS $rgb(0,255,0) 68 10 FPS is perfect }
- !else { drawtext -rn @FPS $rgb(255,0,0) 68 10 FPS starting up, please wait. }
- }
- !if ($1 > 35) {
- !drawtext -rn @FPS $rgb(255,0,0) 73 35 $str(|,25)
- !drawtext -rn @FPS $rgb(0,255,0) 273 35 $str(|,10)
- !drawtext -rn @FPS $rgb(0,0,255) 353 35 $str(|,$calc($1 - 35))
- !if ($3 > 20) { drawtext -rn @FPS $rgb(0,0,255) 68 10 FPS to high, chance application will run to fast to use. }
- !else { drawtext -rn @FPS $rgb(255,0,0) 68 10 FPS starting up, please wait. }
- }
- !titlebar @FPS $1 Time(s): $3 Frames: $2
- !drawdot @FPS
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement