ID:140775
 
Code:
mob
proc
hunger()
for()
Hunger -= 1
if(Max_Hunger < Hunger)
Hunger = Max_Hunger
if( Hunger < 25 )
src << "You are feeling hungry!"
if(Hunger < 10)
src << "You're starting to starve"
if(Hunger < 0 )
src <<"You're starving!"
if(Hunger < -25)
src <<"You die of strvation!"
sleep(10)


Problem description:
Well, the problems is that after the first if message "You are feeling hungry!" starts repeating itseelf along with the other two messages until the mob die.

verb
Claws()
src << "you slash your own hand!"
hp -=2
if(src.worn)
src.worn = 0
usr.overlays -= 'boneC.dmi'
src << "You stop using your claws!"
else
src.worn = 1
usr.overlays += 'boneC.dmi'
energy -=2
src << "You use your claws!"
if(energy<0)
src << "you're too tired!"
return

Problem description:
And with this one i can't seem to make the mob stop the action after it reaches 0 energy ut just keep going down and reapeating the message.

Some help or at least a hint of what is missing or wrong would be apreciated. thanks
I'm not exactly sure how you want these to work...
mob
proc
hunger()
for()
Hunger -= 1
if(Max_Hunger < Hunger)
Hunger = Max_Hunger
if( Hunger < 25 )
if(Hunger<-25)
src << "You die of starvation!"
else if(Hunger<0)
src << "You're starving!"
else if(Hunger<10)
src << "You're starting to starve"
else
src << "You are feeling hungry!"
sleep(100)

verb
Claws()
src << "you slash your own hand!"
hp -=2
if(src.worn)
src.worn = 0
usr.overlays -= 'boneC.dmi'
src << "You stop using your claws!"
else
if(energy<0)
src << "you're too tired!"
return
src.worn = 1
usr.overlays += 'boneC.dmi'
energy -=2
src << "You use your claws!"
In response to Chowder
I forgot to explain that, my badd, sorry
For the first one i intended for the message appear when you reached certain level of hunger wich they do but they start appearing and keep doing so until the mob dies, and all i wanted was for them to appear one or twice tops between if statements.
i Dont know if i made myself clear enough, i apologize if i didnt.
In response to Enshi
mob
proc
hunger()
for()
Hunger -= 1
if(Max_Hunger < Hunger)
Hunger = Max_Hunger
switch(Hunger)
if(25)
src << "You are feeling hungry!"
if(10)
src << "You're starting to starve"
if(0)
src << "You're starving!"
if(-25)
src << "You die of starvation!"
sleep(100)

verb
Claws()
src << "you slash your own hand!"
hp -=2
if(src.worn)
src.worn = 0
usr.overlays -= 'boneC.dmi'
src << "You stop using your claws!"
else
if(energy<0)
src << "you're too tired!"
return
src.worn = 1
usr.overlays += 'boneC.dmi'
energy -=2
src << "You use your claws!"
In response to Chowder
switch() is not what you want here. Instead, you just should have an if() - else if() chain, but going the other way: you start at the minimum value and work your way up.

if(< -25)
//A
else if(< 0)
//B
else if(< 25)
//C
else
//D


You could also instead specify ranges, with statements such as:

if(X < 25 && X >= 0)


but, that requires more typing, and is more difficult to modify.

As for the second question, I'm thoroughly unclear on what is wanted.
In response to Garthor
Yeah except that they don't want it going off every loop...

For the first one i intended for the message appear when you reached certain level of hunger wich they do but they start appearing and keep doing so until the mob dies, and all i wanted was for them to appear one or twice tops between if statements.

Translation

"I want the message to appear when hunger reaches certain values but instead it keeps appearing until it dies. I only wanted it to appear once between if statements."

Yes, I can understand how you thought of your method as the original code is very deceptive that's why I requested further clarification in my first post if it was not what they wanted. My first post also has the exact method you posted.