mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2003
Posts: 40
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2003
Posts: 40
Hi there,
the following script lines are 5 yrs old and function well except one thing.

First I got to say that I did not write that thing myself all alone and I had help from others. My own knowledge is not so huge.

The *bug* in the script is when it's loaded then UTF8 won't be displayed. The script is to display a few own styles to have a better overview while reading. It helped me for so long and I would like to keep it.

Can someone tell me what it is that avoids UTF8 display?

Here are the code lines:

Code:
;Nickchange
on ^*:NICK: {
  var %chan = 1
  while ($comchan($newnick, %chan)) {
    /echo -ti2 $ifmatch 10.:Nickchange:. $bold($nick) is now known as  $bold($newnick)
    /inc %chan
  }
  /haltdef
}

;Quit
on ^*:QUIT: {
  var %chan = 1
  while ($comchan($nick, %chan)) {
    /echo -ti2 $ifmatch 12.:Quits:. $bold($nick) ( $+ $address $+ ) ( $+ $1- $+ )
    /inc %chan
  }
  /haltdef
}

;Part
on ^*:PART:#: {
  /echo -ti2 $chan 12.:Parts:. $bold($nick) has parted ( $+ $address $+ )
  /haltdef
}

;Action jemand anderes
on ^*:ACTION:*:#: {
  echo -t $chan 8.:Action:. »» $bold($nick) $1-
  haltdef
}

;Action /me
on ^*:ACTION:*:?: {
  echo -t $nick 8.:Action:. »» $bold($nick) $1-
  haltdef
}

;Channel Join
on ^*:JOIN:#: {
  /echo -ti2 $chan 10.:Joins:. $bold($nick) ( $+ $address $+ )
  /haltdef
}


;Topicchange
on ^*:TOPIC:#: {
  /echo -ti2 $chan 7.:Topic:. $1-
  /echo -ti2 $chan Set by: $bold($nick)
  /haltdef
}

;Mode event
on ^*:MODE:#: {
  /echo -ti2 $chan 14.:Mode:. $bold($nick) changed mode to $1-
  /haltdef
}

;Voice
on ^*:VOICE:#: {
  /echo -ti2 $chan 3.:Voice:. $nick sets +v $bold($vnick)
  /haltdef
}

;Devoice
on ^*:DEVOICE:#: {
  /echo -ti2 $chan 7.:Devoice:. $nick sets -v $bold($vnick)
  /haltdef
}

;Halfop
on ^*:HELP:#: {
  /echo -ti2 $chan 3.:HOP:. $nick sets +h $bold($hnick)
  /haltdef
}

;De Halfop
on ^*:DEHELP:#: {
  /echo -ti2 $chan 7.:DeHOP:. $nick sets -h $bold($hnick)

  /haltdef
}

;Op
on ^*:OP:#: {
  /echo -ti2 $chan 3.:OP:. $nick sets +o $bold($opnick)
  /haltdef
}

;DeOP
on ^*:DEOP:#: {
  /echo -ti2 $chan 7.:DeOP:. $nick sets -o $bold($opnick)
  /haltdef
}

;Kick
on ^*:KICK:#: {
  /echo -ti2 $chan 4.:Kick:. $bold($knick) was kicked by $nick ( $+ $1- $+ )
  /haltdef
}

;Ban
on ^*:BAN:#: {
  /echo -ti2 $chan 4.:Banned:. $bold($bnick) $banmask banned by $nick
  /haltdef
}

;Unban
on ^*:UNBAN:#: {
  /echo -ti2 $chan 3.:Unbanned:. $bold($bnick) $banmask unbanned by $nick
  /haltdef
}

;Notice
on ^*:notice:*:*: {
  if ($nick == operserv) { echo -a $timestamp 7.:Operserv:. $1- | haltdef }
  if ($nick == chanserv) { echo -a $timestamp 7.:Chanserv:. $1- | haltdef }
  if ($nick == nickserv) { echo -a $timestamp 7.:Nickserv:. $1- | haltdef }
  if ($nick == memoserv) { echo -a $timestamp 7.:Memoserv:. $1- | haltdef }
  if ($nick == hostserv) { echo -a $timestamp 7.:Hostserv:. $1- | haltdef }
  if ($nick == botserv) { echo -a $timestamp 7.:Botserv:. $1- | haltdef }
  if ($nick == helpserv) { echo -a $timestamp 7.:Helpserv:. $1- | haltdef }
  if ($nick == nightowl.dyn.ee) { echo -a $timestamp .:Server:. $1- | haltdef }
  if ($+(*,$nick,*) !iswm operservchanservnickservmemoservhostservbotserv) { echo -a $timestamp 7.:Notice:.  $+ $nick $+  $1- | haltdef }
  splay -cw sounds/notice.wav
}

