mIRC Home    About    Download    Register    News    Help

Print Thread
#107064 06/01/05 05:24 PM
Joined: Jan 2005
Posts: 5
X
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jan 2005
Posts: 5
If any one will be so kind?? could it When i am banned it waits two seconds then sends to chanserv /cs unban #channel so its auto please? smile

Thanks in advance Cypher

#107065 06/01/05 05:30 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on @!*:ban:#:{
  if ($banmask iswm $address($me,5)) { .timer 1 2 cs unban $chan $v1 }
}


New username: hixxy
#107066 06/01/05 06:04 PM
Joined: Jan 2005
Posts: 5
X
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jan 2005
Posts: 5
Quote:
Code:
on @!*:ban:#:{
  if ($banmask iswm $address($me,5)) { .timer 1 2 cs unban $chan $v1 }
}


Very Very Helpfull but how do i auto join channel again after it unbanned me?

#107067 06/01/05 06:27 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on @!*:ban:#:{
  if ($banmask iswm $address($me,5)) { 
    .timer 1 2 cs unban $chan $v1 
    .timer 1 3 if ( $me !ison $chan ) { join $chan }
  }
}


New username: hixxy
#107068 06/01/05 06:37 PM
Joined: Jan 2005
Posts: 5
X
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jan 2005
Posts: 5
Quote:
Code:
on @!*:ban:#:{
  if ($banmask iswm $address($me,5)) { 
    .timer 1 2 cs unban $chan $v1 
    .timer 1 3 if ( $me !ison $chan ) { join $chan }
  }
}


Thanks alot but the auto join dont work frown after it unbans me i want it to join right away no wait

Thanks in Advance Cypher

#107069 06/01/05 06:41 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on @!*:ban:#:{
  if ($banmask iswm $address($me,5)) { 
    .timer 1 2 cs unban $chan $v1 $chr(124) if ( $me !ison $chan ) { join $chan }
  }
}


Make sure you paste the script in as you see it, syntax is important for this script.


New username: hixxy
#107070 06/01/05 06:43 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
/help $banmask
/help Nick and Address Identifiers.

#107071 06/01/05 07:01 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Since we are positive that your services are ChanServ, the best way to rejoin the channel is upon receiving the message that you are unbanned, rather than to use a timer.

Btw why do you only want to unban yourself after 2 seconds?

Anyway, this will do exactly as you want: when you get banned, after 2 seconds you will ask chanserv to unban you, and when chanserv does this, you will autojoin immediately, that is if you aren't on the channel already.


on @!*:BAN:#: if $banmask iswm $address($me,5) { .timer 1 2 cs unban # $!me }
[color:blue]

on *:NOTICE:*:?: {
tokenize 32 $strip($1-)
if $nick == ChanServ && $me !ison $6 && *bans* $me *cleared* iswm $1- { join $6 }
}
[/color]


Gone.
FiberOPtics #202647 27/07/08 08:13 AM
Joined: Jul 2008
Posts: 3
G
Self-satisified door
Offline
Self-satisified door
G
Joined: Jul 2008
Posts: 3
help me please....if i want to set auto unban after 14 days??

can i see the code???thx before

gonjos #202666 27/07/08 05:32 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:op:#:{
  if $opnick == $me {
    var %a = 1
    while %a <= $ibl($chan,0) {
      if $calc($ctime - $ibl($chan,%a).ctime) > 1209600 {
        .mode -b $chan $ibl($chan,%a)
    }
    else {
      .timer 1 $calc($v2 - $v1) .mode $safe($chan) -b $ibl($chan,%a)
    }
    inc %a
    }
  }
}
on *:ban:#:{
  .timer 1 1209600 .mode -b $safe($chan) $banmask
}
alias safe return $!decode( $encode($1,m) ,m)

Safe alias provided courtesy of Qwerty.

