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 help script

Old posts that have not been replied to for several years.
Locked
User avatar
duofruo
Halfop
Posts: 94
Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:

need help script

Post by duofruo »

i wana make a script that you will pe able to "templeave" your eggdrop. and olso "comeback" him throw msg

Code: Select all

bind pub n|n .templeave proc:templeave
proc proc:templeave {nick uhost hand chan arg} {
global duo templeave
putserv "PART $chan :I have temporarly left from $chan by demand of $nick. user comback to rejoin $chan"
eval channel set [list $chan] +inactive
}
and for comeback i use

Code: Select all

bind msg n|n .comeback proc:comeback
proc proc:comeback {nick uhost hand arg} {
global duo templeave
putquick "privmsg $nick :i will try to comeback to $arg"
eval channel set $arg -inactive
}
but is a problem. For example somebody form chan #chan .templeave the egdrop. but if someone whith +n from #chan2 will comeback to #chan the gg listen to him. i wana disable that
i hope u understand me.
Embrace The Inevitable
User avatar
CrazyCat
Revered One
Posts: 1253
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Code: Select all

if { [matchattr $nick +n $arg] == 1} {
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Two things... first there's no point to the "eval" bit. The normal way to call procs in tcl is

procname arg1 arg2

rather than

eval procname [list $arg1] [list $arg2]

Second, change your bind to -|-, since if a person has +n in #chan instead of #chan2, and no global +n, the bind won't trigger at all. Instead, do matchattr checking inside the proc, like this:

if {![matchattr $hand n|n $arg]} { return 0 }

Then you need to make sure that $arg is a valid channel before trying to use channel set. Or, another way to do it, would be to put channel set inside catch {} and msg the user something like "$arg1 is not a valid channel you fool!" if there's an error.
User avatar
duofruo
Halfop
Posts: 94
Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:

Post by duofruo »

i am in a big confusion, i have some problem whith english, but i will try thx
Embrace The Inevitable
User avatar
duofruo
Halfop
Posts: 94
Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:

Post by duofruo »

Code: Select all

if {![matchattr $hand n|n $arg]} { return 0 } 
this worked. thx a lot. i try to make a cool script, but i have some prblems
Embrace The Inevitable
Locked