mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 3 1 2 3
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Hello laugh I am making a Twitch chat bot for Myself and maybe someone else. I Need something that you can add,remove and edit commands as I can seem to get any of the ones on the Forum to work smirk If you could post a working script and teach me how to use it I will make a command for you and stuff. Thanks laugh

Last edited by AllDayGrinding; 12/04/14 07:05 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
How rude

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
How May I ask?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
This is a help forum, not a forum to place orders. You need to put some work in. You already saw this script: https://forums.mirc.com/ubbthreads.php/topics/244453/Re:_Command_that_adds/removes_#Post244453, it works perfectly. The usage was given in the original post. If you can't get it working you need to figure out why, or provide reproducible steps to show that it isn't working.

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I did ask how I used it like What did I have to Type to add a command or delete a command? Please help

Joined: Mar 2014
Posts: 52
P
Babel fish
Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
Code:
on $*:text:/^!commandadd !?(\S+)/iS:#test:{


!commandadd ..

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Then what do I need to type and what would I need to type to the command and delete it. Also is there a way to make only Op use it?

Joined: Mar 2014
Posts: 52
P
Babel fish
Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
you have to type in your command lol
!commandadd !hello /me welcomes you to the stream

!commandremove !hello

it is already for op only
if you didnt change anything
Code:
on $*:text:/^!commandadd !?(\S+)/iS:#test:{
  if ($nick !isop #) return
  writeini commands.ini commands $regml(1) $$3-
}

on $*:text:/^!commandremove !?(\S+)/iS:#test:{
  if ($nick !isop #) return
  remini commands.ini commands $regml(1)
}

on $*:text:/^!repeat !?(\S+) (off|\d+)/iS:#test:{
  if ($nick !isop #) return
  
  var %command = $regml(1), %interval = $regml(2)
  
  if ($timer(command. $+ %command)) {
    if (%interval == off) .timercommand. $+ %command off
    else msg # ! $+ %command is already repeating
  }
  elseif ($readini(commands.ini,n,commands,%command)) {
    var %response = $v1
    .timercommand. $+ %command 0 $iif(%interval < 5,5,%interval) msg # $safe(%response)
    msg # %response
  }
}

on $*:text:/^!(\S+)/:#test:{
  if ($nick !isop #) return
  if ($readini(commands.ini,n,commands,$regml(1))) msg # $v1
}

alias safe return $!decode( $encode($1,m) ,m)


