mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
hello,

is it possible to set custom Message color for specific channel on channel panel? i want to keep red color for all channels, and disable it for one channel.

that's global option:

Click to reveal..


and i want to disable red color for one channel:

Click to reveal..

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
You can do this by adding this code into the Script Editor -> Remotes tab into a new file (File -> New) from menubar.

Place the channel name and when you hit the "F2" f-key from the keyboard it will mark it as read, also you can change the 'f2' to what ever f-key you want, or you can use it manually like: /markasread #CHANNEL

Code:

Code:
alias f2 { markasread #CHANNEL-NAME-HERE }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a channel! | return }
  if (!$window($1)) { echo 4 -a Error: The $qt($1) channel window does not exists! | return }
  window -g0 $qt($1)
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
thanks, westor!

not exactly what i wanted, but it's useful anyway.

Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
i just tested it. coupla questions, if you don't mind:

1. instead of using Script Editor, i put the contents of your script to markasread.mrc file, and placed it in mIRC directory. then i did /load -rs markasread.mrc, and script successfully loaded. is it correct method of installing the script?

2. it works fine - when i press F2, it marks channel read. but only inside the given network. is it possible to modify that script, so it will mark given channel read, even if the focus is on another network?

thanks again.

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
1. Yes the method is correct.

2. Yes use this method: /markasread NETWORK #channel

Code:

Code:
alias f2 { markasread IRC-NETWORK-HERE #CHANNEL-NAME-HERE }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  scon $1
  if ($window($2)) { window -g0 $qt($2) }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
thanks for quick reply, but when i hit F2 from any network, i'm receiving this error:

Quote:
* /window: invalid parameters (line 6, markasread.mrc)

Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
i see you updated the script.

i renewed it. i don't receive an error anymore, but nothing happens, when i press F2 now.

i tried two methods for naming the network:

1.
Code:
alias f2 { markasread GazelleGames #gazellegames }

(that's how this network Group is called in Servers)

2.
Code:
alias f2 { markasread GGn #gazellegames }

(that's how this network is listed in channels panel)

none of them work.

p.s.: i tested newer script with another network/channel, and there still nothing happens, when i'm pressing F2.

Last edited by abelenki; 15/03/16 02:34 PM.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Yes i was wrong, use this code:

Code:
alias f2 { markasread IRC-NETWORK-HERE #CHANNEL-NAME-HERE }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  var %t = $scon(0)
  while (%t) {
    if ($scon(%t).network == $1) { var %id = $scon(%t).cid }
    dec %t
  }
  if (!%id) { return }
  scid %id
  if ($window($2)) { window -g0 $qt($2) }
}


If you want to find the network you can use : //echo -a $network


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
Originally Posted By: westor
Yes i was wrong, use this code:

many thanks!! it works like a charm (i can mark the channel read from any network now)!

Quote:
If you want to find the network you can use : //echo -a $network

thanks, the correct name was GGn.

Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
i extended this script a little, so now i have keys F1-F4 for mark as read all 4 channels i'm sitting on:

Click to reveal..
Code:
alias f1 { markasread ForeverChat #retroroms }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  var %t = $scon(0)
  while (%t) {
    if ($scon(%t).network == $1) { var %id = $scon(%t).cid }
    dec %t
  }
  if (!%id) { return }
  scid %id
  if ($window($2)) { window -g0 $qt($2) }
}

alias f2 { markasread EFNet #messdev }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  var %t = $scon(0)
  while (%t) {
    if ($scon(%t).network == $1) { var %id = $scon(%t).cid }
    dec %t
  }
  if (!%id) { return }
  scid %id
  if ($window($2)) { window -g0 $qt($2) }
}

alias f3 { markasread GGn #gazellegames }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  var %t = $scon(0)
  while (%t) {
    if ($scon(%t).network == $1) { var %id = $scon(%t).cid }
    dec %t
  }
  if (!%id) { return }
  scid %id
  if ($window($2)) { window -g0 $qt($2) }
}

alias f4 { markasread Mibbit #khui }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  var %t = $scon(0)
  while (%t) {
    if ($scon(%t).network == $1) { var %id = $scon(%t).cid }
    dec %t
  }
  if (!%id) { return }
  scid %id
  if ($window($2)) { window -g0 $qt($2) }
}


also, i added Mark channels as read option to popups.ini, so i can mark all channels read via right-click menu:

Click to reveal..
Code:
[mpopup]
n20=Mark channels as read:/markasread ForeverChat #retroroms | /markasread EFNet #messdev | /markasread GGn #gazellegames | /markasread Mibbit #khui


thanks again, westor!

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Good, but you don't need to copy the alias markasread {} every time, 1 is enough to do the job!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
Originally Posted By: westor
Good, but you don't need to copy the alias markasread {} every time, 1 is enough to do the job!

thanks, i'll try that.

Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
is it correct now?

Click to reveal..
Code:
alias f1 { markasread ForeverChat #retroroms }
alias f2 { markasread EFNet #messdev }
alias f3 { markasread GGn #gazellegames }
alias f4 { markasread Mibbit #khui }
alias markasread {
  if (!$1) { echo 4 -a Error: Please specify a network! | return }
  if (!$2) { echo 4 -a Error: Please specify a channel! | return }
  var %t = $scon(0)
  while (%t) {
    if ($scon(%t).network == $1) { var %id = $scon(%t).cid }
    dec %t
  }
  if (!%id) { return }
  scid %id
  if ($window($2)) { window -g0 $qt($2) }
}


seems to be working fine.

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Yes it's correct, well done!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2016
Posts: 16
Pikka bird
OP Offline
Pikka bird
Joined: Feb 2016
Posts: 16
Originally Posted By: westor
Yes it's correct, well done!

thank you. wink


Link Copied to Clipboard