These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

EveAI Live (EVE-Online API/class library for .Net/ C#/ VB.Net)

Author
Ruthless Brian
Caldari Provisions
Caldari State
#81 - 2012-03-05 13:30:12 UTC  |  Edited by: Ruthless Brian
Thank you for the awesome .NET API, much appreciated.

I am struggling with three things and it would be great if someone could provide a small code snippet on how to tackle these problems.

1) What is the easiest way to get the level of a skill? As far as I can see I have to loop ALL learned skills until I find the skill I'm looking for. Is this correct?

2) The second issue is related to the first, how can I find a certain item in the EveAI.Core, say a ship, by searching for a name?

3) Is it possible to get the implants used for slot 6-10?
CaptainThorVonAwesome
The Star Belly Sneetches of the Apocalypse
#82 - 2012-03-05 23:25:54 UTC
Marcus Sworaven wrote:
I'm trying to extract transactions for each wallet from my corp. I'm using this for loop:
Quote:
For i As Integer = 0 To 6
CorpWalletTransactions(i) = apiCorp.GetCorporationWalletTransactions(1000 + i)
Next


CorpWalletTransactions is declared as follows:
Quote:
Public CorpWalletTransactions(6) As List(Of EveAI.Live.TransactionEntry)

CorpWalletTransactions(6) = New List(Of EveAI.Live.TransactionEntry)


When I extract the first wallet (the master wallet) it shows 0 transactions. Which is correct. Then I extract the second wallet, which shows a number of transactions, also correct. But when I extract the remaining wallets (which should be empty) I get the transactions identical to the second wallet.

I get the same result when I declare the wallets separately.

Am I missing something? Am I doing something wrong?


Marcus,

In playing around with the API I have run into the same problem, however I discovered that a declared API call can have an accountKey hard coded into the constructor. So what I did was declared one EveAPI without a accountKey to fetch a list of accounts, and then looped through the accounts using a second EveAPI object to fetch the data. Like so...:

Dim eveAPI As New EveAI.Live.EveApi(keyID, vCode, characterID, 1000)
Dim eveAccounts As List(Of EveAI.Live.AccountBalance) = eveAPI.GetCorporationAccountBalance

For i As Integer = 0 To eveAccounts.Count - 1
Dim iAccountKey As Integer = eveAccounts.Item(i).AccountKey
Dim eveAPI_Wallets As New EveAI.Live.EveApi(keyID, _
vCode, _
characterID, _
iAccountKey)

Dim eveJournal As List(Of EveAI.Live.JournalEntry) = eveAPI_Wallets.GetCorporationWalletJournal()
Dim eveTransactions As List(Of EveAI.Live.TransactionEntry) = eveAPI_Wallets.GetCorporationWalletTransactions()


iAccountKey = Nothing

eveJournal = Nothing
eveTransactions = Nothing

eveAPI_Wallets = Nothing
Next i


However the one thing that I have been able to determine is that the GetCorporationWalletJournal() function returns the default number of rows from CCP's API call, 50 rows, and there seems to be no way to itterate through the data sets to collect more rows. CCP has to options, one is FromID and the other is rowCount. RowCount by default is 50, but can go up to 2,560, since I am ever only getting 50 rows back I'd be willing to guess this value is not being passed. Also, the FromID sets the row at which the pulls starts going back in time from. So if you have 2565 rows in total, you could set it at the 2,560th row and get that plus the remaining 5 rows.

With that, I'd like to either suggest or offer up my assistance in modifying the GetCorporationWalletJournal() and GetCorporationWalletTransactions() functions to accept the "fromID" and the "rowCount" values that CCP accepts and input parameters to the API.

Hope this helps and at least makes a little sense. If you have any questions hit me up in game or shoot me a note and I'll help as I can.

Fly safe!
-Thor
Squornshellous Zeta
BioDyne
#83 - 2012-03-09 03:16:12 UTC
CaptainThorVonAwesome wrote:

However the one thing that I have been able to determine is that the GetCorporationWalletJournal() function returns the default number of rows from CCP's API call, 50 rows, and there seems to be no way to itterate through the data sets to collect more rows. CCP has to options, one is FromID and the other is rowCount. RowCount by default is 50, but can go up to 2,560, since I am ever only getting 50 rows back I'd be willing to guess this value is not being passed. Also, the FromID sets the row at which the pulls starts going back in time from. So if you have 2565 rows in total, you could set it at the 2,560th row and get that plus the remaining 5 rows.

