i need help deleting - 11/10/12 06:33 AM
Code:
on *:TEXT:*:*: { if ($1 == !addcmd) { if (!$2) { msg $chan $nick More parameters needed. | halt } elseif ($2 == !addcmd) || ($2 == !delcmd) || ($2 == ! $+ $null) { msg $chan $nick Primary triggers cant be set. | halt } elseif (!$2 = !$read(scripts/cc.txt,ntw,* $+ $2 $+ *)) { msg $chan $2 already taken. | halt } write -il1 scripts/cc.mrc on *:TEXT: $+ $2 $+ : $+ $chr(35) $+ : { describe $chr(35) $3- } | write scripts/cc.txt $2 $3- | write scripts/cc1.txt $2 $3- $chr(91) $+ CREATED BY $+ $chr(93) $nick | /write -l4 scripts/cc.html This page was modified on: $date(ddd mmm dd $+ $chr(44) yyyy) $chr(64) $time(h:nntt) <br><ol> | write -il8 scripts/cc.html <tr><td $+ $chr(32) $+ nowrap $+ $chr(61) $+ $chr(34) $+ nowrap $+ $chr(34) $+ > $+ $chr(32) $+ $2 $+ $chr(32) $+ </td> <td> $3- </td></tr> | run -ns: scripts/ccftpbatch.bat .timer 1 1 describe # $nick added $2 to $me $+ . Thank you for your addition. Click http://tinyurl.com/all-bot-commands for the complete list of commands. .timer 1 1 load -rs scripts/cc.mrc | .timer 1 1 load -rs scripts/cc.txt | .timer 1 1 load -rs scripts/cc.html } elseif ($1 == !delcmd) { set %istriggerdel $2 set %delhtml <tr><td $+ $chr(32) $+ nowrap $+ $chr(61) $+ $chr(34) $+ nowrap $+ $chr(34) $+ > $+ $chr(32) $+ %istriggerdel $+ $chr(32) $+ set %delmrc on *:TEXT: $+ %istriggerdel $+ : $+ if ($nick !isop $chan) { msg $chan $nick not enough access. | halt } elseif (!$2) { msg $chan $nick More parameters needed. | halt } elseif (! $+ %istriggerdel == !$read(scripts/cc.txt,ntw,* $+ %istriggerdel $+ *)) { msg $chan $nick This trigger doesnt exist. | halt } write -dw" %delmrc $+ *" scripts/cc.mrc write -ds" %delhtml " scripts/cc.html write -ds" $+ %istriggerdel $+ " scripts/cc.txt run -ns: scripts/ccftpbatch.bat msg $chan The trigger %istriggerdel has been removed...hopefuly? .timer 1 1 load -rs scripts/cc.mrc | .timer 1 1 load -rs scripts/cc.txt | .timer 1 1 load -rs scripts/cc.html unset %istriggerdel unset %delhtml unset %delmrc } elseif ($1 == !editcmd) { set %istriggeredit $2 set %istriggert $3 $4- if ($nick !isop $chan) { msg $chan $nick not enough access. | halt } elseif (!$3) { msg $chan $nick More parameters needed. | halt } elseif (!$read(scripts/cc.txt,ntw,* $+ %istriggeredit $+ *)) { msg $chan $nick This trigger doesnt exist. | halt } write -ds" $+ %istriggeredit $+ " scripts/cc.txt | write scripts/cc.txt %istriggert msg $chan The trigger %istriggeredit has been edited...hopefuly? | run -ns: scripts/ccftpbatch.bat unset %istriggeredit unset %istriggert } elseif ($1 == !search) { set %istriggersearch $2 elseif (!$3) { msg $chan not the correct parameters | halt } elseif (!$read(scripts/cc.txt,nts,* $+ %istriggersearch $+ *)) { msg $chan $nick This trigger doesnt exist. | halt } msg $chan searching %istriggersearch filter -ff scripts/cc.txt scripts/temp.txt * $+ %istriggersearch $+ * .play -pq3f1m1 $chan scripts/temp.txt 2000 remove scripts/temp.txt unset %istriggersearch } }
I am sorry if i am using anybody's code, but i needed something to start from. the problem i am having is getting the !delcmd <trigger to delete> to delete from the html file scripts/cc.html. i am not having any issues getting the command to delete from the .mrc file or the .txt file. for some reason, i cant get it to find and delete from the .html file. if someone can help me, i would really really appreciate it. i love this website, and have been learning alot from it. the purpose of this scripts is for a custom bot i created in a jtv channel. so i get alot of custom commands added. i would like the mods in my chat to be able to delete any they feel are unnecessary.
ps....the !editcmd doesnt work yet either, but i can play with that after i get the !delcmd to work right. !addcmd and !search already work properly