These six values are numbered from 0 to 5: VALUE0, VALUE1, VALUE2, VALUE3, VALUE4, and VALUE5. Therefore, the value you can use for charged items is VALUE5. There is an if-check associated to it: if objval5($o) == 3 (to check the value) and commands used to set it: mposet $o value5 1 or mpoadd $o value5 1.
Two things to remember here: if the item is on the mob who executes the program (this mob is generally the supermob, as he executes all object progs), you can use mposet $o value5 1. But, if the item is in someone else's inventory (let's say in $n's inventory), you have to use mposet on $n $o value5 1 (or mpoadd on $n $o value5 1).
Here is an example for a 'ring of fly' that can be used once per month (its vnum is iVNUM).
Code: Select all
>intercept_prog ringcommandword~
if wear_loc($o) != -1
if objval5($o) == 0
cast 'fly' $n
mposet on $n iVNUM value5 1
mpechoat $n You rise in the air.
mpechoaround $n $N rises in the air.
else
mpechoat $n Nothing happens.
mpechoat $n Perhaps the ring needs to be recharged?
endif
else
mpechoat $n You should wear the ring first.
endif
~
>time_prog 10~
if day() == 20
if objval5($o) != 0
mpechoat $n Your ring glows briefly as it is recharged.
mposet on $n iVNUM value5 0
endif
endif
~
Code: Select all
>exa_prog 100~
if objval5($o) == 0
mpechoat $n The ring glows faintly.
else
mpechoat $n The ring does not glow.
endif
~