# HG changeset patch # User ARAKI Tsuyohito # Date 1445652478 -32400 # Node ID 5f56d9a6abedafdb2e15d765256e5d229e6e1084 # Parent ff96f149289b336df090579cb823c8e63f66ac97 preopen diff -r ff96f149289b -r 5f56d9a6abed opencampus2015/accountcheck.rb --- a/opencampus2015/accountcheck.rb Sat Oct 24 08:32:26 2015 +0900 +++ b/opencampus2015/accountcheck.rb Sat Oct 24 11:07:58 2015 +0900 @@ -103,7 +103,7 @@ -expires = "SAT, 24 Oct 2015 00:00:00 GMT" +expires = "SUN, 25 Oct 2015 00:00:00 GMT" printf("Content-type: text/html; charset=UTF-8 Set-Cookie:id=%s ;expires=%s diff -r ff96f149289b -r 5f56d9a6abed opencampus2015/cookie.rb --- a/opencampus2015/cookie.rb Sat Oct 24 08:32:26 2015 +0900 +++ b/opencampus2015/cookie.rb Sat Oct 24 11:07:58 2015 +0900 @@ -28,8 +28,10 @@ Registering Account -

さかたっち

-

cookieを削除しました!

-とうろくがめんへ! +

Miyazac Quest

+

記憶は消えた...

+ +
_EOS_ diff -r ff96f149289b -r 5f56d9a6abed opencampus2015/prof.rb --- a/opencampus2015/prof.rb Sat Oct 24 08:32:26 2015 +0900 +++ b/opencampus2015/prof.rb Sat Oct 24 11:07:58 2015 +0900 @@ -33,7 +33,7 @@ aria = cook[0][5] exp = cook[0][6] pt = cook[0][7] -lv = cook[0][8] +#lv = cook[0][8] rescue printf(<<_EOS_) = lv5 lv = 5 +gage = 0 elsif e1 >= lv4 lv = 4 +gage = 100-(e1-lv4)/(lv5-lv4.to_f)*100 elsif e1 >= lv3 lv = 3 +gage = 100-(e1-lv3)/(lv4-lv3.to_f)*100 elsif e1 >= lv2 lv = 2 -end -################################################## +gage = 100-(e1-lv2)/(lv3-lv2.to_f)*100 +end######################################### - m1 = "馬小屋" - mimg1 = "./img/food.png" - m2 = "客室" - mimg2 = "./img/niku.png" image = "./img/#{cal}#{lv}.png" alt = "#{cal}.png" @@ -248,15 +251,29 @@ #exppoint = "select e1 from box where id = ?" #じぶんのidのboxにある一体目の経験値 #expp = db.execute(exppoint,id) #exp = expp[0][0].to_i -gage = 0 +#gage = 0 #gage2 = db.execute("select no1 from box where id = ?",id) #exp2 = exp #esa = "


" - - - - +wcname ="select name from zukan where no = ?" +cal1 = db.execute(wcname,no1)[0][0] +begin +cal2 = db.execute(wcname,no2.to_s)[0][0] +rescue +cal2 = db.execute(wcname,no2.to_s)[0] +end +begin +cal3 = db.execute(wcname,no3.to_s)[0][0] +rescue +cal3 = db.execute(wcname,no3.to_s)[0] +end +chengeform = '

coin:%d$

- - + - +
+ +
_EOS_ -print "#{expp}" diff -r ff96f149289b -r 5f56d9a6abed opencampus2015/profeel.css --- a/opencampus2015/profeel.css Sat Oct 24 08:32:26 2015 +0900 +++ b/opencampus2015/profeel.css Sat Oct 24 11:07:58 2015 +0900 @@ -68,3 +68,8 @@ background: #eef; border: solid 2px navy;} +div.calque {margin-left:auto; margin-right:auto; +width: 180px; height: 180px; +background: #eef; +border: solid 2px navy;} + diff -r ff96f149289b -r 5f56d9a6abed opencampus2015/quest.rb --- a/opencampus2015/quest.rb Sat Oct 24 08:32:26 2015 +0900 +++ b/opencampus2015/quest.rb Sat Oct 24 11:07:58 2015 +0900 @@ -7,11 +7,73 @@ c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8") db = SQLite3::Database.new("sql/main.sq3") +id = c.cookies["id"][0].to_i +chenge = c["chenge"].to_i +box = db.execute("select * from box where id = ?",id) +no1 = box[0][1] +e1 = box[0][2] +t1 = box[0][3] +tm1 = box[0][4] +no2 = box[0][5] +e2 = box[0][6] +t2 = box[0][7] +tm2 = box[0][8] +no3 = box[0][9] +e3 = box[0][10] +t3 = box[0][11] +tm3 = box[0][12] +newname = "select name from zukan where no = ?" +if chenge == 2 + db.execute("update box set no1=?,e1=?,t1=?,tm1=?,no2=?,e2=?,t2=?,tm2=? where id = ?",no2,e2,t2,tm2,no1,e1,t1,tm1,id) +elsif chenge == 3 + db.execute("update box set no1=?,e1=?,t1=?,tm1=?,no3=?,e3=?,t3=?,tm3=? where id = ?",no3,e3,t3,tm3,no1,e1,t1,tm1,id) +end +calname = db.execute(newname,no1)[0][0] +db.execute("update test set cal = ? where id = ?",calname,id) -id = c.cookies["id"][0].to_i -cmps = c["cmps"] + + cmps = c["cmps"] x = 0 +per ="%" newone = "" + +data = "select * from test where id = ?" +cook = db.execute(data, id) +begin +cal = cook[0][2] +rescue +printf(<<_EOS_) + + + + + + + +Miyazac Quest + + + + +
+

記録が無くなったようだ...

記憶も消してやりなおしたまえ......

+
新規記憶の作成
+
作成前に記憶を消す
+
skip@xxxx.co.jp
+ + + + +_EOS_ +exit(0) ##プログラム終了! これがないと以降のプログラムが動いてしまう。 +end ################################## #card = "select " 設定してる予定のi1,i2,i3を選びたい。どこから? メインテーブル? それようのテーブル? exppoint = "select e1 from box where id = ?" #じぶんのidのboxにある一体目の経験値 @@ -81,7 +143,55 @@ ' end -printf(<<_EOS_,cmps,xs,newone,cmpsget) + +lv = 1 +gage = 0 +e1 = db.execute("select e1 from box where id = ?",id)[0][0]#じぶんのidのboxにある一体目の経験値 +no1 = db.execute("select no1 from box where id = ?",id)[0][0] +lv2 = db.execute("select lv2 from zukan where no = ?",no1)[0][0].to_i +lv3 = db.execute("select lv3 from zukan where no = ?",no1)[0][0].to_i +lv4 = db.execute("select lv4 from zukan where no = ?",no1)[0][0].to_i +lv5 = db.execute("select lv5 from zukan where no = ?",no1)[0][0].to_i +if e1 < lv2 +lv = 1 +gage = 100-(e1/lv2.to_f*100) +elsif e1 >= lv5 +lv = 5 +gage = 0 +elsif e1 >= lv4 +lv = 4 +gage = 100-(e1-lv4)/(lv5-lv4.to_f)*100 +elsif e1 >= lv3 +lv = 3 +gage = 100-(e1-lv3)/(lv4-lv3.to_f)*100 +elsif e1 >= lv2 +lv = 2 +gage = 100-(e1-lv2)/(lv3-lv2.to_f)*100 +end + + +################################################## +if lv == 1 + color = "black" +elsif lv == 2 + color = "navy" +elsif lv == 3 + color = "green" +elsif lv == 4 + color = "red" +elsif lv == 5 + color = "yellow" +else + color = "pink" + image = "./img/snail.png" + alt = "snails_bug" +end + +image = "./img/#{cal}#{lv}.png" +alt = "#{cal}.png" + + +printf(<<_EOS_,per,gage,per,per,per,color,cmps,xs,newone,image,alt,cmpsget) だぁんじょん @@ -111,6 +235,12 @@

だぁんじょん%s

%s %s

+
+
+%s +
+
+

exp