With that, I'd like to either suggest or offer up my assistance in modifying the GetCorporationWalletJournal() and GetCorporationWalletTransactions() functions to accept the "fromID" and the "rowCount" values that CCP accepts and input parameters to the API.



Yes, please! I would very much like to see the rowCount parameter implemented in GetCorporationWalletJournal() (in addition to GetCharacterWalletJournal(), which I believe has the same limitation).

The fromID parameter would be great too, but I would have to think that the rowCount would be very easy to implement (being essentially a passthrough parameter to the API), whereas I could see the fromID requiring more work.

Jognu, thank you for continuing to maintain this library!

- SZ
Ion Tyche
Interstellar Hedgehogs
#84 - 2012-03-16 19:43:03 UTC  |  Edited by: Ion Tyche
I'm trying to populate a list with items present in market

comboBox2.Items.AddRange(api.EveApiCore.ProductTypes.ToArray());

But there are some items like "#system" or "planet (temperate)" etc. How to get real market items only?
Oeuf
Trailerpark Industries
#85 - 2012-03-19 03:48:20 UTC
Is there a site where I can get the newest version of EVEAI or is this project dead now? Link from the top thread is dead.

Regards,
Oeuf
Jognu
French Kiss Singularity
#86 - 2012-03-23 18:45:35 UTC
The links of the first thread works ;)

EveAI developper: https://forums.eveonline.com/default.aspx?g=posts&t=21803

Nuquerna Dae
Equilibrium - Enterprises
#87 - 2012-03-29 05:55:14 UTC  |  Edited by: Nuquerna Dae
CaptainThorVonAwesome wrote:
Marcus Sworaven wrote:
I'm trying to extract transactions for each wallet from my corp. I'm using this for loop:
Quote:
For i As Integer = 0 To 6
CorpWalletTransactions(i) = apiCorp.GetCorporationWalletTransactions(1000 + i)
Next


CorpWalletTransactions is declared as follows:
Quote:
Public CorpWalletTransactions(6) As List(Of EveAI.Live.TransactionEntry)

CorpWalletTransactions(6) = New List(Of EveAI.Live.TransactionEntry)


When I extract the first wallet (the master wallet) it shows 0 transactions. Which is correct. Then I extract the second wallet, which shows a number of transactions, also correct. But when I extract the remaining wallets (which should be empty) I get the transactions identical to the second wallet.

I get the same result when I declare the wallets separately.

Am I missing something? Am I doing something wrong?


Marcus,

In playing around with the API I have run into the same problem, however I discovered that a declared API call can have an accountKey hard coded into the constructor. So what I did was declared one EveAPI without a accountKey to fetch a list of accounts, and then looped through the accounts using a second EveAPI object to fetch the data. Like so...:

Dim eveAPI As New EveAI.Live.EveApi(keyID, vCode, characterID, 1000)
Dim eveAccounts As List(Of EveAI.Live.AccountBalance) = eveAPI.GetCorporationAccountBalance

For i As Integer = 0 To eveAccounts.Count - 1
Dim iAccountKey As Integer = eveAccounts.Item(i).AccountKey
Dim eveAPI_Wallets As New EveAI.Live.EveApi(keyID, _
vCode, _
characterID, _
iAccountKey)

Dim eveJournal As List(Of EveAI.Live.JournalEntry) = eveAPI_Wallets.GetCorporationWalletJournal()
Dim eveTransactions As List(Of EveAI.Live.TransactionEntry) = eveAPI_Wallets.GetCorporationWalletTransactions()


iAccountKey = Nothing

eveJournal = Nothing
eveTransactions = Nothing

eveAPI_Wallets = Nothing
Next i


However the one thing that I have been able to determine is that the GetCorporationWalletJournal() function returns the default number of rows from CCP's API call, 50 rows, and there seems to be no way to itterate through the data sets to collect more rows. CCP has to options, one is FromID and the other is rowCount. RowCount by default is 50, but can go up to 2,560, since I am ever only getting 50 rows back I'd be willing to guess this value is not being passed. Also, the FromID sets the row at which the pulls starts going back in time from. So if you have 2565 rows in total, you could set it at the 2,560th row and get that plus the remaining 5 rows.

