mIRC Homepage
Posted By: moshkin whats wrong with this? - 12/11/06 09:58 PM
can someone edit it so this works, then i can compare, cuz last time someone tried to explain but just confused me.


on *:text:!setrules:#: {
if ( $nick isop $chan ) || ( $nick ishop $chan ) {
set %event $2-
/msg $nick The event has been set to: %event }

on *:text:!rules:#: {
/msg $chan Todays event is: %event }
Posted By: RusselB Re: whats wrong with this? - 12/11/06 10:09 PM
Code:
  on *:text:!setrules*:#: {
if $nick($chan,$nick,oh) {
set %event $2-
/msg $nick The event has been set to: %event
}
}

on *:text:!rules:#: {
describe # sees that $iif(!%event,there's no event set,today's event is: %event)
}
 


You needed an * in the first on text event to allow people to enter the actual event. The * is a wildcard that will match anything entered, including nothing.

I changed the format of your if statements that were checking if the person that entered the command was op or half-op. The way you had it would work, this is just a different manner.

You were also missing a closed brace at the end.

Nothing needed to be changed with the second on text event or any of the code that followed it, but I changed the message so that it would show properly if there was no event set

If you have further questions about what I did here, feel free to ask.
Posted By: moshkin Re: whats wrong with this? - 13/11/06 04:01 PM
it doesnt work, i wanted it to be !setrules then wahterver i want, then when u type !rules is comes up with the rules. if anyone could help?
Dont really trouble your self mIRC has annoyed me enough to just look around if i find a good bot i will just use that, or find someone selling a script or something.
Posted By: Riamus2 Re: whats wrong with this? - 13/11/06 05:12 PM
If you are doing this from the script's mIRC (i.e. the bot), then you will want to use:
Code:
on *:input:*: {
  if ($1 == !setrules) {
    if (!$2) { echo -a Error: You need to include the rules/events with this command. }
    else {
      set %event $2-
      echo - a Event set to: $2-
    }
  }
}
on *:text:!rules:#: {
  msg $chan Today's event is: $2-
}


Or, if you want the command to work from somewhere other than the bot (the client with the script), use:

Code:
on *:text:*:#: {
  if ($1 == !setrules && ($nick isop $chan || $nick ishop $chan)) {
    if (!$2) { .notice $nick Error: You need to include the rules/events with this command. }
    else {
      set %event $2-
      .notice $nick Event set to: $2-
    }
  }
  elseif ($1 == !rules) {
    msg $chan Today's event is: $2-
  }
}


As a note, feel free to look around at other clients, but remember that mIRC is the only one with really good script support. If you want that ability, then you'll want to stick to mIRC.
© mIRC Discussion Forums