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 

script request

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


Joined: 21 May 2006
Posts: 103

PostPosted: Tue May 23, 2006 11:17 pm    Post subject: script request Reply with quote

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.
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Tue May 23, 2006 11:49 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Wed May 24, 2006 1:48 am    Post subject: Reply with quote

does offline time count or not?
Back to top
View user's profile Send private message Send e-mail
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Wed May 24, 2006 3:59 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Wed May 24, 2006 4:26 am    Post subject: Reply with quote

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 Rolling Eyes
Code:
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]
   }
Back to top
View user's profile Send private message Send e-mail
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Wed May 24, 2006 5:17 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Wed May 24, 2006 5:21 am    Post subject: Reply with quote

i get this error buddy :-s

Code:
[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]$
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Wed May 24, 2006 2:03 pm    Post subject: Reply with quote

i missed some closing brackets. here's the corrected code + !adduser:
Code:
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]
   }
}
Back to top
View user's profile Send private message Send e-mail
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Wed May 24, 2006 2:27 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Wed May 24, 2006 2:29 pm    Post subject: Reply with quote

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

Code:
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 Razz 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
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Wed May 24, 2006 2:36 pm    Post subject: Reply with quote

i am using this time stamp format btw

et time1 [clock format [clock seconds] -format "%Y %m %d %H %M"]
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