mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2015
Posts: 4
L
lukar14 Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Jul 2015
Posts: 4
So I'm very, very new to coding and have absolutely no experience at all. I've come to understand the very basic stuff in mIRC, but somethings I'm just not getting. I've managed to make a custom twitch chat bot using tutorials on youtube and have got it working for the most part. I just can't seem to get !addquote or !addjoke to work. I had them working originally and all they would add was the first word of the sentence that I would type. No they aren't working at all.
The code I'm using is:
Code:
on *:TEXT:!addquote *:#: {
  if ($nick !isOp #) { return }
  write quotes.txt $2- $+
  msg $chan Added: $2-
}


Edit: I should also mention that it is not automatically adding the quote.txt file. And when added manually, it will still not recognize or write into that file.

Any advice or help would be greatly appreciated!
Thank you!

Last edited by lukar14; 31/07/15 02:33 AM.
Joined: Dec 2014
Posts: 18
D
Pikka bird
Offline
Pikka bird
D
Joined: Dec 2014
Posts: 18
Code:
 
on *:text:!addquote *:#: {
  if ($nick isop #) {
    var %r = $read(quote.txt,ns,$2)
    if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This quote $qt($2) is quote exist into the database! | return }
    write quote.txt $2-
    msg $chan /me + quote $2 has been added to the database!
  }
}
on *:text:!delquote *:#: {
  if ($nick isop #) {
    var %r = $read(quote.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This quote $qt($2) does NOT exist into the database! | return }
    write -dl $+ $readn quote.txt
    msg $chan /me - Quote $2- has been deleted from the database!
  }
}
on *:text:!editquote & *:#: {
  if ($nick isop #) {
    var %r = $read(quote.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This quote $qt($2) does NOT exist into the database! | return }
    write -l $+ $readn quote.txt $2-
    msg $chan /me -> Quote $2 has been updated!
  }
}
ON *:TEXT:*:#: { 
  tokenize 32 $strip($1-,burci)
  if ($read(quote.txt, nts, $1)) {
    var %com = $v1
    var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan  | return }
    msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
  }
}

This is a modified version of my !addcom !editcom !delcom script. It should work with what you want. With the ability to both delete and edit your quotes, in case of mistakes! (If it does not work, sorry I am tired!

Last edited by dailyproblem; 31/07/15 05:46 AM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
There's also one I made a while ago found here if you'd like to try that out.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jul 2015
Posts: 4
L
lukar14 Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Jul 2015
Posts: 4
So I've tried both scripts and still neither are creating the quotes.txt file or even being recognized by the bot when I type in chat. Is there something I'm still not doing right?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Are you using it all in the same remote script file? Create a new file by going to File > New while in the script editor, then paste it there.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jul 2015
Posts: 4
L
lukar14 Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Jul 2015
Posts: 4
I think that I am. I'm using mSLDev to edit scripts, but I have tried pasting directly into mIRC and it's still not being recognized.

Joined: Oct 2014
Posts: 35
M
Ameglian cow
Offline
Ameglian cow
M
Joined: Oct 2014
Posts: 35
Are you requesting the user list? - https://forums.mirc.com/ubbthreads.php/topics/254093/


Matti
Joined: Jul 2015
Posts: 4
L
lukar14 Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Jul 2015
Posts: 4
Thank you! I think that did the trick!
Thanks everyone for their help!


Link Copied to Clipboard