String

By BlueThen on May 10, 2008

String. Drag the blue dot around and the other dots will follow like a string. :D
Image

;String 1.02
;Made by BlueThen on May 10, 2008.
;To install, paste this script into your remotes (alt + r),
;then type /string or right click the channel or status to open.
;Drag the blue dot.
alias String window -paoCzdk0 +tnbL @string -1 -1 400 400 | window -poCzdhk0 +tnbL @string.buf -1 -1 800 800 | string.init
on *:close:@string: { window -c @string.buf | unset %string.x %string.h }
alias -l string.init {
  %string.x = 20 | drawfill @string.buf 0 0 1 1
  drawtext @string.buf 1 Tahoma 40 237 25 Made by Bluethen | drawtext @string.buf 1 Tahoma 40 281 75 bluethen.com 
  while (%string.x) {
    hadd -m x %string.x $calc(150 + (%string.x * 25)) | hadd -m y %string.x 400   
    drawdot @string.buf $iif(%string.x == 1,12,1) 10 $calc(150 + (%string.x * 25)) 400 | dec %string.x
  }
  drawcopy -m @string.buf 0 0 800 800 @string 0 0 400 400
}
menu channel,status {
  String: { String }
}
menu @string {
  sclick: { if ($sqrt($calc((($mouse.x * 2) - $hget(x,1))^2 + (($mouse.y * 2) - $hget(y,1))^2)) < 10) set %string.h y }
  uclick: { set %string.h n }
  leave: { set %string.h n }
  mouse: {
    if (%string.h == y) {
      clear @string.buf | drawfill @string.buf 0 0 1 1
      drawtext @string.buf 1 Tahoma 40 237 25 Made by Bluethen | drawtext @string.buf 1 Tahoma 40 281 75 bluethen.com | %string.x = 1
      while (%string.x <= 20) {
        if (%string.x == 1) {
          hadd -m x 1 $calc($mouse.x * 2) | hadd -m y 1 $calc($mouse.y * 2) | if ($hget(x,1) > 760) hadd -m x 1 760 | if ($hget(x,1) < 40) hadd -m x 1 40
          if ($hget(y,1) > 720) hadd -m y 1 720 | if ($hget(y,1) < 40) hadd -m y 1 40 | drawdot @string.buf 12 10 $hget(x,1) $hget(y,1)
        } 
        else {
          hadd -m x %string.x $calc($hget(x, $calc(%string.x - 1)) + (25 * $cos($getangle2($hget(x, $calc(%string.x - 1)),$hget(y, $calc(%string.x - 1)),$hget(x, %string.x),$hget(y, %string.x))).deg))
          hadd -m y %string.x $calc($hget(y, $calc(%string.x - 1)) + (25 * $sin($getangle2($hget(x, $calc(%string.x - 1)),$hget(y, $calc(%string.x - 1)),$hget(x, %string.x),$hget(y, %string.x))).deg))
          drawdot @string.buf 1 10 $hget(x, %string.x) $hget(y, %string.x)
        } 
        inc %string.x
      }
      drawcopy -m @string.buf 0 0 800 800 @string 0 0 400 400
    }
  }
}
alias getangle2 {
  %p1.x = $1 | %p1.y = $2 | %p2.x = $3 | %p2.y = $4 | %p3.x = %p2.x | %p3.y = %p1.y | %opposite = $sqrt($calc((%p2.x - %p3.x)^2 + (%p2.y - %p3.y)^2))
  %hypotenuse = $sqrt($calc((%p2.x - %p1.x)^2 + (%p2.y - %p1.y)^2)) | %angle = $asin($calc( %opposite / %hypotenuse )).deg
  if (%p1.y < %p2.y) %angle = $calc(360 - %angle) | if ((%p1.x > %p2.x) && (%p1.y > %p2.y)) %angle = $calc(180 - %angle)
  elseif ((%p1.x > %p2.x) && (%p1.y < %p2.y)) %angle = $calc(180 +(360 - %angle)) | return $iif($calc(360 - %angle) == 360,0,$v1)
}

Comments

Sign in to comment.
Jonesy44   -  May 10, 2008

LMFAO! :P

 Respond  
BlueThen   -  May 10, 2008

For the sake of your tampon-phobia, I changed it to blue. :P

 Respond  
Jonesy44   -  May 10, 2008

funny thing perception.. eh

 Respond  
napa182   -  May 10, 2008

nice work like always BlueThen, but i would just change the color of the red dot to blue cuz it looks like a tampon string with that red dot. 7/10

 Respond  
Jonesy44   -  May 10, 2008

make a whip version of this, with like gravity (editable!) that would be class :P

good stuff, 9/10

 Respond  
Eugenio   -  May 10, 2008

LOL EL
wtfudge I have to admit, thats a bloody good idea (amazing for a yank(even more amazing for a yank like EL))
even if SNAKES has been done before you should do it again.
lol @ this script , when I first did it for some reason it buggered up :0

 Respond  
BlueThen   -  May 10, 2008

I believe that\'s already been done for mIRC.

 Respond  
EL   -  May 10, 2008

Ahh cool man wd o0o i have an idea it may be able to be done is a snake game yanno that line that eats dots an grows etc? thats be something neat maybe?

 Respond  
BlueThen   -  May 10, 2008

Fixed the border thing.

I really have nothing I can do for the last dots, in the script, the closer dots to the red one is effect more than the dots farther away. So the ones at the end may seem like they\'re stuck.

I\'ve been trying to release as many scripts as possible, but school\'s been getting in the way, and concepts are hard to find.

 Respond  
EL   -  May 10, 2008

Ok cool idea but it looks like the last 3 or 4 dots are sticking an not followin a clean line instead they stick hard an move at a sharp angle instead if your moving in a soft arc.Alho i got it stuck on the boarder as well i wanted to see the limits so i draged it to the bottom edge an it got stuck,the red dot went passed the boarder an i couldn\'t retrieve it see if you can make it stop at the picwin edges maybe its a nice concept as well an one of your longer codes as well nice work BT.`-.-´

 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.