mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2016
Posts: 4
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Nov 2016
Posts: 4
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

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

Joined: Nov 2016
Posts: 4
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Nov 2016
Posts: 4
I found the issue I was using the add.pts replace not my add.hp


Link Copied to Clipboard