Adding an HP system Daily refresh - 27/11/16 05:29 PM
I was trying to add an HP system in my bot so that people could fight monsters, and I was wanting the refresh on it to be an hourly full refresh so if they lose all the HP they get it back. I'm not sure if I'm doing this wrong but any help would be greatly appreciated
I probably missed a closing bracket or something
Code:
on $*:join:#:{ $+(.timerHp.,#,.,$nick) 3 3600 add.hp $+(#,.,$nick) add.pts $+(#,.,$nick) } on $*:part:#:$+(.timerHp.,#,.,$nick) off alias lookUpHp { var %topic $+($chan,.,$nick) var %HP $readini(HP.ini,%topic,HP) return %HP } alias -l add.hp { if ($lookUpHp == 3) { writeini -n HP.ini $1 HP $calc($readini(HP.ini,$1,HP) + 0) } elseif ($lookUpHp == 2) { writeini -n HP.ini $1 HP $calc($readini(HP.ini,$1,HP) + 1) } elseif ($lookUpHp == 1) { writeini -n HP.ini $1 HP $calc($readini(HP.ini,$1,HP) + 2) } else { writeini -n HP.ini $1 HP $calc($readini(HP.ini,$1,HP) + 3) } }
I probably missed a closing bracket or something