With that, I'd like to either suggest or offer up my assistance in modifying the GetCorporationWalletJournal() and GetCorporationWalletTransactions() functions to accept the "fromID" and the "rowCount" values that CCP accepts and input parameters to the API.

Hope this helps and at least makes a little sense. If you have any questions hit me up in game or shoot me a note and I'll help as I can.

Fly safe!
-Thor


Hey Thor,

I'm kinda totally new with VB.net and the api stuff, but getting along with the basics to experiment a bit.
Your explanation and example were very helpfull so far, but i'm lacking the knowledge at this point to get the EveJournal list into a DataGridView, any tips? I get it to work when i open and read an exported .csv file, but can't figure out how to get the info from the EveJournal List that is created into a DataViewGrid. Thanks in advance.

Nuq.
CaptainThorVonAwesome
The Star Belly Sneetches of the Apocalypse
#88 - 2012-03-31 06:03:52 UTC
Nuquerna Dae wrote:


I'm kinda totally new with VB.net and the api stuff, but getting along with the basics to experiment a bit.
Your explanation and example were very helpfull so far, but i'm lacking the knowledge at this point to get the EveJournal list into a DataGridView, any tips? I get it to work when i open and read an exported .csv file, but can't figure out how to get the info from the EveJournal List that is created into a DataViewGrid. Thanks in advance.

Nuq.


Nuq,

The best thing that I can suggest is to create data table object and set it up with a column for each piece of information you want to capture. Then create a for loop to process through the journal entries. Once you have completed that process you can set the data grid's data source equal to the data table and then bind the data sources. For the sake of this example I will assume you are doing this on the individual level and not the corporate level, I have also assumed that you have created an API object and passed it the parameters required to get it to work.

Once you have that taken care of you need to setup a container to collect your data into, in this case if you are going straight to a data grid you can simply build a data table like so:

Dim eveOutput As New DataTable
eveOutput.Columns.Add("accountKey")
eveOutput.Columns.Add("Date")
eveOutput.Columns.Add("TransferType")
eveOutput.Columns.Add("GivingPartyName")
eveOutput.Columns.Add("ReceivingPartyName")
eveOutput.Columns.Add("AdditionalDataName")
eveOutput.Columns.Add("Amount")
eveOutput.Columns.Add("Balance")
eveOutput.Columns.Add("Reason")
eveOutput.Columns.Add("TaxAmount")

