egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Only Version Certain Ips.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Sat Jan 16, 2010 12:36 am    Post subject: Only Version Certain Ips. Reply with quote

hello all i have this working code with me however its versioning every ip but i jus want it to version certain ips like for example *!*@125.* *!*@118.* , i tried to play around with it but with no success,help will be appreciated.. Code is listed below :
Code:

bind ctcr - VERSION version:reply
bind join - * check:version

proc check:version {nick uhost hand chan} {
if {[isop $nick $chan] || [isvoice $nick $chan] || [matchattr $hand Pfov|Pfov $chan]} {
return 0
}

global cversion
chattr proxychk +|+P $chan
set cversion([string tolower $nick]) 1
putserv "PRIVMSG $nick :\001Version\001"
utimer 90 [list no:version:reply $nick $uhost $chan]
}

proc version:reply {nick uhost hand dest kw arg} {
global cversion
if {[info exists cversion([string tolower $nick])]} {
unset cversion([string tolower $nick])
}
}


proc no:version:reply {nick uhost chan} {
global cversion
if {[info exists cversion([string tolower $nick])] && [onchan $nick $chan]} {
putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
putserv "KICK $chan $nick : Spam"
unset cversion([string tolower $nick])
}
}

putlog "Version Kicker"


Thank you For Assisting.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jan 31, 2013 5:26 pm    Post subject: Reply with quote

You can try this if you have problems leave a reply and i will take a closer look at the code

Code:

bind ctcr - VERSION version:reply
bind join - * check:version

set temp(hosts) {
   "125."
   "133."
}

proc check:version {nick uhost hand chan} {
   global temp

   if {[isop $nick $chan] || [isvoice $nick $chan] || [matchattr $hand Pfov|Pfov $chan]} {
      return 0
   }

   global cversion
   chattr proxychk +|+P $chan
   set cversion([string tolower $nick]) 1
   foreach n [split $temp(hosts)] {
      if {[string match -nocase "$n*" [lindex [split [getchanhost $nick $chan] @] 1]]} {
         putserv "PRIVMSG $nick :\001Version\001"
         utimer 90 [list no:version:reply $nick $uhost $chan]
      }
   }
}

proc version:reply {nick uhost hand dest kw arg} {
   global cversion
   if {[info exists cversion([string tolower $nick])]} {
      unset cversion([string tolower $nick])
   }
}


proc no:version:reply {nick uhost chan} {
   global cversion
   if {[info exists cversion([string tolower $nick])] && [onchan $nick $chan]} {
      putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
      putserv "KICK $chan $nick : Spam"
      unset cversion([string tolower $nick])
   }
}

putlog "Version Kicker"

_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Feb 01, 2013 4:48 am    Post subject: Reply with quote

Code:

set ctcpList [list "*!*@125.*" "*!*@118.*"]

bind join - * version:join
bind ctcp - VERSION version:reply

proc version:join {nick uhost hand chan} {
   global versionCheck
   if {[isbotnick $nick]} return
   if {[matchattr $hand Pfov|Pfov $chan]} return
   if {[lsearch -glob $::ctcpList "$nick!$uhost"]!=-1]} {
      if {[lsearch [array names versionCheck] $nick] != -1} return
      puthelp "PRIVMSG $nick :\001Version\001"
      array set versionCheck { $nick 1 }
      utimer 90 [list version:punish $nick $uhost $chan]
   }
}

proc version:reply {nick uhost hand dest key text} {
   global versionCheck
   if {![isbotnick $dest]} return
   if {[lsearch [array names versionCheck] $nick] != -1} return
   array unset versionCheck $nick
}

proc version:punish {nick uhost chan} {
   global versionCheck
   if {[lsearch [array names versionCheck] $nick] != -1} return
   if {[onchan $nick $chan]} {
      putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
      putserv "KICK $chan $nick :Spam!"
   }
   array unset versionCheck $nick
}

Haven't tested so let me know if you get any errors.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber