Advertisement
basictomonokai

マスコットカレンダー プログラム ソース

Dec 17th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. REM Start of BASIC! Program
  2.  
  3. console.title "マスコットカレンダ起動中..."
  4.  
  5.  
  6. grabfile afl$,"msc.txt",1
  7.  
  8.  
  9. array.delete fk1$[]
  10. split fk1$[],afl$,"\n"
  11. array.length lfk1,fk1$[]
  12.  
  13.  
  14.  
  15.  
  16. socket.myip ip$
  17. if ip$="" then
  18. popup "ネットワーク未接続なので終了します。",0,0,1
  19. pause 4000
  20. exit
  21. else
  22. popup "ネットワーク接続済",0,0,1
  23. pause 4000
  24. endif
  25.  
  26.  
  27. graburl arss$,"http://rss.rssad.jp/rss/mainichi/flash.rss"
  28.  
  29.  
  30.  
  31. array.delete wk1$[]
  32. split wk1$[],arss$,"\n"
  33. array.length lwk1,wk1$[]
  34.  
  35.  
  36. j=1
  37.  
  38. p1$=""
  39. p2$=""
  40. p3$=""
  41. p4$=""
  42. p5$=""
  43. p6$=""
  44. p7$=""
  45. p8$=""
  46. p9$=""
  47. p10$=""
  48.  
  49. for i=1 to lwk1
  50.  
  51. if is_in("<title>",wk1$[i])<>0 then
  52. out$=replace$(wk1$[i],"<title>","")
  53. out$=replace$(out$,"</title>","")
  54. out$=mid$(out$,5)
  55. if j=1 then
  56. p1$="☆☆毎日新聞速報☆☆"
  57. endif
  58. if j=2 then
  59. p2$=out$
  60. endif
  61. if j=3 then
  62. p3$=out$
  63. endif
  64. if j=4 then
  65. p4$=out$
  66. endif
  67. if j=5 then
  68. p5$=out$
  69. endif
  70. if j=6 then
  71. p6$=out$
  72. endif
  73. if j=7 then
  74. p7$=out$
  75. endif
  76. if j=8 then
  77. p8$=out$
  78. endif
  79. if j=9 then
  80. p9$=out$
  81. endif
  82. if j=10 then
  83. p10$=out$
  84. endif
  85. j=j+1
  86. endif
  87.  
  88.  
  89. next i
  90.  
  91. array.delete wk1$[]
  92.  
  93. print p1$
  94. print p2$
  95. print p3$
  96. print p4$
  97. print p5$
  98. print p6$
  99. print p7$
  100. print p8$
  101. print p9$
  102. print p10$
  103.  
  104. console.title "画面編集中..."
  105.  
  106. grabfile outhtml$,"cal810.htm",1
  107.  
  108. nxtcal:
  109.  
  110.  
  111. outhtml$=replace$(outhtml$,"@@@1@@@",p1$)
  112. outhtml$=replace$(outhtml$,"@@@2@@@",p2$)
  113. outhtml$=replace$(outhtml$,"@@@3@@@",p3$)
  114. outhtml$=replace$(outhtml$,"@@@4@@@",p4$)
  115. outhtml$=replace$(outhtml$,"@@@5@@@",p5$)
  116. outhtml$=replace$(outhtml$,"@@@6@@@",p6$)
  117. outhtml$=replace$(outhtml$,"@@@7@@@",p7$)
  118. outhtml$=replace$(outhtml$,"@@@8@@@",p8$)
  119. outhtml$=replace$(outhtml$,"@@@9@@@",p9$)
  120. outhtml$=replace$(outhtml$,"@@@10@@@",p10$)
  121.  
  122. isz=420-int(rnd()*20)
  123. sisz$=replace$(str$(isz),".0","")
  124.  
  125. outhtml$=replace$(outhtml$,"@@@sisz@@@",sisz$)
  126.  
  127. inm=int(rnd()*lfk1)+1
  128. if inm>lfk1 then
  129. inm=lfk1
  130. endif
  131.  
  132.  
  133. outhtml$=replace$(outhtml$,"@@@11@@@",fk1$[inm])
  134.  
  135.  
  136.  
  137. console.title "マスコットカレンダ表示"
  138.  
  139. cls
  140.  
  141. print "カレンダー表示開始"
  142.  
  143. nxttest:
  144.  
  145. HTML.OPEN
  146.  
  147. HTML.LOAD.string outhtml$
  148.  
  149. xnextUserAction:
  150.  
  151. ! loop until data$ is not ""
  152.  
  153. DO
  154. HTML.GET.DATALINK data$
  155. UNTIL data$ <> ""
  156.  
  157. type$ = LEFT$(data$, 4)
  158.  
  159. data$ = MID$(data$,5)
  160.  
  161. ! Act on the data type
  162. ! Shown are all the current data types
  163.  
  164. SW.BEGIN type$
  165.  
  166. ! Back Key hit.
  167. ! if we can go back then do it
  168. SW.CASE "BAK:"
  169. PRINT "BACK key: " + data$
  170. popup "終了します",0,0,0
  171. pause 2000
  172. exit
  173. SW.BREAK
  174.  
  175. ! A hyperlink was clicked on
  176. SW.CASE "LNK:"
  177. PRINT "Hyperlink selected: "+ data$
  178. popup "終了します",0,0,0
  179. pause 2000
  180. exit
  181.  
  182.  
  183. SW.BREAK
  184.  
  185. ! An error occured
  186. SW.CASE "ERR:"
  187. PRINT "Error: " + data$
  188. popup "エラーが発生しました 終了します",0,0,0
  189. pause 2000
  190. exit
  191. SW.BREAK
  192.  
  193. ! User data returned
  194. SW.CASE "DAT:"
  195. PRINT "User data: " + data$
  196.  
  197. ! Check for Exit
  198. IF data$ = "Exit"
  199. PRINT "User ended demo."
  200. HTML.CLOSE
  201. popup "終了します",0,0,0
  202. pause 5000
  203. end
  204. else
  205. msx$=data$+"←データの内容"
  206. popup msx$,0,0,0
  207. html.close
  208.  
  209. if data$="//f//" then
  210. popup "画像ファイルを登録",0,0,0
  211. grabfile afl$,"msc.txt",1
  212.  
  213. text.input kka$,afl$,"画像のURLを1行づつ登録"
  214.  
  215. Text.open w, file_num2, "msc.txt"
  216. msg$="【登録内容】\n"+kka$
  217. popup msg$,0,0,1
  218. pause 4000
  219. text.writeln file_num2,kka$
  220. text.close file_num2
  221.  
  222. pause 1000
  223.  
  224. grabfile afl$,"msc.txt",1
  225. array.delete fk1$[]
  226. split fk1$[],afl$,"\n"
  227. array.length lfk1,fk1$[]
  228. goto nxtcal
  229. endif
  230.  
  231.  
  232. if data$="//w//" then
  233. popup "前月のカレンダを表示",0,0,0
  234. grabfile outhtml$,"cal800.htm",1
  235. goto nxtcal
  236. endif
  237.  
  238. if data$="//y//" then
  239. popup "今月のカレンダを表示",0,0,0
  240. grabfile outhtml$,"cal810.htm",1
  241. goto nxtcal
  242. endif
  243.  
  244. if data$="//z//" then
  245. popup "翌月のカレンダを表示",0,0,0
  246. grabfile outhtml$,"cal820.htm",1
  247. goto nxtcal
  248. endif
  249.  
  250. pause 4000
  251. popup "終了します",0,0,0
  252. exit
  253. ENDIF
  254. SW.BREAK
  255.  
  256. ! Form data returned.
  257. ! Note: Form data returning
  258. ! always exits the html.
  259.  
  260. SW.CASE "FOR:"
  261. PRINT "Form data: "+data$
  262. popup "終了します",0,0,0
  263. pause 2000
  264. exit
  265. SW.BREAK
  266.  
  267.  
  268.  
  269. SW.DEFAULT
  270. PRINT "Unexpected data type:", type$ + data$
  271. popup "終了します",0,0,0
  272. pause 2000
  273. exit
  274.  
  275. SW.END
  276.  
  277. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement