_ do I have to use a timer instead of the /hadd -mu1 ? (I didn't find any option that would enable me to have a time set in milliseconds)

Although it's possible to have a millisecond timer using the -m switch (/help /timer), I'd avoid them and stick with -u in vars/hash tables. You definitely don't have to use them.


_is this the best way to detect flood after all ?

Although it's not bad, it's probably not the best way. Personally, I think the best way is aircdll.dll (you can find it at the DLL section of www.mircscripts.org), which does all the work of calculating/determining flood. It's faster and more accurate.


_why does /hinc stop the internal hash timer started by /hadd -mu1 ?

No idea, but I don't like it either. If it's not a bug, it's an unnecessary feature which I hope is removed.


_are there any mistakes in my little script (is it good to set the parameters into local variables for example ?)

Your script looks correct and the idea behind it is logical too. A couple of suggestions though:
  • I'd perhaps avoid $readini() and instead store/retrieve these two values from a hash table (the same one you use now or a second one).
  • I'd use $cid instead of $server (I assume $$1 is $server right?). $cid is unique, $server is not. For example, you might have clones connected to the same server and joined the same channel. In this case, the flood values would be doubled because each clone would /hinc the same value. Rather extreme case, but still possible.
  • I'd avoid "_" as the delimeter between $$2 and $$3, because it could create conflicts. For example:

    channel: #blah
    nick: _bleh
    %y: #blah_bleh

    channel: #blah_
    nick: bleh
    %y: #blah_bleh

    to avoid this, use a character that at least cannot be the first letter of a nickname (I use ":", the colon, for such purposes)


If you want to get more ideas, there's an interesting flood protection tutorial here, check it out.