代码拉取完成,页面将自动刷新
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()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。