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.

Need some help.

Old posts that have not been replied to for several years.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You are making calls to "nick2hand" all the time when it is not needed, as the $handle variable has this contained for us. Note, that doing "nick2hand" calls may actualy give you problems witht he script. It may kick owners for spamming, or even protect non-owners. The "nick2hand" command has to search the userfile each time it is called, and may detect a different person to the one set in the $handle variable.

You keep using a long line to generate a banmask, when it actualy a very simple command that doesn't require you to do a "getchanhost"

Code: Select all

set banmask "*!*@[lindex [split $host @] 1]"
Just to check, you do not want to punish owners, masters, partyline user or friends?

You keep using the variable $botnick, mainly in the "isop" command. Using the "botisop" command instead, it saves you having to even bother with it's nickname.

Change the "putserv" command to output "mode" as caps, as the server may need it as a requirment.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I don't want to kick users and op's. I see I have many problems .. It's normal .. coz I'm at the begining. :smile: .. and hope one day to have knolege as you have. :smile: Help me with an good code .. of what I try to do .. or show me what lines r wrong. Thx!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I did as u told me to do but still nothing.
I replaced my banmask with set banmask "*!*@[lindex [split $host @] 1]", $n2hand with $handle and now I have a problem with "botisop". How is this command coz I din't do it right and this is not working. Any sugestions .. or some help ? :smile:

Thx!

<font size=-1>[ This Message was edited by: caesar on 2001-11-23 03:52 ]</font>
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

If you read through tcl-commands,doc, you will see the usage for all the commands in eggdrop.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ok ppslim .. I'll look .. but I don't think that I'll fine much there .. but I'm optimist. :smile:
I'll put an reply in here if something new comes up. :smile: Thx again.
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

The syntax for botisop, as found in doc/tcl-commands.doc, is "botisop <channel>"
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Iahh .. I found it :smile: .. "if [botisop $channel]" .. Thx! :smile:

--- Code ---
bind pubm - "*#*" pub_dont_advertise

proc pub_dont_advertise {nick host handle channel arg} {
global botnick
set banmask "*!*@[lindex [split $host @] 1]"
set bantime "1440"
if [botisop $channel] {
if {[string match "*#mychan*" $channel]} { return }
if {([matchattr $handle m] || [matchattr $handle p] || [matchattr $handle b] || [matchattr $handle n] || [matchattr $handle o])} { return }
newchanban $channel $banmask $bantime "Don't advertise!"
putserv "KICK $channel $nick :grin:on't advertise!"
putserv "MODE $channel +b $banmask"
return 1
}
}

putlog "Don't advertise .. loaded."
--- Code ---

Yeee .. I did it :smile: Check this out and see if there r bugs or something. Works fine for me! .. and is just I did needed. :smile:
Thx again ppslim !!!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Hehehe .. for an web page I used "if {[string match "*www.my.page.here*" $arg]} { return }" and work's fine. Yupii .. for this one I answerd myself. :smile:

User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Hi again. I'm bodering u with an other tcl of my own.

- Cut -
proc anti_notice {nick host handle channel arg} {
global botnick
set channel "$arg"
set banmask "*!*@[lindex [split $host @] 1]"
set bantime "1440"
if [botisop $channel] {
if {([matchattr $handle m] || [matchattr $handle p] || [matchattr $handle b] || [matchattr $handle n] || [matchattr $handle f])} { return }
if {$arg == "$channel"} {
- Cut -

As u see this is a part of an anti notice tcl. As it is right now, I meen the entire code works fine, but .. I want to change this 2 lines.

- Cut -
set channel "$arg"
- Cut -

and

- Cut -
if {$arg == "$channel"} {
- Cut -

Any sugestions in what to change them ?
Thx!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I fail to see what you are trying to do.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

- Original Code -
bind notc - * anti_notice

proc anti_notice {nick host handle channel arg} {
global botnick
set channel "$arg"
set banmask "*!*@[lindex [split $host @] 1]"
set bantime "1440"
if [botisop $channel] {
if {([matchattr $handle m] || [matchattr $handle p] || [matchattr $handle b] || [matchattr $handle n] || [matchattr $handle f])} { return }
if {$arg == "$channel"} {
newchanban $channel $banmask $bantime "Don't do channel notices."
putserv "KICK $channel $nick :grin:on't do channel notices."
putserv "MODE $channel +b $banmask"
return 1 }
}
}
- Original Code -

I just want to change 2 lines if it's possible, in a way or other. Any sugestions ?

- Line 1 -
set channel "$arg"
- Line 1 -

and

- Line 2 -
if {$arg == "$channel"} {
- Line 2 -

Thx!

PS: This is and want's to be an Anti Channel Notices. :smile:
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

you've not read the proc arguments properly from tcl-commands.doc

try this

Code: Select all

bind notc - * anti_notice 

proc anti_notice {nick host handle text {dest ""}} { 
global botnick
if {$dest==""} { set dest $botnick }
if {[validchan $dest]} { 
set banmask "*!*@[lindex [split $host @] 1]" 
set bantime "1440" 
if {[botisop $dest]} { 
if {([matchattr $handle m] || [matchattr $handle p] || [matchattr $handle b] || [matchattr $handle n] || [matchattr $handle f])} { return 0 } 
newchanban $dest $banmask $bantime "Don't do channel notices." 
putserv "KICK $dest $nick don't do channel notices." 
putserv "MODE $dest +b $banmask" 
return 1 
} 
} 
}

note that you might wanna protect channel |+n and |+f as well from this


<font size=-1>[ This Message was edited by: Petersen on 2001-11-24 06:28 ]</font>

<font size=-1>[ This Message was edited by: Petersen on 2001-11-24 06:28 ]</font>
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Thx! .. btw .. u forgot an ":"

- Cut -
"putserv "KICK $dest $nick don't do channel notices."
- Cut -

shoud be

- Cut -
"putserv "KICK $dest $nick :grin:on't do channel notices."
- Cut -

Work's great. Thx! :smile:
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

yah i know, cos i copy/pasted that bit and missed the : cos of the smilies.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

:smile: I see. Well I'm back with a new question about a previous tcl of my own.

- Code -

bind pubm - "*#*" pub_dont_advertise

proc pub_dont_advertise {nick host handle channel arg} {
global botnick
set banmask "*!*@[lindex [split $host @] 1]"
set bantime "1440"
if [botisop $channel] {
if {([matchattr $handle m] || [matchattr $handle p] || [matchattr $handle b] || [matchattr $handle n] || [matchattr $handle o])} { return }
if {[string match "*#mychan*" $channel]} {return }
newchanban $channel $banmask $bantime "Lame advertise!"
putserv "KICK $channel $nick :Lame advertise!"
putserv "MODE $channel +b $banmask"
return 1
}
}

putlog "Don't advertise .. loaded."
- Code -

With this code he react's at all words. Any sugestions to fix this problem ? :???:
Locked