概述
因为女友喜欢做些奇奇怪怪的东西,问我有没有刷视频的脚本及自动领金币脚本。按照她的需求做了一个,最后勉勉强强能用吧,实现不易所以就不开源了。
实现效果
APP
后台
账号登录
// 登录
function login () {
try {
const data = {"account": accountLoginData.username ,"password": md5(accountLoginData.password)}
http.__okhttp__.setTimeout(30000)
const result = http.post("http://8.134.130.51:8080/sys/account_script/login",data);
const html = result.body.string();
const obj = JSON.parse(html);
if (obj.code === 0) {
// 存储token
const cloud_token = storages.create('cloud_token');
cloud_token.put('cloudToken', obj.data.token);
// 根据token存储账号
const cloud_account = storages.create('cloud_account');
cloud_account.put(obj.data.token+'_account', data["account"]);
// 根据token存储密码
const cloud_password = storages.create('cloud_password');
cloud_password.put(obj.data.token+'_password', accountLoginData.password);
queren()
} else {
toast("账号密码错误");
}
} catch(e) {
toastLog("登录数据异常:"+e)
}
}
卡密登录
function carmiLogin () {
const carmi = ui.carmiKey.text();
if (carmi) {
try {
const data = {"key": carmi}
http.__okhttp__.setTimeout(30000)
const result = http.post("http://8.134.130.51:8080/sys/account_script/secret_key_login",data);
const html = result.body.string();
const obj = JSON.parse(html);
if (obj.code === 0 && obj.data === true) {
const cloud_carmi = storages.create('cloud_carmi');
cloud_carmi.put('cloudCarmi', carmi);
queren()
}
} catch (e) {
toastLog("卡密登录异常:"+e)
}
}
}
试用脚本
const storage = storages.create('cloud_state')
const cloudState = storage.get('cloudState')
if (cloudState === 0) {
var tipMessage = "试用期已到,请联系工作人员获取永久卡密";
confirm(tipMessage)
// ui.finish();
return
}
if(!cloudState) {
threadMain = threads.start(function () {
main()
});
trialTimedShutdown()
}
// 定时关闭线程
function trialTimedShutdown () {
timedShutdownThread = threads.start(function() {
setInterval(function() {
threadMain.interrupt();
makeStroke.interrupt();
advertisement.interrupt();
timedShutdownThread.interrupt();
threadMain = null;
makeStroke=null;
advertisement=null;
timedShutdownThread=null;
// 没有卡密和token用户,免费使用15分钟,然后关闭,0是试用,1是无法试用
const storage = storages.create('cloud_state')
storage.put("cloudState", 0)
var tipMessage = "试用期已到,请联系工作人员获取永久卡密";
confirm(tipMessage)
}, 60000 * 15);
})
}