mIRC Homepage
Posted By: Eddy2k5 Echo One Time - 04/08/05 06:47 PM
i cant get this working 100%. i tried and tried. but still useless. i write lines from another channel, then it should MSG to the main chan im into. some lines works and some dont show up in main..
when i do !test test test
it only works one time. but thats fine. i want it that way. but then i try !test test2 test2
it dont works and sometimes it works so im happy if someone can help me outa this wink

n0=;Added 2 needed }'s and fixed on text syntaxx
n1=on *:TEXT:!test *:#testa: {
n2= if ($3 == $null) {
n3= halt
n4= }
n5= else {
n6= if !$hget(ech0-prechan,$2) {
n7= hadd -mu900 ech0-prechan $2 .
n8= msg #testa $2 $3
n9= }
n10= }
n11=}
Posted By: SladeKraven Re: Echo One Time - 04/08/05 07:05 PM
I don't know what I'm supposed to be looking at dude, it seems to work for me.

[13:04] <Testing> !test test test
[13:04] <Andy> test test
[13:04] <Testing> !test test test
[13:04] <Testing> !test test2 test2
[13:04] <Andy> test2 test2
[13:04] <Testing> !test test2 test2

If the item exists it wont msg the channel with $2 and $3.

Code:
on *:TEXT:!test *:#testa: { 
  if (!$3) {
    halt
  }
  else {
    if (!$hget(ech0-prechan,$2)) { 
      hadd -mu900 ech0-prechan $2 .
      msg #testa $2 $3
    }
  }
} 


-Andy
Posted By: Eddy2k5 Re: Echo One Time - 04/08/05 07:15 PM
is there any easyier way to echo it just once? in another code?
Posted By: SladeKraven Re: Echo One Time - 04/08/05 07:21 PM
I'm sorry, echo what once?

You're not echoing anything as far as I can see. :s

-Andy
Posted By: Riamus2 Re: Echo One Time - 04/08/05 07:45 PM
If you can give details about exactly what you're trying to accomplish, it would help.

Do you mean you only want "test" to appear and not "test test"? Is that what you mean by once? Or what?

-----

SladeKraven:
Just a note that was pointed out to me in the past... !$3 would trigger if $3 equals $null, but it would also trigger if $3 equals $false, and one other situation that I can't think of right now. So, depending what's being done, using ($3 == $null) may be the best way even if it's a little longer code.
Posted By: Sigh Re: Echo One Time - 04/08/05 09:40 PM
Quote:
So, depending what's being done, using ($3 == $null) may be the best way even if it's a little longer code.


Could be shortened to if ($0 < 3) in this case
Posted By: Riamus2 Re: Echo One Time - 05/08/05 02:10 PM
Yeah, that would work.
© mIRC Discussion Forums