mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 3 1 2 3
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

Page 2 of 3 1 2 3

Link Copied to Clipboard