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.

nospam1.7.2.tcl modification help

Old posts that have not been replied to for several years.
Locked
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

nospam1.7.2.tcl modification help

Post by Weirdo »

Hey

A few of us on aniverse irc are using this script in order to help catch and gline spammers on the network. The new system operates by messages being sent to #nospam when someone is kicked so they can be dealt with. The channel is -n which allows private messages form outside the channel to be put into the channel.

Is there something i can add to this script to allow the bot to report when a spammer hits the channels the bot operates on. If possible, with the format

<time> <date> <channel> <spammer nick> <spammer host> <spammer message>

Best place i think for the code to act is in the Spammer logger section of the script

Code: Select all

proc sl_write {type who where what why} {
  global spam-log spam-log-file
  if {${spam-log}} {
    set file [open ${spam-log-file} a+]
    set when [strftime "%D %r"]
    switch $type {
      c {puts $file "$when: $who said: (#$why) $what in: $where"}
      d {puts $file "$when: $who was sending: $what to people in: $where"}
      i {puts $file "$when: $who invited me to: $where"}
      m {puts $file "$when: $who messaged me with: (#$why) $what"}
      n {if {![string length $where]} {set where "me"} ; puts $file "$when: $who noticed: $where with: (#$why) $what"}
      p {puts $file "$when: $who parted from: $where with: (#$why) $what"}
    }
    close $file
  }
}
Any help regarding this would be wonderful. The script was created by ppslim and is at http://sourceforge.net/projects/no-spam/.


Edit, ok we tried this to add the feature

Code: Select all

  if {${spam-log}} {
  switch $type {
  	c {putserv "PRIVMSG #nospam :$when: $who said (#$why) $what in: $where"}
  	d {putserv "PRIVMSG #nospam :$when: $who was sending: $what to people in: $where"}
  	i {putserv "PRIVMSG #nospam :$when: $who invited me to: $where"}
  	m {putserv "PRIVMSG #nospam :$when: $who messaged me with: (#$why) $what"}
  	n {if {!string length $where]} {set where "me"} ; putserv "PRIVMSG #nospam :$when: $who noticed$
  	p {putserv "PRIVMSG #nospam :$when: $who parted from: $where with: (#$why) $what"}
	}
    set file [open ${spam-log-file} a+]
    set when [strftime "%D %r"]
    switch $type {
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

little help pls
<caron> WOOOAAA OMG WOW LIKE SWEET!!! DO THIS GUYS!!! /join #2,000

[22:06:05] <Natsuki-Chan> [22:06] Tcl error [msgs:abuse]: can't read "when": no such variable
[22:06:05] <Natsuki-Chan> [22:06] #catgirls: mode change '+b *!*caron@*.adelphia.net' by Natsuki-Chan!~Natsuki@spc1-ward1-6-0-cust180.manc.broadband.ntl.com
i dont understand why $when: doesnt work. the code is identical to the stuff above
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

you are using it before it is set
photon?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Move the "set when [strftime "%D %r"]" before the "switch $type {" and should be working..
Once the game is over, the king and the pawn go back in the same box.
Locked