mIRC Home    About    Download    Register    News    Help

Topic Options
#215250 - 09/09/09 01:47 PM mirc dont recognize my script
he3f Offline
Nutrimatic drinks dispenser

Registered: 06/02/07
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:
Code:
    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

Code:
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
}


Top
#215251 - 09/09/09 04:07 PM Re: mirc dont recognize my script [Re: he3f]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
I see multiple errors in your script.

Quote:
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"

Top
#215252 - 09/09/09 04:09 PM Re: mirc dont recognize my script [Re: argv0]
he3f Offline
Nutrimatic drinks dispenser

Registered: 06/02/07
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

Top
#215256 - 09/09/09 07:41 PM Re: mirc dont recognize my script [Re: he3f]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3503
Loc: France
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
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#215335 - 12/09/09 10:29 AM Re: mirc dont recognize my script [Re: he3f]
ziv Offline
Babel fish

Registered: 04/09/09
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.

Top
#215535 - 22/09/09 06:59 PM Re: mirc dont recognize my script [Re: he3f]
s00p Offline
Fjord artisan

Registered: 01/07/08
Posts: 236
Loc: Hell, Australia
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?

Top