View previous topic :: View next topic |
Author |
Message |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3740 Location: Mint Factory
|
Posted: Tue Jun 10, 2003 10:18 am Post subject: |
|
|
Is $user not $nick. Pay attention, don't sleep in class.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
ReaLz Op

Joined: 19 Oct 2002 Posts: 121 Location: Athens, Greece
|
Posted: Tue Jun 10, 2003 2:16 pm Post subject: |
|
|
and add the after the Code: | putlog "I'm not oped in $::channel." | as caesar said, if you haven't already done that. _________________ «A fantastic spaghetti is a spaghetti that does not exist» |
|
Back to top |
|
 |
kevie Voice
Joined: 10 Jun 2003 Posts: 12
|
Posted: Tue Jun 10, 2003 11:59 pm Post subject: |
|
|
Hmm, I seem to be having lotsa probs now with this code, so maybe i would list out the code here to see where the prob lies, currently it seems, it doesnt voice certain users, and it devoices some users after like a few minutes say 10 minutes? And it seems like i cant get the message that says "you've been devoiced for not serving." to work too. would really appreciate to get it work again (PS. I'm sorry for being so slow, really just a newbie)
Code: |
## Settings
set line "*Fserve Active*"
set phrase "*Fserve Active*"
set channel "#E-Hub"
## Binds
bind pubm - "*$line*" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
bind pubm - "*$phrase" saveUser
## Code
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
return
}
proc time_proc {min hour day month year} {check_word}
proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
return 0
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
puthelp "NOTICE $nick :you've been devoiced for not serving."
}
}
}
proc saveUser {nick chan hand idx args} {
if {[validuser $hand]} {
chattr $hand +S
return
}
adduser $nick
chattr $nick +S
}
|
|
|
Back to top |
|
 |
ReaLz Op

Joined: 19 Oct 2002 Posts: 121 Location: Athens, Greece
|
Posted: Wed Jun 11, 2003 1:19 am Post subject: |
|
|
yes I've seen some probs...
1) you have the same line and phrase so I will disable the phrase.
2) you still use $nick instead of $user as caesar told you.. i'll change it..
Code: | ## Settings
set line "*Fserve Active*"
set channel "#E-Hub"
## Binds
bind pubm - "$line" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
bind pubm - "$line" saveUser
## Code
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
return
}
proc time_proc {min hour day month year} {check_word}
proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
return 0
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
puthelp "NOTICE $user :you've been devoiced for not serving."
}
}
}
proc saveUser {nick chan hand idx args} {
if {[validuser $hand]} {
chattr $hand +S
return
}
adduser $nick
chattr $nick +S
} |
_________________ «A fantastic spaghetti is a spaghetti that does not exist» |
|
Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Wed Jun 11, 2003 4:31 am Post subject: |
|
|
Code: | bind pubm - "$line" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
bind pubm - "$line" saveUser |
no need to have two equal pubm binds
Code: | bind pubm - "$line" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
|
just call the saveUser proc from within the voiceUser proc
Code: | proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
saveUser $nick $uhost $hand $channel $rest
return
} |
Code: | adduser $nick
chattr $nick +S |
$nick is not the same as the saved handle on the bot.
when you add the user and the nick is to long, the eggdrop will "cut" the nick.
use this to get the correct handle
Code: | adduser $nick
chattr [nick2hand $nick] +S |
and finally, conserning the timing of devoicing... it has to do with the use of the time bind, it will not wait 30 mins to check the users. It executes every whole and half hour. ie.. 10.00, 10.30, 11.00 .... etc _________________ Elen sila lúmenn' omentielvo |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3740 Location: Mint Factory
|
Posted: Wed Jun 11, 2003 4:44 am Post subject: |
|
|
better [list saveUser $nick $uhost $hand $channel $rest] _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Wed Jun 11, 2003 4:57 am; edited 1 time in total |
|
Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Wed Jun 11, 2003 4:48 am Post subject: |
|
|
if you insist on using list on it (which really is not needed) the drop the "" quotes, or else saveUser will be called with just one argument  _________________ Elen sila lúmenn' omentielvo |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3740 Location: Mint Factory
|
Posted: Wed Jun 11, 2003 4:57 am Post subject: |
|
|
Oups, yes, forgot to remove them  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Wed Jun 11, 2003 4:58 am Post subject: |
|
|
tsk... that's what they all say  _________________ Elen sila lúmenn' omentielvo |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3740 Location: Mint Factory
|
Posted: Wed Jun 11, 2003 5:01 am Post subject: |
|
|
I'm not in that list  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
kevie Voice
Joined: 10 Jun 2003 Posts: 12
|
Posted: Wed Jun 11, 2003 11:53 am Post subject: |
|
|
Ok I've tried what Papillon said and got certain errors
1) [23:44] [gucci] [23:45] * Duplicate user record 'gucci'!
[23:44] [gucci] [23:45] Userfile loaded, unpacking...
[23:44] [gucci] [23:45] (!) I have an user record, but without +b
2) [23:46] [gucci] [23:47] Tcl error [voiceUser]: invalid command name "Â "
Code: |
## Settings
set line "*Fserve Active*"
set channel "#E-hub"
## Binds
bind pubm - "$line" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
## Code
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
saveUser $nick $uhost $hand $channel $rest
return
}
proc time_proc {min hour day month year} {check_word}
proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
return 0
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
puthelp "NOTICE $user :you've been devoiced for not serving."
}
}
}
adduser $nick
chattr [nick2hand $nick] +S }
|
|
|
Back to top |
|
 |
|