You are very correct, my mistake. I definitely meant to make those to read the value from the ini file. However, this was not the error that the user presented.
After i delete messages.ini the script made it again and write
[user]
ID=1
1=1399753742
After this , on the next msg from the user he give me again invalid format: $calc
And the script don't write in the messages.ini
So there are 2 entirely different matters at hand right now.
Updated code that should use the ini file for value:
on *:text:*:#: {
var %ID $iif($readini(messages.ini,$nick,ID),$v1,$null)
inc %ID
writeini messages.ini $nick ID %ID
writeini messages.ini $nick %ID $ctime
remini messages.ini $nick $calc(%ID - 4)
remini messages.ini $nick $calc(%ID - 4) $+ .Difference
var %difference $calc($readini(messages.ini,$nick,%ID) - $readini(messages.ini,$nick,$calc(%ID - 1)))
writeini messages.ini $nick %ID $+ .Difference %difference
if (%difference == $readini(messages.ini,$nick,$calc(%ID - 1) $+ .Difference)) && (%difference >= 30) echo 4 -a Match found by $nick $+ . The difference are both exactly $v1 $+ !
}
Edit: Tested successfully.
I don't know how to make it +-5 seconds however, if this is a requirement someone else will have to step in.
Edit2: Forgot to remove #nillens