This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help with something please.

Old posts that have not been replied to for several years.
Locked
C
Carnage69
Halfop
Posts: 64
Joined: Sat Jun 07, 2003 8:25 pm

help with something please.

Post by Carnage69 »

Hello i am trying to make a anti advertise script and it bans everyone in the chan that talks can someone help me here is the script.

Code: Select all

set advertiseban(banmessage) "Do Not Advertise In #ProFrag"
set advertiseban(time) "120"
set advertiseban(chan) "#profrag"

bind pubm - "$advertiseban(chan) *#*" chanadvertise
proc chanadvertise { nick host hand chan text } {
  global advertiseban botnick
  if { [isop $nick $chan] || [isvoice $nick $chan] } {
  return 1
  }
  set newhost "*!*[string range $host [string first @ $host] end]"
  set comment " $advertiseban(banmessage) (2 Hours)"
  newchanban $chan $newhost $botnick $comment $advertiseban(time)
  return 1
}

putlog "Anti Advertise v1.0 by Carnage Loaded."    
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set advertiseban(banmessage) "Do Not Advertise In #ProFrag" 
set advertiseban(time) "120"
set advertiseban(chans) "#profrag #somechannel" 

bind pubm - {* *#*} chanadvertise

proc chanadvertise {nick uhost hand chan text} { 
  global advertiseban
  if {[lsearch -exact [split [strlwr $advertiseban(chans)]] [string tolower $chan]] == -1 || [isop $nick $chan] || [isvoice $nick $chan]} {
    return
  }
  scan $uhost "%\[^@\]@%s" user host
  newchanban $chan *!*@$host spam "$advertiseban(banmessage)" $advertiseban(time)
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Just a tip:
caesar wrote:

Code: Select all

scan $uhost "%\[^@\]@%s" user host
There's no need to create variables you're not going to use... add a '*' to the first part of the conversion rule to avoid having the value assigned to a variable.

Code: Select all

scan $uhost {%*[^@]@%s} host
Have you ever read "The Manual"?
Locked