mIRC Home    About    Download    Register    News    Help

Print Thread
#3943 29/12/02 03:39 PM
Joined: Dec 2002
Posts: 26
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
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

#3944 29/12/02 03:50 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

#3945 29/12/02 03:51 PM
Joined: Dec 2002
Posts: 144
D
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
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.


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
#3946 29/12/02 04:18 PM
Joined: Dec 2002
Posts: 26
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
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.

#3947 29/12/02 04:21 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

#3948 29/12/02 04:59 PM
Joined: Dec 2002
Posts: 26
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
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?

#3949 29/12/02 05:15 PM
Joined: Dec 2002
Posts: 26
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
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?

#3950 29/12/02 05:39 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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

#3951 29/12/02 05:52 PM
Joined: Dec 2002
Posts: 26
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
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

#3952 29/12/02 05:54 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
To change that you can add an extra "halt" after "echo -a Channel unlocked".

#3953 29/12/02 06:10 PM
Joined: Dec 2002
Posts: 26
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
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


Link Copied to Clipboard