NetLand Script V2.0 — File Browser

NetLandScriptV2.0 / NetLandScriptV2.0 / remote / Intro.mrc

Intro.mrc — 6.89 KB — Download this file

;##############################
; Cool Texts v1.00  - By:John
;
; Usage: /Scroll "End movie Credits"
; Usage: /Typer "Text being typed"
;##############################
;
;# SETTINGS: #####################
;File=$mircdir\cool.txt
;Window=@About
;Font=verdana 16
;Colour=1
;
;NOTE: Dont delete or add any rows here since they are used to set up this addon
;           and dont use a font larger than 20
;##############################

alias Scroll {
  set %scroll.file $read -l9 $scriptdirintro.mrc | set %scroll.file $gettok(%scroll.file,2,61)
  if ($chr(36) $+ scriptdir isin %scroll.file) { set %scroll.file $remove(%scroll.file,$chr(36),scriptdir) | set %scroll.file $scriptdir $+ %scroll.file }
  elseif ($chr(36) $+ mircdir isin %scroll.file) { set %scroll.file $remove(%scroll.file,$chr(36),mircdir) | set %scroll.file $mircdir $+ %scroll.file }
  set %scroll.win $read -l10 $scriptdirintro.mrc | set %scroll.win $gettok(%scroll.win,2,61)
  set %scroll.font $read -l11 $scriptdirintro.mrc | set %scroll.font $gettok(%scroll.font,2,61)
  set %scroll.col $read -l12 $scriptdirintro.mrc | set %scroll.col $gettok(%scroll.col,2,61)
  window -akdp %scroll.win $_centerwin(400,240) 400 240 @ScrollMen
  titlebar %scroll.win - Scrolling
  drawfill -r %scroll.win $rgb(face) $rgb(face) 0 0 1 1
  var %scroll.tmp = $window(%scroll.win).dh,%i = 1
  :loop
  if (%i > 10) { goto next }
  set %scroll.row. [ $+ [ %i ] ] %scroll.tmp
  set %scroll.line [ $+ [ %i ] ] %i
  inc %i | inc %scroll.tmp 20 | goto loop
  :next | _gettexts | .timerScroll -m 0 500 _Ptext
}
alias Typer {
  set %scroll.file $read -l9 $mircdirremote\intro.mrc | set %scroll.file $gettok(%scroll.file,2,61)
  if ($chr(36) $+ scriptdir isin %scroll.file) { set %scroll.file $remove(%scroll.file,$chr(36),scriptdir) | set %scroll.file $scriptdir $+ %scroll.file }
  elseif ($chr(36) $+ mircdir isin %scroll.file) { set %scroll.file $remove(%scroll.file,$chr(36),mircdir) | set %scroll.file $mircdir $+ %scroll.file }
  set %scroll.win $read -l10 $scriptdirintro.mrc | set %scroll.win $gettok(%scroll.win,2,61)
  set %scroll.font $read -l11 $scriptdirintro.mrc | set %scroll.font $gettok(%scroll.font,2,61)
  set %scroll.col $read -l12 $scriptdirintro.mrc | set %scroll.col $gettok(%scroll.col,2,61)
  window -akdp %scroll.win $_centerwin(400,240) 400 240 @ScrollMen
  titlebar %scroll.win - Typer
  drawfill -r %scroll.win $rgb(face) $rgb(face) 0 0 1 1
  set %scroll.row -20
  _gettexts2 | .timerScroll -m 0 50 _Ptext2
}
alias -l _gettexts {
  if (%scroll.line10 > $lines(%scroll.file)) { set %scroll.done $true | goto next }
  if (%scroll.row.1 < -1) { set %scroll.row.1 $calc(%scroll.row.10 + 20) | inc %scroll.line1 10 }
  if (%scroll.row.2 < -1) { set %scroll.row.2 $calc(%scroll.row.1 + 20) | inc %scroll.line2 10 }
  if (%scroll.row.3 < -1) { set %scroll.row.3 $calc(%scroll.row.2 + 20) | inc %scroll.line3 10 }
  if (%scroll.row.4 < -1) { set %scroll.row.4 $calc(%scroll.row.3 + 20) | inc %scroll.line4 10 }
  if (%scroll.row.5 < -1) { set %scroll.row.5 $calc(%scroll.row.4 + 20) | inc %scroll.line5 10 }
  if (%scroll.row.6 < -1) { set %scroll.row.6 $calc(%scroll.row.5 + 20) | inc %scroll.line6 10 }
  if (%scroll.row.7 < -1) { set %scroll.row.7 $calc(%scroll.row.6 + 20) | inc %scroll.line7 10 }
  if (%scroll.row.8 < -1) { set %scroll.row.8 $calc(%scroll.row.7 + 20) | inc %scroll.line8 10 }
  if (%scroll.row.9 < -1) { set %scroll.row.9 $calc(%scroll.row.8 + 20) | inc %scroll.line9 10 }
  if (%scroll.row.10 < -1) { set %scroll.row.10 $calc(%scroll.row.9 + 20) | inc %scroll.line10 10 }

  var %i = 1
  :loop
  if (%i > 10) { goto next }
  set %scroll.text. [ $+ [ %i ] ] $read -l [ $+ [ %scroll.line [ $+ [ %i ] ] ] ] %scroll.file
  if (%scroll.text. [ $+ [ %i ] ] == $null) { set %scroll.text. [ $+ [ %i ] ] $_getspace(1) }
  inc %i | goto loop
  :next 
}

