A simple starfield script I made.
To install, copy and paste this code into your Remotes Scripts (Alt + R),
Then type /stars or right click a channel and click "Stars" to run.
I suggest 100 or below stars. Depends on your computer. May be laggy if set too high.
Updates: Fixed a few serious errors when using hash tables.
;Stars 1.01
;Made by BlueThen on Saturday, March 1, 2008. Graphics, scripted, and all.
;Last updated April 28, 2008
;Please do not distribute without BlueThen's permission.
;To install, copy and paste this code into your Remotes Scripts (Alt + R),
;Then type /stars or right click the channel and click "Stars" to run.
;I suggest 100 or below stars. Depends on your computer. May be laggy if set too high.
;bluethen.the-brotherhood.org
dialog count {
title "Stars"
size -1 -1 187 71
option pixels notheme
text "Star Count:", 1, 13 8 58 17
edit "50", 2, 130 6 44 20, autohs
button "Go!", 3, 109 40 65 25, ok
button "Cancel", 4, 13 40 65 25, cancel
}
menu channel {
Stars: {
stars
}
}
on *:dialog:count:sclick:3: {
set %starcount $did(2)
.timer -h 1 1 window -poCzdk0 +tnbL @Stars -1 -1 300 300
.timer -h 1 1 window -poCzhdk0 +tnbL @Buffer -1 -1 900 900
.timer -h 1 1 SpawnS
}
alias stars {
set %c n
dialog -m count count
}
alias -l Spawns {
set %x 1
while (%x <= %starcount) {
hmake -m %x $+ q 1000
if ($hget(%x $+ q ,posx) != $null) {
hdel %x $+ q posx
}
hadd -m %x $+ q posx 0
if ($hget(%x $+ q ,posy) != $null) {
hdel %x $+ q posy
}
hadd -m %x $+ q posy $rand(1,900)
if ($hget(%x $+ q ,siz) != $null) {
hdel %x $+ q siz
}
hadd -m %x $+ q siz $rand(5,30)
if ($hget(%x $+ q ,col) != $null) {
hdel %x $+ q col
}
hadd -m %x $+ q col $rgb($rand(1,255),$rand(1,255),$rand(1,255))
inc %x
}
starframe
}
alias -l starframe {
if (%c != y) {
set %x2 1
drawtext @buffer 12 Tahoma 30 20 25 Made By BlueThen
drawtext @buffer 12 Tahoma 30 20 75 bluethen.the-brotherhood.org
while (%x2 <= %starcount) {
drawdot -r @buffer $hget(%x2 $+ q , col) $hget(%x2 $+ q , siz) $hget(%x2 $+ q , posx) $hget(%x2 $+ q , posy)
hinc %x2 $+ q posx $hget(%x2 $+ q ,siz)
if ($hget(%x2 $+ q ,posx) > 920) {
hdel %x2 $+ q posx
hdel %x2 $+ q siz
hdel %x2 $+ q col
hdel %x2 $+ q posy
hadd %x2 $+ q posy $rand(1,900)
hadd %x2 $+ q col $rgb($rand(1,255),$rand(1,255),$rand(1,255))
hadd %x2 $+ q siz $rand(5,30)
hadd %x2 $+ q posx 0
}
inc %x2 1
}
drawcopy -m @buffer 0 0 900 900 @stars 0 0 300 300
clear @buffer
.timer -h 1 0 starframe
}
}
on *:close:@stars: {
set %x 1
while (%x <= %starcount) {
hfree %x $+ q
inc %x
}
set %c y
window -c @buffer
}