Blocks is the result of me screwing around with isometric rendering. Enjoy.
Updates:
Unsets leftover variable after being closed.
Optimized a bit.
;Blocks 1.02
;Made by BlueThen on December 4, 2008.
;To install, paste this script into your remotes (alt + r)
;Then, type /blocks or right click the channel or status and click "Blocks"
;Control with cursor.
alias Blocks {
window -paozCdk0 +fbnL @Blocks -1 -1 400 400
window -paohCzdk0 +ndL @Blocks.buf -1 -1 800 800
window -paohCzdk0 +ndL @Blocks.pie -1 -1 100 100
drawfill @Blocks.buf 1 1 1 1
drawcopy @Blocks.buf 0 0 800 800 @blocks 0 0 400 400
set %blocks.t1 drawline @blocks.pie 1 2
}
menu channel,status {
Blocks: {
blocks
}
}
alias -l blocks.frame {
clear @blocks.buf
drawfill @Blocks.buf 1 1 1 1
%blocks.x = 1
while (%blocks.x <= 5) {
%blocks.y = 1
while (%blocks.y <= 5) {
blocks.db $blocks.gd($1, $2, $calc((((120* %blocks.x) +100) - ((120* %blocks.y) +100)) *0.894154 +400), $calc((((120* %blocks.x) +100) + ((120* %blocks.y) +100)) *0.447759 -55)) $calc((((120* %blocks.x) +100) - ((120* %blocks.y) +100)) * 0.894154 +300) $calc((((120* %blocks.x) +100) + ((120* %blocks.y) +100)) * 0.447759 -200)
inc %blocks.y
}
inc %blocks.x
}
drawtext -o @Blocks.buf 14 Georgia 40 234 640 Made by BlueThen
drawtext -o @Blocks.buf 15 Georgia 40 228 680 www.bluethen.com
drawcopy @Blocks.buf 0 0 800 800 @blocks 0 0 400 400
}
alias -l blocks.db {
clear @blocks.pie
drawfill -r @blocks.pie 16711935 16711935 1 1
set %blocks.h $iif($calc((900 / $1) * 3 + 10) < 40, $v1, $v2)
%blocks.t2 = $calc(64.8 - %blocks.h)
%blocks.t3 = $calc(42.4 - %blocks.h)
%blocks.t4 = $calc(87.2 - %blocks.h)
%blocks.t1 5.3 64.8 50 87.2
%blocks.t1 50 87.2 94.7 64.8
%blocks.t1 5.3 64.8 5.3 %blocks.t2
%blocks.t1 50 87.2 50 %blocks.t4
%blocks.t1 94.7 64.8 94.7 %blocks.t2
%blocks.t1 50 %blocks.t3 94.7 %blocks.t2
%blocks.t1 50 %blocks.t3 5.3 %blocks.t2
%blocks.t1 5.3 %blocks.t2 50 %blocks.t4
%blocks.t1 50 %blocks.t4 94.7 %blocks.t2
drawfill @blocks.pie 15 1 85 62
drawfill @blocks.pie 14 1 11 62
drawfill @blocks.pie 0 1 50 40
drawcopy -t @blocks.pie 16711935 0 0 95 95 @blocks.buf $2 $3 228 228
}
menu @blocks {
mouse: {
blocks.frame $calc($mouse.x *2) $calc($mouse.y *2)
}
}
on *:close:@blocks: {
window -c @blocks.buf
window -c @blocks.pie
unset %blocks.*
}
alias -l blocks.gd return $sqrt($calc(($3 - $1)^2 + ($4 - $2)^2))
Ok, I did that. But really, that's not even half the lag. The lag comes from all the drawcopying from one window to another. You see, I can't really do individual solid shapes because when they overlap, the drawfill wouldn't fill all the way. So I had to have it create each individual block in a seperate window, then drawcopy it.
Works okay here. You could be able to cut down on the speed by replacing reoccurring calculations with variables. This: $calc(64.7759 - %blocks.h) is done over and over, so mIRC needs to parse every $calc() over and over. If you set it in the beginning as, say var %c1 = $calc(64.7759 - %blocks.h) then just replace every instance of that calculations with %c1, it will cut down parsing time. This is the same for all of the repetitive calculations. Anyways, hope this helps.
Thanks for the feedback, people. Just to let you know, http://bluethen.com is back up, so visit it and register if you haven't already. Also, start posting some more! I'd like to see some people releasing their scripts and snippets there.