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 

AC.tcl error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
SIrJoKer
Voice


Joined: 06 Aug 2009
Posts: 7

PostPosted: Fri Nov 18, 2011 8:59 am    Post subject: AC.tcl error Reply with quote

Hey guys,
I just installed AC.tcl on my egg but doesn't wanna work properly and it gives me an error in telnet: Tcl error [ac:check]: can't read "user_names": no such variable

The code:
Code:
############ BINDS #################
set counter ""
bind dcc n adduser ac:adduser
bind dcc n remuser ac:remuser
bind dcc n listusers ac:list
# bind notc - "*does not wish to be added to channels*" ac:noadduser
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} {
global lastseen
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)."
}
}
}

proc ac:noadduser { nick uhost hand text dest } {
global noadduser
set text [split $text]
set noadduser [lrange $text 1 end]
}

proc ac:adduser { handle idx text } {
ac:get_list
global ac user_names notifyusers oprules reason noadduser
if {$text == ""} { putdcc $idx "Syntax: .adduser <CService username>"; return }
foreach arg $user_names {
if {[string tolower $arg] == [string tolower $text]} {
putdcc $idx "Username $text already exists!"
return
}
if {$arg == ""} { continue }
}
set victim " "
set maskhost *@$text.users.undernet.org
foreach nick [chanlist $ac(chan)] {
if [string match -nocase $maskhost [getchanhost $nick $ac(chan)]] {
set victim $nick
break
}
}
if {![llength $victim]} {
putdcc $idx "$text with host $maskhost is not on $ac(chan) or not logged in X with +x mode."
} {
lappend user_names $text
puthelp "PRIVMSG X :ADDUSER $ac(chan) $text 1"
# if {[string match "*wish to be added to channels at this*" $noadduser]} { putdcc $idx "$text does not wish to be added to channels at this time. Turn the noadduser off."; return}
adduser $text *!*@$text.users.undernet.org
chattr $text +fp|+fo $ac(chan)
chattr $text |+fo $ac(backchan)
putkick $ac(chan) $victim $reason       
putdcc $idx "Username $text added!"
foreach line $oprules { puthelp "PRIVMSG $victim :$line" }
sendnote IDA_SYSTEM $notifyusers "Added Username $text in $ac(chan) by $handle."
}
ac:write_acdb
}
proc ac:remuser { handle idx text } {
ac:get_list
global ac user_names found notifyusers
if {$text == ""} { putdcc $idx "Syntax: .remuser <CService username>"; return }
foreach arg $user_names {
if {[string tolower $arg] != [string tolower $text]} {
lappend user_names2 $arg
set found 0
continue
}
if {[string tolower $arg] == [string tolower $text]} {
set found 1
continue
}
if {$arg == ""} { continue }
}

if {!$found} { putdcc $idx "Username $text does not exist!"; unset user_names2; return }
set user_names $user_names2
unset user_names2
puthelp "PRIVMSG X :REMUSER $ac(chan) $text"
deluser $text
putdcc $idx "Username $text deleted!"
if {$notifyusers != "" && $notifyusers != " "} {
foreach notfuser $notifyusers {
sendnote IDA_SYSTEM $notfuser "Removed Username $text in $ac(chan) by $handle."
}
}
ac:write_acdb
}

proc ac:get_list { } {
global user_names
if {[file exists acdb.dat]} {
set acdb [open acdb.dat r]
while {![eof $acdb]} {
gets $acdb ac_line
if {$ac_line == ""} { continue }
set user_names $ac_line
close $acdb
break
}
}
}

proc ac:write_acdb { } {
global ac user_names
set acdb2 [open acdb.dat w]
puts $acdb2 $user_names
close $acdb2
}
putlog "Access increasing script v1.0 by iamdeath loaded! \[ac.tcl\]"
# End of code



Can you please help me out with this error ?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Nov 20, 2011 10:44 am    Post subject: Reply with quote

You get that error cos the user_names variable isn't created (doesn't exist) prior to using it. Have you contacted iamdeath to let him know about this error?
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
SIrJoKer
Voice


Joined: 06 Aug 2009
Posts: 7

PostPosted: Wed Nov 23, 2011 1:13 pm    Post subject: Reply with quote

No i have no contact with him so far. I thought i will find an answer for my problem here. Thanks anyway!
Back to top
View user's profile Send private message
SIrJoKer
Voice


Joined: 06 Aug 2009
Posts: 7

PostPosted: Fri Nov 25, 2011 11:29 am    Post subject: Reply with quote

I have sent a pm to him about 3 days ago but no reply. There is enyone who can help me with this issue please ?
Back to top
View user's profile Send private message
SIrJoKer
Voice


Joined: 06 Aug 2009
Posts: 7

PostPosted: Wed Dec 07, 2011 3:22 am    Post subject: Reply with quote

There is nobody who can help me with this script ? Sad
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 Support & Releases 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