;Servernotice
on ^*:snotice:*:*: {
  if ($nick == operserv) { echo -a $timestamp 7.:Operserv:. $1- | haltdef }
  if ($nick == chanserv) { echo -a $timestamp 7.:Chanserv:. $1- | haltdef }
  if ($nick == nickserv) { echo -a $timestamp 7.:Nickserv:. $1- | haltdef }
  if ($nick == memoserv) { echo -a $timestamp 7.:Memoserv:. $1- | haltdef }
  if ($nick == hostserv) { echo -a $timestamp 7.:Hostserv:. $1- | haltdef }
  if ($nick == botserv) { echo -a $timestamp 7.:Botserv:. Botserv: $1- | haltdef }
  if ($nick == helpserv) { echo -a $timestamp 7.:Helpserv:. $1- | haltdef }
  if ($nick == nightowl.dyn.ee) { echo -a $timestamp .:Server:. $1- | haltdef }
  if ($+(*,$nick,*) !iswm operservchanservnickservmemoservhostservbotserv) { echo -a $timestamp 7.:Notice:.  $+ $nick $+  $1- | haltdef }
}

;Whois
raw 311:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 378:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 307:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 319:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 312:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 301:*:echo -a $timestamp 4.:Away:.  $2- | haltdef
raw 313:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 320:*:echo -a $timestamp 4.:Whois:. $2- | haltdef
raw 317:*: { 
  echo -a $timestamp 4.:Idle Time:. $duration($3) | haltdef
  echo -a $timestamp 4.:Signed On:. $asctime($4) | haltdef
  echo -a $timestamp 4.:Duration:. $duration($calc($ctime - $4)) | haltdef
}
raw 310:*:echo -a $timestamp 4.:Help:. $2- | haltdef
raw 318:*:echo -a $timestamp 4.:Whois:. $2- | haltdef

;Whowas
raw 406:*:echo -a $timestamp 4.:Whowas:. $2- | haltdef
raw 314:*:echo -a $timestamp 4.:Whowas:. $2- | haltdef
raw 312:*:echo -a $timestamp 4.:Whowas:. $2- | haltdef
raw 369:*:echo -a $timestamp 4.:Whowas:. $2- | haltdef

;Who
raw 352:*:echo  $timestamp 4.:Who:. $2- | haltdef

;Topic 32 ist Topic 33 der Setzer
raw 333:*:echo -a $timestamp 4.:Topic:. Set by $3 on $asctime($4) | haltdef
raw 332:*:echo -a $timestamp 4.:Topic:.  $3-  | haltdef

;aliases
alias me echo -ta 8.:Action:. »» $bold($me) $1- | .me $1-
alias bold { return $chr(2) $+ $1- $+ $chr(2) }



; <Nick> common
on ^*:TEXT:*:#:{
  echo -tml # 0«0 $+ $nick(#,$nick).pnick $+ 0» $1-
  haltdef
}

;own Nick 
on ^*:TEXT:*:*:{
  var %nick = $iif($chan,$left($remove($nick($chan,$nick).pnick,$nick),1) $+ $nick,$nick)
  var %window = $iif($chan,$chan,$nick)
  echo -tmi2 %window 0«0 $+ %nick $+ 0» $1-
  haltdef
}

;own nick in query
on *:INPUT:*: {
  if (($left($1,1) == / || $left($1,1) == $readini($mircini,text,commandchar)) && (!$ctrlenter)) return
  .msg $active $1-
  var %nick = $iif($chan,$left($remove($nick($chan,$nick).pnick,$nick),1) $+ $nick,$nick)
  echo $color(own) -atmi2 0«0 $+ %nick $+ 0» $1-
  halt
}



Thanks for help in advance smile

regards
NiGHtowL



gr33tz
NiGHtOwL
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
alias bold { return $chr(2) $+ $1- $+ $chr(2) }


Try using $utfencode($chr(2)).

Joined: May 2003
Posts: 40
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2003
Posts: 40
I am sorry. Pls can you explain it a bit better... I don't know where and what. Can you give a bit more of an example and where I got to do this in the whole script.

