|
Joined: Feb 2007
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2007
Posts: 9 |
so i have this script, that download a Script from a mysql server. it put the script from mysql into a txt file, and load it. so thinks looks good, there inst any errors in the script. Not at all. but mirc have like just loaded it as plain text. it dont recognize that the text is a mirc script. and the "check brackets" dont do any think to it. If i add/change a char in the script, when it is loaded. i recognize the script. and every think is good. problem is, that i need it to do it all manually mysql script, gat gathers the script from mysql: var %sql = SELECT * FROM script WHERE botid = ? AND scriptnavn = ?
var %res = $mysql_query(%track.db, %sql, $2, $3-,)
write -c $qt($mircdir $+ $3- $+ .txt)
write -c text601.txt
var %myok $mysql_fetch_all(%res, text600.txt)
write text601.txt $remove($read(text600.txt,n,1),$2 $+ $chr(9) $+ $3- $+ $chr(9))
write $qt($mircdir $+ $3- $+ .txt) $replace($read(text601.txt,n,1),\x0d\x0a,$crlf)
load -rs $qt($mircdir $+ $3- $+ .txt)
mysql_free %res
and this i how the script from mysql looks in remote on *:text:*:#: {
if ($nick isop #NesH.cPanel) && ($chan == #NesH.cPanel) {
if ($1 == !reklame) {
notice $nick !setlines - !addreklame - !delreklame - !reklamelist
}
if ($1 == !setlines) {
if ($2 == $null) {
notice $nick ERROR: !setlines <linger der er mellem reklame>
notice $nick lines er lige nu: $readini(reklameL.ini,data,lines)
}
else {
if ($2 isnum) {
if ($2 < 74) {
notice $nick tallet skal være støre end 74
}
if (75 <= $2) {
writeini reklameL.ini data lines $2
notice $nick Lines er nu sat til $2
}
}
else {
notice $nick ERROR: <linger der er mellem reklame(skal være et tal)>
}
}
}
if ($1 == !addreklame) {
if ($5 == $null) {
notice $nick ERROR: Det skal være en sætning på mindst 5 ord
}
else {
writeini reklameL.ini reklame reklame $+ $calc($ini(reklameL.ini,reklame,0) + 1) $2-
notice $nick reklame er nu gemt
}
}
if ($1 == !reklamelist) {
var %x 1
while (%x <= $ini(reklameL.ini,reklame,0)) {
notice $nick ReklameList: ( $+ %x $+ ) $readini(reklameL.ini,reklame,$ini(reklameL.ini,reklame, %x))
inc %x
}
notice $nick reklamelist done
}
if ($1 == !delreklame) {
if ($2 == $null) {
notice $nick ERROR: du skrev ikke hvad for en reklame du ville slette
}
else {
if ($2 isnum) {
if ($readini(reklameL.ini,reklame,reklame $+ $2)) {
remini reklameL.ini reklame reklame $+ $2
notice $nick reklamen er nu sletet
}
else {
notice $nick reklamen findes ikke..
}
}
}
}
}
inc %lines $+ $chan
checklines $chan
}
alias checklines {
echo @lines $time [ % [ $+ [ lines [ $+ [ $1 ] ] ] ] ]
if ($readini(reklameL.ini,data,lines) < [ % [ $+ [ lines [ $+ [ $1 ] ] ] ] ]) {
if ([ % [ $+ [ reklamenr $+ [ $1 ] ] ] ] == $null) {
set %reklamenr $+ $1 1
}
if ([ % [ $+ [ reklamenr $+ [ $1 ] ] ] ] > $ini(reklameL.ini,reklame,0)) {
set %reklamenr $+ $1 1
}
echo -a hej
var %xH [ % [ $+ [ reklamenr $+ [ $1 ] ] ] ]
echo -a d %xH
var %xH $ini(reklameL.ini,reklame,%xH)
echo -a %xH d
msg $1 $readini(reklameL.ini,reklame,%xH)
inc %reklamenr $+ $1
set %lines $+ $1 0
}
}
on *:part:#: {
inc %lines $+ $chan
checklines $chan
}
on *:join:#: {
inc %lines $+ $chan
checklines $chan
}
on *:mode:#: {
inc %lines $+ $chan
checklines $chan
}
on *:rawmode:#: {
inc %lines $+ $chan
checklines $chan
}
on *:nick: {
inc %lines $+ $chan
checklines $chan
}
on *:quit: {
inc %lines $+ $chan
checklines $chan
}
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
I see multiple errors in your script. var %myok $mysql_fetch_all(%res, text600.txt) Is missing an =, for instance. Also, if that code (the first chunk you pasted) is the only thing in the file, there's nothing for mIRC to recognize. You can't just put random lines of code into text files and load them in mIRC. Ideally that code should be inside some kind of alias or event... Exactly what do you mean by "do it all manually"?
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Feb 2007
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2007
Posts: 9 |
the var think is really not a error
and the first part is in a alias, there wanst a reason for pasting all the other part of the script
any way. I have fund a way, so it works
i had to write it all one more time to a new txt file
|
|
|
|
Joined: Jul 2006
Posts: 4,145
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,145 |
The '=' sign on /var is part of the syntax because it's in the help file, but you can omit it since mirc 6.3 if you want
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Sep 2009
Posts: 52
Babel fish
|
Babel fish
Joined: Sep 2009
Posts: 52 |
I'v noted some bracket errors, you might want to have a better look at your second chunk of code.
Make sure it's perfect, both of them.
ziv.
|
|
|
|
Joined: Jul 2008
Posts: 236
Fjord artisan
|
Fjord artisan
Joined: Jul 2008
Posts: 236 |
It's a sore sight. I can't read that, but from what I can see, it's vulnerable. $readini(reklameL.ini,data,lines) yaaaaar Does mIRC know about "$mysql_query"? Are you loading the DLL that I reckon you'll be needing for that?
Now tell me, honestly, where did you copy/paste that code from, and why haven't you read the relevant parts of the mIRC help file that would help you understand how this works?
|
|
|
|
|