我正在尝试为自动投注(bustabit.com)编写脚本
他们在github上有一个关于这个的手册
我想阅读 engine.history 中的“胸围”对象来编写 if 语句
但我不知道 javascript 对象是如何工作的(我没有太多编程经验)
我试过这个,但它不工作
if (engine.history(game.bust)=1.37){log("bust is 1.37")};
有人可以帮忙吗?
我正在尝试为自动投注(bustabit.com)编写脚本
他们在github上有一个关于这个的手册
我想阅读 engine.history 中的“胸围”对象来编写 if 语句
但我不知道 javascript 对象是如何工作的(我没有太多编程经验)
我试过这个,但它不工作
if (engine.history(game.bust)=1.37){log("bust is 1.37")};
有人可以帮忙吗?
等号用于赋值。
您应该使用==进行平等检查阅读此
if (engine.history(game.bust)==1.37){log("bust is 1.37")};
然后
history(game.bust) 意味着历史是一个函数,它接受一个参数,它是游戏对象内的属性 bust 的值
阅读你分享的历史有一个方法,它将历史转换为一个数组。
engine.history.toArray()
之后,您可以使用数组方法来查找您要查找的历史记录项,例如
const engineHistory = engine.history.toArray()
const element = engineHistory.find(historyItem => historyItem.bust == 1.37)