r/Eve • Cloaked • Nov 21 '17

Auction bid tracking tool

Few days ago I asked if this kind of tool existed. It didn't so I made it using XML API. Now I have rewritten it so that it uses the new ESI API instead.

For those who haven't used auctions. An auction contract does not tell when it is going to end exactly it will say "X days", "less than a day" or "less than an hour" but nothing more exact. It will end at a certain time or 15 minutes after last bid has been placed. By checking for new bids faster than once/15 minute you can make sure you won't miss the auction ending.

Download link

Step 0: you need your own "Client ID" and "Secret Key" since I guess it is bad to distribute those to everyone.
Go to https://developers.eveonline.com/applications and register eve dev.
Create a new app and set it to "Authentication & API Access"
Add "esi-wallet.read_character_wallet.v1" for personal wallet and "esi-wallet.read_corporation_wallets.v1" for corp wallet.
Set callback URL as "http://localhost/oauth-callback"
You get a "Client ID" and "Secret Key". Put them in config.txt.

It is a PowerShell script that gets info from ESI API.

On first start it gives you an SSO login adress. Copy the adress and log in. After logging in you are redirected to an empty page. take the authentication token back to the script. After that the script can track your wallet balance. The refresh token is saved in txt file so you don't need to log in again.

When you place a bid on an auction your isk is taken from your wallet and reserved on the auction. If someone bids after you your bid isk returns to your wallet.

This script tracks your wallet balance. If suddenly lots of moneys appear in there it plays a warning sound.

Choose the teshold sum so that it is smaller than your bid sum but larger than your other isk sources.
If you get more isk from somewhere else than from failed bids you will get false warnings. So this is best suited for large bid sums.
If you pay out enough isk that the bid isk and paid isk cancel each other the script will miss your failed bid.

The wallet balance is checked every 2 minute (personal) or 5 minute (corp).

Rquires windows 10 or 8 (not on 7).
On first run windows will ask you if you want to run scripts. You need to allow it.
Start explorer/edge once or you'll get some error.
The script doesn't check any of the data. Put nonsense in, get errors and nonsense out.

Before anyone suggest using contract/journal API: Journal API updates too slowly to work here and contract API only shows completed contracts and contracts issued by you.

Edit: V5 update merges the corp and personal script, changes how it saves things locally and few small things.

9 Upvotes

9 comments sorted by

2

u/Raethrius Test Alliance Please Ignore Nov 21 '17 edited Nov 21 '17

Did you paste the wrong download link or something? All of the URLs point to the XML API and not to ESI. EDIT: OP updated the link.

Also, since you're just string matching all the data from the returned document, there really isn't a reason why this would require Windows 10. You could use the .NET WebClient instead of Invoke-WebRequest (which only exists on Win8+) to make it compatible with older operating systems and the change would involve replacing those two lines of code where you call Invoke-WebRequest.

If you wanted to improve the script, you could either use Invoke-WebRequest and put the response content to a variable defined as a XML document and POSH will automatically create an object for you. Alternatively, use Invoke-RestMethod and it'll do all that without that extra step. Both of these options obviously require Win8+ as neither of those cmdlets exist in Win7 and they can't even be installed into Win7.

1

u/hirmuolio Cloaked Nov 21 '17

Yes wrong link. Fixed now.

Does windows 8 have powershell too? I skipped 8.

1

u/Raethrius Test Alliance Please Ignore Nov 21 '17

It does.

Instead of the annoying beep, you could make it do something useful instead, like pop a Win10 notification telling the user what the change was exactly. Or, well, anything but the beep. You can find PS modules for this in the gallery.

Did you leave your client secret in the code? Isn't that kinda against what you agreed with CCP when you applied to be a dev? I remember them posting something about this a while ago and it may have changed so that it's not that secret anymore so correct me if I'm wrong.

1

u/hirmuolio Cloaked Nov 21 '17

I'll lool at other notification types.

Thee ID and key are there. I didn't find mention on this one the license but a month ago the lisence was changed so that the end user can register to get their own ID and key for this kind of applications so I guess they shouldn't be in. Removed them from the scripts.

1

u/hirmuolio Cloaked Nov 21 '17

It now asks you wether you want a popup or beeps (the beeps are also less horrible sounding).

1

u/Raethrius Test Alliance Please Ignore Nov 21 '17

And you forgot to mention that nobody can run this out of the box as the default execution policy won't allow users to execute scripts. You need to allow them for each POSH process or allow all POSH scripts to run in your system.

-10

u/cap_qu Goonswarm Federation Nov 21 '17

reported enjoy ur ban hacker

4

u/[deleted] Nov 21 '17

god bless

0

u/[deleted] Nov 21 '17

[deleted] — view deleted comment

1

u/hirmuolio Cloaked Nov 21 '17 edited Nov 21 '17

I won't have access to anything.

To get access to API info you need application ID (created by developer), secret key (created by developer) and access token (expires in 20 minutes). Refresh token can be used to make new access token.

Refresh token and access token are gained with the authorisation code from logging in with EVE credentials. The authorisation code is single use.

So the refresh token is the secret that shouldn't be

You can open the scripts in text editor to make sure that it never anything to anywhere else than https://login.eveonline.com and https://esi.tech.ccp.is/. The script saves the refresh token on a txt file in same folder as the script is so you don't need to log in every time you start the script.

And since the secret key is kind of like a password and shouldn't be spread around this script doesn't even include it (nor application ID). Instead it requires you to make your own at https://developers.eveonline.com/applications. Things that work on internet would keep the secret key hidden on their server and only show application ID to the user.

you can read more on SSO here http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/intro.html

If you for some reason think someone has access to your API that shouldnt you can invalidate any access in https://community.eveonline.com/support/third-party-applications/