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.

Deleting file upon leaving channel

Old posts that have not been replied to for several years.
Locked
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Deleting file upon leaving channel

Post by Buffy_25 »

Hi all,

I would like to delete a specific file when my bot leaves the channel or get disconnected.

Find below the script i made for it:

Code: Select all

bind evnt - disconnect-server delfile
bind part - * part
bind kick - * kick
bind sign - * signoff

proc part {nick uhost hand chan arg} {
if {![string match -nocase "$chan" "#channel"]} { return 0 }
if {[string equal -nocase $nick "mybotname"] || [string match -nocase "*@hisuhost.com" $uhost]} {
file delete /usr/home/account/eggdrop/logs/help.txt
}
}

proc kick {nick uhost hand chan arg} {
if {![string match -nocase "$chan" "#channel"]} { return 0 }
if {[string equal -nocase $nick "mybotname"] || [string match -nocase "*@hisuhost.com" $uhost]} {
file delete /usr/home/account/eggdrop/logs/help.txt
}
}

proc signoff {nick uhost hand chan arg} {
if {![string match -nocase "$chan" "#channel"]} { return 0 }
if {[string equal -nocase $nick "mybotname"] || [string match -nocase "*@hisuhost.com" $uhost]} {
file delete /usr/home/account/eggdrop/logs/help.txt
}
}

proc delfile disconnect-server {
file delete /usr/home/sparqy/eggdrop/logs/ftpusers.txt
}
Did I forget anything? To be sure that this file is deleted whenever my bot leaves the channel for any reason?

Thanks.

Rgds,
Buffy
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

no need of checking uhost, no need of -nocase switch

use global variable $botnick instead of "mybotname"
Locked