mIRC Home    About    Download    Register    News    Help

Print Thread
#101609 26/10/04 04:03 PM
Joined: Mar 2003
Posts: 160
Marantz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2003
Posts: 160
i've used this alias as the most simplistic way i can, for aligning and getting the mode prefix from myself and other nicks, when typing.

Code:
 alias xnick1 {
  var %a $iif($2,$2,$chan),%b $iif($1 !isreg %a,$left($nick(%a,$1).pnick,1)) $+ $1
  return $str(ÿ,$calc(21 - $len(%b))) $+ $iif($1 !isreg %a,$+(00,$left(%b,1),06,$mid(%b,2,20)),$+(06,$mid(%b,1,21)))
} 


thing is, now i want to extract the actualy mode prefix itself ie;
the @ . ~ % & + or whatever, so i can move it over and seperate the nickname from the prefix for a theme idea i have, not sure how to extract just the mode though.. any ideas would be great.

Last edited by Marantz; 26/10/04 04:05 PM.
#101610 26/10/04 07:14 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Looking at your4 script I see:

var %a $iif($2,$2,$chan),%b $iif($1 !isreg %a,$left($nick(%a,$1).pnick,1)) $+ $1

Boldfaced to stand out - that section would return JUST the prefix


Those who fail history are doomed to repeat it
#101611 27/10/04 09:57 AM
Joined: Mar 2003
Posts: 160
Marantz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2003
Posts: 160
Ok thanks, now i got that sorted, i ran into a snag. my theme is aligned
looks something like

10:00am |~| Marantz: hi

trouble is, if the user has no mode it puts it out of line
some how i need it to fill with a - or a ? just something that will keep it aligned when the user has no mode. frown

#101612 27/10/04 10:12 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
SO why not something simple like:

if ($left($nick(%a,$1).pnick,1) == $null) { use your theme here and use | $+ $chr(160) $+ | }

That way it'll add a hard space (I believe it's called) and keep it uniform? Just a thought


Those who fail history are doomed to repeat it
#101613 27/10/04 10:27 AM
Joined: Mar 2003
Posts: 160
Marantz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Mar 2003
Posts: 160
that's what i thought, but it won't ever be $null because it takes the $left
so it will always choose the first letter of the nickname if the user has no mode lol

#101614 27/10/04 12:35 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
very true HOWEVER, you COULD do something like:

if ($left($nick(%a,$1).pnick,1) !isalnum) { use your theme here and use | $+ $chr(160) $+ | }

Which would check to see if the first digit is a letter and/or number smile Then if it's not, (which rules out MOST nicknames right there).................... try /help isnum (and the others listed there) for more ideas


Those who fail history are doomed to repeat it

Link Copied to Clipboard