mIRC Home    About    Download    Register    News    Help

Print Thread
#154938 02/08/06 12:46 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I was playing with the ON TABCOMP event in the new mIRC and I came up with something useful I could do with it, but I'm not sure the best way to go about it. Sometimes it's annoying when I'm using tab nick completion to get a nick beginning with P, because the channel services bot's nick begins with P and I always get them first. How would I write this so that if $1 is that nick, skip it and go to the next P nick and then keep going through the P's as I tab? Thanks.

#154939 02/08/06 12:59 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
i think you'd need to sendkey for tabbing.

btk


billythekid
#154940 02/08/06 01:04 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
mIRC 2.0 has the ON TABCOMP event, which fires whenever you hit tab to complete a nick. I know this could at least be done by looping through all names in the channel.

#154941 02/08/06 02:42 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
that's right, so to get $1 filled with the next nick, within the event, you would need to send the tab again, using sendkey..

btk

Last edited by billythekid; 02/08/06 02:43 PM.

billythekid
#154942 03/08/06 04:08 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I haven't looked at the TABCOMP event in any detail yet, but the little bit I did read about didn't mention any easy way to actually modify the text that is added into the edit bar. I expected some command like:

/tabcomp <replacement>

Whatever you have for <replacement> would be placed into the editbox in place of the current word.

-genius_at_work

#154943 03/08/06 05:18 AM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
yes, of course you could get $left($1-,1) and loop through $line(#,x) for matches, but that's messy in my mind. would be much nicer to have a /tabcomp option.

btk


billythekid
#154944 03/08/06 12:12 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
[code]#tabcomp.p.catcher on
on *:tabcomp:#:{
var %tabcompword = $gettok($1-,$numtok($left($editbox($target),$editbox($target).selstart),32),32)
if (%tabcompword == P) { sendkeys {tab} | .disable #tabcomp.p.catcher }
}
#tabcomp.p.catcher end
on *:tabcomp:#:{ .enable #tabcomp.p.catcher }
;
;
;
alias sendkeys {
if ($1-) {
var %i = SendKeys $+ $ctime
.comopen %i WScript.Shell
if (!$comerr) {
var %x = $com(%i,SendKeys,3,bstr,$1-)
.comclose %i
return %x
}
return 0
}
else { echo -ac info * /sendkeys: insufficient parameters }
}[code]

* this code breaks down if your using dual editboxs, as it uses the first editbox only to locate what words being tabcomped, (i dont know of an easy way to ensure which one is being tabcomped but 99% of people i think dont use the second one anyway)
* the group disabling and enabling is to protect against a runaway loop, if "P" is the only P* nick in channel.

#154945 03/08/06 12:21 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I tried your script, and I replaced P with the P nick that I don't want, in this line:
Code:
if (%tabcompword == P) { sendkeys {tab} | .disable #tabcomp.p.catcher }


I just tried hitting P and then tab. I think the name I don't want was the only P nick in the room at the time. The script seemed to lock up. The nick I don't want completed itself on tab and then just sat there "fluttering" on and off very quickly. I had to part the channel to get out. I'm not sure how to fix this. Thanks.

#154946 04/08/06 07:30 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Worked fine for me, no problem. Lets see your code alteration.


Link Copied to Clipboard