mIRC Home    About    Download    Register    News    Help

Print Thread
#149520 20/05/06 09:21 AM
Joined: May 2006
Posts: 3
C
css Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: May 2006
Posts: 3
I'll like used a small code to make request in the mysql Database automatically, the problem it is by making an echo on a nick !

[code]
#Chan -> look pretime
set chanpretime "#PRES"
#Chan -> addpre & nuke
set chanadd "#TIME"
#Chan ->your checkpre
set chanpre "#your checkpre"
#Host de la db
set host {localhost}
#User de la db
set user {root}
#Pass de la db
set password {}
#Database name
set db {'PRE}
#Nickserv : 1=ON
set nson 1
#pass nickserv
set nspass "pass_bot"
#Nick bot
set nsbot "nick_bot"

##############################
# MySQL Connec #
###############################
load libmysqltcl.dll
package require mysqltcl

if [catch {mysqlconnect -host $host -user $user -password $password -db $db} mysql_handler] {
putquick "PRIVMSG $chanadd :ERROR..."
}

###############################
# !addpre By Nick Echo (Automatik)
###############################
bind pub - !addpre pub:addpre

proc pub:addpre {nick uhost handle channel arg } {
global Hdecalage chanadd chanpre mysql_handler


set arg [lindex [split $arg] 0]
if {![rlzexist $arg] && [string tolower $channel]=="$chanadd"} {

set passedsec [expr [unixtime]-[expr $Hdecalage*3600]]
set curdate [strftime %Y-%m-%d $passedsec]
set curtime [strftime %H:%M:%S $passedsec]

set sql "INSERT INTO releases(name,date,time,unixtime,nuke) VALUES('$arg','$curdate','$curtime','$passedsec','')"
mysqlquery $mysql_handler $sql

-------------------------------------
Example:
echo_chan -> #PRES
Echo_nick > PRED
PRED : «BoX» PRE : Aquamarine 2006 iTALiAN MD CAM XviD-BoX «»AUTRE-IT«»

Thank smirk

#149521 20/05/06 09:52 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
I dont understand your code, but echoing to a nick other then your own is not possible afaik...

#149522 20/05/06 02:32 PM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
I can't really place the language you are writing the DLL in really... maybe you should try the developement part of the forum for indepth help on the DLL


If it ain't broken, don't fix it!
#149523 20/05/06 03:35 PM
Joined: May 2006
Posts: 3
C
css Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: May 2006
Posts: 3
Hum...


Link Copied to Clipboard