Exemplo n.º 1
0
        public int Random(int min, int max)
        {
            var capture = new RandomAsync {
                engine = ScriptEngine, reqId = RandomRequest.GenerateId()
            };

            RandomRequest.Completed += capture.Continuation;
            using (CreateMute())
                Program.Client.Rpc.RandomReq(capture.reqId, min, max);
            Suspend();
            return(capture.result);
        }
Exemplo n.º 2
0
        public int Random(int min, int max)
        {
            var capture = new RandomAsync {
                engine = _engine, reqId = RandomRequest.GenerateId()
            };

            RandomRequest.Completed += capture.Continuation;
            using (new Mute(_engine.CurrentJob.muted))
                Program.Client.Rpc.RandomReq(capture.reqId, min, max);
            _engine.Suspend();
            return(capture.result);
        }