mIRC Home    About    Download    Register    News    Help

Print Thread
#126114 25/07/05 04:55 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Ok, Im making a script... that need to follow a nick...

E.x: If nick join channel...... the script saves the nick... but!! if the nick changes to nick1.. then the script still follows it...... like....

The issue is that...... I'm makin a join/part script... If sombody joins and part within 10 seconds they get banned!

Code:
 on 1:join:#:{ auser 2 $nick | timer 1 10 ruser $nick }
on 2:part:#:{ .msg X ban # $nick 336 499 join/part } 


this works nice.... but if I make a new level 5.. that is for admin commands..... all with level 5 get's banned..... so... I know there is a feature that "load" the nick/address into the "mirc" :tongue: sombody knows what im talking about? Since, I almost dont know it my self.. confused grin

#126115 25/07/05 05:15 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
FYI: This type of script is commonly called a Revolving Door script in case you want to look up other scripts that do this.

If you're just using it to ban those who part too quickly, use this:
Code:
on *:join:#chan: {
  set -u10 $+(%,RevolvingDoor.,$nick) 1
}
on *:part:#chan: {
  if ($+(%,RevolvingDoor.,$nick) != $null) {
    .msg X ban # $nick 336 499 join/part 
  }
}


Replace the 10 in -u10 with the number of seconds a person must remain in the channel.

Just as a note... I just copied your way of banning using X. I don't use X, so can't tell you if that's a valid format.

If you need to track nicks for some other reason, you can use $level to find out the level of a user.

Example to prevent a level 5 (op?) from having something like a ban done to them:
Code:
if ($level($nick) == 5) { halt }


Invision Support
#Invision on irc.irchighway.net
#126116 25/07/05 05:22 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Strange, i waited 1 min befor parting.. and it bans me! hmm..?

#126117 25/07/05 05:53 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Sorry... It wasn't evaluating the variable. frown

Replace:

if ($+(%,RevolvingDoor.,$nick) != $null) {

with

if (%RevolvingDoor. [ $+ [ $nick ] ] ) != $null) {


Invision Support
#Invision on irc.irchighway.net
#126118 26/07/05 01:16 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
thanks!! grin

#126119 26/07/05 01:46 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
what, it still dosen't work! I't acted the same way!

#126120 26/07/05 02:22 PM
Joined: Jul 2005
Posts: 40
K
Ameglian cow
Offline
Ameglian cow
K
Joined: Jul 2005
Posts: 40
simple this:

on *:join:#chan: { set -u10 %rd. [ $+ [ $nick ] ] 1 }
on *:part:#chan: { if (%rd. [ $+ [ $nick ] ] == 1) { .msg X ban # $nick 336 499 join/part } }

have fun


j0k3r @ k4s.ch
#126121 26/07/05 02:27 PM
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
nice! Worked perfect! Thanks grin

#126122 26/07/05 04:36 PM
Joined: Aug 2004
Posts: 11
H
Pikka bird
Offline
Pikka bird
H
Joined: Aug 2004
Posts: 11
i followingly tried to add a check with X (on undernet) for the revolving.
i think this came out very(!) crude though, and additionally i have no way test it (got no channel on undernet).
so for keeping safe, don't simply copy and paste it without understanding it more or less. i'm sure it's got a few flaws in it.
add some errorlevel-echo's to see where the script goes and where it stops. and of course change the variables to your needs.

Code:
on *:start:{ init_hBan_X }
alias init_hBan_X {
  set %hBan_X_JoinPartDelay 10
  set %hBan_X_Xdelay 10
  set %hBan_X_adjustFactor <=
  set %hBan_X_adjust 5
  ;"adjust" refers to the access level with X. in combination with "adjustFactor" ex. "<= 5" should result in
  ;users with levels 0-4 being revolve-banned and levels 5+ remaining unharmed.
  set %hBan_X_duration 336
  set %hBan_X_banmask 5
  set %hBan_X_level 499
  set %hBan_X_reason join/part
  set %hBan_X_chans #chan
  ;when adding chans here, separate with commas, not blanks
  set %hBan_X_Xaddress X!cservice@undernet.org
  set %hBan_X_network undernet
}

#hBan_X_group off
on ^1:notice:*:?:{
  if (%hBan_X_network isin $network) && ($address($nick,5) == %hBan_X_Xaddress) {
    if (access isin $1-) { .set $eval($+(%hBan_X_,$2)) $eval($+(%hBan_X_,$2),2) $4 }
    elseif (match isin $1-) { .set $eval($+(%hBan_X_,$2)) $eval($+(%hBan_X_,$2),2) 0 }
    .hBan_X_proc $eval($+(%hBan_X_,$2),2)
  }
}
alias hBan_X_proc {
  if ($2 %hBan_X_adjustFactor %hBan_X_adjust) {
    .msg X@cserve.undernet.org ban $1 %hBan_X_adr %hBan_X_duration %hBan_X_level %hBan_X_reason
  }
}
#hBan_X_group end

on ^1:join:%hBan_X_chans:{ 
  .set -u $+ $eval(%hBan_X_JoinPartDelay) $eval($+(%,RevolvingDoor.,$nick)) 1
  .set %hBan_X_adr $address($nick,%hBan_X_banmask)
}
on ^1:part:%hBan_X_chans:{
  if ($eval($+(%,RevolvingDoor.,$nick),2) != $null) {
    .enable #hBan_X_group
    .set $eval($+(%hBan_X_,$nick)) $chan
    .msg x access $chan $nick -min [color:red]%hBan_X_banmask[/color]
    .timerhBX 1 %hBan_X_Xdelay .disable #hBan_X_group
  }
}


that's just a construct. an idea.

edit1

Last edited by harl; 26/07/05 04:40 PM.

Link Copied to Clipboard