Skip to content
General IRCX

Kicking Host

A TG007 community discussion started by ConstantVirus1.

Discussion 2 posts
Page 1 of 1
Open
Topic #1064 · 2 published posts · 1,407 views

Does anyone here know a code that will make my script kick a host, that kicks a host on a higher level then them. Like say I have a host on my level 2 access, and he/she kicks a host on my level 3 or 4. A brown host kicks another brown host, or a gold host kicks another gold host, my script will unban them, if there was a ban set, and it will remove the kicker from the user level they are on, and de-op them.

 

This is what I have so far.

 

on *:kick:*:{ 
 if ($level($ial($knick,1)) == level3) { 
   set %kickedhost $knick 
   set %badhost $nick 
   access $comchan($nick,1) delete deny %kickedhost 
   if ($read(text/nicksandadresses.txt,w,* $+ %kickedhost $+ *)) { 
     access $comchan($nick,1) delete deny $gettok($read(text/nicksandadresses.txt, $readn),1,150) 
   } 
   msg $comchan($nick,1) unbanned %kickedhost 
   .ruser level2 *! $+ $$ial(%badhost $+ *,1).addr 
   mode # -o %badhost 
   msg $comchan($nick,1) You have been a bad host.. I removed you from my host list , %badhost :) 
   unset %badhost 
   unset %kickedhost 
 } 
} 
on *:JOIN:*:{ 
 if (!$read(text/nicksandadresses.txt,w,* $+ $address($nick,1) $+ *)) { 
   write text/nicksandadresses.txt $address($nick,1) $+ $chr(150) $+ $nick 
 } 
}

 

But that will not remove the ban if there is one set, and no matter what level you are on, even if you are on a higher level, it will still kick you.

try

access $comchan($nick,1) delete deny %kickedhost $+ *!*@*

 

or, store the person's hostname somehow and try

access $comchan($nick,1) delete deny *!*@* $+ %kickedhostname

 

most scripts ban based on hostname, and therefore deleting the deny based on nickname won't work.

 

the logic is this (at least, this is how the logic works on ignitionServer):

Assume that the nick of the kicked host was Ziggy. This means that the full mask would be Ziggy!*@*. When this host was banned, the host that kickbanned the user banned their hostname. Let's assume Ziggy's hostname was a virtual host of ziggy.creator.of.ignitionserver. The access entry is set for *!*@ziggy.creator.of.ignitionserver. When ignitionServer scans the list of access entries, it cannot match Ziggy!*@* with *!*@ziggy.creator.of.ignitionserver, because Ziggy!*@* can match any hostname. It would be a bug if Ziggy!*@* matched that hostname, because Ziggy!*@* is looking for any mask with Ziggy as the nickname, not any mask with any nickname (which is what would happen if it matched the hostname). Vincula also uses similar logic, which is actually the correct logic.

 

Hopefully that explains it.

The Ignition Project | http://www.ignition-project.com/

Registered Linux User Number 368435

 

Hardware: AMD Athlon 64 3500+, DFI nF4 SLI Infinity, 1GB Dual Channel DDR400, 250GB Western Digital 2500 SE16 SATA II @7200rpm, 200GB Seagate 3200A UATA-133 @7200rpm, NVIDIA GeForce 6800GS OC'ed, 20" Apple Cinema Display