This repository was archived by the owner on Mar 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsell_eqs.py
More file actions
39 lines (34 loc) · 1.46 KB
/
sell_eqs.py
File metadata and controls
39 lines (34 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import asyncio
import __init__ # For IDLE
from Basic.wear_unwear import wear_unwear
from login import get_content
async def sell_eqs(server, ids, price, hours):
"""Sell specific EQ ID(s) & reshuffle & upgrade at auctions."""
URL = f"https://{server}.e-sim.org/"
results = []
ids = [x.strip() for x in ids.split(",") if x.strip()]
for Index, ID in enumerate(ids):
ID = ID.replace(URL + "showEquipment.html?id=", "").strip()
if ID == "reshuffle":
item = "SPECIAL_ITEM 20"
elif ID == "upgrade":
item = "SPECIAL_ITEM 19"
else:
item = f"EQUIPMENT {ID}"
payload = {'action': "CREATE_AUCTION", 'price': price, "id": item, "length": hours, "submit": "Create auction"}
url = await get_content(URL + "auctionAction.html", data=payload, login_first=not Index)
if "CREATE_AUCTION_ITEM_EQUIPED" in url:
await wear_unwear(server, ID, "-")
url = await get_content(URL + "auctionAction.html", data=payload)
results.append(f"ID {ID} - {url}\n")
print("".join(results))
if __name__ == "__main__":
print(sell_eqs.__doc__)
server = input("Server: ")
ids = input("EQs ids (separated by a comma): ")
price = input("Starting price: ")
hours = input("Hours: ")
loop = asyncio.get_event_loop()
loop.run_until_complete(
sell_eqs(server, ids, price, hours))
input("Press any key to continue")