mIRC Homepage
Posted By: Sonfloro Channel specific "if" statement - 13/12/14 01:13 AM
So I was wondering if there is a way to make a command display some information all the time, but if its activated on a specific channel, it would add on some extra information.

I'm trying to make a !commands command, that would display normal commands for my bot, then if its on a specific channel display some of the commands that only work on that channel

This is what I have done.

Code:
on *:TEXT:!commands:#:{ .msg $chan The commands for Gayfloro are: !rekt, !brad, !armory, and !prepare}
  if (#whatthehellshappened:) { .msg $chan The channel specific commands are: !timewaste, !stimewaste, !resettime, !resetbonk, !wastedtotal, !bonk, !sbonk, !totalbonk }
}
Posted By: Nillen Re: Channel specific "if" statement - 13/12/14 01:51 AM
/help if then else
/help on text
Posted By: Panda Re: Channel specific "if" statement - 13/12/14 03:18 AM
I'm learning too, but I think it would be something like:

Code:
on *:TEXT:!commands:#:{ 
  if ($chan == #whatthehellshappened) {
    .msg $chan The channel specific commands are: !timewaste, !stimewaste, !resettime, !resetbonk, !wastedtotal, !bonk, !sbonk, !totalbonk
  }
  else {
    .msg $chan The commands for Gayfloro are: !rekt, !brad, !armory, and !prepare
  }
}

Hope this helps a little

Panda
Posted By: Panda Re: Channel specific "if" statement - 13/12/14 01:26 PM
Hey, reading your post again, I don't think I actually gave you what you were asking for, specifically.

Here is what I think you're actually wanting to do (with comments this time :D)

Code:
on *:TEXT:!commands:#:{
  ;
  ; Stuff to do in addition to whichever of the if/else statement is executed
  ;
  .msg $chan The commands for Gayfloro are: !rekt, !brad, !armory, and !prepare
  if ($chan == #whatthehellshappened) {
    ;
    ; Stuff specific to the channel, #whatthehellshappened, would go below
    ;
    .msg $chan The channel specific commands are: !timewaste, !stimewaste, !resettime, !resetbonk, !wastedtotal, !bonk, !sbonk, !totalbonk
  }
  else {
    ;
    ; Stuff specific to any channel, when not #whatthehellshappened
    ;
    .msg $chan There are no channel specific commands for $chan
  }
}

Hope this is a little more helpful than the last answer I gave wink

Panda
Posted By: JuanAm Re: Channel specific "if" statement - 14/12/14 06:11 AM
Error post.
Posted By: Nillen Re: Channel specific "if" statement - 14/12/14 06:34 AM
Panda isn't asking any questions, he's trying to answer Sonfloro's question.
I think you misunderstood the previous post.
Posted By: JuanAm Re: Channel specific "if" statement - 14/12/14 08:46 AM
Originally Posted By: Nillen
Panda isn't asking any questions, he's trying to answer Sonfloro's question.
I think you misunderstood the previous post.


Thank you Nillen, I edited my post blush
© mIRC Discussion Forums