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 

[SOLVED] can't read "lastseen": no such variable

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue May 09, 2006 6:13 am    Post subject: [SOLVED] can't read "lastseen": no such variable Reply with quote

Hi, this is my another script I am having the similiar problem I had eariler with bonus script. What I am trying to do is, if a user's LAST SEEN matches 2 or more thescript stop/return. But I've tried all the possible ways, I am failure. Can you help me out fixing it.
Thanks.


Code:
set ac(owner_username) "owner"
set ac(bot_username) "Bot-Username"
set notifyusers "owner"

set counter ""
bind notc - "USER: * ACCESS: *" ac:get_user
bind notc - "*SUSPENDED*" ac:block_user
bind notc - "LAST SEEN: *" ac:last_seen
bind notc - "LAST MODIFIED: * ago*" ac:modify_check
bind time - "* * * * *" ac:check

proc ac:list { handle idx text } {
global ac botnick user_names
putdcc $idx "Current users: $user_names"
}

proc ac:check { min hour day month year } {
global ac user_names counter
ac:get_list
if {$counter == ""} { set counter "-1" }
if {[lindex $user_names $counter] == ""} { set counter "-1" }
incr counter
if {[lindex $user_names $counter] == ""} { return }
puthelp "PRIVMSG X :ACCESS $ac(chan) [lindex $user_names $counter] -modif"
}

proc ac:get_user {nick uhost hand text dest } {
global botnick ac xaccess xusername
if {$nick != "X"} { puthelp "PRIVMSG $ac(chan) :Nickanme: $nick"; return }
set text [split $text]
set xusername [lindex $text 1]
set xaccess [lindex $text 3]
}

proc ac:block_user {nick uhost hand text dest} {
set xaccess "399"
}

proc ac:last_seen {nick uhost hand text dest} {
set text [split $text]
set lastseen [lindex $text 2]
}

proc ac:modify_check {nick uhost hand text dest } {
global botnick ac xaccess xusername who_main day_main lastseen
set text [split $text]
set who_mod [lindex $text 2]
set day_mod [lindex $text 4]
set prim_1 $who_mod$day_mod
set prim_1 [split $prim_1 ")("]
set prim_1_1 [lindex $prim_1 0]
set day_main [lindex $prim_1 3]
set who_main [lindex $prim_1 1]
ac:recap $xaccess $xusername $who_main $day_main $lastseen
}

proc ac:recap { xaccess xusername who_main day_main lastseen } {
global ac user_names notifyusers
if {[string tolower $who_main] != [string tolower $ac(bot_username)] && [string tolower $who_main] != [string tolower $ac(owner_username)]} { return }
if {$lastseen >= "2"} {return}
if {$xaccess == "399"} { return }
if {$day_main == "0"} { return }
puthelp "PRIVMSG X :MODINFO $ac(chan) ACCESS $xusername [expr $xaccess + 1]"
if {$notifyusers != "" && $notifyusers != " "} {
foreach notfuser $notifyusers {
sendnote IDA_SYSTEM $notfuser "Modified +1 Access Level to $text in $ac(chan)."
}
}
}


The error I get in DCC is:

Code:
Tcl error [ac:modify_check]: can't read "lastseen": no such variable


First I fixed "Suspended", if a username is suspended by anyone the bot will return, so I mentioned it as == 399, that's solved. but LASTSEEN is giving me errors. I want the bot to check LAST SEEN, if a person is not shown within 2 days bot shouldnt modify him. Thanks.
Back to top
View user's profile Send private message Visit poster's website
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Tue May 09, 2006 8:15 am    Post subject: Reply with quote

try it with a string

Code:

setudef str lastseen
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue May 09, 2006 8:43 am    Post subject: Reply with quote

no luck ;/
Back to top
View user's profile Send private message Visit poster's website
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue May 09, 2006 9:44 am    Post subject: Reply with quote

I made 2 changes and it's working fine.

1:

Code:
proc ac:last_seen {nick uhost hand text dest} {
global lastseen
set text [split $text]
set lastseen [lindex $text 2]
}


2nd:

Code:
if {$lastseen >= 2} {return}


Thanks to chris and you all Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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