I'll open this back up to anyone else who wants to write the script. Fortunately for twitch scripts, nicknames are persistent and can't be changed.
As far as $readini() and /writeini go, they are very simple.
/writeini -n file.ini section item value
/echo -a $readini(file.ini,n,section,item)
In your script, you might take an approach like:
var %file = twitch_warns.ini
; $calc() is used in case of $null return, it becomes the number '0'. Required for if < 3.
var %warns = $calc($readini(%file,n,$nick,warns))
if (%warns < 3) {
inc %warns 1
writeini -n %file $nick warns %warns
writeini -n %file $nick warning $+ %warns $fulldate
msg $chan $nick $+ : This is your $ord(%warns) warning! Don't let it happen again!
}
else {
timeout $nick Too many warnings.
}
You can list the warning dates with something like...
var %nick = $$2
var %file = twitch_warns.ini
var %warns = $calc($readini(%file,n,%nick,warns))
var %i = 1
while (%i <= %warns) {
var %warning = $readini(%file,n,$nick,warning $+ %i)
msg $chan %nick $+ 's warning %i happened on %warning
inc %i
}
Last edited by Raccoon; 27/01/15 03:05 AM.