alias -l _gettexts2 {
  if (%scroll.row >= 200) { drawrect -fr %scroll.win $rgb(face) 1 0 0 $window(%scroll.win).dw $window(%scroll.win).dh | set %scroll.row 0 }
  set %scroll.num 1
  if (%scroll.line == $null) { set %scroll.line 1 }
  else { inc %scroll.line }
  inc %scroll.row 20
  set %scroll.text $read -l [ $+ [ %scroll.line ] ] %scroll.file 
  if (%scroll.text == $null) { set %scroll.text $_getspace(1) }
  if (%scroll.line > $lines(%scroll.file)) {
    set %scroll.num 1 | set %scroll.line 1 
    drawrect -fr %scroll.win $rgb(face) 1 0 0 $window(%scroll.win).dw $window(%scroll.win).dh | set %scroll.row 0
    set %scroll.text $read -l [ $+ [ %scroll.line ] ] %scroll.file 
  }
}

alias -l _Ptext {
  _refresh
  if (%scroll.done) && (%scroll.row.10 < - $+ $window(%scroll.win).fontsize) { .timerScroll off | unset %scroll.* | scroll }
  var %i = 1,%text
  :loop
  if (%i > 10) { set %i 1 | goto next }
  set %text %scroll.text. [ $+ [ %i ] ]
  if (%text != $null) {
    ;#Text not centered:
    ;drawtext -c %scroll.win %scroll.col %scroll.font 10 %scroll.row. [ $+ [ %i ] ] $window(%scroll.win).dw 20 %text
    ;#Text Centered: (Needs both lines)
    drawtext -cr %scroll.win $rgb(face) %scroll.font 0 %scroll.row. [ $+ [ %i ] ] $window(%scroll.win).dw 20 $str(%text,10)
    drawtext -c %scroll.win %scroll.col %scroll.font $_center(%text) %scroll.row. [ $+ [ %i ] ] $window(%scroll.win).dw 20 %text
    inc %i | goto loop
  }
  :next
  if (%i > 10) { goto end }
  dec %scroll.row. [ $+ [ %i ] ] 20 | inc %i | goto next
  :end | _gettexts
}
alias -l _Ptext2 {
  if ($mid(%scroll.text,%scroll.num,%scroll.num) != $null) { 
    ;#Text not centered:
    ;drawtext %scroll.win %scroll.col %scroll.font 10 %scroll.row $mid(%scroll.text,1,%scroll.num) 
    ;#Text Centered: 
    drawtext %scroll.win %scroll.col %scroll.font $_center(%scroll.text) %scroll.row $mid(%scroll.text,1,%scroll.num) 
    inc %scroll.num | return 
  } 
  else { _gettexts2 }
}
alias -l _center {
  var %center = $window(%scroll.win).dw - $width($1,$gettok(%scroll.font,1,32),$gettok(%scroll.font,2,32),0,0)
  return $round($calc(%center / 2),0)
}
alias -l _centerwin { return $calc(( [ $window(-1).w ] - $1) / 2)) $int($calc(( [ $window(-1).h ] - $2) / 2)) }
alias -l _refresh { 
  drawrect -fnr %scroll.win $rgb(face) 1 0 0 $window(%scroll.win).dw $window(%scroll.win).dh 
  return 
}
alias -l _getspace { return $str($chr(160),$1) }
menu @ScrollMen {
  sclick: .timerScroll off | window -c %scroll.win | unset %scroll.*
  &Exit: .timerScroll off | window -c %scroll.win | unset %scroll.*
}
on *:close:%scroll.win: .timerScroll off | window -c %scroll.win | unset %scroll.*
on *:load: {
  if ($version < 5.6) { echo -a 4Error:  $+ $colour(normal) $+ This Addon requires atleast mIRC 5.6 to function. | echo -a 11,1Download a newer version of mIRC at: http://www.mirc.co.uk/get.html | unload -rs intro.mrc | halt }
  echo -a Cool Texts v1.0
  echo -a By GoodNews (gh0st@home.se)
  echo -a $_getspace(1)
  echo -a Usage:
  echo -a /Scroll "End credits for a movie"
  echo -a /Typer "Text being typed"
}