ChanArt V2.0 — File Browser

ChanArtV2.0 / ChanArtV2.0 / chanart2.mrc

chanart2.mrc — 5.82 KB — Download this file

;:::::::::::::::::::::::::::::::::::::::::::::::::::: ChanArt V2.0, by KiloVolt, 1998 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

menu channel {
  ChanArt
  .Modern: window -c @ChanArtBF | unset %ChanArt* | .disable #ChanArtBF | ChanArt
  .ButterFly: window -c @ChanArt | unset %ChanArt* | .disable #ChanArt | ChanArtBF
}

menu @ChanArt {
  sclick: clear @ChanArt
}

menu @ChanArtBF {
  sclick: clear @ChanArtBF
}

on 1:start: {
  if ($version < 5.31) { echo 4 -a ******* The script (ChanArt V2.0) requires Mirc ver. 5.31 or later ********* | beep 2 200 }
  .disable #ChanArt | .disable #ChanArtBF
}

on 1:close:@ChanArt: .disable #ChanArt | unset %ChanArt*
on 1:close:@ChanArtBF: .disable #ChanArtBF | unset %ChanArtBF*
on 1:connect: .disable #ChanArt | .disable #ChanArtBF
on 1:disconnect: .disable #CharArt | .disable #ChanArtBF | unset %ChanArt* | window -c @ChanArt | window -c @ChanArtBF

;::::::::::::::::::::::::::::::::::::: Alias ChanArt :::::::::::::::::::::::::::::::::::::::
;Opens the modern art window and enables event trapping

alias ChanArt {
  if ($server == $null) { echo 4 -s Not connected to a server | beep | halt }
  window -pod +tn @ChanArt $int($calc( [ $window(-1).w ] / 1.8)) 20 $int($calc( [ $window(-1).w ] / 3)) $int($calc( [ $window(-1).h ] / 3))
  .enable #ChanArt
  set %ChanArt.x $window(@ChanArt).dw | set %ChanArt.y $window(@ChanArt).dh
}

;::::::::::::::::::::::::::::::::::::: Alias ChanArtTriang :::::::::::::::::::::::::::::
;Draws a triangle to the modern art window

alias ChanArtTriang {
  drawline @ChanArt $rand(0,15) $rand(1,5) $1 $2 $3 $4 $3 $4 $5 $6 $5 $6 $1 $2 
}

;:::::::::::::::::::::::::::::::::::::::: Alias ChanArtspray ::::::::::::::::::::::::::::::
;Draws a spray (or cluster) of multicolored dots at random spacing to the Art window

alias ChanArtspray {
  set %ChanArt.i 3
  :sprayloop
  if (%ChanArt.i > 100) goto sprayend
  drawdot @ChanArt $rand(0,15)  $rand(1, 3) $calc($1 + $rand(3, %ChanArt.i)) $calc($2 + $rand(3, %ChanArt.i))
  inc %ChanArt.i 5 | goto sprayloop
  :sprayend
} 

;::::::::::::::::::::::::::::::::::::::::: Alias ChanArtBFReflect ::::::::::::::::::::::::::::::::::::::
;Draws a triangle and its reflection to create a wing pair in the Butterfly window

alias ChanArtBFReflect {
  drawline -r @ChanArtBF %ChanArtBF.color %ChanArtBF.size $1 $2 $3 $4 $3 $4 $5 $6 $5 $6 $1 $2 
  drawline -r @ChanArtBF %ChanArtBF.color %ChanArtBF.size $1 $2 $3 $calc(%ChanArtBF.y - $4) $3 $calc(%ChanArtBF.y - $4) $5 $calc(%ChanArtBF.y - $6) $5 $calc(%ChanArtBF.y - $6) $1 $2 
}

;::::::::::::::::::::::::::::::::::::::::::: Alias ChanArtBF ::::::::::::::::::::::::::::::::::::::
;Opens the ButterFly window and enables event trapping

alias ChanArtBF {
  window -c @ChanArtBF
  window -pod +tn @ChanArtBF $int($calc( [ $window(-1).w ] / 1.8)) 20 $int($calc( [ $window(-1).w ] / 3)) $int($calc( [ $window(-1).h ] / 3))
  set %ChanArtBF.x $window(@ChanArtBF).dw | set %ChanArtBF.y $window(@ChanArtBF).dh
  .enable #ChanArtBF
}

;:::::::::::::::::::::::::::::::::::::::::: Alias ChanArtBFWings::::::::::::::::::::::::::::::::::::
;Draws wings of random color, size, and number to the ButterFly
; window with calls to the alias ChanArtReflect

alias ChanArtBFWings {
  clear @ChanArtBF
  set %ChanArtBFloop.i 0 | set %ChanArtBF.wings $rand(4,6)
  :BFloop
  if (%ChanArtBFloop.i >= %ChanArtBF.wings) goto BFloopend
  set %ChanArtBF.color $rgb($rand(0,255),$rand(0,255),$rand(0,255)) | set %ChanArtBF.size $rand(1,4)
  ChanArtBFReflect   $calc(%ChanArtBF.x / 2)  $calc(%ChanArtBF.y / 2) $rand(0,%ChanArtBF.x) $rand($calc(%ChanArtBF.y / 2),%ChanArtBF.y) $rand(0,%ChanArtBF.x) $rand($calc(%ChanArtBF.y / 2),%ChanArtBF.y)
  inc %ChanArtBFloop.i | goto  BFloop
  :BFloopend
}

;::::::::::::::::::::::::::::::::::::::: Events trapping for Modern art :::::::::::::::::::::::::::::::::::::

#ChanArt off
on me:1:PART:#: if ($chan(0) < 2) { window -c @ChanArt | unset %ChanArt* | .disable #ChanArt }
on 1:JOIN:#: drawline @ChanArt $rand(0,15) $rand(1,8) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
on 1:PART:#: drawrect -ef @ChanArt $rand(0,15) $rand(1,10) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
on 1:QUIT: drawrect @ChanArt $rand(0,15) $rand(1,10) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
on 1:TEXT:*:#: drawdot @ChanArt $rand(0,20) $rand(1,15) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
on 1:ACTION:*:#: drawfill @ChanArt $rand(0,15) $rand(0,15) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
on 1:NICK: drawrect -f @ChanArt $rand(0,15) $rand(1,8) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
on 1:KICK:#: drawtext -o @ChanArt $rand(0,15) arial $rand(8,20) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) OUCH!
on 1:BAN:#: ChanArtTriang   $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y) $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)  
on 1:UNBAN:#: ChanArtspray $rand(0,%ChanArt.x) $rand(0,%ChanArt.y)
#ChanArt end

;:::::::::::::::::::::::::::::::::::::::::: Events trapping for ButterFly Art ::::::::::::::::::::::::::::::::::

#ChanArtBF off
on me:1:PART:#: if ($chan(0) < 2) { window -c @ChanArtBF | unset %ChanArt* | .disable #ChanArtBF }
on 1:TEXT:*:#: ChanArtBFWings
#ChanArtBF end

;=============== REFERENCE  ============
;/drawline -ihnr @ <colour> <size> <x y> <x y> [<x y>...]
;/drawrect -ihnrfec @ <colour> <size> <x y w h> [<x y w h>...]
;/drawtext -hnrpboc @ <colour> [colour] [fontname fontsize] <x y [w h]> <text>
;/drawdot -ihnr @ <colour> <size> <x y> [<x y>...]
;/drawfill -ihnrs @ <colour> <colour> <x y>