加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
temp.py 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
李文龙 提交于 2024-11-01 10:36 . add items.json
import argparse
import time
from libs import config
from libs.action import WebDriverAction
from libs.game import Game
from libs.image import ImageTool
from libs.log import Log
from libs.movement import Movement
from libs.trade_helper import TradeHelper
from libs.window import AdsWindow
if __name__ == "__main__":
accounts = config.get_accounts()
for user_id in accounts:
if int(user_id) < 16:
continue
log = Log(user_id)
driver = AdsWindow(user_id).open(False)
game = Game(driver, user_id)
action = WebDriverAction(driver)
movement = Movement(driver)
image_tool = ImageTool(driver)
trade_helper = TradeHelper(driver, user_id)
game.enter_game()
# 需要买的东西
items_to_buy = {
"Copperite Bar": 1,
"Copperite Ore": 3,
"Silk Fiber": 6,
"Silk Rope": 1,
"Silk Slug Slime": 4,
"Popberry Wine": 1,
"Popberry": 24,
"Cooking Mix": 10,
"Honey": 3,
"Whittlewood Log": 3,
"Whittlewood Plank": 1,
"Grainbow": 2,
"Grainbow Flour": 1,
"Clayum Matrix": 2,
"Clayum Powder": 1
}
# buy
trade_helper.goto_buy_position()
game.get_backpack()
filter_input = trade_helper.open_market_buy()
for item_name in items_to_buy:
qty = items_to_buy.get(item_name)
has_qty = game.get_backpack_qty(item_name)
if qty > has_qty:
trade_helper.market_buy_item(filter_input, item_name, qty - has_qty)
action.escape()
action.escape()
action.escape()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化