Advertisement
imk0tter

Untitled

May 13th, 2011
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.24 KB | None | 0 0
  1. menu channel,query,status,menubar,@SpiralOfLife {
  2.   Spiral Out:/SpiralOfLife 50
  3. }
  4.  
  5. alias SpiralOfLife {
  6.   if (%spiralOfLife) {
  7.     Spiral.Destroy
  8.   }
  9.   Spiral.Create $1
  10. }
  11.  
  12. on 1:close:@SpiralOfLife: {
  13.   .timerSpiralofLife off
  14.   %spiralofLife = $false
  15.   .hfree SpiralOfLife
  16. }
  17. alias Spiral.Destroy {
  18.   .timerSpiralOfLife off
  19.   close @SpiralofLife
  20.   %spiralOfLife = $false
  21.   .hfree SpiralOfLife
  22. }
  23.  
  24. alias Spiral.Create {
  25.   Spiral.InitWindow
  26.   Spiral.InitDots $1
  27.   Spiral.StartAnimation
  28. }
  29. alias Spiral.StartAnimation {
  30.   .timerSpiralOfLife 0 0 Spiral.RenderScene
  31. }
  32. alias Spiral.InitDots {
  33.   set %spiralFrame 0
  34.   set %spiralTicks $ticks
  35.   var %MultiDirection 0
  36.   var %dotCount $1
  37.   var %baseSize 4
  38.   var %baseDist 4
  39.   var %baseAngle 12
  40.   var %angleOffset $calc(%baseAngle / (%dotCount + 1) * (1 + %multiDirection))
  41.   var %redBase 0
  42.   var %redOffset $calc(255 / %dotCount)
  43.   var %currDist %baseDist
  44.   var %x 1
  45.   hadd -m SpiralOfLife DotCount %dotCount
  46. }
  47.  
  48. alias Spiral.InitWindow {
  49.   var %window.h 768
  50.   var %window.w 1024
  51.   hadd -m SpiralOfLife window.midx $calc(%window.w / 2)
  52.   hadd -m SpiralOfLife window.midy $calc(%window.h / 2)
  53.   hadd -m SpiralOfLife window.w %window.w
  54.   hadd -m SpiralofLife window.h %window.h
  55.   window -aBdfp @SpiralOfLife -1 -1 %window.w %window.h
  56. }
  57.  
  58. alias Spiral.RenderScene {
  59.   var %baseSize 4
  60.   var %sizeMax 8
  61.   var %baseDist 6
  62.   var %framesPerDegree 11
  63.   %spiralTicks = $ticks
  64.   var %dotCount $hget(SpiralOfLife,DotCount)
  65.   var %dotCount2 %dotCount
  66.   drawrect -nrf @SpiralOfLife $rgb(255,255,255) 1 0 0 $hget(SpiralOfLife,window.w) $hget(SpiralOfLife,window.h)
  67.   var %lastX, %lastY
  68.   var %window.midx $hget(SpiralOfLife,window.midx)
  69.   var %window.midy $hget(SpiralOfLife,window.midy)
  70.   var %list,%list2,%list3
  71.   while %dotCount {
  72.     var %length $calc(%baseDist * %dotCount - %baseDist)
  73.     var %dotSize $calc((%dotCount / %dotCount2) * (%sizeMax - %baseSize) + %baseSize)
  74.     var %dotOffset %dotSize / 2
  75.     var %newAngle $calc(((((1 + %dotCount2 - %dotCount) / %framesPerDegree) * %spiralFrame) + 90) % 360)
  76.     var %zz $sin(%newAngle).deg
  77.     var %newX $calc(%zz * %length + %window.midx - %dotOffset)
  78.     ;var %newY $calc($cos(%newAngle).deg * %length + %window.midy - %dotOffset)
  79.     var %newY %length + $calc(%window.midy / 2)
  80.     ;var %newY $calc(($cos($calc(%newAngle * 2)).deg) * %length + (%window.midy / 3) - %dotOffset + %length)
  81.     %list = %list $round(%zz,2)
  82.     %list2 = %list2 %newX
  83.     %list3 = %list3 %newY
  84.     var %color $rgb($calc(255 / %dotCount2 * %dotCount),120,180)
  85.  
  86.     ;Uncomment the next line to draw dots;
  87.     drawDot -nr @SpiralOfLife %color %dotSize $calc(%newX + %dotOffset) $calc(%newY + %dotOffset)
  88.  
  89.     ;Uncomment to draw line from center
  90.     drawline -nr @SpiralOfLife %color 2 %newX %newY %window.midx $calc(%window.midy / 2 )
  91.  
  92.     if %lastX != $null && %lastY != $null {
  93.       ;Uncomment the next line to draw lines
  94.       drawline -nr @SpiralOfLife %color 2 %newX %newY %lastX %lastY
  95.     }
  96.     var %lastX %newX
  97.     var %lastY %newY
  98.  
  99.     ;hadd -m SpiralOfLife %dotCount $+ .Angle %newAngle
  100.     dec %dotCount
  101.   }
  102.   var %dotCount $hget(SpiralOfLife,DotCount)
  103.   var %iter $int($calc(%dotCount / 2))
  104.   var %x 2,%lastX,%lastY
  105.   /*
  106.   while %x <= %iter {
  107.     if $count(%list,$token(%list,1 - $+ %x,32)) == $floor($calc(%dotCount / %x)) {
  108.  
  109.       var %k $v2
  110.       var %y %x
  111.       while %nny {
  112.         var %z %k
  113.         while %z {
  114.           dec %z
  115.         }
  116.         dec %y
  117.       }
  118.       drawsave -q80 @SpiralOfLife SpiralOfLife- $+ %x $+ - $+ %spiralFrame $+ - $+ $ticks $+ .jpg
  119.       %x = $calc(%iter + 1)
  120.     }
  121.     inc %x
  122.   }
  123.   */
  124.   drawDot @SpiralOfLife
  125.   inc %spiralFrame 1
  126. }
  127.  
  128. alias bigtest {
  129.   if $* {
  130.     var %
  131.     echo -a $len(%x) %x
  132.   }
  133. }
  134. alias spiralTest {
  135.   var %x $1
  136.   var %y 1
  137.   var %z $2
  138.   while %y <= %z {
  139.     var %a $regsubex($str(.,%x),/(.)/g,$round($sin($calc(((\n * 0.05) * %y + 90) % 360)).deg,3) $+ $chr(32))
  140.     var %b $numtok(%a,32)
  141.     var %c $floor($calc(%x / 2))
  142.     var %d 2
  143.     var %match 0
  144.     while %d <= %c {
  145.       if $count(%a,$token(%a,1 - $+ %d,32)) == $floor($calc(%x / %d)) {
  146.         echo -a Solid wavelength found ( $+ %d $+ ) $v2 : %a
  147.         %d = %c + 1
  148.       }
  149.       inc %d
  150.     }
  151.     inc %y
  152.   }
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement