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 finishing my script.

Old posts that have not been replied to for several years.
Locked
S
SkyNet

Need help finishing my script.

Post by SkyNet »

I'm writting an FServe Auto-Voice script. It's mostly done. I have it !list 'ing and voicing. I just have to get it to devoice.

Here's a snippit of my code:

Code: Select all

proc voice_devoice {nick uhost hand chan text} {
    global voice_chan voice_devoice voice_endvoice voice_me
    if { $voice_endvoice == 1 } {
	if { ([isvoice $nick $voice_chan]) && (![voice_me $nick $voice_chan]) } {
	    pushmode $voice_chan -v $nickname
	}
    }
}

proc voice_me {nick uhost hand chan text} {
    global voice_chan
    if { [botisop $voice_chan] } {
	if { (![isop $nick $voice_chan]) && (![isvoice $nick $voice_chan]) } {
	    putserv "MODE $voice_chan +v $nick"
	}
    }
}
Okay, I'm not very good at .tcl at all, but it's what eggdrop uses so I have to learn to use it a little bit. Now what I want to do, or the idea I have is:

During the !list "voice_me" voices all the FServe, so I was thinking why can't for devoice we have a negation of that? hence (![voice_me $nick $voice_chan]) however this doesn't work. But you understand what I'm after right? If they have voice, and voice_me didn't pick them up, then they should be devoiced.
S
SkyNet

Post by SkyNet »

Can someone help correct this code?

Code: Select all

set voice_chan "#ILA"
set voice_listone "R"
set voice_listtwo "S"

proc voice_list {nick host hand chan text} {
    global voice_chan voice_listone voice_listtwo
    foreach nick {[userlist $voice_listtwo $voice_chan]} {
        chattr $nick -$voice_listtwo $voice_chan
    }
    foreach nick {[userlist $voice_listone $voice_chan]} {
        chattr $nick -$voice_listone $voice_chan
        chattr $nick +$voice_listtwo $voice_chan
    }
    putserv "PRIVMSG $voice_chan :!list"
    utimer $voice_waittime {voice_endvoice}
}
Why won't the foreach nick parts work?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Try renaming it to something else than nick, since you already have that var in the proc header..
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

ditch the {}'s around your [userlist... calls.... they are inhibiting your command and variable substitutions...

ie.

Code: Select all

foreach nick [userlist $voice_listone $voice_chan] {
 .. stuff ..
}
Locked