;###########################
;# Binary God V2.0 #
;# Made by DeathfireD 1/3/04 #
;###########################
;[binclock]
alias bc.start {
.timerbc -m 0 100 bc.drawtime
window -pk0od +ft @BinaryClock -1 -1 260 104
}
alias bc.drawtime {
if ($window(@BinaryClock) == $null) {
.timerbc off
halt
}
drawrect -nf @BinaryClock 0 1 1 1 180 200
set %bc.tfmt 243434444
set %bc.i 1
while (%bc.i <= $len(%bc.tfmt)) {
set %bc.z $mid(%bc.tfmt, %bc.i, 1)
while (%bc.z) {
bc.bit $bc.getbit(%bc.i, %bc.z) %bc.i %bc.z
dec %bc.z
}
inc %bc.i
}
bc.drawblobs
; Update the display
drawdot @BinaryClock
;drawtext @BinaryClock 4 Arial 10 10 65 $time - $gettok($calc($ticks / 1000),2,$asc(.))
unset %bc.*
}
alias bc.bit {
set %bc.active 2
if ($1 == 1) set %bc.active 4
set %bc.dist 0
if ($2 > 2) inc %bc.dist 20
if ($2 > 4) inc %bc.dist 20
if ($2 > 6) inc %bc.dist 20
inc %bc.dist $calc(($2 * 20) - 10)
set %bc.top $calc(70 - ($3 * 15))
drawrect -nf @BinaryClock %bc.active 1 %bc.dist %bc.top 10 10
}
alias bc.drawblobs {
drawrect -nf @BinaryClock 2 1 52 20 5 5
drawrect -nf @BinaryClock 2 1 52 45 5 5
drawrect -nf @BinaryClock 2 1 112 20 5 5
drawrect -nf @BinaryClock 2 1 112 45 5 5
drawrect -nf @BinaryClock 2 1 172 20 5 5
drawrect -nf @BinaryClock 2 1 172 45 5 5
}
alias bc.getbit {
if ($1 <= 6) {
set %bc.time $left($time,2) $+ $mid($time,4,2) $+ $right($time,2)
set %bc.val $mid($revstr($base($mid(%bc.time,$1,1),10,2)), $2, 1)
}
else {
set %bc.time $gettok($calc($ticks / 1000),2,$asc(.))
set %bc.val $mid($revstr($base($mid(%bc.time,$calc($1 - 6),1),10,2)), $2, 1)
}
if (%bc.val == $null) set %bc.val 0
return %bc.val
}
;reverse a string. used to reverse the bits into an easier order to 'use' them
alias revstr {
set %bc.str $len($1)
set %bc.ret
while (%bc.str) {
set %bc.ret %bc.ret $+ $mid($1, %bc.str,1)
dec %bc.str
}
return %bc.ret
}
menu channel,status {
Binary
.Binary Clock: bc.start
}
;[Bingod starts here]
dialog bin2new {
title "Binary God V2.0"
size -1 -1 160 120
option dbu
box "Binary God V2.0", 1, 1 3 157 114
edit "================================================Binary God V2.0 By: DeathfireD ================================================Special thanks to the mIRC.com message board team and Gene from okatu-chat. Without them I wouldent have gotten the script done and tested. If you feel you can help in anyway click the send feedback button and tell me what you can do/fix.", 2, 6 13 148 59, read multi
button "Exit", 3, 6 107 37 7, ok
link "www.o-cmembers.cjb.com", 4, 88 107 65 8
text "Please send me your feedback.", 5, 42 73 77 8
button "Click to Send me feedback", 6, 48 83 68 7
}
alias bin2new { dialog -md bin2new bin2new }
on *:dialog:bin2new:sclick:*:{
if $did == 6 { run mailto:DJOrdway@adelphia.net?subject=Binary God v1.0 input }
if $did == 4 { run
http://www.o-cmembers.cjb.net }
}
alias bin.decode {
var %temp = $1-
var %output
while (%temp) {
var %char = $chr($base($left(%temp,8),2,10))
%output = %output $+ $iif(%char == $chr(32),$chr(1),%char)
%temp = $right(%temp,-8)
}
return $replace(%output,$chr(1),$chr(32))
}
alias bin.encode {
var %output
var %temp = $1-
while (%temp) {
%output = %output $+ $base($asc($left(%temp,1)),10,2,8)
%temp = $right(%temp,-1)
}
return %output
}
menu channel,Query {
-
binary
.Say Something in Binary:.msg # $bin.encode($$input(Enter your text.,e)) | echo -a < $+ $me $+ @binon> $!
.Info About Binary God
..about:/bin2new
}
menu Status {
-
Binary
..Info About Binary God
...about:bin2new
}
on 1:INPUT:?:{
if $left($1,1) isin 01 {
.msg # $1-
echo -a $+(<,$me,@binon>) $bin.decode($1-)
halt }
}
on *:INPUT:#:{
if $left($1,1) isin 01 {
.msg # $1-
echo -a $+(<,$me,@binon>) $bin.decode($1-)
halt }
}
on $1^:text:/^[01 ]+$/:?:{
echo -mbflirt $nick $+(<,$nick,@binon>) $bin.decode($1-)
haltdef
}
on $*^:text:/^[01 ]+$/:#:{
echo -mbflirt # $+(<,$nick,@binon>) $bin.decode($1-)
haltdef
}
on 1:LOAD:/echo 12Binary God V2.0 Script By DeathfireD Loaded!
on 1:UNLOAD:/echo 4Binary God V2.0 Script By DeathfireD Unloaded!
}