As I said, I don't know much about it.


gr33tz
NiGHtOwL
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
There are a few locations in the script where $bold is used.

As $bold is not part of the mIRC identifiers, it has to be called from an alias.

Just add the alias, as posted, to the end of the current script, so the $bold will actually put the information into bold.

Without the alias, you should get error an error message the first time the script encounters the $bold identifier.

Joined: May 2003
Posts: 40
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2003
Posts: 40
Hi RusselB,
thanks for your answer. I don't get it. I have to replace a line? I have to add a line? As I said, please, I do not know what to do.

It would be very helpful to just say:

Go line so and so in your script and replace this with that and/or add a line thisAndThatexactly.

Please understand that I had help from 2 People 5 years ago getting these lines together. I never needed that again. It helped me until today and until I joined 2 channels where ppl are in using UTF8. It gives me a real headache.

DJ_Sol said:

alias bold { return $chr(2) $+ $1- $+ $chr(2) }


Try using $utfencode($chr(2)).

so I write at the end of the script $utfencode($chr(2))?

Please, I do not understand mirc scripting at all.

Last edited by NiGHtOwL; 17/12/08 03:26 AM.

gr33tz
NiGHtOwL
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) Remove the line that you entered that reads
Code:
$utfencode($chr(2))

2) Replace the line
Code:
alias bold { return $chr(2) $+ $1- $+ $chr(2) }
with
Code:
alias bold { return $utfencode($chr(2)) $+ $1- $+ $utfencode($chr(2)) }


Joined: May 2003
Posts: 40
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2003
Posts: 40
Thank you for your help, but sorry it doesn't work.

I did like you wrote last.

Code:
alias me echo -ta 8.:Action:. »» $bold($me) $1- | .me $1-
alias bold { return $utfencode($chr(2)) $+ $1- $+ $utfencode($chr(2)) }



Maybe my question was misunderstood.

I try again. The above posted script is loaded and avoids that I can read utf8 characters from others. (my settings in mirc are Display) which means when others write german vowels like ä ü ö with UTF8 charset I recieve weird letters.

When the script is unloaded, then I can read the ä ü ö normal.
It is all about being able to read what others write and it must be due these script lines. Unfortunatly I don't understand mirc script at all. Sorry.

Any other ideas?

Thanks for help again

Last edited by NiGHtOwL; 17/12/08 05:21 AM.

gr33tz
NiGHtOwL
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Edit:
My fix was just for nicknames.

Make sure mirc is updated. This problem may have been fixed already.

When you echo text, you will need to $utfencode($1-) all of it.

Code:
on ^*:TEXT:*:#:{
  echo -tml # 0«0 $+ $nick(#,$nick).pnick $+ 0» $utfencode($1-)
  haltdef
}

raw 319:*:{ echo -a $timestamp 4.:Whois:. $utfencode($2-) | haltdef }


Here are some examples.

Joined: May 2003
Posts: 40
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2003
Posts: 40
Thank you, that is very kind of you.

I hope I can figure out all the parts myself where to change it.

Would it be too much to ask if you could change my lines from the first post? I guess I need hours for it and I am often not sure where and what.

So everyone got things he can do top. You are a top coder, I am not.

That for I am a top photographer ;-)

Hey all, thanks for your patience with me.

//edit
I try really hard and I mess all up here because $1 $3 and what else means nothing to me. I just don't get iet where and what and how to change. Yes, there are examples in the above post but sorry, I just can't do it myself.

Could anyone please try and post it here?

I ask myself if echo text ok... but all I did long time ago was alter it for me so I could see nicknames in bold and so on. What has that to do with the text others write to me?

I am sorry, this is all a bit too much for me.

Last edited by NiGHtOwL; 17/12/08 07:01 AM.

gr33tz
NiGHtOwL
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Read the help file on $1- if $1 and $3 mean nothing to you, type /help $1- in mIRC.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: May 2003
Posts: 40
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2003
Posts: 40
I got it!

And you know what it was? As I said... I can read what I write in mIRC but I couldn't read the UTF8 Users.

DJ_Sol came up with $utfencode and explained everything well and it didn't work for me.

Got me thinking and then I thought utfencode... that is when I write something, but that was not my problem. The problem was with decoding. I changed it now to $utfdecode and guess what, it works!

Thanks anyway for leading me to the right thing and for your patience.



gr33tz
NiGHtOwL

Link Copied to Clipboard