MCPcopy Create free account
hub / github.com/chavyleung/scripts / showmsg

Function showmsg

mcdd/mcdd.js:150–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148}
149
150function showmsg() {
151 let subTitle, detail
152 if (signinfo.signapp.code == 0) {
153 if (signinfo.is_today_sign === false) subTitle = '签到: 成功'
154 else subTitle = '签到: 重复'
155 detail = `积分: ${signinfo.info.data.point_num} (+${signinfo.signapp.data.point}), 价值: ${signinfo.info.data.point_money}`
156 } else {
157 subTitle = '签到: 失败'
158 detail = `编码: ${signinfo.signapp.code}, 说明: ${signinfo.signapp.message}`
159 chavy.log(`❌ ${cookieName} showmsg - 签到失败: ${JSON.stringify(signinfo.signapp)}`)
160 }
161
162 if (signinfo.lotteryinfo.code == 0) {
163 if (signinfo.draw_num == 0) subTitle += '; 抽奖: 已转'
164 else subTitle += `; 抽奖: ${signinfo.draw_num}次`
165 } else {
166 subTitle = '抽奖: 失败'
167 detail = `编码: ${signinfo.lotteryinfo.code}, 说明: ${signinfo.lotteryinfo.message}`
168 chavy.log(`❌ ${cookieName} showmsg - 抽奖失败: ${JSON.stringify(signinfo.lotteryinfo)}`)
169 }
170
171 if (signinfo.browseapp.code == 0) {
172 subTitle += '; 浏览任务: 成功'
173 } else if (signinfo.browseapp.code == -1) {
174 subTitle += '; 浏览任务: 重复'
175 } else {
176 subTitle = '浏览任务: 失败'
177 detail = `编码: ${signinfo.browseapp.code}, 说明: ${signinfo.browseapp.msg}`
178 chavy.log(`❌ ${cookieName} showmsg - 浏览任务失败: ${JSON.stringify(signinfo.browseapp)}`)
179 }
180
181 if (signinfo.lottery) {
182 detail += '\n查看抽奖详情\n'
183 for (let i = 0; i < signinfo.lottery.length; i++) {
184 if (signinfo.lottery[i].code == 0) detail += `\n抽奖 (${i + 1}): ${signinfo.lottery[i].data.prize.title}`
185 else detail += `\n抽奖 (${i + 1}): ${signinfo.lottery[i].msg}`
186 }
187 }
188
189 chavy.msg(cookieName, subTitle, detail)
190}
191
192function init() {
193 isSurge = () => {

Callers 1

mcdd.jsFile · 0.70

Calls 2

logMethod · 0.45
msgMethod · 0.45

Tested by

no test coverage detected