|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 397 |
hi i kinda wrote this in a bit of a rush but i cant figur out what is wrong w/ this and why it wont align the | right accordingly
on *:text:*:*: {
echo $chan ¬ $+ $timestamp $chr(124) $lev($chan, $nick) $chr(124) $1-
haltdef
}
;; spaceing aliases
alias lev {
var %total = $chan($chan)
var %a = 1
set %bnick $nick($1, %a)
while $nick($1, %a) {
var %bnickL = $len($nick($1, %a))
if (%bnickL >= $len(%bnick)) { set %bnick $nick($1, %a) }
inc %a 1
}
if ($2 isop $1) var %temp %temp $+ $+ %CopColor $+ @
if ($2 isaop $1) var %temp %temp $+ $+ %CaopColor $+ &
if ($2 ishop $1) var %temp %temp $+ $+ %ChopColor $+ %
if ($2 isvoice $1) var %temp %temp $+ $+ %CvoiceColor $+ +
;;create a str length
var %strlen = $calc($2 - $len(%bnick))
echo :: %strlen
return %temp $+ $2 $+ $str($chr(160), %strlen)
;;unset the biggest nick
unset %bnick
}
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Well i doubt this is your problem, but you have to unset %bnick before you /return a value.
New username: hixxy
|
|
|
|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 397 |
thats not the problem i want it to line up the | lines in the echo the whole point of that alias is to create the spaces needed to make it all align properly ;/
|
|
|
|
Joined: Aug 2003
Posts: 325
Fjord artisan
|
Fjord artisan
Joined: Aug 2003
Posts: 325 |
on *:text:*:*:{ echo $chan $+(¬,$timestamp) $chr(124) $lev $chr(124) $1- | haltdef }
;; spacing aliases
alias lev {
var %a = $nick($chan,0), %blen, %blen2
while (%a) { %blen2 = $len($nick($chan, %a)) | if (%blen2 > %blen ) { %blen = %blen2 } | dec %a }
if ($nick isop $chan) var %temp = $+(%temp,,%CopColor,@)
elseif ($nick isaop $chan) var %temp = $+(%temp,,%CaopColor,&)
elseif ($nick ishop $chan) var %temp = $+(%temp,,%ChopColor,%)
elseif ($nick isvoice $chan) var %temp = $+(%temp,,%CvoiceColor,+)
;echo :: %blen
return $+(%temp,$nick,$str($chr(160), %blen))
} See if that works for you.
|
|
|
|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 397 |
erm.... it didnt work right.....
¬03:18:30 pm | 4@ATMA | test ¬03:18:52 pm | 4@MTexcedf4 | pofs
thats what it outputs ;/
|
|
|
|
Joined: Aug 2003
Posts: 325
Fjord artisan
|
Fjord artisan
Joined: Aug 2003
Posts: 325 |
Check your font too, that can affect alignment. on *:text:*:*:{ echo $chan $+(¬,$timestamp) $chr(124) $lev $chr(124) $1- | haltdef }
;; spacing aliases
alias lev {
var %a = $nick($chan,0), %blen, %blen2
while (%a) { %blen2 = $len($nick($chan, %a)) | if (%blen2 > %blen ) { %blen = %blen2 } | dec %a }
if ($nick isop $chan) var %temp = $+(%temp,,%CopColor,@)
elseif ($nick isaop $chan) var %temp = $+(%temp,,%CaopColor,&)
elseif ($nick ishop $chan) var %temp = $+(%temp,,%ChopColor,%)
elseif ($nick isvoice $chan) var %temp = $+(%temp,,%CvoiceColor,+)
else var %temp = $+(%temp,$chr(160))
return $iif($nick,$+(%temp,$nick,$str($chr(160),%blen)),%blen)
} Try that, and in the room, type in //echo $lev - it should return a value to you. If not, then there is another problem to figure out.
|
|
|
|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 397 |
yes i know that the font can effect it i have a font picked all ready so it will line up right ;/
|
|
|
|
Joined: Aug 2003
Posts: 325
Fjord artisan
|
Fjord artisan
Joined: Aug 2003
Posts: 325 |
on ^*:text:*:#:{ echo $chan $+(¬,$timestamp) $+(| $lev |) $1- | haltdef }
;; spacing aliases
alias lev {
var %a = $nick($chan,0), %\s = $str($chr(160),80), %len, %len2
while (%a) { %len2 = $len($nick($chan,%a)) | if (%len2 > %len || !%len) { %len = %len2 } | dec %a }
if ($nick isop $chan) var %temp = $+(%temp,,%CopColor,@)
elseif ($nick isaop $chan) var %temp = $+(%temp,,%CaopColor,&)
elseif ($nick ishop $chan) var %temp = $+(%temp,,%ChopColor,%)
elseif ($nick isvoice $chan) var %temp = $+(%temp,,%CvoiceColor,+)
else var %temp = $+(%temp,$chr(160))
return $iif($nick,$+(%temp,$left($+($nick,%\s),%len)),%len)
} That should do it.
|
|
|
|
Joined: Dec 2002
Posts: 397
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 397 |
srry i forgot to post update but it is fixed and works fine now ;p was also crunched down in bytes (more of a plus ;p)
|
|
|
|
|