ニコスクリプト専用スレ


告知欄


■ニコスクリプト専用スレ

現在表示しているスレッドのdatの大きさは58KBです。

115 名前: no name :2008/03/16(日) 17:46:56 ID:pisu4NF/

ランダム置換について色々試行錯誤中。
ttp://www.nicovideo.jp/watch/sm2595140

一番最初(すんごい重かった)
---------------
 0::/random=0
 ###置換対象が4つあるため、以下の行を対象と結果を変えて4回記述
  0::/rep1=replace(src:'置換対象1',dest:'1置換結果1',fill:true,color:0x00ffff,size:'small');
  commentTrigger(random=(rand(chat.message)+chat.vpos*1000+random)%5;
  if(when:random==1,then:rep8.dest='1置換結果2');
  if(when:random==2,then:rep8.dest='1置換結果3');
  if(when:random==3,then:rep8.dest='1置換結果4');
  if(when:random==4,then:rep8.dest='1置換結果5'),timer:200)
---------------

現状(多少軽くなった?)
---------------
 0::/random=0;ex1=['結果1','結果2','結果3','結果4'];ex2=['結果1','結果2','結果3','結果4'];ex3=['結果1','結果2','結果3','結果4'];ex4=['結果1','結果2','結果3','結果4']
  0::/rep1=replace(src:'‡',dest:'‡',fill:true,color:0x00ffff);
  rep2=replace(src:'‰',dest:'‰',fill:true,color:0xffff00);
  rep3=replace(src:'o',dest:'o',fill:true,color:0xff0000);
  rep4=replace(src:'§',dest:'§',fill:true,color:0x00cc00,size:'small')
 ###置換結果を配列化し、コメントトリガー内のif文を削除
  0::/commentTrigger(random=(rand(chat.message)+chat.vpos*1000+random)%6;
  rep1.dest=ex1[random];rep2.dest=ex2[random];rep3.dest=ex3[random];rep4.dest=ex4[random]),timer:200)
---------------

コメントトリガー使ってランダム置換するのって、高負荷になるのは避けられないんですかねぇ。。

名前
メール
コメント
新着レスの表示 掲示板に戻る 全部 前100 次100 最新50