mIRC Home    About    Download    Register    News    Help

Topic Options
#142190 - 16/02/06 03:04 PM unset warned
blk Offline
Babel fish

Registered: 07/02/06
Posts: 95
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?


Edited by blk (16/02/06 03:07 PM)
_________________________
-blk-

Top
#142191 - 16/02/06 03:09 PM Re: unset warned
blk Offline
Babel fish

Registered: 07/02/06
Posts: 95
Hmm... I just tested it.. sumwhere the nick change is messed up..

[edit]My bad, it works, just had a typo...


Edited by blk (16/02/06 03:13 PM)
_________________________
-blk-

Top
#142192 - 16/02/06 03:14 PM Re: unset warned
shadow007 Offline
Ameglian cow

Registered: 13/02/06
Posts: 31
Loc: friesland
it wont work on my bot confused

if i say !warn he does nothing


Edited by shadow007 (16/02/06 03:15 PM)
_________________________
if someone has some nice scrips send them to
Triforce-wisdome@hotmail.com

Top
#142193 - 16/02/06 03:16 PM Re: unset warned
blk Offline
Babel fish

Registered: 07/02/06
Posts: 95
you have to type !warn <nick> <time to be warned> <reason>
_________________________
-blk-

Top
#142194 - 16/02/06 03:19 PM Re: unset warned
blk Offline
Babel fish

Registered: 07/02/06
Posts: 95
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...
_________________________
-blk-

Top
#142195 - 16/02/06 03:24 PM Re: unset warned
shadow007 Offline
Ameglian cow

Registered: 13/02/06
Posts: 31
Loc: friesland
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
_________________________
if someone has some nice scrips send them to
Triforce-wisdome@hotmail.com

Top
#142196 - 16/02/06 04:28 PM Re: unset warned
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
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.

Top
#142197 - 16/02/06 05:05 PM Re: unset warned
blk Offline
Babel fish

Registered: 07/02/06
Posts: 95
With that I get-
DOBAN Unknown command
_________________________
-blk-

Top
#142198 - 16/02/06 05:08 PM Re: unset warned
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
Did you put the code within the code tags into remote?

Top
#142199 - 16/02/06 05:08 PM Re: unset warned
blk Offline
Babel fish

Registered: 07/02/06
Posts: 95
Opps.. forgot to get rid of the alias part..
Thanks grin
_________________________
-blk-

Top
#142200 - 17/02/06 12:06 AM Re: unset warned
DaveC Offline
Planetary brain

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

Top
#142201 - 18/02/06 09:46 PM Re: unset warned
Suntop Offline
Nutrimatic drinks dispenser

Registered: 16/10/03
Posts: 9
Loc: Evergreen Forest, Abode
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 }
_________________________
--==> Wizard Suntop <==--

Top