mIRC Home    About    Download    Register    News    Help

Print Thread
#83062 15/05/04 03:40 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
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

Code:
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
}


Need amazing web design for low price: http://www.matrixn3t.net
#83063 15/05/04 03:51 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
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
#83064 15/05/04 03:55 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
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 ;/


Need amazing web design for low price: http://www.matrixn3t.net
#83065 15/05/04 06:59 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Code:
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.

#83066 15/05/04 07:20 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
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 ;/


Need amazing web design for low price: http://www.matrixn3t.net
#83067 15/05/04 07:25 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Check your font too, that can affect alignment.
Code:
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.

#83068 15/05/04 11:49 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
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 ;/


Need amazing web design for low price: http://www.matrixn3t.net
#83069 16/05/04 03:56 AM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Code:
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.

#83070 16/05/04 04:36 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
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)


Need amazing web design for low price: http://www.matrixn3t.net

Link Copied to Clipboard