mIRC Home    About    Download    Register    News    Help

Print Thread
#57917 27/10/03 08:22 AM
Joined: Sep 2003
Posts: 5
V
varul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Sep 2003
Posts: 5
hello .. i am trying to make a black-list script over a week and i dont know what is the problem ... it should normally work
Here is it :

on 10:TEXT:!blist *:#: { //mode $chan -o $2 //mode $chan +b $address($2,3) | //kick $chan $2 0,4! 0,2Blacklisted 0,4! | //write blist\blist.txt $address($2,3) }
on *:JOIN:#kappa:{
var %blist = $read(blist\blist.txt, s, $address($nick,3))
if (%blist == $null) { notice $nick 0,4Welcome to  $chan  }
else { //mode $chan -o $nick | //mode $chan +b $address($nick,3) | //kick $chan $nick 0,4! 0,2Blacklisted 0,4! }
}


Does anyone have any ideea why doesnt it work ? confused

#57918 27/10/03 09:22 AM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
quick edit...

Code:
on 10:TEXT:!blist*:#:{
  mode $chan -o+b $2 $address($2,3)
  kick $chan $2 0,4! 0,2Blacklisted 0,4!
  write blist\blist.txt $address($2,3)
}
on *:JOIN:#kappa:{ 
  var %blist = $read(blist\blist.txt, w, $address($nick,3))
  if (!%blist) { notice $nick 0,4Welcome to  $chan  } 
  else {
    mode $chan -o+b $nick $address($nick,3)
    kick $chan $nick 0,4! 0,2Blacklisted 0,4!
  }
}

;if using mIRC 6.12
on 10:TEXT:!blist*:#:{
  mode $chan -o $2
  ban -k $chan $2 3 0,4! 0,2Blacklisted 0,4!
  write blist\blist.txt $address($2,3)
}
on *:JOIN:#kappa:{ 
  var %blist = $read(blist\blist.txt, w, $address($nick,3))
  if (!%blist) { notice $nick 0,4Welcome to  $chan  } 
  else {
    mode $chan -o $nick
    ban -k $chan $2 3 0,4! 0,2Blacklisted 0,4!
  }
}


Go ahead, jump. 100,000 lemmings can't be wrong.
#57919 27/10/03 02:25 PM
Joined: Dec 2002
Posts: 94
K
Babel fish
Offline
Babel fish
K
Joined: Dec 2002
Posts: 94
i find
$read(blist\blist.txt, w, * $+ $address($nick,3) $+ *)
works alot better


Lets get dirty
Joined: Sep 2003
Posts: 5
V
varul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Sep 2003
Posts: 5
It still doesnt work... only the first part works and by that i mean when i say !blist someone it ban-kicks him but when he rejoins nothing hapens.i think it has to do whit the variable
%blist smirk.. do you still have another ideea ??

Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Just out of curiosity, why are you using a txt file? mIRC has a userlist feature which is more than adequate for this.
Code:
[color:green]; code to add a user[/color]
[color:green]; syntax: !blist <nick> <reason>[/color]
on [color:blue]@[/color]10:TEXT:!blist*:#: {
  [color:green]; This checks if the specified nick is on the channel[/color]
  if ($2 ison #) {
    [color:green]; if so, it adds him[/color]
    [color:green]; format: *!*identd@*.host.domain #channel reason[/color]
    .guser BLIST $2 3 $chan $3-
    [color:green]; and of course it removes him, kicking with the specified reason[/color]
    ban -k # $2 3 $3-
  }
}
[color:blue] [/color]
[color:green]; When a user matching a banned address joins[/color]
on @BLIST:JOIN:#: {
  [color:green]; check if he is banned on the channel he joined in[/color]
  if ($gettok($ulist($address($nick,3)).info,1,32) == $chan) {
    [color:green]; if so, then remove him with the pre-specified reason[/color]
    ban -k # $nick 3 $gettok($ulist($address($nick,3)).info,2-,32) 
  }
}

note: these two events are only triggered when you are opped. The second is pointless if you are not, but if you want to allow people to blacklist users even when you are not opped, remove the blue @. I am also assuming you work with 6.12 here.

note2: if you rather not rely on the userlist (it occasionally gets wiped, although you can of course add code to the first event to auto-back it up when a user gets added), you might wanna consider using a hash table (same but), or a ini file.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#57922 28/10/03 09:42 AM
Joined: Sep 2003
Posts: 5
V
varul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Sep 2003
Posts: 5
i have mirc 6.03 ... and that is exaclty the point ... it makes no fun working with predefined mirc variables ... i would appreciate if you could help me with MY script smile . thx

#57923 28/10/03 09:58 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
The only difference is that I'm not sure if 6.03 supports the -k flag in the ban. If not, use the following to replace the one ban line and it will work:

Code:
ban # $nick 3 
kick # $nick $gettok($ulist($address($nick,3)).info,2-,32


As for the rest, it shouldn't be that hard to use

Code:
write filename.txt $address($1,3) $chan $3-


instead of the guserline, and

Code:
if ($read(filename.txt,s,$address($nick,3))) { kickban here }


to match in the on join line. It's merely a helluva lot simpler to match entries when you add them to the userlist. And why re-invent the wheel?

Code:
on @*:JOIN:#: {
  [color:green]; if the user exists, kickban[/color]
  if ($read(filename.txt,s,$address($nick,3))) { 
    ban # $nick 3 
    kick # $nick $gettok($ulist($address($nick,3)).info,2-,32
  }  
  [color:green]; otherwise welcome him[/color]
  else {  
    .notice $nick Welcome to $chan ! 
  }
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#57924 29/10/03 09:56 AM
Joined: Sep 2003
Posts: 5
V
varul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
V
Joined: Sep 2003
Posts: 5
it finally works smile) thx m8s smile

Last edited by varul; 29/10/03 09:56 AM.

Link Copied to Clipboard