mIRC Home    About    Download    Register    News    Help

Print Thread
using commands in a on TEXT? #245020 08/04/14 11:37 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I have been trying to use commands that you would be usually type in chat (like /timers off) But i can't seem to get it working, it just does nothing.

This is probably the wrong way to do it:
Code:
on *:text:!gain on:#: {
  if ($nick == theyoungergamer ) {
    ex /enable #Group
    msg # gaining of points is enabled
  }
}

any help would be appreciated smile


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: using commands in a on TEXT? [Re: judge2020] #245021 08/04/14 11:41 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
i was playing around, EX shouldn't be there (thought it was execute)


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: using commands in a on TEXT? [Re: judge2020] #245048 09/04/14 07:36 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I figure it out, but it just says it in the chat, not executing the command
Code:
on *:text:!gain on:#: {
  if ($nick == theyoungergamer ) {
    msg # gaining of points is enabled
    msg # /enable #Group
    msg # /timers off
    msg # /server irc.twitch.tv:6667
  }
}
on *:text:!gain off:#: {
  if ($nick == theyoungergamer ) {
    msg # /disable #Group
    msg # gaining of points is disabled
    msg # /timers off
  }
}


All i get is the message in the chat.
Any help?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: using commands in a on TEXT? [Re: judge2020] #245051 09/04/14 09:26 PM
Joined: Jan 2004
Posts: 1,287
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,287
Because you're messaging the room. What do you think msg # is supposed to do?

I seriously doubt you want to reconnect to the server when someone says !gain on, or stop all timers with either command.

Re: using commands in a on TEXT? [Re: Loki12583] #245055 10/04/14 02:03 AM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
the only way i can get the timers for people already in the room going is by reconnecting.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: using commands in a on TEXT? [Re: judge2020] #245056 10/04/14 02:15 AM
Joined: Jan 2004
Posts: 1,287
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,287
No it's not

Re: using commands in a on TEXT? [Re: Loki12583] #245057 10/04/14 03:15 AM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
ok, then. How would i turn on and off my my join script while also stopping all timers?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: using commands in a on TEXT? [Re: judge2020] #245058 10/04/14 03:17 AM
Joined: Jan 2004
Posts: 1,287
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,287
Do whatever you do on connect or join separately, or loop through all nicks in the channel. It would help if you provided the code you're talking about.

Re: using commands in a on TEXT? [Re: Loki12583] #245065 10/04/14 12:13 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Code:
#Group On
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 2)
}
#Group End

I am trying to make a different command !gain on/off so after the livestream is over people don't earn points for AFKing.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: using commands in a on TEXT? [Re: judge2020] #245077 10/04/14 03:18 PM
Joined: Jan 2004
Posts: 1,287
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,287
Groups are not suitable if you only want to disable the events for certain channels, use a global variable instead.

Code:
raw 353:*:{
  var %chan = $3
  if (%points. [ $+ [ %chan ] ]) {
    tokenize 32 $4-
    startpoints %chan $*
  }
}

on !*:join:#:{
  if (%points. [ $+ [ # ] ]) startpoints # $nick
}

on *:part:#:{
  if ($nick == $me) { $+(.timerpoints.,#,.*) off }
  else { $+(.timerpoints.,#,.,$nick) off }
}

alias -l startpoints {
  var %chan = $1, %nick = $2
  if (%nick == $me) return

  $+(.timerpoints.,%chan,.,%nick) 0 600 add.pts $+(%chan,.,%nick)
  add.pts $+(%chan,.,%nick)
}

alias add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 2)
}

on *:text:!gain on:#: {
  if ($nick == theyoungergamer) {
    msg # gaining of points is enabled
    set -e %points. [ $+ [ # ] ] 1

    var %i = 1, %n = $nick(#,0)
    while (%i <= %n) {
      startpoints # $nick(#,%i)
      inc %i
    }
  }
}

on *:text:!gain off:#: {
  if ($nick == theyoungergamer) {
    msg # gaining of points is disabled
    unset %points. [ $+ [ # ] ]
    $+(.timerpoints.,#,.*) off
  }
}