ID:139515
 
Code:
mob/var
wavel = 0 //Soul Wavelength
resonating = 0 //They aren't resonating
soul = 100 // Amount of Soul (like Magic, Mana, CHakra, Different strokes for different folks


mob
verb
Soul_Resonance()
if(!usr.resonating)
return
if(usr.wavel == 100)
usr<< "Your Resonance Rate can't go any higher"
return
usr.resonating = 1
usr.soul -= 100


Problem description:
Alright, I want this to take away 100 soul (obviously) and then make their soul decrease by 1, and wavel to increase by 1. I want it to do this until they reach 100 or until they hit the button again. How can I do this?

You have to use a loop, search in the DM Ref for: for(), while()

Ex: one method for recovery would be: WHILE person HP < max, increase HP. (maybe use min() to make sure the max value HP is MAXHP if: min(HP+X,MAXHP))
In response to GhostAnime
Alright, I checked out while and figured it out, here is my code:
mob/var
wavel = 0 //Soul Wavelength
resonating = 0 //They aren't resonating
soul = 1000 // Amount of Soul (like Magic, Mana, CHakra, Different strokes for different folks
msoul = 1000
sowavel


mob
verb
Soul_Resonance()
if(usr.resonating)
usr.resonating = 0
usr<< "You stop raising your Resonance Rate"
if(usr.wavel == 100)
usr<< "Your Resonance Rate can't go any higher"
return
usr.resonating = 1
usr<< "You being to resonate with your Weapon"
usr.soul -= 100
while(usr.resonating)
if(usr.wavel <= 100)
usr.sowavel = rand(1,5)
usr.soul -= usr.sowavel
usr.wavel += usr.sowavel
if(usr.soul >= usr.msoul)
usr.soul = usr.msoul
if(usr.wavel >= 100)
usr.wavel = 100
usr<< "You cannot resonate any higher"
usr.resonating = 0


Ok, so everything works like it is supposed to, but I realized that this follows all my instructions, and does it all almost instantaneously, how can i slow it down so it raises slowed and the user can stop of they want to before it reaches 100?
In response to HaffCaff
Put a sleep() in the while
In response to Masschaos100
Does it matter where?
In response to HaffCaff
As long as its not an any of those if statements it should be fine :)
In response to Masschaos100
Alright, thanks alot! It works :D