eveOutput.Columns("accountKey").DataType = System.Type.GetType("System.Int32")
eveOutput.Columns("Date").DataType = System.Type.GetType("System.DateTime")
eveOutput.Columns("TransferType").DataType = System.Type.GetType("System.String")
eveOutput.Columns("GivingPartyName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("ReceivingPartyName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("AdditionalDataName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("Amount").DataType = System.Type.GetType("System.Decimal")
eveOutput.Columns("Balance").DataType = System.Type.GetType("System.Decimal")
eveOutput.Columns("Reason").DataType = System.Type.GetType("System.String")
eveOutput.Columns("TaxAmount").DataType = System.Type.GetType("System.Decimal")

Once you have done this you can simply execute the call to the API to collect the journal entries, and then process through them like so:

Dim eveJournal As List(Of EveAI.Live.JournalEntry) = eveAPI_Wallets.GetCorporationWalletJournal()
For Each eveEntry As EveAI.Live.JournalEntry In eveJournal
Dim tmpRow As DataRow = eveOutput.NewRow
tmpRow("accountKey") = BLAHH
.
.
.
.
.
eveOutput.Rows.Add(tmpRow)
Next

Then once this is done you can finally say this.
dvDataView.DataSource = eveOutput
dvDataView.DataBind()


Hope this gets you started! Please ping me in game if you have any questions!




Bastaardicious
Deep Core Mining Inc.
Caldari State
#89 - 2012-04-03 21:03:05 UTC
Hi Guys,

I'm currently experimenting a bit with C# and EveAI. Programming noob, but i'm slightly getting there.

Can anyone tell me how to show the Category for skills? I've managed to fill a textbox with all skills my character has learned, but they are uncategorized and/or sorted.

I've done sorting via the Listbox properties (actually wanted to do this in the code, but i'll have to be a bit more experienced to figure that out), and can't find the Categories anywhere?

I did debugging and checked most values that were returned but I didn't see it.
Nuquerna Dae
Equilibrium - Enterprises
#90 - 2012-04-04 09:51:25 UTC
CaptainThorVonAwesome wrote:
Nuquerna Dae wrote:


I'm kinda totally new with VB.net and the api stuff, but getting along with the basics to experiment a bit.
Your explanation and example were very helpfull so far, but i'm lacking the knowledge at this point to get the EveJournal list into a DataGridView, any tips? I get it to work when i open and read an exported .csv file, but can't figure out how to get the info from the EveJournal List that is created into a DataViewGrid. Thanks in advance.

Nuq.


Nuq,

The best thing that I can suggest is to create data table object and set it up with a column for each piece of information you want to capture. Then create a for loop to process through the journal entries. Once you have completed that process you can set the data grid's data source equal to the data table and then bind the data sources. For the sake of this example I will assume you are doing this on the individual level and not the corporate level, I have also assumed that you have created an API object and passed it the parameters required to get it to work.

Once you have that taken care of you need to setup a container to collect your data into, in this case if you are going straight to a data grid you can simply build a data table like so:

Dim eveOutput As New DataTable
eveOutput.Columns.Add("accountKey")
eveOutput.Columns.Add("Date")
eveOutput.Columns.Add("TransferType")
eveOutput.Columns.Add("GivingPartyName")
eveOutput.Columns.Add("ReceivingPartyName")
eveOutput.Columns.Add("AdditionalDataName")
eveOutput.Columns.Add("Amount")
eveOutput.Columns.Add("Balance")
eveOutput.Columns.Add("Reason")
eveOutput.Columns.Add("TaxAmount")

eveOutput.Columns("accountKey").DataType = System.Type.GetType("System.Int32")
eveOutput.Columns("Date").DataType = System.Type.GetType("System.DateTime")
eveOutput.Columns("TransferType").DataType = System.Type.GetType("System.String")
eveOutput.Columns("GivingPartyName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("ReceivingPartyName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("AdditionalDataName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("Amount").DataType = System.Type.GetType("System.Decimal")
eveOutput.Columns("Balance").DataType = System.Type.GetType("System.Decimal")
eveOutput.Columns("Reason").DataType = System.Type.GetType("System.String")
eveOutput.Columns("TaxAmount").DataType = System.Type.GetType("System.Decimal")

Once you have done this you can simply execute the call to the API to collect the journal entries, and then process through them like so:

Dim eveJournal As List(Of EveAI.Live.JournalEntry) = eveAPI_Wallets.GetCorporationWalletJournal()
For Each eveEntry As EveAI.Live.JournalEntry In eveJournal
Dim tmpRow As DataRow = eveOutput.NewRow
tmpRow("accountKey") = BLAHH
.
.
.
.
.
eveOutput.Rows.Add(tmpRow)
Next

Then once this is done you can finally say this.
dvDataView.DataSource = eveOutput
dvDataView.DataBind()


Hope this gets you started! Please ping me in game if you have any questions!







Thanks a million Thor! that really helped me a lot Big smile
Lokty
Terra Logistics
#91 - 2012-04-11 10:26:58 UTC
Is there a way to change the EvEAi cache folder? I'm using it on an IIS Server and the AppPool has no access to the default folder.
Jognu
French Kiss Singularity
#92 - 2012-04-24 14:35:28 UTC
I work on a new version with the last bugs that you found and the last API modifications ;)

EveAI developper: https://forums.eveonline.com/default.aspx?g=posts&t=21803

Jognu
French Kiss Singularity
#93 - 2012-04-25 13:00:04 UTC
New release for Escalation with a couple of others fixs/features !

Quote:
Version 2.4.0.1

  • New static data (Escalation_1.0_67593)
  • Add the CharacterLocationsApi, the CorporationLocationsApi and the TypeNameApi
  • Update the MemberTrackingApi so you can use (or not) the advanced mode (thanks to Gorn Che)
  • Add an App.config file which allow to change the cache folder (this file is optionnal, you can delete it)
  • Add the getCharacterNameLookup and the getCharacterIDLookup function
  • WalletJournalApi: fix an infnite loop (thanks to Almeiti du Larr)

EveAI developper: https://forums.eveonline.com/default.aspx?g=posts&t=21803

Kronus Heilgar
Science and Trade Institute
Caldari State
#94 - 2012-04-26 06:03:42 UTC
Is there a way to easily disable the local cache? The problem I'm having is with the getApiKeyInfo() function. If I give it a valid key, and then change the access mask of the key, and then re-run the function it still gives me the old access mask (so if a user of my site puts in a key with the wrong mask, I tell them it's wrong, then they go fix it, it won't recognize the change).

This is not the signature you're looking for.

Desmont McCallock
#95 - 2012-04-26 06:58:03 UTC  |  Edited by: Desmont McCallock
ApiKeyInfo is cached for at least 5 minutes by the API itself. You need to make a 'Cached Until' check before allowing the re-run of the function.
Jognu
French Kiss Singularity
#96 - 2012-04-26 08:42:30 UTC
Yes, the local cache is based on the cache of the API itself. So even if you delete the cache file, you will still get the same datas (or nothing if it's on an API that respond only one time).

EveAI developper: https://forums.eveonline.com/default.aspx?g=posts&t=21803

Marbin Drakon
Reboot Required
#97 - 2012-04-26 11:30:34 UTC
Thanks for the update, Jognu.

Would it be possible for you to add a check for an EveAI.Data.zip file in it's folder before it goes to it's compiled-in resource copy? Or am I missing a way that this can be done already?

Eve W-Space: Open source wormhole mapping and corporation management: https://forums.eveonline.com/default.aspx?g=posts&t=210073

Kronus Heilgar
Science and Trade Institute
Caldari State
#98 - 2012-04-26 18:41:45 UTC  |  Edited by: Kronus Heilgar
This scenario is occurring as a result of the local cache:

- User puts in valid keyID and vCode
- EveAI gets chars on key and caches
- User puts in same keyID with no vCode
- even though the eve API would return validation error, EveAI returns same characters

I need a way to make it return nothing if it's an invalid vCode (instead of cached result)

Also, is there a function for the CharacterName.aspx API call? If there is, I can't seem to find it (I need to use it to get the name of a corporation from CorporationID).

This is not the signature you're looking for.

Jognu
French Kiss Singularity
#99 - 2012-04-27 07:44:34 UTC
Marbin Drakon wrote:
Thanks for the update, Jognu.

Would it be possible for you to add a check for an EveAI.Data.zip file in it's folder before it goes to it's compiled-in resource copy? Or am I missing a way that this can be done already?



This is not what happens ?

Kronus Heilgar wrote:
This scenario is occurring as a result of the local cache:

- User puts in valid keyID and vCode
- EveAI gets chars on key and caches
- User puts in same keyID with no vCode
- even though the eve API would return validation error, EveAI returns same characters

I need a way to make it return nothing if it's an invalid vCode (instead of cached result)

Also, is there a function for the CharacterName.aspx API call? If there is, I can't seem to find it (I need to use it to get the name of a corporation from CorporationID).

I'll look if I can do something for this, but it may be difficult because the cache files are not based on the vcode.

For the CharacterName use the function GetCharacterNameLookup.

EveAI developper: https://forums.eveonline.com/default.aspx?g=posts&t=21803

Marbin Drakon
Reboot Required
#100 - 2012-04-27 09:10:51 UTC  |  Edited by: Marbin Drakon
It didn't work when I tried it. I put EveAI.Data.zip files in both the application root and the /bin folder where I had the EveAI libraries.

Also I get the exception: Method not found: 'System.Collections.Generic.List`1(EveAI.Live.Corporation.MemberTrackingEntry) EveAI.Live.EveApi.GetCorporationMemberTracking(Boolean)'. --exception edited to make the forums happy.

From the code:

EveApi corpapi = new EveApi(stuff, "morestuff);
var members = corpapi.GetCorporationMemberTracking(true);

That code works without the boolean overload on GetCorporationMemberTracking();

Eve W-Space: Open source wormhole mapping and corporation management: https://forums.eveonline.com/default.aspx?g=posts&t=210073