iPeer

Untitled

Apr 5th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.09 KB | None | 0 0
  1. alias resolutions {
  2.   if (!$3) { echo 4 -tg Invalid arguments! /resolutions STEPS WIDTH_RATIO HEIGHT_RATIO [STARTING_RESOLUTION] | echo 4 -tg EX: /resolutions 5 16 9 1024 | halt }
  3.   var %steps $1
  4.   var %WIDTH_RATIO $2
  5.   var %HEIGHT_RATIO $3
  6.   var %width $iif($4, $v1 - %WIDTH_RATIO, 0)
  7.  
  8.   if (!$window(@Resolutions)) {
  9.     ; Tabs: Num, Resolution, Pixels
  10.     window -e -t10,30,70 @Resolutions
  11.   }
  12.   if ($line(@Resolutions, 0) > 0) {
  13.     echo -g @Resolutions $chr(160)
  14.   }
  15.   else {
  16.     aline @Resolutions $+(ID,$chr(9),Resolution,$chr(9),Pixels)
  17.   }
  18.  
  19.   ;echo -g @Resolutions Listing %steps resolutions for $+(%WIDTH_RATIO,:,%HEIGHT_RATIO) $iif(%width > 0,starting at $calc(%width + %WIDTH_RATIO),)
  20.   var %lastheight = 0
  21.   var %stepnum = 1
  22.   var %height 0
  23.  
  24.   while (%stepnum <= %steps) {
  25.     inc %width %WIDTH_RATIO
  26.     %height = $calc(%width / %WIDTH_RATIO * %HEIGHT_RATIO)
  27.  
  28.     if (%lastheight != %height) {
  29.       aline @Resolutions $+(%stepnum,$chr(9),%width $+ x $+ %height,$chr(9),$bytes($calc(%width * %height),b))
  30.       %lastheight = %height
  31.       inc %stepnum
  32.     }
  33.  
  34.   }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment