|
Joined: May 2005
Posts: 12
Pikka bird
|
OP
Pikka bird
Joined: May 2005
Posts: 12 |
Right now, when I use tab completion mIRC doesn't put a : at the end of the word. How do I make mirc do so?
I mean: when I expand g-tab and get guy, i'd like to get guy: instead.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Here's an example of how it can be done, it's not too accurate but you may be able to improve slightly.. -Andy
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
As far as i know there is no way to trigger an action on a keypress in a normal window such as a channel (apart from the built in control, shift and function key support). There is an on keydown and on keyup which could do it but the events work only in custom windows. What you may have to do is use an on input event. Script this event to check if $1 (first word) is a nickname in the channel the text is being input to (or matches query nick in query) and replace nick with nick: something like... keep in mind this code is untested, and if i recall correctly you do not need to specify the output location with the /say command when used in an on input, but i could be wrong. on *:INPUT:*: {
if ($chan) {
; in channel
if ($1 ison $chan) { say $1 $+ : $2- }
else {
; in query
if ($1 == $active) { say $1 $+ : $2- }
; in chat
elseif ($+(=,$1) == $active) { say $1 $+ : $2- }
}
} This would not append the : when you press tab, but it would insert it when the line is input.
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Didn't actually think of that, doh! -Andy
|
|
|
|
Joined: May 2005
Posts: 12
Pikka bird
|
OP
Pikka bird
Joined: May 2005
Posts: 12 |
Tried that, it works. I know nothing of scripting, I just copy/paste from other people It sorta works, but it doubles things Example: this is what I get when I do N tab hello: [13:52] > nael: hello [13:52] > nael hello Repeats twice
|
|
|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
Ameglian cow
Joined: Aug 2005
Posts: 39 |
maybe if you add haltdef at the end it would work? try this: on *:INPUT:*: {
if ($chan) {
; in channel
if ($1 ison $chan) { say $1 $+ : $2- }
else {
; in query
if ($1 == $active) { say $1 $+ : $2- }
; in chat
elseif ($+(=,$1) == $active) { say $1 $+ : $2- }
}
haltdef
}
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You're also missing a closing brace too..
on *:INPUT:*: {
if ($chan) {
if ($1 ison $chan) { say $1 $+ : $2- }
[color:red]}[/color]
else {
if ($1 == $active) { say $1 $+ : $2- }
elseif ($+(=,$1) == $active) { say $1 $+ : $2- }
}
halt
}
-Andy
|
|
|
|
Joined: May 2005
Posts: 12
Pikka bird
|
OP
Pikka bird
Joined: May 2005
Posts: 12 |
It no longer repeats with that, now it doesn't accept input at all no text is sent to the channel after the first substitution.
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
on *:INPUT:*: {
if (($ctrlenter) || (/*iswm $1-)) return
if (($1 ison $chan) || ((!$chan) && (($1 == $active) || ($+(=,$1) == $active)))) {
haltdef
say $1 $+ : $2-
}
}
|
|
|
|
Joined: May 2005
Posts: 12
Pikka bird
|
OP
Pikka bird
Joined: May 2005
Posts: 12 |
* /if: invalid format Changed it a bit, got * /if: invalid format (line 66, script2.mrc) line 66 is: if (($ctrlenter) || (/*iswm $1-)) return Found out the problem on EFNet #mirc, missing a space between /* and iswm. Works perfectly now
Last edited by Lys; 31/08/05 12:46 PM.
|
|
|
|
Joined: Jul 2005
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Jul 2005
Posts: 25 |
alias -l say {
if ($active == #) && ($1 ison #) msg $active $+($1,:) $2-
elseif ($active == $1) || ($+(=,$1) == $active) msg $active $+($1,:) $2-
else msg $active $1-
}
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
Apologies for the missing brace and haltdef, that code was quickly typed out in the post and never given a second look. This revised code should work as you desire without the need for a say alias and so on. It was tested and worked correctly for me in all 3 circumstances (nick in chan, nick in query, nick in chat).
on *:INPUT:*: {
; in channel
if ($chan) && ($1 ison $chan) {
say $1 $+ : $2-
haltdef
}
; in query or chat
elseif ($1 == $active) || ($+(=,$1) == $active) {
say $1 $+ : $2-
haltdef
}
}
Buster and Slade mistakenly placed the halts outside of the if statements, Kelder's code will also work correctly (and infact goes further by taking into account the $ctrlenter to overide). The check for "/" is not actually needed, as the proceding if statements will fail if it is present (i dont know any network that allows a nickname to begin with a /). However checking if it the custom command prefix is present could be useful.
Last edited by Om3n; 31/08/05 02:28 PM.
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Is it just me, or did everyone forget to use a ^?
on ^*:input:*: {
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 5,024 |
You don't need the ^ prefix with the ON INPUT event.
Regards,
Mentality/Chris
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Ok. I didn't know that.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|