proc
meditate()
if(usr.meditate==0)
usr.powerlevel += 0
usr.stamina -= 0
usr.maxki+= 0
if(usr.meditate == 1)
usr.stamina -= rand(4,7)
usr.random = rand(1,4)
if(usr.random ==4)
usr.will += 1
usr.maxpowerlevel += rand(25,250)
usr.maxki += rand(1,5)
if(usr.random == 3)
usr.powerlevel += rand(50,500)
if(usr.random == 2)
usr << "<b><font size = 2>You feel more honor enter your blood."
usr.maxki += rand(2,8)
if(usr.random == 1)
usr << "<b><font size = 2>You get more will to fight."
usr.will += 2
if(usr.stamina <= 5)
usr << "<FONT COLOR=White><b>You feel to tired.."
usr.meditating =0
// usr.FlightLearn()
// usr.AuraMake()
sleep(50)
usr.meditate()
Problem description:
I just coded this a few minutes ago and the program is not working.Am i using the random() wrongly? because when i meditate nothing happens.
First: Don't call a proc inside itself. That is bad. It doesn't allow the first proc to finish and ends up infinitely calling the same proc over and over, and as far as the program is concerned all of those procs never finish (until the player stops meditating, then they all will finish), which will ultimately cause a crash if they do it long enough.
Second: I added debugging messages so you can see where your proc is going wrong. Solving a problem like this can be easily handled in steps.
1: At the beginning, add a message saying "Proc started" or whatever. Something so you know that your proc is in fact being called.
2: At each point where the code branches (any if()'s, other proc calls, etc) add another message saying "Proc is at stage X", letting yourself know it reached that point.
Continue doing the above until you find out where your proc is stopping, and then you can try to figure out what is causing it to stop there.