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.

bot remove the akick and founder only allowed to add akick..

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

bot remove the akick and founder only allowed to add akick..

Post by Sydneybabe »

Hi everyone i need a script that bot have a capability to check if the user that use akick is founder or sop on channel.. when sop add akick on channel the bot will remove the akick and msg. him/her only founder can add akick...and when the founder add an akick the bot will ignore it. i hope someone can help me thanks a lot and have a nice day :D
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I'm not that familiar with dalnet and chanserv, how would you (or your bot) get notified that someone added an akick?
NML_375
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

hi nml375 eggdrop is notified on notice example like this
[11:31] -ChanServ:@#channel- [VERBOSE] ^BNickOfOpAddAkick^B!~ident@isp.of.user => akick #ateneo add *!*@85.107.210.208
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

ChanServ "WHY" command would be needed also:
-ChanServ- Usage - WHY <channel> <nick>
Reply:
-ChanServ- Boues has FOUNDER access to #channel. Reason: Identification to the founder's nickname, Almozo. Channel Frozen: NO
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

yes Alchera :) i hope someone can help me regarding this thanks a lot in advance. :D
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

One thing that came to mind when I sat down and started to scratch my head..

Would malicousAOP have to join the channel to be able to add akick's?
If not, would ChanServ WHO-request work even if he did not join the channel?
NML_375
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

On DALnet any SOp/AOp with access can trigger anything outside a channel simply by communicating with ChanServ.

Most channel founders therefore have verbose mode set as a precautionary measure.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

yes i set the channel settings to verbose on so that the verbose on akick will notice by sop eggdrop when sop users adding akick :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

A first draft, regular expressions might need tuning and other strange stuffs:

Code: Select all

bind notc - {[VERBOSE]* => akick * add *} check:akick
bind notc - {* has * access to * Reason:*} check:why
catch {unset akick:queue}


proc check:akick {nick host hand text {dest ""}} {
 if {$dest == "" || [isbotnick $dest] || ![string equal -nocase "chanserv!service@dal.net" "$nick!$host"]} {
  return
 }
 if {[regexp -- {^\[VERBOSE\] (.+?)!(.+?) => akick (.+?) add (.+?)$} [stripcodes bcruag $text] match tnick thost tchan tmask] && ![isbotnick $tnick]} {
  set ::akick:queue([list [string tolower $tchan] [string tolower $tnick]]) $tmask
  putserv "CHANSERV WHY $tchan $tnick"
 }
}

proc check:why {nick host hand text {dest ""}} {
 if {![string equal -nocase "chanserv!service@dal.net" "$nick!$host"]} {
  return
 }
 if {$dest == "" || [isbotnick $dest]} {
  if {[regexp -- {^(.+?) has (SOp|AOp) access to (.+?)\. +Reason: Identification to the nickname (.+?)\. Channel Frozen: (YES|NO)$} [stripcodes bcruag $text] match tnick tacc tchan trnick tfrozen]} {
   if {[info exists ::akick:queue] && [info exists ::akick:queue([list [string tolower $tchan] [string tolower $tnick]])]} {
    putserv "CHANSERV AKICK $tchan DEL [set ::akick:queue([list [string tolower $tchan] [string tolower $tnick]])]"
    puthelp "PRIVMSG $tnick :Only Founder may add AKICK's to $tchan"
    unset ::akick:queue([list [string tolower $tchan] [string tolower $tnick]])
   }
  }
 }
}
Edit:
Fixed bogus bindings and variable-name issues.

Edit:
Tuning of regular expression.

Edit:
Updated hostmask-check of chanserv.
Also added some debug-logging.

Edit:
Fixed missing close-brackets in check:why

Edit:
Used static AOP rather than $tacc. Could be fixed to SOp instead.

Edit:
Code modified to remove the AKICK rather than remove the SOp access from the evil SOp.

Edit:
Minor typo fixed.

Edit:
Had to dump the list-queue in favor of arrays.

Edit:
Sync'd with the debug-version on page 3.
Adjusted regular expression to not include trailing .

Edit:
Now matching multiple spaces after the channelname.
Last edited by nml375 on Fri Dec 07, 2007 1:59 pm, edited 18 times in total.
NML_375
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

See one issue already, this will react on both AOP's and SOP's :/

Thinking of changing WHO-lookup into a ACC-lookup..
NML_375
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

nml375 wrote:See one issue already, this will react on both AOP's and SOP's :/

Thinking of changing WHO-lookup into a ACC-lookup..
Below are DALnet's access levels:
-2 = Channel is frozen or closed
-1 = AutoKICKed from the channel
0 = basic
1 = AutoOp
2 = SuperOp
3 = Has founder access via a NickServ access list mask
4 = Has founder access via identification to NickServ
5 = Has founder access via identification to ChanServ
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

hi nml375 when i load the script i got this error --->
[22:44] Tcl error in file 'eggdrop.conf':
[22:44] bad type, should be one of:
while executing
"bind - notc {[VERBOSE]* => akick * add *} check:akick "
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Oops. Apparently I switched the order of arguments in the bindings. Fixed now.
NML_375
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

hi nml375 i load the script and on the partyline this is the message [22:36] Tcl error [check:akick]: can't read "::akick": no such variable
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Various issues with variable-names should be fixed now.
NML_375
Post Reply