mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 2
M
Bowl of petunias
OP Offline
Bowl of petunias
M
Joined: Jan 2015
Posts: 2
Hello i am new to all this and trying to figure out one thing. when i make a command for instance:
Code:
on *:text:!test *:#: {
  if ($2 == $null) { msg $chan Please enter !test [user] }
  else { msg $chan hello good job }
}


if i go into twitch and type "!test hi" it will say "hello good job" but if i say "!test" it returns nothing when i am going to get it so if you type "!test" it will return the "Please enter !test [user]" line.
i have also tried to use:
Code:
on *:text:!test *:#: {
  if (!$2) { msg $chan Please enter !test [user] }
  else { msg $chan hello good job }
}

that does the same thing and doesn't work. I think for some reason it is not picking up that $2 is empty but i dont know any help you have is helpful and i will try it.

Thanks, Moo

Joined: Nov 2014
Posts: 32
P
Ameglian cow
Offline
Ameglian cow
P
Joined: Nov 2014
Posts: 32
If you look at your first line, you're looking for !test *

This is looking for !test, followed by a space, which can then, optionally, be followed by something else.

What you've done, is forced the command to require the space before it will trigger.

Just take the space out and it should work fine:

Code:
on *:text:!test*:#: {
  if ($2 == $null) { msg $chan Please enter !test [user] }
  else { msg $chan hello good job }
}


Hopefully this helps

Joined: Jan 2015
Posts: 2
M
Bowl of petunias
OP Offline
Bowl of petunias
M
Joined: Jan 2015
Posts: 2
Omg thank you Panda that worked you are a life saver. Of Course it had to be something that simple that was driving me crazy.


Link Copied to Clipboard