Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.75 KB | None | 0 0
  1. alias doThisShit {
  2.   echo -a $ticks
  3. }
  4. menu * {
  5.   Pendulum:/pendulum.init
  6. }
  7. alias pendulum.init {
  8.   .timerPend off
  9.   if (!$window(@Pendulum)) { window -ep @Pendulum }
  10.   else { drawrect -rf @Pendulum $rgb(255,255,255) 1 0 0 $window(@Pendulum).w $window(@Pendulum).h }
  11.   %pendulum.radius = $$1
  12.   %pendulum.angle = $calc($$2 * ($pi / 180))
  13.   %pendulum.momentum = $$3
  14.   %pendulum.tick = $ticks
  15.   %pendulum.x = $calc(0 $iif($2 > 0,+,-) $sin($2).deg * $1))
  16.   %pendulum.y = $calc(0 $iif($2 > 0,+,-) $cos($2).deg * $1))
  17.   .timerPend 0 0 pendulum.animate
  18. }
  19. alias pendulum.animate {
  20.   var %x $window(@Pendulum).w / 2
  21.   var %y $window(@Pendulum).h / 2
  22.  
  23.   var %distance $ticks - %pendulum.tick
  24.   %pendulum.tick = $ticks
  25.   $iif(%pendulum.x > 0,dec,inc) %pendulum.momentum $calc(((%distance / 1000) * 9) * ($abs(%pendulum.x) / ($abs(%pendulum.y) + $abs(%pendulum.x))))
  26.   inc %pendulum.angle $calc(%pendulum.momentum / %pendulum.radius)
  27.  
  28.   %pendulum.x = $sin(%pendulum.angle) * %pendulum.radius
  29.   %pendulum.y = $cos(%pendulum.angle) * %pendulum.radius  
  30.   drawrect -nrf @Pendulum $rgb(255,255,255) 1 0 0 $window(@Pendulum).w $window(@Pendulum).h
  31.   drawtext -nr @Pendulum $rgb(255,0,0) 10 $calc($window(@Pendulum).h - 100) Momentum: %pendulum.momentum
  32.   drawtext -nr @Pendulum $rgb(255,0,0) 10 $calc($window(@Pendulum).h - 90)  Angular Momentum Ratio: $calc($abs(%pendulum.x) / ($abs(%pendulum.y) + $abs(%pendulum.x)))
  33.   drawline -nr @Pendulum $rgb(255,0,0) 2 %x %y $calc(%pendulum.x + %x) $calc(%pendulum.y + %y)
  34.   drawdot -nref @Pendulum 0 4 $calc(%x + 2) $calc(%y + 2)
  35.   drawdot -nref @Pendulum $rgb(0,0,255) 8 $calc(%pendulum.x + %x + 4) $calc(%pendulum.y + %y + 4)
  36.   drawdot @Pendulum
  37. }
  38.  
  39. on 1:input:@Pendulum: {
  40.   if ($1 == start) {
  41.     pendulum.init $2-
  42.   }
  43.   if ($1 == stop) {
  44.     pendulum.init
  45.   }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement