mIRC Homepage
Posted By: blk unset warned - 16/02/06 03:04 PM
Ok.. This is the final warned script...
Code:
on *:TEXT:!warn *:*:{
  if ($nick == %logged.in.nick) {
    set %warned.1 $2
    set %reason $4-
    TIMERwarner 1 $3 .ban -ku $+ 30 $chan $2 $4-
    .msg $chan 4 $2 2is being warned because they're3 %reason 2,they need to say 7sorry 2or they will be kbed for 30 secs in10 $3 seconds...
    .notice %warned.1 2You better say 7sorry 2, or you will be kicked...
  }
}
on *:NICK:{
  if ($nick == %warned.1) {
    set %warned.1 $newnick
    .notice %warned.1 2If that was to get out of this, it didn't work...
  }
}
on *:TEXT:sorry:#:{
  if ($nick == %warned.1) {
    TIMERwarner off
    .msg $chan 4 %warned.1 2says they're sorry for3 %reason
    .notice %warned.1 2 You were warned because you were3 %reason 2, dont do it again...
    .notice %warned.1 2Next time there will be no warning... Just a KB!
  }
}

Is there anyway to unset %warned.1 without messing up the them saying sorry part?
Posted By: blk Re: unset warned - 16/02/06 03:09 PM
Hmm... I just tested it.. sumwhere the nick change is messed up..

[edit]My bad, it works, just had a typo...
Posted By: shadow007 Re: unset warned - 16/02/06 03:14 PM
it wont work on my bot confused

if i say !warn he does nothing
Posted By: blk Re: unset warned - 16/02/06 03:16 PM
you have to type !warn <nick> <time to be warned> <reason>
Posted By: blk Re: unset warned - 16/02/06 03:19 PM
Ok, now that that typo's fixed it works grin
But I need to get %warned.1 unset
Everytime that %warned.1 changes their name after the warning, they get the on *:NICK: message...
Posted By: shadow007 Re: unset warned - 16/02/06 03:24 PM
if i type on my bot !warn shadow 30 test it wont work
if i type on shadow !warn !warn mirc 30 test it wont work
if i type on shadow !warn shadow 30 test it wont work



mirc is my bot name
shadow is my name
c is a channel bot
Posted By: hixxy Re: unset warned - 16/02/06 04:28 PM
Code:
alias doban {
  ban -ku30 $1-2 $3-
  unset %warned.1
}


Now in the script you would use:

TIMERwarner 1 $3 doban $chan $2 $4-

You could also unset %warned.1 in the part where they say sorry.
Posted By: blk Re: unset warned - 16/02/06 05:05 PM
With that I get-
DOBAN Unknown command
Posted By: hixxy Re: unset warned - 16/02/06 05:08 PM
Did you put the code within the code tags into remote?
Posted By: blk Re: unset warned - 16/02/06 05:08 PM
Opps.. forgot to get rid of the alias part..
Thanks grin
Posted By: DaveC Re: unset warned - 17/02/06 12:06 AM
You had a logic problem in the script, changing nicks would infact defeat the script, as the timer was using the contents of $2 the passed nick, and not the current contents of %warned.1 at the time the timer went off.

This code should work.

Code:
on *:TEXT:!warn *:*:{
  if ($nick == %logged.in.nick) {
    set %warned.1 $2
    set %reason $4-
    TIMERwarner 1 $3 .ban -ku $+ 30 $chan [color:blue]$(%warned.1,)[/color] $4- [color:blue]$(| unset %warned.1,)[/color]
    .msg $chan 4 $2 2is being warned because they're3 %reason 2,they need to say 7sorry 2or they will be kbed for 30 secs in10 $3 seconds...
    .notice %warned.1 2You better say 7sorry 2, or you will be kicked...
  }
}
on *:NICK:{
  if ($nick == %warned.1) {
    set %warned.1 $newnick
    .notice %warned.1 2If that was to get out of this, it didn't work...
  }
}
on *:TEXT:sorry:#:{
  if ($nick == %warned.1) {
    TIMERwarner off
    .msg $chan 4 %warned.1 2says they're sorry for3 %reason
    .notice %warned.1 2 You were warned because you were3 %reason 2, dont do it again...
    .notice %warned.1 2Next time there will be no warning... Just a KB!
     [color:blue]unset %warned.1[/color]
  }
}


The first blue section replaces $2 with the $(%warned.1,) this is so the timer has the variable %warned.1 in there not the contents of $2 since changing nick would bet $2, being that it is the old nick. The $(<text>,) is needed to tell mirc, DONT evaluate <text> (in this case dont get the contents of %warned.1) but just leave it as "%warned.1".

The second blue section adds a second command to the timer "| unset %warned.1" command sepertor and unset command, both are incased in another $(<text>,) to tell mirc this is still part of the timer command, and to not cause %warned.1 to be evaluated, as it might have been

The 3rd blue bit is just unsetting the %warned.1 in the sorry section.
Posted By: Suntop Re: unset warned - 18/02/06 09:46 PM
What if this person says sorry with a smiley?:
<nick> Sorry :-(
by adding a * after the word sorry, this someone can say more than just sorry, and it still works smile

Code:
on *:TEXT:sorry*:#:{
  if ($nick == %warned.1) {
    TIMERwarner off
    .msg $chan 4 %warned.1 2says they're sorry for3 %reason
    .notice %warned.1 2 You were warned because you were3 %reason 2, dont do it again...
    .notice %warned.1 2Next time there will be no warning... Just a KB!
     unset %warned.1
  }
} 


or by adding a * in front, they can say:
<nick> I am so very sorry :-(
Code:
on *:TEXT:*sorry*:#:{
  if ($nick == %warned.1) {
    TIMERwarner off
    .msg $chan 4 %warned.1 2says they're sorry for3 %reason
    .notice %warned.1 2 You were warned because you were3 %reason 2, dont do it again...
    .notice %warned.1 2Next time there will be no warning... Just a KB!
     unset %warned.1
  }
}


But on the other hand, then they can also say:
<nick> I'm not going to say sorry! :-P
..so this have to be up to you to figure out how to get this right wink
Maybe add a line like:
Code:
if (sorry isin $1-) &amp;&amp; (not isin $1-) { kick $chan %warned.1 Appology not accepted! | halt }
© mIRC Discussion Forums