改行も扱いたくていくつか方法を試したのですが、改行自体はできるけれど
文章が終わるところで終了してくれず、ループしてしまうといった状況です。
問題の箇所は95行目あたりからです。
ソースが長くてすみません。よろしくお願いします。
//---バイト数チェックモジュール #module #deffunc biteload str chk s = chk notesel s max = noteinfo(1) return #deffunc chkbite int chk_place//調べる文字,インディエット if chk_place >= max{//範囲外の場所ははじく chk_s = "" s_length = 0 return } getstr chk_s,s,chk_place,,1//文字を取得 s_length = strlen(chk_s)//バイト数を取得 ; if s_length = 0:return -1 ; if s_length = 1:return 1 ; if s_length = 2:return 2 return #defcfunc biteinfo int info_prm if info_prm = 0{//バイト数 if s_length = 0:return -1 if s_length = 1:return 1 if s_length = 2:return 2 } if info_prm = 1 : return chk_s//調べた文字 if info_prm = 2{//文章全体の長さ infobreak num = 0//調べる場所 str_num = 0//文字数 repeat chkbite num bite = biteinfo(0) if bite = -1:break num += bite str_num ++ loop infoback return str_num } if info_prm = 3{ return chk_place//現在の初めからのバイト数 } return -1 #deffunc infobreak//パラメータを一時保持します。 rp0 = s_length rp1 = chk_s rp2 = chk_place return #deffunc infoback//パラメータを戻します。 s_length = rp0 chk_s = rp1 chk_place = rp2 return #defcfunc chklen num = 0//調べる場所 str_num = 0//文字数 repeat chkbite num bite = biteinfo(0) if bite = -1:break num += bite str_num ++ loop return str_num #global //-----------モジュール終了 /*notesel a noteload "test.txt" */ a = "HELLO!\nHELLO\nこんにちは!\nコンニチハ\nコンニチハ\n12345\n12345\n" biteload a place = 0 pos_x = 0 pos_y = 0 enter = "" wait 100 poke enter,1,0xBD//改行の文字コード? repeat chkbite place if biteinfo(1) = enter{ place += 2 pos_x = 0 pos_y += y_max y_max = 0 await 500 continue } pos pos_x,pos_y mes biteinfo(1) pos_x += ginfo(14) if ginfo(15) > y_max:y_max = ginfo(15) if pos_x >= 400{ pos_x = 0 pos_y += y_max y_max = 0 } if biteinfo(0) = -1 : break place += biteinfo(0) await 40 loop