mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
I recently added code that Nellin helped me with previously and now my points are not counting up at all. Here is what I have, the code that he gave me is supposed to stop the points from counting when the streamer leaves and start counting again when the streamer returns or another streamer leaves or returns. Also is it possible to have a join and part command only in one channel and then if another channel wants to use it, they can use it also? Here is my current code.

on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
if ($mid(#,2-) ison #) writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}
alias -l addPoints {
if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
var %topic $+($chan,.,$nick)
var %points $calc($readini(Points.ini,%topic,Points) + $1)
writeini -n Points.ini %topic Points %points
return %points
}
alias -l lookUpPoints {
var %topic $+($chan,.,$nick)
var %points $readini(Points.ini,%topic,Points)
return %points
}
alias doaddpoints {
if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
var %topic $+($1,.,$2)
var %points $calc($readini(Points.ini,%topic,Points) + $3)
writeini -n Points.ini %topic Points %points
echo -a Added points for %topic
}
alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic Points
echo -a Removed points for %topic
}
on *:text:!points:#:{
if ($readini(Points.ini,$+(#,.,$nick),Points) > 0) {
msg # $Nick you have $readini(Points.ini,$+(#,.,$nick),Points) points!
}
else { msg # Sorry you do not have any points }
}
on $*:text:/!points (add|remove)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
{ msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
}
else { msg $chan This command is only available to moderators. }
}

on $*:text:/!points /Si:#:{
if ($nick isop #) {
if ($2 == on) {
msg # points system is now on
.timerpoints on }
elseif ($2 == off) {
.timerpoints off }
msg # points system is now off
else {
msg # Something went wrong, points was not turned off!
}
}






alias autoJoin {
if (%nmJoin isop %chJoin) {

describe %chJoin -> [MOD] %nmJoin welcome to the stream!
}
else {
describe %chJoin -> %nmJoin welcome to the stream!
}
}

on *:join:#:{
if (%awFlag == 1) {
%chJoin = $chan
%nmJoin = $nick
/timerJoin 1 1 /autoJoin
}
}

on *:part:#:{
if (%awFlag == 1) {
if ($nick isop $chan) {
describe $chan -> [MOD] $nick thanks for stopping bye! smile
}
else {
describe $chan -> $nick thanks for stopping bye! smile
}
}
}

on *:text:!start auto message:#:{
%awFlag = 1
describe $chan Auto join / leave message started.
}

on *:text:!stop auto message:#:{
%awFlag = 0
describe $chan Auto join / leave message stopped.



Last edited by powerade661; 28/01/15 03:18 AM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Why not post in the other thread? ^_^

Also, your code is very hard to read when you don't use [code][/code]

You probably did something wrong. Maybe try and add this line instead


