mIRC Homepage

devoice myself

Posted By: FireBrick

devoice myself - 29/12/02 03:39 PM

A number of family members use mIRC to visit their favorite chat groups. We keep the #channels open and they are tiled.

I would like to be able to leave my chat room open but 'lock' the keyboard for that channel if I'm going to be away from the computer.
This way there wouldn't be the occasional error when someone typed into the wrong chat room screen.
I've looked at the 'lock' feature and that isn't exactly what I want.
I can't 'devoice' myself as I'm not an 'op' and my room is not moderated.

Can a hot key be created to disable typing into a channel and a password or hotkey to reenable typing.

I use mIRC every day, as do my family members and we are always forgetting and typing into the wrong rooms.

As always, Please and thank you
Posted By: Collective

Re: devoice myself - 29/12/02 03:50 PM

You can use a script like this to do such a thing:

on 1:INPUT:#channelnamehere:{
if ( %locked == 1 ) {
if ( $$?="This channel is locked, enter your password" != password ) {
echo -a Invalid password entered
halt
}
set %locked 0
echo -a Channel unlocked
}
}

Using that if you typed
Code:
/set %locked 1
whenever you left noone would be able to message #channelnamehere until the word "password" was entered into the edit box that would pop up if they tried.

Having said that it would be a ncie feature.
Posted By: Dana

Re: devoice myself - 29/12/02 03:51 PM

Code:
menu status {
  $iif($group(#locking).status == off,Lock,Unlock) : $iif($group(#locking).status == off,.enable #locking,.disable #locking)
}
#locking off
On *:INPUT:[color:red]#channel[/color]: echo -a *** Locked | halt
#locking end

Replace #channel with the name of the channel that you wish to be able to lock.
Posted By: FireBrick

Re: devoice myself - 29/12/02 04:18 PM

Ok I sort of understand the logic of the code.
but I'm not sure how to implement it.
I copy that code to say 'Remote'????

and how would I enter the word I want to be the password?

I'm really new at this.
Posted By: Collective

Re: devoice myself - 29/12/02 04:21 PM

Yes, copy the code to "Remotes". In the first line replace "#channelnamehere" with the name of your channel, and on the third line replace the second "password" with what you want the password to be.
Posted By: FireBrick

Re: devoice myself - 29/12/02 04:59 PM

Got it, thanks
It works with one teeny glitch

If I 'lock' it with the /set %locked 1 keystrokes and someone types something. It appears to be saved and after the unlock procedure is done the keystrokes saved are then sent to the channel.
So what I need to figure out is. If someone types into the 'locked' channel, it simply replies "This channel is locked" or some such, and erases from memory anything that was typed.

Did I make that clear?
Posted By: FireBrick

Re: devoice myself - 29/12/02 05:15 PM

Ooops, I spoke too soon.
It is NOT locking the keyboard.
I type
/set %locked 1

now I type 'test'
up pops the windows input request window
If I just hit enter without inserting any password, the window disappears and the channel is now unlocked.
What I typed to bring up the input window is now sent to the channel.
What did I do wrong?
Posted By: Collective

Re: devoice myself - 29/12/02 05:39 PM

You didn't do anything wrong, use this instead:

on 1:INPUT:#channelnamehere:{
if ( %locked == 1 ) {
if ( $?="This channel is locked, enter your password" != password ) {
echo -a Invalid password entered
halt
}
set %locked 0
echo -a Channel unlocked
}
}

Just added an extra $ by accident frown
Posted By: FireBrick

Re: devoice myself - 29/12/02 05:52 PM

Bingo
Removing that extra $ did it.
It still then sends whatever was typed while locked, but I can live with that.

I guess that proves the old adage that $ is the root of all evil???? crazy
Posted By: Collective

Re: devoice myself - 29/12/02 05:54 PM

To change that you can add an extra "halt" after "echo -a Channel unlocked".
Posted By: FireBrick

Re: devoice myself - 29/12/02 06:10 PM

and that worked too.
I did a little color so the echos stand out.
Can't thank you enough.
Give yourself a raise on my authority.
smirk
© 2020 mIRC Discussion Forums