First PicWin since August, sadly.
Tree is simply a fancy generator. It animates a tree/shrub like plant thing growing using lines an' such. Not much to it really...
(Press the Space bar to reset it.)
Updates:
Fixed minor draw-error bug.
Restricts two instances of Tree now... seeing as how two instances is not possible, and would crash it.
Added "Aspects" menu.
;Tree 1.03
;Made by BlueThen on October 11, 2008.
;Last updated October 12, 2008.
;To install, put this snippet into your remotes (Alt + R)
;Type /tree or right click the channel or status and click "Tree" to run.
;Press the space bar to reset it.
alias tree {
if (!$window(@tree)) {
dialog -m tree.aspect tree.aspect
dialog -s tree.aspect 100 100 325 227
window -paozCdk0 +fbnL @Tree -1 -1 400 400
window -paohCzdk0 +ndL @tree.buf -1 -1 800 800
tree.init
}
}
menu channel,status {
Tree: { tree }
}
alias -l tree.init {
clear @tree.buf
unset %tree.*
set %tree.life $did(tree.aspect,1).sel
set %tree.split $did(tree.aspect,2).sel
set %tree.len $did(tree.aspect,6).sel
set %tree.siz $did(tree.aspect,8).sel
set %tree.s n
set %tree.limbs 1
drawfill @tree.buf 3 3 1 1
drawtext @tree.buf 12 Tahoma 30 520 20 Made by BlueThen
drawtext @tree.buf 12 Tahoma 30 520 60 BlueThen.com
hadd -m InitAng 1 $r(1,360)
hadd -m Size 1 $r(15,30)
hadd -m X 1 400
hadd -m Y 1 400
hadd -m Shade 1 0
hadd -m Life 1 1
hadd -m Status 1 Alive
drawcopy @tree.buf 0 0 800 800 @tree 0 0 400 400
tree.frame
}
alias -l tree.frame {
if (%tree.s != y) {
set %tree.x %tree.limbs
while (%tree.x) {
if ($hget(status, %tree.x) == alive) {
if ($r(1, $calc(31 - %tree.split)) == 1) {
inc %tree.limbs
hadd -m InitAng %tree.limbs $calc($hget(initang, %tree.x) $iif($r(1,2) == 1, +, -) $r(1,180))
hadd -m Status %tree.limbs alive
hadd -m Life %tree.limbs 1
hadd -m Size %tree.limbs $calc($hget(Size, %tree.x) * $iif($hget(Size, %tree.x) > %tree.siz, 0.95, 1))
%tree.a = $hget(initAng, %tree.limbs)
hadd -m X %tree.limbs $calc($hget(X, %tree.x) + (($r(50,100) * ($hget(size, %tree.limbs) * (%tree.len * 0.01))) * $cos(%tree.a).deg))
hadd -m Y %tree.limbs $calc($hget(Y, %tree.x) + (($r(50,100) * ($hget(size, %tree.limbs) * (%tree.len * 0.01))) * $sin(%tree.a).deg))
hadd -m Shade %tree.limbs $calc($hget(Shade, %tree.x) + $iif($hget(Shade, %tree.x) < 230, $r(5,20), 0))
drawline -r @tree.buf $rgb(139,$hget(Shade, %tree.limbs),19) $hget(size, %tree.limbs) $hget(X, %tree.limbs) $hget(Y, %tree.limbs) $hget(X, %tree.x) $hget(Y, %tree.x)
}
%tree.ns = $calc($hget(Size, %tree.x) * $iif($hget(Size, %tree.x) > %tree.siz, 0.95, 1))
%tree.a = $calc($hget(initang, %tree.x) $iif($r(1,2) == 1, +, -) $r(1,90))
%tree.nx = $calc($hget(X, %tree.x) + (($r(50,100) * (%tree.ns * (%tree.len * 0.01))) * $cos(%tree.a).deg))
%tree.ny = $calc($hget(Y, %tree.x) + (($r(50,100) * (%tree.ns * (%tree.len * 0.01))) * $sin(%tree.a).deg))
hadd -m Shade %tree.x $calc($hget(Shade, %tree.x) + $iif($hget(Shade, %tree.x) < 230, $r(5,20), 0))
drawline -r @tree.buf $rgb(139,$hget(Shade, %tree.x),19) %tree.ns $hget(X, %tree.x) $hget(Y, %tree.x) %tree.nx %tree.ny
hadd -m InitAng %tree.x %tree.a
if ($hget(x, %tree.x) > 600) hadd -m InitAng %tree.x 180
if ($hget(x, %tree.x) < 200) hadd -m InitAng %tree.x 0
if ($hget(y, %tree.x) > 600) hadd -m InitAng %tree.x 270
if ($hget(y, %tree.x) < 200) hadd -m InitAng %tree.x 90
hadd -m X %tree.x %tree.nx
hadd -m Y %tree.x %tree.ny
hadd -m Size %tree.x %tree.ns
hadd -m Life %tree.x $calc($hget(life, %tree.x) + 1)
if ($hget(life, %tree.x) > $calc(%tree.life - %tree.limbs)) {
hadd -m Status %tree.x Dead
}
}
dec %tree.x
}
if ($window(@tree)) drawcopy -m @tree.buf 0 0 800 800 @tree 0 0 400 400
.timer 1 0 tree.frame
}
else unset %tree.*
}
on *:keydown:@tree:32: {
set %tree.s y
.timer? off
tree.init
}
on *:close:@tree: { window -c @tree.buf | .timer? off | set %tree.s y | dialog -x tree.aspect }
on *:dialog:tree.aspect:close:0: { window -c @tree | window -c @tree.buf | .timer? off | set %tree.s y }
dialog tree.aspect {
title "Tree Aspects"
size -1 -1 325 227
option pixels notheme
scroll "", 1, 10 26 300 16, horizontal top range 1 150
scroll "", 2, 10 74 300 16, horizontal top range 1 30
text "Limb Life: ", 3, 10 8 100 16
text "Split Rate: ", 4, 10 54 118 18
text "Limb Length: ", 5, 10 102 122 16
scroll "", 6, 10 120 300 16, horizontal top range 1 20
text "Min. Limb Size:", 7, 10 148 120 18
scroll "", 8, 10 168 300 16, horizontal top range 1 20
text "50/150", 9, 212 8 100 16, right
text "24/30", 10, 212 54 100 18, right
text "4/20", 11, 212 102 100 16, right
text "3/20", 12, 212 148 100 18, right
button "Reset", 14, 129 194 66 24
}
on *:dialog:tree.aspect:scroll:*: {
if ($did == 1) { set %tree.life $did(1).sel | did -ra tree.aspect 9 $did(1).sel $+ /150 }
if ($did == 2) { set %tree.split $did(2).sel | did -ra tree.aspect 10 $did(2).sel $+ /30 }
if ($did == 6) { set %tree.len $did(6).sel | did -ra tree.aspect 11 $did(6).sel $+ /20 }
if ($did == 8) { set %tree.siz $did(8).sel | did -ra tree.aspect 12 $did(8).sel $+ /20 }
}
on *:dialog:tree.aspect:init:0: {
tree.reset
}
on *:dialog:tree.aspect:sclick:14: {
tree.reset
}
alias -l tree.reset {
did -c tree.aspect 1 100
did -ra tree.aspect 9 100/150
did -c tree.aspect 2 24
did -ra tree.aspect 10 24/30
did -c tree.aspect 6 4
did -ra tree.aspect 11 4/20
did -c tree.aspect 8 3
did -ra tree.aspect 12 3/20
set %tree.life 100
set %tree.split 24
set %tree.len 4
set %tree.siz 3
}
* /drawcopy: invalid window (line 69, script5.mrc)
* /drawcopy: invalid window (line 69, script5.mrc)
This just randomly pops up sometimes, not sure why.
Line 69:
drawcopy -m @tree.buf 0 0 800 800 @tree 0 0 400 400
Also, if you have it open and select the Tree from the menu again while it's still open, you get it maximized on your screen with no way to get rid of it except ALT+Z