Eekwa   -  Jan 08, 2015

Is there a way to count how many times something has been done i.e:

var %scount = 0
inc %scount

And increase it everytime someone joins a channel. I'd like to know how to make it so that I can count and reset how many people join each day to my channel. I don't mind it being ini either. I'm using MIRC.

Yawhatnever  -  Jan 09, 2015

All you need is inc %scount. This will automatically create a global variable that persists (if it doesn't exist) and will increment it by 1.

Eekwa  -  Jan 10, 2015

@Yawhatnever: Could you please, give me an example so for ex:

on !*:join:#:
{
var %jcount = 0
inc $jcount
msg $chan Welcome to the chat $1, you're visitor %jcount today!
}

Eekwa  -  Jan 10, 2015

@Yawhatnever: As well, a command to reset the var?

Yawhatnever  -  Jan 10, 2015

Sure.

on *:join:#:{
  inc %jcount
  msg # Visitor %jcount
}

The command to unset the variable is unset %jcount.

var %jcount = 0 creates a local variable which is unset immediately when the script finishes. To create a persistent global variable, use /set rather than /var.

Eekwa  -  Jan 10, 2015

I'm not sure how to do my code, but hold on; @Yawhatnever

on 1:connect:

 /set %jcount 0

}

on *:join:#:
{
inc %jcount
msg # Visitor %jcount
}

on *:TEXT:!resetjoin:#:
{
if($nick isop)
{
unset %scount
/set $jcount 0
}
}

Is this right?

Yawhatnever  -  Jan 10, 2015

No, there are a lot of issues with those little snippets. I'd recommend heading to http://en.wikichip.org/wiki/mirc/introduction and reading through as many of the articles as you can sit through in the basics category in the navigation pane.

Here's a little piece for resetting the count that would go with the exampe join script I posted earlier:

on *:text:!resetjoin:#:{
  if ($nick isop $chan) {
    unset %scount
  }
}
Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.