This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Access Script

Old posts that have not been replied to for several years.
Locked
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Access Script

Post by stevegarbz »

Ok, well currently I have things like:

Code: Select all

bind pub nm .addop h:addop:msg
proc h:addop:msg {nick host hand chan text} {    
     set user [lindex $text 0] 
     set address *![getchanhost [lindex $text 0]] 
     if {[string match -nocase $text ""]} { 
     putquick "NOTICE $nick :You didn't include a nickname." 
     return 0 
  } 
     if {![onchan $text $chan]} { 
     putquick "NOTICE $nick :$user isn't on $chan." 
     return 0 
    } 
    putquick "NOTICE $nick :Added op: $user" 
    adduser $user $address 
    chattr $user +ao $chan
pushmode $chan +o $user
}
Now, after I add the user, I want to be able to use commands like:

.access = Will display my access
.access * = Will display *'s access

If anyone could please help me with this, it would be greatly appreciated.

Thanks.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try FzCommands, I don't see why this should be rewritten.
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

I just don't want a big script like that. I have everything I need in that small one.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You can do something like this:

Code: Select all

bind pub - .access show:access

proc show:access {nick uhost hand chan arg} {
 if {![llength [set t [lindex [split $arg] 0]]]} { set t $nick }
 if {[matchattr [nick2hand $t] n|n $chan]} {
  puthelp "PRIVMSG $chan :$t is an owner."
 } elseif {[matchattr [nick2hand $t] m|m $chan]} {
  puthelp "PRIVMSG $chan :$t is a master."
 }
}
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

Thanks. How would I add more levels to it?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Observe the code and think about it. Also, read eggdrop.conf to know about eggdrop's flags.
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

Yeah, I got it. Thanks.
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

What would be the way to make it so people that aren't added to have it say something? What would the flag set be?

And -- My addop script adds their ident too. Is there a way to make it *!*@ip.domain
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

This example should help you:

Code: Select all

if {[matchattr $hand n|n $chan]} {
 # he's an owner
} elseif {[matchattr $hand m|m $chan]} {
 # he's a master
} else {
 # he's something else.
}
As for the address, use this:

Code: Select all

set address *!*@[lindex [split [getchanhost [lindex [split $text] 0]] @] 1]
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

Now is when I run into a bad problem, because it doesn't work. Eggdrop is only holding 9 characters for the person's nickname. Is there a way for the op, to make it .+host the user's address to the user 'Op'? I would pre-add all of these users, and then just .addop would add their host, and then for the access script it would lookup their host?
s
stevegarbz
Op
Posts: 104
Joined: Sat Dec 04, 2004 7:25 pm

Post by stevegarbz »

Nevermind, I got it. Thanks for all the help Sir_Fz
Locked