mirc dont recognize my script - 09/09/09 12:47 PM
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:
and this i how the script from mysql looks in remote
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 }