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.

script request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

script request

Post by whittinghamj »

hi guys, i have a question request. If its on the download section sorry if i missed it.

I am looking for a tcl which would do the following.

Everytime the bot sees a new nice it adds the name to a txt file and date / time stamps that entry.

Then when ever a channel +o does !age <nick> the bot looks at the file and finds the record and says ok <nick> has been in channel for 7 weeks 2 days.

not idle time but from the first time the nick was seen on the channel. does that make sence?

any help would be great. thank you

god bless u all.
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

just a thort, i guess kinda like a seen script but just from the first time the bot saw the user would be frigging great.
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

does offline time count or not?
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

yes offline counts as well
i just need to know when the bot first saw the person until today / now

eg the text would say nick 200601010515

numbers are thus
2006 year 01 month 01 day 05 hour 15 minute

Then i do

!age nick
bot says nick has been on #lobby for x months x days x hours x minutes

is answer = zero then say nothing eg if yeah was 0 then ignore the year part

and to add to the text file

i would like a !adduser <nick> bind

any ideas buddy?

god bless
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

i think this should work. if something's wrong, leave a reply and i'll try to fix it this evening. now i got to go to school :roll:

Code: Select all

bind pub -|- !age pub:age
bind join -|- "#chan *" add:age

set userjoindata ""

proc add:age {nick uhost hand chan} {
	if {![lsearch $::userjoindata $nick]} {
		lappend userjoindata {$nick clock format [clock scan now] -format "%D %T"}
}
proc pub:age {nick uhost hand chan text} {
	if {[llength $text] > 1} { 
		puthelp "PRIVMSG $chan :You were supposed to look for a nick.. not more" 
	} elseif {![lsearch $::userjoindata $text]} {
		puthelp "PRIVMSG $chan :I don't remember seing $text
	} else {
		puthelp "PRIVMSG $chan :$text has been in $chan since [lindex $::userjoindata [lsearch $::userjoindata $nick] 2] 
	}
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

instead of onjoin - how would i add the user using !adduser <nick>

I would like to manually add the user if its not too much work.

AND THANK YOU SO MCUH - I WILL BUY YOU A BEER
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

i get this error buddy :-s

Code: Select all

[03:23] missing close-brace
    while executing
"proc add:age {nick uhost hand chan} {
   if {![lsearch $::userjoindata $nick]} {
      lappend userjoindata {$nick clock format [clock scan now] -fo..."
    (file "scripts/lobby/users.tcl" line 132)
    invoked from within
"source scripts/lobby/users.tcl"
    (file "zeus.conf" line 83)
[03:23] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
[f4w@lobby-poseidon eggdrop]$
User avatar
krimson
Halfop
Posts: 86
Joined: Wed Apr 19, 2006 8:12 am

Post by krimson »

i missed some closing brackets. here's the corrected code + !adduser:

Code: Select all

bind pub -|- !age pub:age
bind pub -|- !adduser pub:add:age

set userjoindata ""

proc pub:add:age {nick uhost hand chan text} {
   if {[llength $text] > 1} {
      puthelp "PRIVMSG $chan :You were supposed to add a nick.. not more"
   } elseif {![lsearch $::userjoindata $text]} {
      lappend userjoindata {$nick clock format [clock scan now] -format "%D %T"}
	}
}
proc pub:age {nick uhost hand chan text} {
   if {[llength $text] > 1} {
      puthelp "PRIVMSG $chan :You were supposed to look for a nick.. not more"
   } elseif {![lsearch $::userjoindata $text]} {
      puthelp "PRIVMSG $chan :I don't remember seing $text
   } else {
      puthelp "PRIVMSG $chan :$text has been in $chan since [lindex $::userjoindata [lsearch $::userjoindata $nick] 2]
   }
}
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

hi mate

thanks - it does not crash the bot now. but it does nothing

not tcl errors nor does it give the error messages in the irc channel eg you need to specify a nick or anyt other error - but it does not add the info the text file - any suggestions buddy?

Thanks for the recode.

god bless you my son
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

here is what i have wil the userfile set - see if i have done something stupid like normal :P

Code: Select all

bind pub -|- !age pub:age 
bind pub -|- !adduser pub:add:age 

set userjoindata "users.txt" 

proc pub:add:age {nick uhost hand chan text} { 
   if {[llength $text] > 1} { 
      puthelp "PRIVMSG $chan :You were supposed to add a nick.. not more" 
   } elseif {![lsearch $::userjoindata $text]} { 
      lappend userjoindata {$nick clock format [clock scan now] -format "%D %T"} 
   } 
} 
proc pub:age {nick uhost hand chan text} { 
   if {[llength $text] > 1} { 
      puthelp "PRIVMSG $chan :You were supposed to look for a nick.. not more" 
   } elseif {![lsearch $::userjoindata $text]} { 
      puthelp "PRIVMSG $chan :I don't remember seing $text 
   } else { 
      puthelp "PRIVMSG $chan :$text has been in $chan since [lindex $::userjoindata [lsearch $::userjoindata $nick] 2] 
   } 
}
and the age works now i have added the missing " s at the end of the puthelp lines near the end :P but it just says this

Quest has been in #chan since - no time - i manually added the nick / date to test !age - i might have the wrong date format tho for that part :-s
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

i am using this time stamp format btw

et time1 [clock format [clock seconds] -format "%Y %m %d %H %M"]
Post Reply