mIRC Homepage
Posted By: Salemakos On Input Question.. - 15/02/08 09:48 PM
hey.I want a "on input" remote...
when I say "lol" i see LooooooooooL
when I say "xa" i see XaXaXaXa etc..

But!

If there is "c" mode in channel..I get something like that: Color is not permitted in this channel

So, the remote will show again the "LoooooooooooL" but with no colors this time..

any idea?
Posted By: Riamus2 Re: On Input Question.. - 15/02/08 09:56 PM
Code:
on *:input:#: {
  if ($chr(99) !isin $chan($chan).mode) { var %color = 04 }
  if ($1- == lol) { msg $chan %color $+ LooooooooooL }
  elseif ($1- == xa) { msg $chan %color $+ XaXaXaXa }
  halt
}


This should work on any network that uses lowercase "c" for disallowing colors. Note that it uses $chr(99) so it only checks for lowercase c and not uppercase C. Just repeat the elseif line and change the comparison/output. Remember to include %color $+ so that it will include colors or not based on the mode.

One note, this is set up to use one color. If you need more than one color for outputs, you can basically just take that mode line and incorporate it into the IF/ELSEIF comparison lines using different colors...

Code:
on *:input:#: {
  if ($1- == lol) {
    if ($chr(99) !isin $chan($chan).mode) { var %color = 04 }
    msg $chan %color $+ LooooooooooL
  }
  elseif ($1- == xa) {
    if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
    msg $chan %color $+ XaXaXaXa
  }
  halt
}


That makes it longer, but handles using more than one color. Of course, you can also adjust it further if you need more than one color in a single output.
Posted By: Salemakos Re: On Input Question.. - 15/02/08 10:01 PM
thanks I will try it..previously I had this:

on *:input:*:{
if (lol isin $strip($1-)) {
if ($target = #) {
if ( $iif(c isincs $gettok($chan(#).mode,1,32),$style(1)) ) {
if (/ !isin $1) { msg # $replace($1-,lol,loooooooooooooooooooooooooooooooooool²) | halt }
else { $replace($1-,lol,loooooooooooooooooooooooooooooooooool²) | halt }
}
else {
if (/ !isin $1) { msg # $replace($1-,lol,4looooo7ooooo4ooooo7ooooo4ooooo7ooooo4oooool7²) | halt }
else { $replace($1-,lol,4looooo7ooooo4ooooo7ooooo4ooooo7ooooo4oooool7²) | halt }
}
}
else {
if (/ !isin $1) { msg $target $replace($1-,lol,4looooo7ooooo4ooooo7ooooo4ooooo7ooooo4oooool7²) | halt }
else { $replace($1-,lol,4looooo7ooooo4ooooo7ooooo4ooooo7ooooo4oooool7²) | halt }
}
}
}


But there were some probs..I dont remember now..
Posted By: Salemakos Re: On Input Question.. - 15/02/08 10:27 PM
I cant even talk with your first example :)) just "lol" and "xa"

Posted By: RoCk Re: On Input Question.. - 15/02/08 10:36 PM

Change the halt to haltdef

Actually.....

Code:

on *:input:#: {
  if ($1- == lol) {
    if ($chr(99) !isin $chan($chan).mode) { var %color = 04 }
    msg $chan %color $+ LooooooooooL
    haltdef
  }
  elseif ($1- == xa) {
    if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
    msg $chan %color $+ XaXaXaXa
    haltdef
  }
}


Posted By: Bekar Re: On Input Question.. - 16/02/08 12:38 AM
What's wrong with 'c isincs $chan($chan).mode'?

Or perhaps:
Code:
ON *:INPUT:#: {
  var %msg, %color = $iif(c !isincs $chan($chan).mode, 04)
  if ($1- == lol) {
    %msg = %color $+ LooooooooL
  }
  elseif ($1- == xa) {
    %msg = %color $+ XaXaXaXa
  }
  if (%msg != $null) {
    say %msg
    haltdef
  }
}
Posted By: RoCk Re: On Input Question.. - 16/02/08 12:39 AM

It's not my code.
Posted By: Salemakos Re: On Input Question.. - 16/02/08 10:28 AM
hey :)) thanks but I have another problem now..

this is the code:

on *:input:#: {
if ($1- == lol) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 04 }
msg $chan %color $+ LooooooooooL
haltdef
}
elseif ($1- == xa) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ XaXaXaXa
haltdef
}
elseif ($1- == xaxa) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ XaXaXaXaXaXaXaXaXaXaXaXa
haltdef
}
elseif ($1- == lool) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ LoooooooooooooooooooooooL
haltdef
}
elseif ($1- == xixi) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ XiXiXiXiXiXiXiXiXiXiXiXi
haltdef
}
elseif ($1- == xexe) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ XeXeXeXeXeXeXeXeXeXeXeXe
haltdef
}
elseif ($1- == brb) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ BrB!
haltdef
}
elseif ($1- == ok) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ OkZz
haltdef
}
elseif ($1- == bye) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ ByE!
haltdef
}
elseif ($1- == makia) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ MakiaMakiaMakia
haltdef
}
elseif ($1- == hi) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ Hi!
haltdef
}
elseif ($1- == :*) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ :*:*:*
haltdef
}
elseif ($1- == :p) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ :PPpp
haltdef
}
elseif ($1- == back) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ Back!
haltdef
}
elseif ($1- == wb) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ Wb!
haltdef
}
elseif ($1- == !) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ !!!
haltdef
}
elseif ($1- == ?) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ ???
haltdef
}
elseif ($1- == hello) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ Hello!
haltdef
}
elseif ($1- == bb) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ Bye
haltdef
}
}


But if add "smile" and "frown"

nothing works! or should I say, it works but not right..
example:

elseif ($1- == :)) {
if ($chr(99) !isin $chan($chan).mode) { var %color = 10 }
msg $chan %color $+ :)))
haltdef
}

because its 2 parenthesis together..
Posted By: Riamus2 Re: On Input Question.. - 16/02/08 11:08 AM
Sorry, wasn't thinking when putting the halt in there. Should have been in each IF.

If you want to use characters that mIRC uses for parsing commands, such as parentheses, you'll have to use $chr like was shown for the lowercase c. $chr(40) is ( and $chr(41) is ). Then use $+ between : and the $chr to combine them.
Posted By: Riamus2 Re: On Input Question.. - 16/02/08 11:09 AM
Nothing's wrong with isincs. I just forgot about it. smile
Posted By: Salemakos Re: On Input Question.. - 22/02/08 06:10 PM
its ok :)) thanks, but..

i Dont know why but if its mode C also in channel the remote behaves like with the mode c, it doesn`t show colors!!!

C is for no CTCPs..

ASCII code 99 is for c
its correct..

why??

Posted By: RoCk Re: On Input Question.. - 22/02/08 06:37 PM

You need to change all of these
if ($chr(99) !isin $chan($chan).mode)

to this
if (c !isincs $chan($chan).mode)
Posted By: 5618 Re: On Input Question.. - 22/02/08 06:38 PM
since using "C" or "c" in the script makes no difference, using $chr(99), lowercase C, also has no effect. You have to use "if (c isincs $chan($chan).mode) { script }"
Posted By: Salemakos Re: On Input Question.. - 22/02/08 06:45 PM
ok thanks smile
© mIRC Discussion Forums