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 

Some help addop delop

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


Joined: 23 Feb 2009
Posts: 201

PostPosted: Wed Dec 16, 2009 1:43 pm    Post subject: Some help addop delop Reply with quote

Hey found this bit of code by nml for addop has a small error

Tcl error [msg:addop]: missing "

Also how can i go about adding delop to this, addop needs to be global so basicaly will need to do adduser nick then chattr handle +flags



Code:
bind msg SA addop cmd:addop

proc cmd:addop {nick host hand text} {
 if {![validuser $hand]} {
  set hand [string range $nick 0 8]
  if {![validuser $hand]} {
   adduser [string range $nick 0 8] [maskhost "${nick}!${host}]
  } else {
   puthelp "PRIVMSG $nick :Unable to register new handle"
   return 1
  }
 }
 chattr $hand "+ho"
}

_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Dec 16, 2009 1:56 pm    Post subject: Reply with quote

Minor typo in there.

Code:
proc cmd:addop {nick host hand text} {
 if {![validuser $hand]} {
  set hand [string range $nick 0 8]
  if {![validuser $hand]} {
   adduser [string range $nick 0 8] [maskhost "${nick}!${host}"]
  } else {
   puthelp "PRIVMSG $nick :Unable to register new handle"
   return 1
  }
 }
 chattr $hand "+ho"
}


For "delete op", reverse logic and use deluser to remove the user record, or chattr to remove the flags (deluser shown below):
Code:
bind msg ho delop cmd:delop
proc cmd:delop {nick host hand text} {
 if {[validuser $hand]} {
  deluser $hand
 }
}

Chattr version:
Code:
bind msg ho delop cmd:delop
proc cmd:delop {nick host hand text} {
 if {[validuser $hand]} {
  chattr $hand "-ho"
 }
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Wed Dec 16, 2009 2:25 pm    Post subject: Reply with quote

addop dont seem to work when i do addop nickname
_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Dec 16, 2009 2:27 pm    Post subject: Reply with quote

This script was written to add the user him/herself, not someone else.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Wed Dec 16, 2009 2:30 pm    Post subject: Reply with quote

Ah i see i want it so +SA users can add delop
_________________
Blake
UKEasyHosting UKStormWatch
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