mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 215
J
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
Joined: Mar 2014
Posts: 215
J
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
Joined: Mar 2014
Posts: 215
J
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
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Mar 2014
Posts: 215
J
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
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
No it's not

Joined: Mar 2014
Posts: 215
J
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
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Mar 2014
Posts: 215
J
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
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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
  }
}


Link Copied to Clipboard