| View previous topic :: View next topic |
| Author |
Message |
WazzaUK Voice
Joined: 02 Jul 2006 Posts: 19
|
Posted: Sun Sep 10, 2006 5:36 pm Post subject: bind join/part |
|
|
im trying to set a field in a MYSQL table when users are in a particular channel ('yes' when join, 'no' when part). Join works fine, but part doesnt even seem to call the procedure. Ive gotta be missing something..
Any ideas.....
| Code: | load /usr/local/lib/mysqltcl-3.02/libmysqltcl3.02.so
package require mysqltcl
set db_handle [mysqlconnect -host ###.###.###.### -socket /var/lib/mysql/mysql.sock -user <user> -password <password> -db <database>
bind join - "#channel *" join_main
bind part - "#channel *" part_main
proc join_main {nick uhost hand channel} {
global db_handle botnick
if {$nick==$botnick} {return 0}
set sql "UPDATE users SET onirc = 'yes' WHERE username = '$nick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
if {$result != 1} {
putlog "SQL - error"
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Online \002$nick\002 added"
}
}
proc part_main {nick uhost hand channel} {
global db_handle botnick
if {$nick==$botnick} {return 0}
set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
if {$result != 1} {
putlog "SQL - Error"
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Offline \002$nick\002 removed"
}
} |
|
|
| Back to top |
|
 |
WazzaUK Voice
Joined: 02 Jul 2006 Posts: 19
|
Posted: Sun Sep 10, 2006 6:00 pm Post subject: i see it |
|
|
| i forgot a msg param in part procedure |
|
| Back to top |
|
 |
WazzaUK Voice
Joined: 02 Jul 2006 Posts: 19
|
Posted: Sun Sep 10, 2006 7:27 pm Post subject: Quit / Ping timeout |
|
|
| seems that part doesnt cover quit and pingtime out - any ideas??? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Sep 10, 2006 7:59 pm Post subject: |
|
|
Yup, quit is a completely separate (irc) command from part..
Hence it got its own binding, "sign":
| Quote: |
bind sign <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <reason>
Description: triggered by a signoff, or possibly by someone who got
netsplit and never returned. The signoff message is the last
argument to the proc. Wildcards can be used in the mask, which is
matched against '#channel nick!user@host'.
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
WazzaUK Voice
Joined: 02 Jul 2006 Posts: 19
|
Posted: Mon Sep 11, 2006 2:22 am Post subject: nick change |
|
|
yep sign covered quit/ping timeout
what about nick change - is there a list of these procedures anywhere?
got it lol
bind nick <flags> <mask> <proc> procname <nick> <user@host> <handle> <channel> <newnick>
Stackable
Triggered when someone changes nicknames. Wildcards are allowed. The mask is matched against #channel newnick. |
|
| Back to top |
|
 |
|