mIRC Homepage
Posted By: moshkin Really, waht is IRC's problem? - 14/11/06 04:34 PM
the pc script works, but event or rules doesnt -.-


#greet on
on 1:JOIN:#:{ .notice $nick Hi there, welcome to #future_elites, please enjoy your stay !! }
#greet end

/auser 100 Moshkin

on 1:part:#future_elites:/msg $nick Thanks for joining us on #future_elites!



!-----------------------------flood control ------------------------!

on @*:TEXT:*:#: {

if (%aflood) && ($nick isvoice $chan || $nick isop $chan) { return }

if (%aflood) && (%flood2. [ $+ [ $wildsite ] ] == $null) {

set -u2 %flood2. [ $+ [ $wildsite ] ] 1

}

elseif (%flood2. [ $+ [ $wildsite ] ] >= 2) {

kick # $nick flood

unset %flood2. [ $+ [ $wildsite ] ]

}

else { inc -u2 %flood2. [ $+ [ $wildsite ] ]

}

if (%repeats) ($nick isvoice $chan || $nick isop $chan) { return }

var %text = $hash($strip($1-),32)

var %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]

var %old.text = $deltok(%old.text,1,46)

if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text) {

return

}

var %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]

var %count = $gettok(%temp,1,46)

inc %count

set -u60 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text

if (%count >= 3) {

ban -u5 # $nick 13

kick # $nick repeat

}

if (%ainvite) && ($nick isvoice $chan || $nick isop $chan) { return }

if (%ainvite) && $regex($1-, #\w) {

ban # $nick 13

kick # $nick advertise

}
}


!---------PC script ------------!

on *:TEXT:!setworld*:#: {
if (($nick isreg $chan || $nick isvoice $chan )) { halt }
else set %rank $2-
msg $chan The current world has been set : %rank .
}
on $*:TEXT:/^!(pcw|world)/iS:#:{
{ if ($nick ishop $chan) || ($nick isop $chan) || ($nick isvoice $chan) /notice $nick 8,2the current world is %rank
else /notice $nick voice or higher only
}

!--------- Event -----------!

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

!--------- Rules -----------!


on *:text:!setrules*:#: {
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 %rules $2-
.notice $nick Event set to: $2-
}
}
elseif ($1 == !rules) {
msg $chan The rules in this channel are: $2-
}
}
Posted By: schaefer31 Re: Really, waht is IRC's problem? - 14/11/06 04:55 PM
It's not possible to ever reach the elseif statement in either one because in the event headers, you have !setevent or !setrules as the trigger words (which also happens to be $1), and then in the elseif you check if $1 is !event or !rules, which is obviously not possible in this case. You need to either change the trigger word to be more general or just make a separate event for !rules and !event.
Posted By: moshkin Re: Really, waht is IRC's problem? - 14/11/06 05:02 PM
how do i make a separate event?
Posted By: moshkin Re: Really, waht is IRC's problem? - 14/11/06 05:07 PM
and another thing it has against me, i use it as a bot, so i use another client for general use and this just sits there for commands, i cant set the world, i set it once then after that it doesnt listen to me.
Posted By: learn3r Re: Really, waht is IRC's problem? - 14/11/06 05:27 PM
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 %rules $2-
.notice $nick Event set to: $2-
}
}
elseif ($1 == !rules) {
msg $chan The rules in this channel are: $2-
}
}
---
on *:text:!*:#: {
if ($1 == !setevent && ($nick isop $chan || $nick ishop $chan)) {
if (!$2) { .notice $nick Error: You need to include the event with this command. }
else {
set %event $2-
.notice $nick Event set to: $2-
}
}
elseif ($1 == !event) {
msg $chan Today's event is: $2-
}
}


Posted By: learn3r Re: Really, waht is IRC's problem? - 14/11/06 05:35 PM
or
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 %rules $2-
      .notice $nick Event set to: $2-
    }
  }
  if ($1 == !setevent && ($nick isop $chan || $nick ishop $chan)) {
    if (!$2) { .notice $nick Error: You need to include the event with this command. }
    else {
      set %event $2-
      .notice $nick Event set to: $2-
    }
  }
  else {
    if ($1 == !rules) {
      msg $chan The rules in this channel are: $2-
    }
    if ($1 == !event)
    msg $chan Today's event is: $2-
  }
}
  
Posted By: moshkin Re: Really, waht is IRC's problem? - 14/11/06 06:37 PM
this goes in the remotes section right?
Posted By: Zonk Re: Really, waht is IRC's problem? - 14/11/06 10:32 PM
Quote:
or
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 %rules $2-
      .notice $nick Event set to: $2-
    }
  }
  if ($1 == !setevent && ($nick isop $chan || $nick ishop $chan)) {
    if (!$2) { .notice $nick Error: You need to include the event with this command. }
    else {
      set %event $2-
      .notice $nick Event set to: $2-
    }
  }
  else {
    if ($1 == !rules) {
      msg $chan The rules in this channel are: $2-
    }
    if ($1 == !event)
    msg $chan Today's event is: $2-
  }
}
  


OR????

He needs to use this one or the second event will never trigger...
Posted By: learn3r Re: Really, waht is IRC's problem? - 14/11/06 10:58 PM
Quote:

OR????

He needs to use this one or the second event will never trigger...



He posted his code i just edited it.
if he only wants to use one of them then he has an option.
and that's y i said or.
Posted By: moshkin Re: Really, waht is IRC's problem? - 15/11/06 04:48 PM
Quote:
this goes in the remotes section right?
Posted By: Riamus2 Re: Really, waht is IRC's problem? - 15/11/06 11:41 PM
Unless someone states otherwise when writing a script for you, all scripts will go in Remotes in a *NEW* file.
© mIRC Discussion Forums