mob
verb
Train(mob/M)
if(usr.canttrain==1)
usr<<"You drop to your knees"
else
usr.Exp+=2
usr.Stam-=1
usr.Stam()
usr.Level_Up()
ID:178167
Jun 12 2002, 3:05 pm
|
|
How would i loop the following so it continues till the stamina is gone
|
In response to Garthor
|
|
Whenever i click train it freezes it
|
In response to SuperSaiyansElite
|
|
oops, while(usr.stam)
|
In response to Garthor
|
|
I dont understand it still freezes...And when i take it out it doesnt freeze
|
In response to SuperSaiyansElite
|
|
Silly me, you should put a sleep(10) at the end. Your stamina is so high, it's overloading the computer with procs running over and over and over.
|
In response to Garthor
|
|
How would i make it stop once its at lowest stamina
heres my stamina proc. mob |
In response to SuperSaiyansElite
|
|
Why do you even need that proc? Why not just use if(usr.Stam<=2) instead of the canttrain stuff? Anyway, take out that if statement, and just use the while(usr.Stam) etc.
|
In response to Garthor
|
|
What?
|
In response to SuperSaiyansElite
|
|
Hmmm.Wish i could help but im pretty nebish at coding.Never had to loop anything either
|
In response to SuperSaiyansElite
|
|
I would revise it and rewrite it so that you don't need the loop.
Or use a spawn(1) at the end of each running so that the computer will ignore you and do other things until the spawn is done. |
In response to ShadowWolf
|
|
All I'm gonna say is I'm goin for the MM training system
|
Train(mob/M)
while(Stam)
if(usr.canttrain==1)
usr<<"You drop to your knees"
else
usr.Exp+=2
usr.Stam-=1
usr.Stam()
usr.Level_Up()