mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
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-
}
}

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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.

Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
how do i make a separate event?

Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
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.

Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
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-
}
}



Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
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-
  }
}
  


learn learn learn
Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
this goes in the remotes section right?

Joined: Jan 2003
Posts: 53
Z
Babel fish
Offline
Babel fish
Z
Joined: Jan 2003
Posts: 53
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...

Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
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.

Joined: Oct 2006
Posts: 60
M
moshkin Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
Quote:
this goes in the remotes section right?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Unless someone states otherwise when writing a script for you, all scripts will go in Remotes in a *NEW* file.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard