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 

Error in adduser setup?

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


Joined: 23 Jul 2006
Posts: 40

PostPosted: Mon Nov 06, 2006 9:20 pm    Post subject: Error in adduser setup? Reply with quote

Code:
proc battle:adddj { nick host hand chan text } {
[adduser [join [lindex [split $text] 0] [join [lrange [split $text] 1 end]]] [chattr [join [lindex [split $text] 0] fD]
putlog "$head $nick added new dj: [join [lindex [split $text] 0] with hostmask: [join [lrange [split $text] 1 end]]]"
}

proc battle:removedj { nick host hand chan text } {
[deluser $text]
putlog "$head $nick removed dj: $text"
}


It refuses to add them - no errors are returned, but the person is not added. Here's the format:

@adduser HANDLE HOSTMASK

EX:
@adduser Nara *!*@Nara.*

~Nara
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Nov 06, 2006 9:48 pm    Post subject: Reply with quote

Just a question, why do you try to execute the return-code form adduser and deluser?
And this $head-variable you have in that putlog; it's not defined anywhere in this code, and it's not imported from globalspace

Also, would you mind including the binds you've used?

edit: Had a closer look at that adduser code..
To be honest, I'm not sure what you try to accomplish with all those nested commands

A simple example on how to do it would be something like this:
Code:
proc battle:adddj {nick host hand chan text} {
 set txt [split $text]; set handle [lindex $txt 0]; hostmask [lindex $txt 1]
 if {[adduser $handle $hostmask]} {
  chattr $handle fD
  putlog "$nick added new dj: $handle with hostmask: $hostmask"
 }
}

proc battle:removedj {nick host hand chan text} {
 if {[deluser $text]} {
  putlog "$nick removed dj: $text"
 }
}

bind pub n @adduser battle:adddj
bind pub n @deluser battle:removedj


Of course you don't need to set txt, handle or hostmask; tho I find it makes the code somewhat more easy to read
_________________
NML_375, idling at #eggdrop@IrcNET
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 -> 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