Dawn and I were making some slot machines and realized it was kinda hard, and you had to use VCE.
So I made this:
(named brick could also be self)
onActivate->NAMED BRICK->setRandomPrintNum [0] [1]
onActivate->NAMED BRICK->brickPrintEqualTo [1]
onPrintTestSucces->Client->CenterPrint [You won!] [3]
onPrintTestFailure->Client->CenterPrint [You lost!] [3]
It also comes with onPrintEqual 0 though 9 which could be used to create the above with:
onActivate->Self->setRandomPrintNum[0][1]
onPrintEqual0->Client->CenterPrint [You lost!] [3]
onPrintEqual1->Client->CenterPrint [You won!] [3]
(note, due to a bug in setRandomPrintNum, this above example won't work without modifying the random print num add-on)The onPrintEqual6 event is an improvment over the
onPrintCountReachSix event in that the onPrintCountReachSix won't trigger unless the number reaches six by
brick->incrementPrintCount, where as onPrintEqual6 will trigger if 6 is reached with brick->incrementPrintCount OR brick->setPrintCount
Download:
http://syerjchep.org/event_print.zipVersion 2 makes the onPrintEqual# event also trigger on a decremented print count, not just an incremented one.
It also adds the onPrintChange input event.
Version 3 has brickPrintEqual, which is like brickPrintEqualTo, except instead of a number argument, it checks if the brick doing the event has the same print number as the target brick.