mIRC Homepage
Posted By: Tw33ty on input: "halt" doesn't work - 01/08/06 08:15 PM
Code:
on *:input:*:{
  var %i = 1 
  while (%i <= $nick($chan,0)) { 
    if ($left($1,1) != /) && (!$ctrlenter) && ($active != Status Window) && ($status = connected) && ($1 == $nick($chan,%i)) { 
      say my stuffs here | halt
    } 
    inc %i
  } 
}


Everytime I type sumth, there appear two lines, instead of the mainstuff. What's wrong with the code?
Posted By: bwr30060 Re: on input: "halt" doesn't work - 01/08/06 08:26 PM
Code:
on ^*:input:*:{
  var %i = 1 
  while (%i <= $nick($chan,0)) { 
    if ($left($1,1) != /) && (!$ctrlenter) && ($active != Status Window) && ($status = connected) && ($1 == $nick($chan,%i)) { 
      say my stuffs here | haltdef
    } 
    inc %i
  } 
}


EDIT-- Forget that. My changes didn't work for me. Am I understanding your code (or what you want) correctly? It looks like it should do stuff if the first word you typed is a nickname in the channel.
Posted By: Tw33ty Re: on input: "halt" doesn't work - 01/08/06 08:33 PM
doesn't work
Posted By: DaveC Re: on input: "halt" doesn't work - 01/08/06 09:23 PM
(1) your codes written badly, the initial 4 conditions should not be in the while loop
Code:
on *:input:*:{
  if ($left($1,1) != /) && (!$ctrlenter) && ($active != Status Window) && ($status == connected) && ($chan)) { 
    var %i = 1| while (%i <= $nick($chan,0)) { if ($1 == $nick($chan,%i) { say my stuffs here | halt } | inc %i } 
  }
}


(2) Even more of a problem is that your actually looping at all and doing a INPUT:*
Code:
on *:input:#:{ if ($left($1,1) != /) && (!$ctrlenter) && ($1 ison $chan)) { say my stuffs here | halt } }
;or even just 
on *:input:#:{ if ((!$ctrlenter) && ($1 ison $chan)) { say my stuffs here | halt } }


(3) Its likely the line appears twice becuase some other script also has an on input
locate it and add the & directive
Posted By: Tw33ty Re: on input: "halt" doesn't work - 01/08/06 09:42 PM
Quote:
(3) Its likely the line appears twice becuase some other script also has an on input
locate it and add the & directive


That was the problem.
Thank you very much :)
© mIRC Discussion Forums