RusselB #202691 28/07/08 08:34 AM
Joined: Jun 2008
Posts: 48
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jun 2008
Posts: 48
RusselB must have been in a hurry so Ill explain the code for him incase anyone wants to know.

It sets a timer when you ban the person to unban them in 14 days.
Since there is a darn good chance you wont stay connected or even have mirc open that long he also added some backups. Every time you are opped in a channel it checks every entry in the ban list and if it has been more than 14 days it unbanes them but if not it sets a timer to unset it in the remaining time it had.
So, if you restarted mirc and connected and were opped in #channel and #channel had one user who was banned 7 days ago, it will set a timer to unban that user in 7 days so they will have served the whole 14 days.

This is a pretty good system except for the fact that you can be reopped in a channel without having disconnected so this code can end up having multiple timers for each entry.

To fix this problem I will edit his code to include a name in the timer that uses the channel name and banned address and then if it is setting a timer that already exists it will just overwrite it instead of making a duplicate.

Also, while it may appear that the brackets are off and the else line and inc %a are outside the while loop it was just the way he wrote it, its actually just fine.

Anyone using the code should consider changing the # in the events to a specific channel. Don't forget you can do multiple channels by seperating with a comma like
Code:
on *:text:!trigger:#testing,#anotherchannel:{ commands }

Heres the new code with the timer line changed to name the timer so we can avoid multiple timers for each entry stacking up.
Code:
on *:op:#:{
  if $opnick == $me {
    var %a = 1
    while %a <= $ibl($chan,0) {
      if $calc($ctime - $ibl($chan,%a).ctime) > 1209600 {
        .mode -b $chan $ibl($chan,%a)
    }
    else {
      .timer $+ $chan $+ $ibl($chan,%a) 1 $calc($v2 - $v1) .mode $safe($chan) -b $ibl($chan,%a)
    }
    inc %a
    }
  }
}
on *:ban:#:{
  .timer 1 1209600 .mode -b $safe($chan) $banmask
}
alias safe return $!decode( $encode($1,m) ,m)

Good luck.


I've gone to look for myself. If I should return before I get back, please keep me here.
Typos #202720 28/07/08 11:08 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks for the explanation of my code... as you noted, I was in a bit of a hurry. Now to further implement the usage of the named timers that you were nice enough to start (and I'm a bit surprised that you didn't do this), here's the code with the named timer also being used in the on ban event, to ensure that a double timer isn't set
Code:
on *:op:#:{
  if $opnick == $me {
    var %a = 1
    while %a <= $ibl($chan,0) {
      if $calc($ctime - $ibl($chan,%a).ctime) > 1209600 {
        .mode -b $chan $ibl($chan,%a)
    }
    else {
      $+(.timer,$chan,$ibl($chan,%a)) 1 $calc($v2 - $v1) .mode $safe($chan) -b $ibl($chan,%a)
    }
    inc %a
    }
  }
}
on *:ban:#:{
  $+(.timer,$chan,$banmask) 1 1209600 .mode -b $safe($chan) $banmask
}
alias safe return $!decode( $encode($1,m) ,m)



RusselB #202924 02/08/08 07:40 PM
Joined: Jul 2008
Posts: 3
G
Self-satisified door
Offline
Self-satisified door
G
Joined: Jul 2008
Posts: 3
thanks a lot...first, i will open my dictionary to translate ...after that i will try de code to my irc...thank you so much

