mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2014
Posts: 42
K
Kooky Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Oct 2014
Posts: 42
I don't know if this possible or where to really start..

But what I'd like to do, is to have a script (not for twitch!) that assigns 1pt per typed character of a post to a $nick. So if I have someone posting a large amount, they'll get points for their posts. The more active someone is, the more points they get.

Is this possible? And can someone point me in the right direction? Thank you!

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
try seeing the following in the help file:
/help $len (returns the length of the parameter $len(test) returns 4
/help on text
you might need to see /help /while too but not nessecarily
the points can be stored in .ini files
if you choose .ini storage /help /writeini
/help $readini
Or you could store them simply in variables. You can make different variables for each network and/or channel with the use of dynamic variables.
for dynamic variables try /help [ ]
I think these are what you gonna need. If anyone has to suggest more helpfull staff it would be great!!

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Much like OrFeAsGr suggested, I recommend using ini files for their simplicity.
Here's a little pseudocode you can try to follow

When someone types anything
Check length of what they wrote
Add length to their section in ini file


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
I would recommend using hash tables for simplicity and performance. The main problem with your idea is the encouragement for abuse. People spamming random jibberish at 500 characters per line.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Oct 2014
Posts: 42
K
Kooky Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Oct 2014
Posts: 42
Thanks for the suggestions! Is there a way to have it be based off of per post, as opposed to character length or amount of a post? I'm thinking that may help simplify it.

Joined: Apr 2015
Posts: 3
K
Self-satisified door
Offline
Self-satisified door
K
Joined: Apr 2015
Posts: 3
Code:
ON *:TEXT:*:#: {
  var %newpoints $calc($readini(Points.ini,$nick,Points) + 1)
  writeini -n Points.ini $nick Points %newpoints
}


This should do for adding the points on every post into chat.

Last edited by Keydosed; 05/04/15 08:59 PM.

Link Copied to Clipboard