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 Notes

Support & discussion of released scripts, and announcements of new releases.
Post Reply
R
Road_to_Hell
Voice
Posts: 2
Joined: Sat Aug 23, 2008 6:06 pm

Help With Notes

Post by Road_to_Hell »

Hello,
i'm using added-on.tcl from your archive, but i have a problem with the function to send note to me when someone adds or delete user/ban.
I am the permanent owner of the bot.

When a friend add a user, the bot message me with this:
[00:54] <(Since1914> *** Note arrived for you.

But when i try to read it:
[00:54] <Road_to_Hell> .notes read all
[00:54] <(Since1914> You have no messages.

I can't read the note and don't know why :(

I just need tcl who notes me every time when someone adds or deletes an user.

Please help and sorry for my bad english.

Here is the tcl:

Code: Select all

# add-on.tcl
# Copyright (c)2000-2002 by funak <funak@funak.sk>
# Last update: 1.6.2002
#
#  Features:
#  -script adds an "Added" entry into the userfile for each user which were added 
#   (ex. ADDED: by funak as luzer (23-07-2001@03:55))
#  -script adds a "Changed" entry into the userfile for each user which had changed
#   flags (ex. CHANGED: by funak (23-07-2001@03:55) +o #mychann)
#  -script sends a note to the users specified in the config file's notify-newusers 
#   setting about new and deleted users 
#   (ex. User funak deleted luzer (23-07-2001@03:55).)
#  -script adds (handle date@time) to bans' reason, so banned person can see who 
#   set a ban on him (ex.[  1] *!*ident@hostmask (perm)
#					 funak: reason (set by funak on 23-07-2001@03:55) )
#                     
# Based on - Added.tcl by Nils Ostbjerg <shorty@business.auc.dk> (C)Copyright (2000)
#
# Changelog:
# v1.0 - first relase
#	   removed: hello, addhost
#	   added: deluser, -user, -bot, notifying ppl about deleted users
# v1.2 - added: "changed" field, notifying ppl about new users
# v1.2 - added: "who banned" to bans' reason
#
# Any ideas, suggestions, bugreports, flames, cash, cars (I prefer new Skoda Superb),
# etc should be sent to me ;o)) 
# (contact info above).

set verzia v1.2

##########################################################################
# Bindings                                                               #
##########################################################################
unbind dcc m|m adduser *dcc:adduser
unbind dcc m|m deluser *dcc:deluser
unbind dcc m|- +user *dcc:+user
unbind dcc m|- -user *dcc:-user
unbind dcc t|- +bot *dcc:+bot
unbind dcc t|- -bot *dcc:-bot
unbind dcc m|m chattr *dcc:chattr
unbind dcc o|o +ban *dcc:+ban

bind dcc m|m adduser dcc:adduser
bind dcc m|m deluser dcc:deluser
bind dcc m|- +user dcc:+user
bind dcc m|- -user dcc:-user
bind dcc t|- +bot dcc:+bot
bind dcc t|- -bot dcc:-bot
bind dcc m|m chattr dcc:chattr
bind dcc o|o +ban dcc:+ban

##########################################################################
# Initilization                                                          #
##########################################################################
if {![info exists whois-fields]} {
    set whois-fields ""
}

# Add "Added" field
set ffound 0
foreach f2 [split ${whois-fields}] {
    if {[string tolower $f2] == [string tolower "ADDED"]} {
        set ffound 1
        break
    }
}
if {$ffound == 0} {
    append whois-fields " " "ADDED"
}

# Add "Changed" field
set ffound 0
foreach f2 [split ${whois-fields}] {
    if {[string tolower $f2] == [string tolower "CHANGED"]} {
        set ffound 1
        break
    }
}
if {$ffound == 0} {
    append whois-fields " " "CHANGED"
}
			    
##########################################################################
# dcc:chattr start                                                       #
##########################################################################
proc dcc:chattr {hand idx paras} {
 set user [lindex $paras 0]
 set flags [lindex $paras 1]
 set on_chan [lindex $paras 2]
 if {[validuser $user]} {
  *dcc:chattr $hand $idx $paras
  setuser $user xtra CHANGED "by $hand ([strftime %d-%m-%Y@%H:%M]) $flags $on_chan"
 } else {
  *dcc:chattr $hand $idx $paras
 }
}
##########################################################################
# dcc:chattr end                                                         #
##########################################################################

##########################################################################
# dcc:add/deluser start                                                  #
##########################################################################
proc dcc:adduser {hand idx paras} {
    set user [lindex $paras 1]
    if {$user == ""} {
	if {[string index $paras 0] == "!"} {
	    set user [string range [lindex $paras 0] 1 end]
	} else {
	    set user [lindex $paras 0]
	}
    }
    if {[validuser $user]} {
	*dcc:adduser $hand $idx $paras
    } else {
	*dcc:adduser $hand $idx $paras
	if {[validuser $user]} {
            setuser $user xtra ADDED "by $hand as $user ([strftime %d-%m-%Y@%H:%M])"
		tellaboutnew $hand $user
	}
    }
}    

proc dcc:deluser {hand idx paras} {
    set user [lindex $paras 0]
    if {[validuser $user]} {
	*dcc:deluser $hand $idx $paras
      tellaboutdel $hand $user
    } else {
	*dcc:deluser $hand $idx $paras
    }
}    
##########################################################################
# dcc:add/deluser end                                                    #
##########################################################################

##########################################################################
# dcc:+/-user start                                                      #
##########################################################################
proc dcc:+user {hand idx paras} {
    set user [lindex $paras 0]
    if {[validuser $user]} {
        *dcc:+user $hand $idx $paras
    } else {
        *dcc:+user $hand $idx $paras
        if {[validuser $user]} {
            setuser $user xtra ADDED "by $hand as $user ([strftime %d-%m-%Y@%H:%M])"
		tellaboutnew $hand $user
        }
    }
}

proc dcc:-user {hand idx paras} {
    set user [lindex $paras 0]
    if {[validuser $user]} {
        *dcc:-user $hand $idx $paras
        tellaboutdel $hand $user
    } else {
        *dcc:-user $hand $idx $paras
    }
}
##########################################################################
# dcc:+/-user end                                                        #
##########################################################################

##########################################################################
# dcc:+/-bot start                                                       #
##########################################################################
proc dcc:+bot {hand idx paras} {
    set user [lindex $paras 0]
    if {[validuser $user]} {
        *dcc:+bot $hand $idx $paras
    } else {
        *dcc:+bot $hand $idx $paras
        if {[validuser $user]} {
            setuser $user xtra ADDED "by $hand as $user ([strftime %d-%m-%Y@%H:%M])"
		tellaboutnew $hand $user
        }
    }
}

proc dcc:-bot {hand idx paras} {
    set user [lindex $paras 0]
    if {[validuser $user]} {
        *dcc:-bot $hand $idx $paras
        tellaboutdel $hand $user
    } else {
        *dcc:-bot $hand $idx $paras
     }
}
##########################################################################
# dcc:+/-bot end                                                         #
##########################################################################

##########################################################################
# tellaboutnew start                                                     #
##########################################################################
proc tellaboutnew {hand user} {
    global notify-newusers
    foreach ppl ${notify-newusers} {
	sendnote $hand $ppl "User $hand added $user ([strftime %d-%m-%Y@%H:%M])."
    }
}    
##########################################################################
# tellaboutnew end                                                       #
##########################################################################

##########################################################################
# tellaboutdel start                                                     #
##########################################################################
proc tellaboutdel {hand user} {
    global notify-newusers
    foreach ppl ${notify-newusers} {
	sendnote $hand $ppl "User $hand deleted $user ([strftime %d-%m-%Y@%H:%M])."
    }
}    
##########################################################################
# tellaboutdel end                                                       #
##########################################################################

##########################################################################
# +ban start                                                             #
##########################################################################
proc dcc:+ban {handle idx arg} {
  if {$arg == ""} {
    *dcc:+ban $handle $idx $arg
    return 0
  }
  *dcc:+ban $handle $idx "$arg (set by $handle on [strftime %d-%m-%Y@%H:%M])"
}
##########################################################################
# +ban end                                                               #
##########################################################################

putlog "########################################"
putlog "#\002Add/Del/Change/Ban\002 addon $verzia by Funak#"
putlog "########################################"
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

The script you've displayed seems fine. I would check the following:
1. The notes module is loaded.
2. The notes module settings are correct. (check for note file failure)
3. Check if there are any scripts loaded that alter/affect the notes. (i.e notes2.tcl including in the default eggdrop script directory)

I'd also check the output of .set errorInfo and possibly your logs for error messages relating to notes.
G
GiOrGoS
Voice
Posts: 5
Joined: Sun Mar 22, 2009 8:05 pm

help

Post by GiOrGoS »

i suppose u have tried .notes read instead of .notes all read?
try the msg command as well if this fails /msg botnick notes pass read
Post Reply