mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2016
Posts: 50
T
Babel fish
OP Offline
Babel fish
T
Joined: May 2016
Posts: 50
Hi so I'm currently working on a way for people to create bot commands via Twitch chat, and I would like to know how I can make code run if there is no $2 (So if the users only types "!addcom") I would like to send them an error message

This is my code thus far:
Code:
on *:TEXT:!addcom *:#: {
 if ($2 == help) {
 msg # SAVE MEH!
 }
  else {
   var -g %usercommand = $2
   var -g %userinput = $3-
   msg # $nick created command: %usercommand that says: %userinput
  }
} 


I would like to know if something like this was possible (I have tested it, doesn't work):
Code:
on *:TEXT:!addcom *:#: {
 if ($2 == $null) {
 msg # You haven't specified any command to create
 }
} 


Any help would be very much appreciated! laugh

Kind Regards
TillableToast


Life is potato.
Joined: May 2016
Posts: 50
T
Babel fish
OP Offline
Babel fish
T
Joined: May 2016
Posts: 50
Nvm got it all working now!


Life is potato.

Link Copied to Clipboard