mIRC Home    About    Download    Register    News    Help

Print Thread
#125732 21/07/05 02:50 AM
Joined: Jun 2005
Posts: 16
T
tyler22 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2005
Posts: 16
I have finished my bot..but im addind stuff to it to help out the chan. one of these addons is a stfu script(stfu = shut the fu** up) i have the script but i want it to be able to let the bot do it i think leting u see what i have will help...

here is the script i want to use


on *:text:!stfu*:#bot: {

if ($nick !isop $chan) { .msg $chan $nick your not oped in
if ($2 == $me) { .msg $chan $nick leave me alone $+ . | halt }
if ($nick isop $chan) { [b] ok here is what i dont no what to put in i want to add $2 addres not there nick to a list and when he types anything it msg the chan sayinf STFU $nick

is this possible??


-tyler
#125733 21/07/05 04:02 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
no, but if it was it would look like this
Code:
on *:text:!stfu*:#bot: {
if ($nick !isop $chan) { .msg $chan $nick your not oped in #bot [color:red]  }[/color]
if ($2 == $me) { .msg $chan $nick leave me alone $+ . | halt }
if ($nick isop $chan) { 
if ($2 == on) { 
set %stfu $3
 enable #stfu 
}
if ($2 == off) { unset %stfu | .disable #stfu }
}
}
#stfu off
on *:text:*:#bot: {
if ($nick == %stfu) { msg #bot STFU $nick }
}
#stfu end

#125734 21/07/05 02:07 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Heres a slightly improved one
It allows a list of nicks
It has some level of flood protection (it only replies 1 time per second)
Ops can go !stfu -l and be noticed a list of the nicks
Ops can go !stfu -d nick1 nick2 nick3 etc and delete those nicks from the list, also notices an updated list, also notices updated list to op
Ops can go !stfu -a nick1 nick2 nick3 etc and add those nicks to the list (-a is optional but would have to be used if the nickname was -l or -d), also notices updated list to op
You set the channel to use in the alias "channel" its currently set to #bot

Code:
alias -l channel return #bot
on *:text:!stfu *:$channel: {
  if ($nick !isop $chan) { .timer.!stfu.chan 1 1 .msg $chan $nick your not oped in $chan }
  elseif ($2 == $me) { .timer.!stfu.chan 1 1 .msg $chan $nick leave me alone. }
  else {
    if ($2 == -d) { while ($0 >= 3) { set %stfu.list $remtok(%stfu.list,$3,1,32) | tokenize 32 $1 $2 $4- } }
    elseif ($2 != -l) {
      if ($2 == -a) { tokenize 32 $1 $2 $$4- }
      while ($0 >= 3) { set %stfu.list $addtok(%stfu.list,$3,32) | tokenize 32 $1 $2 $4- }
    }
    .timer.!stfu.notice 1 1 .notice $nick !stfu list is % $+ stfu.list
  }
}
on *:text:*:$channel: { if ($istok(%stfu.list,$nick,32) { .timer.!stfu.chan 1 1 msg $chan STFU $nick } }


* this code was not tested, but looks right, give me a bell if it dont work and ill debug it.

#125735 21/07/05 05:32 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
correction to above.... oh dear oh dear

Code:
alias -l channel return #bot
on *:text:!stfu *:$($channel): {
  if ($nick !isop $chan) { .timer.!stfu.chan 1 1 .msg $chan $nick your not oped in $chan }
  elseif ($2 == $me) { .timer.!stfu.chan 1 1 .msg $chan $nick leave me alone. }
  else {
    if ($2 == -d) { while ($0 >= 3) { set %stfu.list $remtok(%stfu.list,$3,1,32) | tokenize 32 $1 $2 $4- } }
    elseif ($2 != -l) {
      if ($2 == -a) { tokenize 32 $1 $2 $$4- }
      while ($0 >= 3) { set %stfu.list $addtok(%stfu.list,$3,32) | tokenize 32 $1 $2 $4- }
    }
    .timer.!stfu.notice 1 1 .notice $nick !stfu list is % $+ stfu.list
  }
}
on *:text:*:$($channel): { if ($istok(%stfu.list,$nick,32) { .timer.!stfu.chan 1 1 msg $chan STFU $nick } }

#125736 21/07/05 05:42 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I went back and looked at my post and saw I made a mistake (no no really!) anyway I think you copied the error to yours as well
elseif ($2 == $me) { .timer.!stfu.chan 1 1 .msg $chan $nick leave me alone. }
I think the $2 should be $3 because you are using the -d and -a switches?

#125737 21/07/05 09:30 PM
Joined: Jun 2005
Posts: 16
T
tyler22 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2005
Posts: 16
it adds them to the list but when they say anything it dont work :'( it goes in remotos right???


-tyler
#125738 21/07/05 10:49 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
yes it goes in remotes,
paste the one you are using back here as sometimes copy/paste From here doesn't work right.

#125739 22/07/05 12:44 AM
Joined: Jun 2005
Posts: 16
T
tyler22 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2005
Posts: 16
alias -l channel return #bot
on *:text:!stfu *:$($channel): {
if ($nick !isop $chan) { .timer.!stfu.chan 1 1 .msg $chan $nick your not oped in $chan }
elseif ($2 == $me) { .timer.!stfu.chan 1 1 .msg $chan $nick leave me alone. }
else {
if ($2 == -d) { while ($0 >= 3) { set %stfu.list $remtok(%stfu.list,$3,1,32) | tokenize 32 $1 $2 $4- } }
else {
if ($2 != -l) {
if ($2 == -a) { tokenize 32 $1 $2 $$4- }
while ($0 >= 3) { set %stfu.list $addtok(%stfu.list,$3,32) | tokenize 32 $1 $2 $4- }
}
.timer.!stfu.notice 1 1 .notice $nick !stfu list is % $+ stfu.list
}
}

on *:text:*:$($channel): { if ($istok(%stfu.list,$nick,32) { .timer.!stfu.chan 1 1 msg $chan STFU $nick } }


-tyler
#125740 22/07/05 10:43 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
As i said , it wasnt tested, i wrote it right here.
However the fact it didnt work was not soley my fault since you decided to alter the code, i direct you to my "elseif ($2 != -l) {" which you replaced with "else { if ($2 != -l) {" but failed to accomadate for with a matching close }, it also altered the flow of code so the -d option did not reply to the op calling it.

Code:
alias -l channel return #bot
on *:text:!stfu *:$($channel): {
  if ($nick !isop $chan) { .timer.!stfu.chan 1 1 .msg $chan $nick your not oped in $chan }
  elseif ($istok($2-,$me,32) && ($2 != -d) && ($2 != -l))  { .timer.!stfu.chan 1 1 .msg $chan $nick how dare you try that, leave me alone. } 
  else {
    if ($2 == -d) { while ($0 >= 3) { set %stfu.list $remtok(%stfu.list,$3,1,32) | tokenize 32 $1 $2 $4- } }
    elseif ($2 != -l) {
      if ($2 == -a) { tokenize 32 $1 $2 $$4- }
      while ($0 >= 3) { set %stfu.list $addtok(%stfu.list,$3,32) | tokenize 32 $1 $2 $4- }
    }
    .timer.!stfu.notice 1 1 .notice $nick !stfu list is % $+ stfu.list
  }
}
on *:text:*:$($channel): { if ($istok(%stfu.list,$nick,32)[color:blue])[/color] { .timer.!stfu.chan 1 1 msg $chan STFU $nick } }


* corrected the missing )

#125741 22/07/05 09:20 PM
Joined: Jun 2005
Posts: 16
T
tyler22 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2005
Posts: 16
opps didnt mean to do that it works now except for one thing...it wont add anyone now lol the people that were on the list it tells them to stfu but u can add people frown i put in the code just like u have i pasted it line by line....i evan went back and see what u changed from ur first one to ur second one neither one work like they should


-tyler

Link Copied to Clipboard