mob/verb
Test_When()
when(Test == 0,10)
world << "It works!"
Change_Test()
Test = !Test
world << "Test: [Test]"
proc
when(var/Condition,var/Sleep)
while(!Condition)
world << "Sleeping. Condition: [Condition], Sleep: [Sleep]."
sleep(Sleep)
Problem description:
The problem, if you can tell, is that Condition is never updated. Once the when() proc gets it's initial Condition, the value never changes. For example:
var/Test = 5
when(Test > 11)
Once received, the while() statement will continually check to see if 5 > 11. Regardless of whether or not it's value increases, the while() statement will never receive the updated value. I'm wondering if there's a way to get passed this problem so that the while() statement can update it's check.
Is going to be evaluated in the argument. Depending on whether or not Test actually does equal zero, it will evaluate to 1 or 0. In order to do something like this, you'll have to pass it as a string and use something like SET or SET_mod.