HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2023
0305
Akinput 特定の文字を入力したとき2解決


Ak

リンク

2023/3/5(Sun) 19:34:36|NO.99160

input命令で特定の文字を入力してボタンを押すと特定の動作をするようにするにはどうしたらいいですか。ver3.51だと思います。



この記事に返信する


Ak

リンク

2023/3/5(Sun) 19:35:58|NO.99161

title "ごま塩Game"
mmload "hajimetenootsukai.mp3"
mmplay 0
exec "https://note.com/ak_nikushio2940/n/n8d1a570d46e1", 16
pos 150,260
objsize 100,100
button goto "Readme",*readme
pos 350,260
objsize 100,100
button goto "Fonts",*fonts
pos 220,0
picload "GomashioGame.jpg" ,1

pos 170,200
font "けいふぉんと" ,50
color 255
mes "ごま塩Game"

pos 250,260
objmode 2
font "けいふぉんと", 25, 1
objsize 100,100
font "けいふぉんと"
button goto "start!",*start
stop

*readme
exec "使用する前に必ずお読みください.txt",16
stop

*fonts
exec "keifont.ttf",16
stop
pos 220,0
picload "GomashioGame.jpg" ,1

pos 170,200
font "けいふぉんと" ,50
color 255
mes "ごま塩Game"

pos 250,260
objmode 2
font "けいふぉんと", 25, 1
objsize 100,100
font "けいふぉんと"
button goto "Start!",*start
stop
*start
screen 0, 620, 480
pos 0,260
objsize 620,100
button goto "童貞クイズ",*douteikuizu
pos 0,160
objsize 620,100
button goto "ごま塩クイズ",*gomashiokuizu
stop
*douteikuizu
screen 0, 620, 480
pos 55,50
font "けいふぉんと",30
mes "この中に童貞がいます。誰でしょうか?"
; コンボボックスオブジェクトの表示位置
pos 0,100

; コンボボックスオブジェクトのサイズ (横幅のみ)
; (無指定の場合の横幅サイズは64
objsize 620

; コンボボックス選択肢
combox a, 100, "Ak\nごま塩\nぷぷ\n灰猫\nさとかりにゃんこ\nポメリ二アン\n24歳アイス「僕はやっぱり王道のバニラアイスですかね、、」\n僕の書いた絵\nベリーメロン"
button goto "OK" ,*kotaes

stop

;正解と不正解
*gomashiokuizu
screen 0, 620, 480
stop
*kotaes
if a=0:goto *Akd
if a=1:goto *Gomashiod
if a=2:goto *pupud
if a=3:goto *hainekod
if a=4:goto *satokarid
if a=5:goto *pomed
if a=6:goto *aisud
if a=7:goto *bokud
if a=8:goto *berid
stop

*Akd
goto *fuseikaid
stop

*gomashiod
goto *fuseikaid
stop

*pupud
goto *fuseikaid
stop

*hainekod
dialog "正解!",0
goto *nimond
stop

*satokarid
goto *fuseikaid
stop

*pomed
goto *fuseikaid
stop

*aisud
goto *fuseikaid
stop

*bokud
goto *fuseikaid
stop

*berid
goto *fuseikaid
stop


*fuseikaid
dialog "不正解!",0
goto *douteikuizu

;第二問

*nimond
screen 0, 620, 480

pos 55,50
font "けいふぉんと",30
mes "灰猫の名言は?"



Ak

リンク

2023/3/6(Mon) 10:24:42|NO.99162

解決しました。
instr
でできるんですね、ありがとうございました。
font "けいふぉんと",30
mes "灰猫の名言は?"
text = ""//初期化
objsize 620,
input text//InputBox作成
button "OK",*ok//ボタン作成
stop
*ok
if instr(text,0,"yes")!-1{ //yesが見つかったら…
dialog "正解!"
goto *sanmond
}
if instr(text,0,"")!-1{ // が見つかったら…
dialog "不正解!"
goto *nimond
}

*sanmond



ONION software Copyright 1997-2023(c) All rights reserved.