mIRC Home    About    Download    Register    News    Help

Topic Options
#254261 - 31/07/15 03:25 AM [Twitch] Add quote not working?
lukar14 Offline
Self-satisified door

Registered: 31/07/15
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!


Edited by lukar14 (31/07/15 03:33 AM)

Top
#254263 - 31/07/15 06:45 AM Re: [Twitch] Add quote not working? [Re: lukar14]
dailyproblem Offline
Pikka bird

Registered: 31/12/14
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!


Edited by dailyproblem (31/07/15 06:46 AM)

Top
#254270 - 31/07/15 01:07 PM Re: [Twitch] Add quote not working? [Re: lukar14]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#254272 - 31/07/15 01:26 PM Re: [Twitch] Add quote not working? [Re: Nillen]
lukar14 Offline
Self-satisified door

Registered: 31/07/15
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?

Top
#254273 - 31/07/15 03:20 PM Re: [Twitch] Add quote not working? [Re: lukar14]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#254275 - 31/07/15 03:29 PM Re: [Twitch] Add quote not working? [Re: Nillen]
lukar14 Offline
Self-satisified door

Registered: 31/07/15
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.

Top
#254277 - 31/07/15 05:05 PM Re: [Twitch] Add quote not working? [Re: lukar14]
MattiSony Offline
Ameglian cow

Registered: 26/10/14
Posts: 35
Are you requesting the user list? - http://forums.mirc.com/ubbthreads.php/topics/254093/
_________________________
Matti

Top
#254286 - 01/08/15 01:59 AM Re: [Twitch] Add quote not working? [Re: MattiSony]
lukar14 Offline
Self-satisified door

Registered: 31/07/15
Posts: 4
Thank you! I think that did the trick!
Thanks everyone for their help!

Top