if ($mid(#,2-) !ison #) return

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
My apologies, posting in my other thread didn't cross my mind. Where do I add that into the code?

Code:

on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts { 
if ($mid(#,2-) ison #) writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}
alias -l addPoints {
if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
var %topic $+($chan,.,$nick)
var %points $calc($readini(Points.ini,%topic,Points) + $1)
writeini -n Points.ini %topic Points %points
return %points
}
alias -l lookUpPoints {
var %topic $+($chan,.,$nick)
var %points $readini(Points.ini,%topic,Points)
return %points
}
alias doaddpoints {
if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
var %topic $+($1,.,$2)
var %points $calc($readini(Points.ini,%topic,Points) + $3)
writeini -n Points.ini %topic Points %points
echo -a Added points for %topic
}
alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic Points
echo -a Removed points for %topic
}
on *:text:!points:#:{
if ($readini(Points.ini,$+(#,.,$nick),Points) > 0) {
msg # $Nick you have $readini(Points.ini,$+(#,.,$nick),Points) points!
}
else { msg # Sorry you do not have any points }
}
on $*:text:/!points (add|remove)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
{ msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
}
else { msg $chan This command is only available to moderators. }
}

on $*:text:/!points /Si:#:{
if ($nick isop #) {
if ($2 == on) {
msg # points system is now on
.timerpoints on }
elseif ($2 == off) {
.timerpoints off }
msg # points system is now off
else {
msg # Something went wrong, points was not turned off!
}
}





Code:

alias autoJoin {
if (%nmJoin isop %chJoin) {

describe %chJoin -> [MOD] %nmJoin welcome to the stream!
}
else {
describe %chJoin -> %nmJoin welcome to the stream!
}
}

on *:join:#:{
if (%awFlag == 1) {
%chJoin = $chan
%nmJoin = $nick
/timerJoin 1 1 /autoJoin
}
}

on *:part:#:{
if (%awFlag == 1) {
if ($nick isop $chan) {
describe $chan -> [MOD] $nick thanks for stopping bye! smile
}
else {
describe $chan -> $nick thanks for stopping bye! smile
}
}
}

on *:text:!start auto message:#:{
%awFlag = 1
describe $chan Auto join / leave message started.
}

on *:text:!stop auto message:#:{
%awFlag = 0
describe $chan Auto join / leave message stopped.








Last edited by powerade661; 28/01/15 04:05 AM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Just put it as the first line under any of the aliases you want to stop working when your Twitch account isn't on the channel.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
I am confused. So I replace this
Code:
 if ($mid(#,2-) ison #) writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1) 
with this? Also how would I use the !start auto message but only activate it in a specific channel as shown above?

Code:
  if ($mid(#,2-) !ison #) return 


So if I wanted it to stop counting when a streamer parts the channel I would put it below here?

Code:
 on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts { 
  if ($mid(#,2-) ison #) writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  if ($mid(#,2-) !ison #) return   
or am I completely off?

Last edited by powerade661; 28/01/15 04:55 AM.
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Ok I got that working, is it possible to specify which channel I want it to stop on so for instance
Code:
if ($mid(#,2-) !ison #channel name here) return 

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
At that point you'd need to use

if (YourTwitchAcc !ison #ChannelName) return

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Ok and last but least (I feel like I am talking your ear off) what about if a specific streamer joins is it possible to make the points count again on that channel or any other channel? In other words if I wanted the points to stop if <streamer> leaves and start again when he joins how would I do this? I think we may have have a misunderstanding, I want it to stop when a specific streamer leaves and start again when they join. Sorry for the confusion.

Last edited by powerade661; 28/01/15 06:20 AM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
I might be misunderstanding, but it would seem that

if ($mid(#,2-) !ison #) return

already does what you're asking for smile

Last edited by Sakana; 28/01/15 07:44 AM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You can attempt to debug by using
//echo -a $mid(#,2-)
In channel #nillens this would return nillens.

So in essence, it's saying "IF (nillens ISN'T on #nillens) do nothing"

Originally Posted By: powerade661
I recently added code that Nellin
I lol'd laugh


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Ok thanks guys, I am not really sure if it is working properly but I placed it here.
Code:
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts { 
  if ($mid(#,2-) !ison #) return
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)


Or would I need to be more specific such as this and place this under alias -l add.pts? I think I understand what you are saying guys. I have coded in VB, but this stuff is a whole different animal to me, sorry for being so confused. I have been looking at the help in MIRC and it has kind of explained a lot of these things so far. I am just confused as to where the placement of this goes.

Code:
 if streamer1 ($mid(#,2-) !ison #streamer1) return
    



So basically it is detecting whether the streamer is leaving the channel or not to count up the points, right? Not if I leave the channel it doesn't count points, right? I understand the command ison means that it is saying if <twitch channel is on this channel then do <whatever> I am guessing that you have operators set to say if it is not in the channel? I am kind of confused as to how this actually works.

Last edited by powerade661; 28/01/15 02:18 PM.

Link Copied to Clipboard