Code:
if ($nick !isop #) return

if nick who is executing the command not an op then return, else add command.

everything i told you is already specified in this thread
https://forums.mirc.com/ubbthreads.php/topics/244453/Re:_Command_that_adds/removes_#Post244453

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Thank you. I will see if I can get it to work in the morning

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I cant get that to work... http://gyazo.com/e10f0f4cc1a0565c1148f7c844e524cb Please help

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Are you running the bot under a different name? Are you an op? Have you placed this script in its own file?

There is no response from the bot when you add or delete commands.

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
What do you mean by all that?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
I can't be any more clear. You need to take some initiative and read through the help files.

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
That doesnt say any code though. I am Only `13

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I am running the script in the bit called remote. I dont understand by what you mean Different name and yes I am the owner of the channel

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Originally Posted By: AllDayGrinding
I cant get that to work... http://gyazo.com/e10f0f4cc1a0565c1148f7c844e524cb Please help

Very basic question smile

What did you type?
And what did you expect after you typed that?


Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I do not think that code is writing the command into commands.ini as after I type what I typed there is still no commands in there. Does anyone know?

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Did you just copy the code and paste into remote right away?
Did you realize that you need to edit the code?
Did you realize that the code is work on channel #test?
Had you edit #test to #yourchannelname to make it working on your channel?


Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I just copied and pasted in into the remote.. Should I change #Test to My channel whenever it says #test. Didnt realise I had to edit it

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Yes. You have to change #test to #yourchannelname otherwise the code will not work. Actually it works, but on the channel #test.

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
It is still not writing the command in commands.ini

Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
This script relies on a ops hash table to verify if someone is a channel moderator or not.

Example usage

set trigger popcorn Pull up a chair and grab some popcorn
Remove trigger popcorn

To call the trigger you use !popcorn

The Trigger supports 4 responses for one !command you do that by setting trigger..4

set trigger popcorn This is line 1
set trigger popcorn2 This is line 2
set trigger popcorn3 This is line 3
set trigger popcorn4 This is line 4

!popcorn would then show "This is Line 1" etc

;===========================================================
; Dynamic triggers - newtriggers.mrc
;===========================================================
; Author : Bill Larson (blarson@compu.net)
; Revision: 1.0
; FileName: newtriggers.mrc
;===========================================================

on 1:TEXT:set trigger*:#:{
if !$hget(ops,$nick) { /halt }

if !$3 || !$4 {
/notice $nick Format: set trigger <triggername> <info>
/halt
}
/hadd triggers $$3 $4-
/msg $chan trigger for $3 set to
/msg $chan $4-

/hsave -o triggers triggers.hsh
/halt
}

on 1:TEXT:remove trigger*:#:{
if !$hget(ops,$nick) { /halt }

if $3 {
if !$hget(triggers, $3) {
/msg $chan no trigger info is set for $3 sorry.
/msg $chan Try using set trigger first.
/halt
} else {
/hdel triggers $$3
/msg $chan Trigger info was removed for $3
/hsave -o triggers triggers.hsh
/halt
}
} else {
/msg $chan Format: remove trigger Triggername
}
}

on 1:TEXT:!*:#:{
/var %command $remove($1,!)
if $hget(triggers, %command) {
/msg $chan $hget(triggers, %command)
}
if $hget(triggers, %command $+ 2) {
/msg $chan $hget(triggers, %command $+ 2)
}
if $hget(triggers, %command $+ 3) {
/msg $chan $hget(triggers, %command $+ 3)
}
if $hget(triggers, %command $+ 4) {
/msg $chan $hget(triggers, %command $+ 4)
}
/halt
}

alias dumptrigs {
/var %t 1
/var %ttotal $hget(triggers,0).item
while (%t <= %ttotal) {
/echo -s set trigger $hget(triggers,%t).item $hget(triggers,$hget(triggers,%t).item)
/inc %t
}
}

on 1:disconnect:{
/hsave -o triggers triggers.hsh
}

on 1:connect:{
/hmake triggers 100
/hload -o triggers triggers.hsh
}

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Originally Posted By: AllDayGrinding
It is still not writing the command in commands.ini


What did you type?
How did you know that is not writing?
Is your commands.ini file empty?

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I Typed !commandadd !hello Welcome to the stream! Then I looked in the commands.ini file and nothing is in there

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
What did you put your #channel as?
And what is your registered twitch name?


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I put it as #alldaygrinding and my Twitch username Is AllDayGrinding

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
i think the bot name matters more than your name...


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Oh OK I'll Try it

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
My Bot name is GrindingBot so I Typed #grindingbot wherever it has a # But yet it still does not write the command in Commands.ini Does anyone know why this is happening?

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Lets try this code. Put it into new remote file. ( Alt+R, File, New.. )

Code:
on $*:text:/^!commandadd !?(\S+)/iS:#:{
  if ($nick !isop #) { echo -ag You are not OP }
  else {
    writeini commands.ini commands $regml(1) $$3-
    echo -ag $readini(commands.ini,command,$regml(1))
  }
}

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Do I need to change any of that?

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Only thing i can see is if you want to rename the file commands.ini . If not, then no you dont need to change anything.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I put that into a new file but still it does not write anything in commands.ini

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You cant type it in the same client that running the script, somone else in the channel need to type.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
Well you can but you have to setup an on input...

The on INPUT event triggers when you enter text in an editbox and press enter.

Format: on <level>:INPUT:<*#?=!@>:<commands>

Example: on 1:INPUT:#mIRC:/echo You entered the text " $1- " in the #mIRC window

Examples

on 1:INPUT:#:/echo I just mumbled " $1- " in a channel

Triggers when you enter text in an editbox in a channel window and press enter. The $1- parameters refer to the text that you entered. If you /halt this event, you can prevent mIRC itself from processing your message.

on 1:INPUT:?:/echo I just mumbled " $1- " in a query window
on 1:INPUT:=:/echo I just mumbled " $1- " in a dcc chat
on 1:INPUT:!:/echo I just mumbled " $1- " in a fileserver


You can also specify a specific channel/window name instead of *#?=!@.

You can use the $ctrlenter identifier to test whether Control+Enter was pressed when the user entered the text.

Note: You can use commands such as /say with on INPUT and they will send the message to the window in which you are typing, however most commands/events do not work this way and require you to specify the actual destination of a message.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I know he can do that on input, but since he said it dont work (The script he have), then my guess was he typed the command in him self with the same client. Easy to think you can trigger it your self.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I don't think this is the case. From previous posts he has described that his username which he is logged in to on twitch.tv is AllDayGrinding and his mIRC application is singed as GrindingBot or something similar. The previous pictures he has sent have all been written by the user and not triggered.

There's most likely a problem with another on *:text:*:#: event in his remote.ini file.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
So Would I need to get someone else to add a command or have to change the code?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Here's what you should do. Paste everything you have in your remote.ini file into a pastebin and link it here. The code we've provided several times for you that you claim do not work have never been faulty, it is entirely an user error and there's no way we can help you (this topic is the proof of that) unless you show us everything you've done so far and how messed up your file truly looks.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Here is my script. http://pastebin.com/F30c5mM7

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You didn't include any script involving creating a dynamic trigger for events.
Easier words: None of the scripts that have been pasted here are in the pastebin you sent.

Sidenote: You have 2 join events and one too many closing brackets.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I'll Make a different one. I took the Adding and removing commands out of the script. here is it with it. Is there anyway you could check why it does not work?. http://pastebin.com/bhVzxeQF

Last edited by AllDayGrinding; 20/04/14 04:32 PM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
This will only work in the channel #test since you specified it to be only used in that channel. Remove test so you only have # and it will work on all channels.

You still have an extra closing bracket at the end however.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Ok Then Will it all work?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Mhm.
Replace the first part with this if you want a confirmation message each time you successfully create a command.
Code:
on $*:text:/^!commandadd !?(\S+)/iS:#:{
  if ($nick !isop #) return
  msg # Successfully created $regml(1) $+ !
  writeini commands.ini commands $regml(1) $$3-
}

You need to take some time and study and understand the scripts you're working with.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Ok Cheers for your Help! Do you have a chat bot?

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
What is this part for?
Code:
on $*:text:/^!(\S+)/:#:{
  if ($nick !isop #) return
  if ($readini(acommands.ini,n,commands,$regml(1))) msg # $v1
}

also, What would the edit command be for this?

EDIT: figured out that that code is what says the command.

Last edited by judge2020; 20/04/14 10:40 PM. Reason: EDIT

#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
What would the edit command be?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
There is no edit.
If you create a command that already exists you will overwrite the old one, that's how you edit.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Page 1 of 3 1 2 3

Link Copied to Clipboard