|
Joined: Feb 2003
Posts: 3,412
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
I have this for my nick completer:
if ($right($1,1) = %nc_trigger)
in this case %nc_trigger = : , but when i type a nick that left the channel, then the script trying to complete it, any way i can fix that ? if $nick arent on $chan do this, i dont know how. so i would like to have somthing infront of ($right($1,1) = %nc_trigger) that makes the script skip to the next part, somone that have an idea? :tongue:
|
|
|
|
DaveC
|
DaveC
|
check if you get a nick match for $left($1,-1)
|
|
|
|
Joined: Feb 2003
Posts: 3,412
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
how would i check that ? $left($1,-1)
this is the line i use now.. set %nick $nick(#,$fline(#,$replace($1,%nc_trigger,*),1,1))
if ($left($1,-1) != $null) && ($right($1,1) = %nc_trigger) { ?
|
|
|
|
DaveC
|
DaveC
|
if ($right($1,1) = %nc_trigger) {
set %nick $nick(#,$fline(#,$replace($1,%nc_trigger,*),1,1))
if (%nick != $null) { .... }
}
Im having trouble understanding what you want, the above well check for your trigger (:) set %nick to the first matching it finds, then just check if %nick was set to anything. I left your code intacked as a SET as i dont know what else your doing with it, but if its only needed inside the alias/event consider using a VAR. I personally find the inbuilt nick completor in mirc just fine.
|
|
|
|
Joined: Feb 2003
Posts: 3,412
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
this is what i have:
on *:input:#:{
elseif (/* !iswm $1) {
if ($right($1,1) = %nc_trigger) {
if (%ncc = 2) {
set %inptext $1-
[color:red]nocomplete[/color]
halt
}
set %inptext $2-
set %nick $nick(#,$fline(#,$replace($1,%nc_trigger,*),1,1))
[color:red]complete[/color]
halt
}
unset %_idle
if ($group(#input) == on) && ($away) inc %_inputlines
set %inptext $1-
settime
[color:red]nocomplete[/color]
if (*: iswm $1) halt
}
the problem is when i type a part of a nick, then it ends up with . text .. same if i see a nick start with lets say [blaa]nick , then i only type the "nick" part, then since the nick on the channel dont exist "it looks from the start of the nick name, and since it start with [blaa] dosent nick exist", and then it ends up with me typing the text out to the channel with that dot instead of the part of the nick i want to be sent to the channel.. hope you understand now.. 
|
|
|
|
DaveC
|
DaveC
|
you could use
set %nick $nick(#,$fline(#,* $+ $left($?1,-1) $+ *,1,1))
that way its looking for *nick* the only problem with using things like that is the chance of hitting the wrong nick esculates.
|
|
|
|
DrStein
|
DrStein
|
Yeap and the only way to solve the problem if hitting the wrong nick is either to tell your script what nick will choose (for example the first) or create a new diallog that will appear in such cases and it will have all possible nicks inside. (in a combo or a list)
Then you can choose from there which one you want
Last edited by DrStein; 04/12/04 12:11 AM.
|
|
|
|
DaveC
|
DaveC
|
My choice would be (assuming more than one match detected) To load the editbox with "%nick $2-" and halt the input event If the user presses ENTER again it rotates to the next matching nick halting the input event again, and onward cycling back as needed. If the user presses CTRL-ENTER it allowes the line to go out. My personaly way is different again... I use F1 key to cycle the $1 ( or F2 to use the last word) of the editbox tell i find the nick i want, i used to use the inbuilt nick completor but the channel i talk in has a bunch of people with the same first 4 letters and im always failing to type them in so never complete the nick using TAB. Only downside to mine is the cursor position in the editbox is lost and any highlighting at the time 
|
|
|
|
Joined: Feb 2003
Posts: 3,412
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
so no other way to see if $nick == $null on that channel ? :tongue: the point with a nickcomplleter dissapear if i have do stuff, then its slow, and i can type the nick by the time i made my options in a dialig or some halting events :tongue:
|
|
|
|
DaveC
|
DaveC
|
so no other way to see if $nick == $null on that channel ? :tongue: the point with a nickcomplleter dissapear if i have do stuff, then its slow, and i can type the nick by the time i made my options in a dialig or some halting events :tongue: Well i cant really say, you keep jumping about with what your after, you wanted to know if the $nick ???? $1: do u mean matches a nick still in the channel, if so then when you do the SET %nick if the nick isnt in channel anymore it well be $null.
|
|
|
|
Joined: Feb 2003
Posts: 3,412
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
if i see a nick on the channel.. [blaa]nick .. then i want to be able to type: nick .. and use ":" nick: but when i do that now, then my nick completer is triggered, and that result in that it trying to complete a nick that arent on the channel.. "since the nick start with [blaa] and not nick", same if somone leav the channel, then my nick completer completes is to . , how can i make "understand" that even if i type nick: it shouldent complete if a user dont start with the "ni" letters, or if he left the channel befor im done typing..
|
|
|
|
DaveC
|
DaveC
|
set %nick $nick(#,$fline(#,* $+ $left($1,-1) $+ *,1,1))
^ that well look for any nick that has the contents of $1 in it ( excluding the ending : ), if %nick is empty then there was no nick that matched it in channel at that time.
so $1 = "nick:" well find blahnick, [blah]nick or nickblah which ever ones first.
|
|
|
|
Joined: Feb 2003
Posts: 3,412
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
|
|
|
|
DaveC
|
DaveC
|
well you got something else going on then becuase it works here. check this line out
//echo Nick name search resulted with " $+ $nick(#,$fline(#,* $+ $left($?1,-1) $+ *,1,1)) $+ "
run that command in a channel and see what it comes back with for a part nick that is there and for one thats not. ie: nick: ick: ic: yayayayayayayayayayaimnothere:
|
|
|
|
|