Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports EveAI
- Imports EveAI.Live
- Imports EveAI.Live.Character
- Public Class Form1
- Dim auth As New AuthenticationData
- Sub SetAuth()
- With auth
- .VCode = My.Settings.VCode
- .KeyID = My.Settings.KeyID
- .CharacterID = My.Settings.CharacterID
- End With
- End Sub
- Function GetProxy() As Net.WebProxy
- If My.Settings.ProxyHost.Length > 2 Then
- Return New System.Net.WebProxy(My.Settings.ProxyHost, My.Settings.ProxyPort)
- Else
- Return Nothing
- End If
- End Function
- Function GetBalance() As Double
- Dim api As New CharacterSheetApi
- api.Configuration.Proxy = GetProxy()
- api.AuthenticationData = auth
- api.UpdateData(EveApiBase.UpdateCharaceristics.Default)
- Dim charsheet As Character.CharacterSheet = api.Data
- Return charsheet.Balance
- End Function
- Function GetSkillInfo(TypeID As Integer) As EveAI.Live.Skill
- Dim api As New EveAI.Live.Generic.SkillTreeApi()
- api.UpdateData()
- Dim skills As List(Of EveAI.Live.Skill) = api.Data
- For Each sk As EveAI.Live.Skill In skills
- If sk.TypeID = TypeID Then
- Return sk
- End If
- Next
- Return Nothing
- End Function
- Function GetSKillTraining() As String
- Dim api As New CharacterSkillQueueApi
- Dim skQ As List(Of SkillInTraining)
- Dim sb As New System.Text.StringBuilder
- Dim sk As EveAI.Live.Skill
- api.Configuration.Proxy = GetProxy()
- api.AuthenticationData = auth
- api.UpdateData(EveApiBase.UpdateCharaceristics.Default)
- skQ = api.Data
- For Each st As SkillInTraining In skQ
- sk = GetSkillInfo(st.SkillTypeID)
- sb.AppendLine(String.Format("{0}: {1:ddd dd MMM HH:mm}", sk.Name, st.TrainingEndLocalTime))
- Next
- Return sb.ToString
- End Function
- Function GetCharacterImage() As Image
- Dim strURL As String = String.Format(My.Settings.ImgURL, My.Settings.CharacterID)
- Dim wc As New Net.WebClient
- With wc
- If My.Settings.ProxyHost.Length > 2 Then
- .Proxy = GetProxy()
- End If
- End With
- Dim img As Image = Image.FromStream(wc.OpenRead(strURL))
- Return img
- End Function
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- SetAuth()
- Dim bmpOut As New Bitmap(My.Settings.ImgBase)
- Dim brush As New SolidBrush(Color.White)
- Dim dblBal As Double = GetBalance()
- Dim gfx As Graphics = Graphics.FromImage(bmpOut)
- gfx.DrawString(String.Format("Balance: {0:#,#} ISK", dblBal), New Font("Arial", 24), brush, New Point(My.Settings.InfoPosX + 101, My.Settings.InfoPosY))
- gfx.DrawString(String.Format("{0}", GetSKillTraining), New Font("Arial", 24), brush, New Point(My.Settings.InfoPosX + 101, My.Settings.InfoPosY+31))
- gfx.DrawString(String.Format("Updated: {0:dd, MMM HH:mm}", Now), New Font("Arial", 12), brush, New Point(My.Settings.InfoPosX, My.Settings.InfoPosY + 108))
- gfx.DrawImage(GetCharacterImage, New Point(My.Settings.InfoPosX, My.Settings.InfoPosY))
- bmpOut.Save(My.Settings.ImgBase.Replace("1280.jpg", "1280_new.png"), Imaging.ImageFormat.Png)
- bmpOut.Dispose()
- Me.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment