]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
fix bug
authorqydysky <qydysky@foxmail.com>
Sat, 14 Nov 2020 21:59:51 +0000 (05:59 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 14 Nov 2020 21:59:51 +0000 (05:59 +0800)
CV/Var.go
Reply/F.go
Reply/Reply.go

index fd79c86b9bcd1d0bad109eefd7ebda521ed9fc2d..e6aa1878262b5e31d347cdef40b278bcc0b20bd3 100644 (file)
--- a/CV/Var.go
+++ b/CV/Var.go
@@ -6,6 +6,7 @@ var (
        Roomid int
        Cookie string
        Title string
+       Rev int//营收
 )
 
 //from player-loader-2.0.11.min.js
index 5e555af907545adf2b4b4b7820055339837f921d..f5f689304124c901e7b60305f50ad3bbff9d2ab7 100644 (file)
@@ -23,6 +23,7 @@ import (
 
 //功能开关
 var AllF = map[string]bool{
+       `ShowRec`:true,//显示本次营收
        "Gtk":false,//Gtk弹幕窗口
        "Saveflv":true,//保存直播流(默认高清,有cookie默认蓝光)
        "Ass":true,//Ass弹幕生成,由于时间对应关系,仅开启流保存时生效
@@ -115,6 +116,15 @@ func selfcross2(a []string) (float32, string) {
 }
 
 //功能区
+//ShowRec 显示h营收
+func ShowRecf(){
+       if!IsOn("ShowRec") {return}
+       for {
+               p.Sys().Timeoutf(60)
+               p.Logf().New().Open("danmu.log").Base(1, "Rec").I("营收 ¥", c.Rec)
+       }
+}
+
 //Gtk 弹幕Gtk窗口
 func Gtkf(){
        if!IsOn("Gtk") {return}
index 5f25e4d23937b1bd9d0ae8827d190dc1be036d1d..6ac15bb86977409ed0988d36a053afc07c39dafe 100644 (file)
@@ -143,6 +143,7 @@ func (replyF) user_toast_msg(s string){
        }
        if price != nil {
                sh = append(sh, "¥", int(price.(float64)) / 1000)
+               c.Rev += int(price.(float64)) / 1000
        }
        {//额外 ass
                Assf(fmt.Sprintln(sh...))
@@ -190,6 +191,7 @@ func (replyF) special_gift(s string){
        }
        if content != nil {
                sh = append(sh, "节奏风暴", content, "¥ 100")
+               c.Rev += 100
        }
        {//额外
                Assf(fmt.Sprintln(sh...))
@@ -309,6 +311,7 @@ func (replyF) send_gift(s string){
        if total_coin != nil {
                allprice = int64(total_coin.(float64) / 1000)
                sh = append(sh, "¥", allprice)
+               c.Rev += int(allprice)
        }
 
        if len(sh) == 0 {return}
@@ -413,6 +416,7 @@ func (replyF) super_chat_message(s string){
        }
        if price != nil {
                sh = append(sh, "¥", price, "\n")
+               c.Rev += int(price.(float64))
        }
        fmt.Println("====")
        fmt.Println(sh...)