mIRC Homepage

Adding,removing and Editing commands then using em

Posted By: AllDayGrinding

Adding,removing and Editing commands then using em - 12/04/14 05:57 PM

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
Posted By: Loki12583

Re: Adding,removing and Editing commands then using em - 12/04/14 06:51 PM

How rude
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 12/04/14 07:02 PM

How May I ask?
Posted By: Loki12583

Re: Adding,removing and Editing commands then using em - 12/04/14 07:06 PM

This is a help forum, not a forum to place orders. You need to put some work in. You already saw this script: http://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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 12/04/14 08:33 PM

I did ask how I used it like What did I have to Type to add a command or delete a command? Please help
Posted By: patrickplays

Re: Adding,removing and Editing commands then using em - 12/04/14 09:44 PM

Code:
on $*:text:/^!commandadd !?(\S+)/iS:#test:{


!commandadd ..
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 12/04/14 10:01 PM

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?
Posted By: patrickplays

Re: Adding,removing and Editing commands then using em - 12/04/14 10:42 PM

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
http://forums.mirc.com/ubbthreads.php/topics/244453/Re:_Command_that_adds/removes_#Post244453
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 12/04/14 11:32 PM

Thank you. I will see if I can get it to work in the morning
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 13/04/14 08:50 AM

I cant get that to work... http://gyazo.com/e10f0f4cc1a0565c1148f7c844e524cb Please help
Posted By: Loki12583

Re: Adding,removing and Editing commands then using em - 13/04/14 02:35 PM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 13/04/14 03:16 PM

What do you mean by all that?
Posted By: Loki12583

Re: Adding,removing and Editing commands then using em - 13/04/14 03:39 PM

I can't be any more clear. You need to take some initiative and read through the help files.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 13/04/14 03:51 PM

That doesnt say any code though. I am Only `13
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 13/04/14 05:50 PM

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
Posted By: blessing

Re: Adding,removing and Editing commands then using em - 14/04/14 03:40 AM

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?

Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 14/04/14 12:30 PM

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?
Posted By: blessing

Re: Adding,removing and Editing commands then using em - 14/04/14 01:03 PM

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?

Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 14/04/14 04:21 PM

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
Posted By: blessing

Re: Adding,removing and Editing commands then using em - 15/04/14 02:47 AM

Yes. You have to change #test to #yourchannelname otherwise the code will not work. Actually it works, but on the channel #test.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 15/04/14 10:16 AM

It is still not writing the command in commands.ini
Posted By: bl968

Re: Adding,removing and Editing commands then using em - 15/04/14 12:35 PM

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
}
Posted By: blessing

Re: Adding,removing and Editing commands then using em - 15/04/14 03:23 PM

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?
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 15/04/14 04:42 PM

I Typed !commandadd !hello Welcome to the stream! Then I looked in the commands.ini file and nothing is in there
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 15/04/14 07:59 PM

What did you put your #channel as?
And what is your registered twitch name?
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 15/04/14 08:15 PM

I put it as #alldaygrinding and my Twitch username Is AllDayGrinding
Posted By: judge2020

Re: Adding,removing and Editing commands then using em - 15/04/14 08:38 PM

i think the bot name matters more than your name...
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 16/04/14 09:13 AM

Oh OK I'll Try it
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 16/04/14 10:03 AM

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?
Posted By: blessing

Re: Adding,removing and Editing commands then using em - 16/04/14 11:10 AM

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))
  }
}
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 16/04/14 06:43 PM

Do I need to change any of that?
Posted By: sparta

Re: Adding,removing and Editing commands then using em - 17/04/14 03:43 AM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 17/04/14 10:14 AM

I put that into a new file but still it does not write anything in commands.ini
Posted By: sparta

Re: Adding,removing and Editing commands then using em - 17/04/14 02:48 PM

You cant type it in the same client that running the script, somone else in the channel need to type.
Posted By: bl968

Re: Adding,removing and Editing commands then using em - 18/04/14 05:23 AM

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.
Posted By: sparta

Re: Adding,removing and Editing commands then using em - 18/04/14 07:44 AM

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.
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 18/04/14 09:17 AM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 20/04/14 01:14 PM

So Would I need to get someone else to add a command or have to change the code?
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 20/04/14 02:09 PM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 20/04/14 04:17 PM

Here is my script. http://pastebin.com/F30c5mM7
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 20/04/14 04:23 PM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 20/04/14 04:31 PM

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
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 20/04/14 04:33 PM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 20/04/14 04:38 PM

Ok Then Will it all work?
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 20/04/14 04:44 PM

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.
Posted By: AllDayGrinding

Re: Adding,removing and Editing commands then using em - 20/04/14 05:17 PM

Ok Cheers for your Help! Do you have a chat bot?
Posted By: judge2020

Re: Adding,removing and Editing commands then using em - 20/04/14 10:15 PM

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.
Posted By: judge2020

Re: Adding,removing and Editing commands then using em - 24/04/14 01:51 PM

What would the edit command be?
Posted By: Nillen

Re: Adding,removing and Editing commands then using em - 24/04/14 01:55 PM

There is no edit.
If you create a command that already exists you will overwrite the old one, that's how you edit.
© 2022 mIRC Discussion Forums