gonjos #202926 02/08/08 08:59 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
For scripting purposes, to my knowledge, there is no difference as to what language you use. ie: A script for someone in the United States, where English/American is spoken will work without modification (unless there's specific text being presented), with a copy of mIRC that is being used by someone in Greece.

RusselB #203189 08/08/08 09:07 AM
Joined: Jul 2008
Posts: 3
G
Self-satisified door
Offline
Self-satisified door
G
Joined: Jul 2008
Posts: 3
sorry, i try to use that script but it doesn't work...
i use that script for my bot at Warcraft III PVPGN Server channel with mirc...

this is my script for my operator...
Code:
on 999:text:!ops*:?: {
  //msg $nick $2 Command for Operator...
  //msg $nick $2 Command Ban : /w Gonjos !Ban [Username] [time] [information]
}


and this is the command for my bot...
Code:
on 999:text:!ban*:?: { 
  /raw ban $2 $4- (Duration: $3 $+ ) (by OP: $nick $+ )
  /raw lockacct $2
  /writeini -n status.ini Status $2 Status : Banned
  /writeini -n status.ini Date $2 Date : $date(dd-mm-yyyy)
  /writeini -n status.ini Time $2 Time : $time(HH:nn)
  /writeini -n status.ini Duration $2 Duration : $3
  /writeini -n status.ini Information $2 Information : $4-
  /writeini -n status.ini by $2 by Operator : $nick
  /timer 1 $3 /raw unban $2
  /timer 1 $3 /raw unlockacct $2
  /timer 1 $3 /writeini -n status.ini Status $2 Status : Un-Banned
  /timer 1 $3 /writeini -n status.ini Information $2 Information : Your ID has been Un-Banned
}


but when i restart my mirc...that script will failed to auto unban...

can you help me to set that script so if i want to restart the mirc, the script still can to auto unban...

sorry if my english to bad...im from indonesia so i can speak english just a little... blush i hope you can understand..thanks

gonjos #203190 08/08/08 09:49 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
When you re-started mIRC (technically when you disconnected mIRC from the network), all online timers were automatically disabled, so none of the /timer commands in your script would still be running.

Do you have any of the following events:
1) ON CONNECT
2) ON JOIN
3) ON START

If so, please post the code(s), as these are the areas where the unban command would have to be issued from for it to work upon a restart.

RusselB #203234 09/08/08 07:37 PM
Joined: Feb 2008
Posts: 34
Ameglian cow
Offline
Ameglian cow
Joined: Feb 2008
Posts: 34
alias id { nickserv identify password}

alias bancheck {
if ( $chan($1).ibl == $true ) {
var %c = 1
while ( %c <= $ibl( $1,0 ) ) {
var %w = $ibl($1,%c)
if ( %w iswm ~r: $+ $fullname ) {
mode $1 -b %w
}
if ( ~c: isin %w ) {
if ( $right( %w,-3 ) ischan ) {
mode $1 -b %w
}
}
if ( %w iswm $address( $me,5 ) ) {
mode $1 -b %w
}
inc %c
}
else { halt }
}
}

on *:INVITE:#: {
if ( $fulladdress == ChanServ!services@services.utonet.org ) {
join $chan
}
}


on *:KICK:*: {
if ($knick == $me) {
cs invite $chan
}
}

on *:JOIN:#: {
if ( $nick == $me ) {
mode $chan +b
.timer $+ $chan -m 1 250 /bancheck $chan
}
}

on *:RAWMODE:#: {
if ( *-*o* iswm $1 ) && ( $me isin $2- ) {
chanserv op $chan $me
}
if ( *-*q* iswm $1 ) && ( $me isin $2- ) {
id
}
if ( *-*a* iswm $1 ) && ( $me isin $2- ) {
chanserv protect $chan $me
}
if (*-*h* iswm $1) && ( $me isin $2- ) {
chanserv halfop $chan $me
}
if (*-*v* iswm $1) && ( $me isin $2- ) {
chanserv voice $chan $me
}
if (*+*b* iswm $1) {
.timer $+ $chan -m 1 250 /bancheck $chan
}
}


}


Just put your password in first line.Using this script and its working ok:)

mbab #203260 10/08/08 03:56 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In future, when posting code, please use the Code Tags button (looks like #)

RusselB #203354 12/08/08 07:08 PM
Joined: Feb 2008
Posts: 34
Ameglian cow
Offline
Ameglian cow
Joined: Feb 2008
Posts: 34
Code:
[/code]Oh sorry.Sure np:)[code]


Link Copied to Clipboard