mIRC Home    About    Download    Register    News    Help

Print Thread
#253783 06/07/15 02:04 PM
Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
I've been wanting to make my own bot for a while now and been working on it for a while, but since I have almost no knowledge of these scripts I've been copy pasting most of them. Most of them do in fact work, even the ones I made myself, except for these 3 copy pasted ones.

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) already exists in the database! | return }
    write commands.txt $2-
    msg $chan /me + Command $2 has been added to the database!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist in the database! | return }
    write -dl $+ $readn commands.txt
    msg $chan /me - Command $2- has been deleted from the database!
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist in the database! | return }
    write -l $+ $readn commands.txt $2-
    msg $chan /me -> Command $2 has been updated!
  }
}


Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) && ($2) {
    write reglist.txt $2
    msg # $2 has been permitted to post a link for 20 seconds
    .timerRemovePermit 1 20 RemovePermit # $2
  }
  if ($read(sreglist.txt,nw,$nick)) && ($2) {
    write reglist.txt $2
    msg # $2 has been permitted to post a link for 20 seconds
    .timerRemovePermit 1 20 RemovePermit # $2
  }
}


Code:
on *:TEXT:!reg add*:#: {
  if ($nick isop #) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
  if ($read(reglist.txt,nw,$nick)) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
}
on *:TEXT:!reg del*:#: {
  if ($nick isop #) {
    if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt 
    msg # $$3 has been removed from the regular list!
  }
  if ($read(reglist.txt,nw,$nick)) {
    if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt 
    msg # $$3 has been removed from the regular list!
  }
}


I've tried many different scripts but none seem to work and I can't figure out why. I've tried changing the .txt's to .ini's and anything I've had come up in my head. I'd appreciate any help.

Also, since I'm going to have the bot in my friends channels too, how can I make so that there are individual commands for individual channels? Such as multiple !twitter commands?

Thanks.

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Hi, there's probably no one who can help you withour more information. "The script doesn't work" is too unspecific. The scripts seem fine from a quick glance

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
are you using cap req membership for the 'if ($nick isop #)' to function?

And have you copy and pasted these to the end of a remote that has other commands? Any previous on text events that would trigger will negate these commands.

Last edited by Belhifet; 07/07/15 06:19 AM.
Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
Originally Posted By: Sakana
Hi, there's probably no one who can help you withour more information. "The script doesn't work" is too unspecific. The scripts seem fine from a quick glance


That's what everyone says. I put them in a new .ini file and even restarted the bot but none of the commands work, it simply does nothing. Everyone says it works, even the other same scripts should work and work for other people, but no idea why they won't work for me.

Originally Posted By: Belhifet
are you using cap req membership for the 'if ($nick isop #)' to function?

And have you copy and pasted these to the end of a remote that has other commands? Any previous on text events that would trigger will negate these commands.


I shouldn't be. Also, they're in a new blank .ini.

Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
Still no success on making them work. The commands do nothing, even though the exact same scripts, and many others for the same thing work for other people. They simply do not do anything. They're all in remote, in blank new .ini's.




Everything else works, except for the 3 I put in the OP. I've tried everything that has come to my mind but I can't figure it out. ANY kind of help is highly appreciated because these 3 commands, multiple channels support are the only things I need to be able to fully use my bot.

Oh and I just realized that I get "Invalid CAP command" every time I connect to irc.twitch.tv, I was wondering if that was affecting it? I tried to google it and did everything that was told to do (check oauth keys, etc.) but it still happens.

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Try using some echoes to locate the problem


Code:
on *:text:!addcom *:#: {
 echo -ag debug 1 $2- 
 if ($nick isop #) {
    echo -ag debug 2
    var %r = $read(commands.txt,ns,$2)
    if (%r) { 
    echo -ag debug 3 %r
.msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) already exists in the database! | return }
    write commands.txt $2-
    echo -ag debug 4 $2-
    msg $chan /me + Command $2 has been added to the database!
  }
}

Last edited by Sakana; 09/07/15 12:48 AM.
Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
Tried it, this is what it does. Not sure if it's showing what it's supposed to be showing but yeah.


Last edited by seshu; 09/07/15 12:04 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
That person's not an operator, why don't you take some time to learn what your scripts are actually doing?

Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
Originally Posted By: Loki12583
That person's not an operator, why don't you take some time to learn what your scripts are actually doing?


It's my own channel which you can see from the picture, also, I tried it with friends and the bot that are all moderators in my chat, still not working.
If I do a normal
Code:
on *:TEXT:!test:#:{ msg $chan test }
if ($nick isop #) { msg # test }

it works perfectly

Last edited by seshu; 09/07/15 01:32 PM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Sure, bot knows about it.. somehow.


Dont give a fish - teach to fish!
Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
Okay so, I was being highly retarded. I just now noticed that mIRC wasn't getting the user list so it did not load the OPs etc. Thing is now, I fixed it, it just now adds everyone to reg list automatically, making them not get timed out. !addcom also doesn't write the commands. It says it adds the command, and I can edit/delete it, but when I do !test it won't work. Any ideas?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Your catch-all text event isn't reading commands from the same file.

Joined: Jul 2015
Posts: 8
S
seshu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2015
Posts: 8
Originally Posted By: Loki12583
Your catch-all text event isn't reading commands from the same file.


I made it so it reads my commands.ini which I have, instead of the .txt which I didn't have but which it created. Reglist on the other hand works perfectly. Not sure if that's what you meant but that's what I'm thinking you meant.

It writes the command and reads the command, but it's not in the right format so it does absolutely nothing. So now this is my only problem currently.



Last edited by seshu; 09/07/15 06:25 PM.

Link Copied to Clipboard