【WAX Chain Game】Release a free and open source Alien Worlds contract script TLM

foreword

"The chain game Farmers World [Farmers World] exploded, releasing a free and open source script"

In the previous article, we shared an open source Farmers World script
[OpenFarmer]: https://github.com/encoderlee/OpenFarmer

After continuous learning during this period, we have developed a script for Alien Worlds
[OpenAlien]: https://github.com/encoderlee/OpenAlien

insert image description here

Technical Update

The implementation principles of the two are similar, but compared with the previous [OpenFarmer] [OpenAlien] this time, the open source [OpenFarmer] has two update points:

1. Completely let the wax cloud wallet account run without the Chrome browser, and use the method of extracting Token to directly send HTTP request signature

2. The underlying EOSIO SDK is changed from the original
[eospy]: https://github.com/eosnewyork/eospy
to our own developed
[eosapi]: https://github.com/encoderlee/eosapi

Supports serialization of transactions and optimizes error handling. In the past, when there was an error in sending a transaction, there was no clear distinction between error types. Now [OpenAlien] can handle different types of errors and give prompts, especially the handling of node errors, to avoid frequent repetitions. Try to cause the IP and account to be blocked by the node.

usage

Method one:

Download the latest packaged version from [Releases] on the right side of the github page. The packaged version only supports Win10 or higher operating systems.

Unzip the files in the compressed package, first modify the configuration file [user.yml], and then double-click to run [user.bat]

Open a second account, copy [user.yml] to [user2.yml], copy [user.bat] to [user2.bat]

Modify the configuration file [user2.yml] to the information of the second account, modify the [user2.bat] file, change the string "user.yml" to "user2.yml", and then double-click to run [user2.bat]

Open more accounts, and so on

Method 2:

1. Run from the source code, install the Python environment first, it is recommended to install the Python 3.9.13 version, because this is the version we have tested

Download link: https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe

Remember to check "Add Python 3.9 to PATH" when installing

2. Download the source code, click the green button [Code], [Download ZIP] on the github project page, and unzip it after downloading

3. Double-click to run [install_dependencies.bat] to install the dependency package. This step only needs to be done once per computer

4. Modify the configuration file [user.yml] first, then double-click to run [user.bat]

5. The multi-opening method is the same as above, that is, copy these two files and run them after modification

Configuration file description

#注意,每个参数名的冒号后面,都有一个空格,修改参数不要丢了空格

# wax节点地址,使用公共节点,有时候会网络不通,或者访问太频繁被限制,出现429错误,可以换节点,或者搭建私有节点
# 公共节点列表:https://wax.eosio.online/endpoints

rpc_domain: https://wax.pink.gg

# cpu代付号,cpu_key填写该代付号私钥,不需要代付则留空
# 注意,由于外星世界官方于2022年10月更新了智能合约,阻止代付行为,所以代付功能失效
cpu_account:
cpu_key:

# 即使可挖时间到了,也延迟20-60秒再挖
delay1: 20
delay2: 60

# http代理(比如127.0.0.1:10808)
# 给脚本设置HTTP代理,这样可以在一定程度上解决公共节点限制访问的问题,不需要则留空
proxy:
proxy_username:
proxy_password:

# 下面三项改为你的账号信息
# account是wax云钱包账号名
# token是什么,先在chrome浏览器中手工登录WAX云钱包  https://wallet.wax.io/dashboard
# 然后在chrome浏览器中输入地址导航到: https://all-access.wax.io/api/session
# 把token复制出来填到下面
# charge_time是采集间隔,单位秒,登录alienworlds官网,打开工具页面,就可以看到,按实际情况填写

account: gts3c.c.wam
token: EHuyFHPcLpSNUJ4BLSUnPxxxxxxxxxxxx
charge_time: 336

List of public nodes: https://wax.eosio.online/endpoints

Note that after copying the token from the Chrome browser, you can click the cross in the upper right corner to close the browser, but do not click to log out to log in to the account, and do not log in to another account directly, otherwise the previous account will be disconnected.

If you need to log in to a second account in Chrome, use Chrome's multi-user feature to log in

Chrome multi-user related article: https://www.chensnotes.com/chrome-profile.html

Common tool

【nodepad++】https://notepad-plus-plus.org/downloads/v8.4.2

Text editor, editing and modifying [user.yml] configuration files is more enjoyable

【cmder】https://cmder.net

Replace the cmd command line tool that comes with windows to prevent the script from dying

The cmd command line tool that comes with the system, the quick edit mode is enabled by default, sometimes due to accidental mouse and keyboard operations,

The log will stay in one place, in a state of suspended animation, causing the script to fail to run continuously. Use [cmder] to solve this problem

common mistakes

1. Transaction errors

There are many reasons for transaction errors, such as smart contract errors, insufficient CPU, incorrect secret keys, WAX node restrictions, etc.

If there are 5 consecutive transaction errors, the script will stop. At this time, you need to manually check the problem or replace the node

Why not keep retrying over and over again? Because of repeatedly submitting wrong transactions, the public node will block you, and it will take 24 hours before you can use the node

Setting up WAX private nodes by yourself will improve this problem to a certain extent

2. Node error

Node errors, especially 429 errors, are mainly because you have too many accounts running under one IP at the same time, frequent requests, and are blocked by the node

After all, the public node is a free service for the world. In order to prevent abuse, many restrictions have been made

Setting up a proxy IP for every N number, or setting up a WAX private node by yourself, will improve this problem to a certain extent

Welcome to reward

Wax wallet address:

m45yy.wam

update record

v1.1 (November 8, 2022)

  1. Optimize the logger, allowing the log output of each account to a different file
  2. Remove the eosapi source files from the code and download the library directly from pip
  3. Increase the CPU resources available to the account to judge, if the CPU is insufficient, it will not try to submit the transaction rashly, reducing the probability of being blocked by the node due to frequent submission of wrong transactions
  4. Note, since the Alien World officially updated the smart contract in October 2022 to prevent payment on behalf, the function of payment on behalf is invalid

おすすめ

転載: blog.csdn.net/CharlesSimonyi/article/details/128088603