| View previous topic :: View next topic |
| Author |
Message |
Ace-T Halfop
Joined: 29 Aug 2006 Posts: 82
|
Posted: Sun Sep 10, 2006 9:29 am Post subject: Trigger help |
|
|
hey guys looking for a script to trigger the bot into send a command to a mysql data base, i have come up with 1 that works when they join irc, it updates the data base but cant get it to work on part or quit...
here is the onjoin code, would some1 to be ble to adapt it to work on part
| Code: |
load /xxxxxxxxxxx/mysqltcl/libmysqltcl2.30.so
package require mysqltcl
set db_handle TOOK THIS BIT OUT
# main strings
bind pub - !user ircjoin
#setudef flag testing
proc ircjoin { nick host handle channel text } {
global db_handle quote_noflags
# if {![channel get $channel testing]} {
# return 0
# }
# if [matchattr $handle $quote_noflags] { return 0 }
# if {($handle == "") || ($handle == "*")} {
# set handle $nick
# }
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 "An error occurred with the sql :("
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Online \002$nick\002 added"
}
}
|
|
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Sep 10, 2006 1:32 pm Post subject: |
|
|
| Wouldn't it simply be a matter of duplicating your 'proc ircjoin' renaming it to like 'proc ircpart' and using the PART and QUIT binds? |
|
| Back to top |
|
 |
|