mIRC Home    About    Download    Register    News    Help

Print Thread
#195027 15/02/08 09:48 PM
Joined: Feb 2008
Posts: 9
S
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?

Joined: Oct 2004
Posts: 8,330
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
Joined: Feb 2008
Posts: 9
S
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..

Joined: Feb 2008
Posts: 9
S
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"


Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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.
Joined: Dec 2002
Posts: 503
B
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
  }
}

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

It's not my code.

Joined: Feb 2008
Posts: 9
S
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..

Joined: Oct 2004
Posts: 8,330
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
Joined: Oct 2004
Posts: 8,330
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
Joined: Feb 2008
Posts: 9
S
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??


Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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

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

Joined: Jun 2007
Posts: 933
5
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.
Joined: Feb 2008
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Feb 2008
Posts: 9
ok thanks smile


Link Copied to Clipboard