egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trigger help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Ace-T
Halfop


Joined: 29 Aug 2006
Posts: 82

PostPosted: Sun Sep 10, 2006 9:29 am    Post subject: Trigger help Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Sep 10, 2006 1:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber