i finally got the delete to work properly with this as the final edit. ( i removed the !editcmd and !search for posting on this thread, but its still included in the script) ...Now i want it to check for the prefix ! as $2, and if $2 does not have ! inside of it, then it should return "$nick More parameters needed." please help me figure out how to get it to check if the matched text includes a ! prefix. thank you in advance. as you can see, i can figure some things out, im just not good at securing it simplifying the code. if i can get help with that too, id be super appreciative. all this is for a justintv channel bot i have created using snippets found, and snippets modified by myself as a learning process.
example:
wrong syntax!delcmd
testresponse: $nick More parameters needed.
correct syntax!delcmd
!testresponse: The trigger
!test has been removed
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 %delmrc on *:TEXT: $+ $2 $+ : $+
if ($nick !isop $chan) { msg $chan $nick not enough access. | halt }
elseif (!$2) { msg $chan $nick More parameters needed. | halt }
elseif (!$2 != !$read(scripts/cc.mrc,ntw,* $+ $2 $+ *)) { msg $chan $nick This trigger doesnt exist. | halt }
write -dw" %delmrc $+ *" scripts/cc.mrc
write -dw"* $+ > $2 < $+ *" scripts/cc.html
write -ds" $+ $2 $+ " scripts/cc.txt
run -ns: scripts/ccftpbatch.bat
msg $chan The trigger $2 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 %delmrc
}
}