Stars

By BlueThen on Mar 15, 2008

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
}

Comments

Sign in to comment.
GTAXL   -  Mar 22, 2010

OMG. What's the use of this script. I'm un-loading this script from my bot. It's just a game. Oh and
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999^^^^^ OWNED LMFAO
I set it to 985 and it worked fine. I'm gonna go higher...

 Respond  
Jethro   -  Jan 29, 2010

Not only have you grown older, you sure have grown wiser, too. lol

 Respond  
BlueThen   -  Jan 28, 2010

Almost 2 years old, wow. I was around 13 at the time I made this. It's amazing how much progress can be made in 2 years.

 Respond  
jackster35-1   -  Jan 28, 2010

@jethro_ i dint edit it i set the star value when you load it

@TephBeiFong It aint a contest :|

99999999999999999999999999999999999999999999999 << OWNED!!!

 Respond  
TophBeiFong   -  Jan 27, 2010

@jackster35-1
i bet on 10,000,000,000,000,000,000,000,000,000 << Owned!!

 Respond  
Jethro   -  Jan 27, 2010

Wow...you really have a way to tamper with a script, don't you?

 Respond  
jackster35-1   -  Jan 27, 2010

LOL crash it by putting it on 9999999999999

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.