mIRC Home    About    Download    Register    News    Help

Print Thread
On Input Question.. #195027 15/02/08 09:48 PM
Joined: Feb 2008
Posts: 9
S
Salemakos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
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?

Re: On Input Question.. [Re: Salemakos] #195029 15/02/08 09:56 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: On Input Question.. [Re: Riamus2] #195030 15/02/08 10:01 PM
Joined: Feb 2008
Posts: 9
S
Salemakos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
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..

Re: On Input Question.. [Re: Salemakos] #195031 15/02/08 10:27 PM
Joined: Feb 2008
Posts: 9
S
Salemakos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
I cant even talk with your first example :)) just "lol" and "xa"


Re: On Input Question.. [Re: Salemakos] #195032 15/02/08 10:36 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

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
  }
}



Last edited by RoCk; 15/02/08 10:39 PM.
Re: On Input Question.. [Re: RoCk] #195034 16/02/08 12:38 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
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
  }
}

Re: On Input Question.. [Re: Bekar] #195035 16/02/08 12:39 AM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

It's not my code.

Re: On Input Question.. [Re: RoCk] #195044 16/02/08 10:28 AM
Joined: Feb 2008
Posts: 9
S
Salemakos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
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..

Re: On Input Question.. [Re: Salemakos] #195046 16/02/08 11:08 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: On Input Question.. [Re: Bekar] #195047 16/02/08 11:09 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Nothing's wrong with isincs. I just forgot about it. smile


Invision Support
#Invision on irc.irchighway.net
Re: On Input Question.. [Re: Riamus2] #195353 22/02/08 06:10 PM
Joined: Feb 2008
Posts: 9
S
Salemakos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
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??


Re: On Input Question.. [Re: Salemakos] #195354 22/02/08 06:37 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

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

to this
if (c !isincs $chan($chan).mode)

Re: On Input Question.. [Re: Salemakos] #195355 22/02/08 06:38 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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 }"

Last edited by 5618; 22/02/08 06:38 PM.
Re: On Input Question.. [Re: 5618] #195357 22/02/08 06:45 PM
Joined: Feb 2008
Posts: 9
S
Salemakos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
ok thanks smile