mIRC Home    About    Download    Register    News    Help

Topic Options
#125732 - 21/07/05 03:50 AM Need help...once again
tyler22 Offline
Pikka bird

Registered: 24/06/05
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

Top
#125733 - 21/07/05 05:02 AM Re: Need help...once again
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
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

Top
#125734 - 21/07/05 03:07 PM Re: Need help...once again
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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.

Top
#125735 - 21/07/05 06:32 PM Re: Need help...once again
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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 } }

Top
#125736 - 21/07/05 06:42 PM Re: Need help...once again
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
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?

Top
#125737 - 21/07/05 10:30 PM Re: Need help...once again
tyler22 Offline
Pikka bird

Registered: 24/06/05
Posts: 16
it adds them to the list but when they say anything it dont work :'( it goes in remotos right???
_________________________
-tyler

Top
#125738 - 21/07/05 11:49 PM Re: Need help...once again
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
yes it goes in remotes,
paste the one you are using back here as sometimes copy/paste From here doesn't work right.

Top
#125739 - 22/07/05 01:44 AM Re: Need help...once again
tyler22 Offline
Pikka bird

Registered: 24/06/05
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

Top
#125740 - 22/07/05 11:43 AM Re: Need help...once again
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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 )

Top
#125741 - 22/07/05 10:20 PM Re: Need help...once again
tyler22 Offline
Pikka bird

Registered: 24/06/05
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

Top