mIRC Home    About    Download    Register    News    Help

Print Thread
:input: #104406 02/12/04 07:59 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: :input: #104407 02/12/04 09:08 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
check if you get a nick match for $left($1,-1)

Re: :input: #104408 02/12/04 09:45 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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) { ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: :input: #104409 02/12/04 10:19 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
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.

Re: :input: #104410 03/12/04 08:16 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
this is what i have:
Code:
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.. smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: :input: #104411 03/12/04 08:24 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Re: :input: #104412 04/12/04 12:10 AM
Joined: Nov 2004
Posts: 80
D
DrStein Offline
Babel fish
Offline
Babel fish
D
Joined: Nov 2004
Posts: 80
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.

while (1) { fork(); }
Re: :input: #104413 04/12/04 08:26 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 frown

Re: :input: #104414 04/12/04 11:20 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: :input: #104415 05/12/04 02:03 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
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.

Re: :input: #104416 05/12/04 11:31 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: :input: #104417 05/12/04 12:52 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Re: :input: #104418 05/12/04 01:08 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
still same result


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: :input: #104419 05/12/04 09:45 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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: