Compare commits

..

No commits in common. "main" and "0.1" have entirely different histories.
main ... 0.1

2 changed files with 14 additions and 36 deletions

View file

@ -4,37 +4,22 @@ Diablo 3 Discord Rich Presence
Quick and dirty way to get Discord's Rich Presence working with Diablo 3. You have to set everything up manually for now. Quick and dirty way to get Discord's Rich Presence working with Diablo 3. You have to set everything up manually for now.
APIs are a hassle. Feel free to fork though. APIs are a hassle. Feel free to fork though.
# Library Dependencies Installation
**pip (Linux, Mac, Windows)** you need python3 installed until I compile this into an executable
>- pip install tkinter modules
>- pip install pypresence pip install tkinter
pip install pypresence
**Arch Linux** download
(It's not a great idea to mix in pip packages on Arch as nearly everything is on the AUR or normal repos already.) the main branch source code and extract it to some folder
>- pacman -S tk running it
>- yay -S python-pypresence open terminal in that folder, or cd into it and run python3 ./d3rpc.py
# Running Feel free to add me on Discord or DM me here.
SailorZoop#9082
>- python3 d3rpc.py
# Things to add (Most likely won't ever happen)
>- always on top button
>- figure out how to pack the png background in executables
>- get actual blizzard's API working
>- connection status indicator
Thanks to Commando950 for helping me with the dictionary and connection check. Thanks to Commando950 for helping me with the dictionary and connection check.
![image](https://user-images.githubusercontent.com/26927890/116476301-524aa700-a87b-11eb-9e22-88e109492bda.png)
![image](https://user-images.githubusercontent.com/26927890/116476391-73ab9300-a87b-11eb-8a05-58c26aa7670f.png)
![d3rpcscreenshot](https://user-images.githubusercontent.com/26927890/116476193-29c2ad00-a87b-11eb-99f3-6f8a860e4c30.png)

View file

@ -1,20 +1,14 @@
#
from pypresence import Presence from pypresence import Presence
from pypresence import Client from pypresence import Client
from tkinter import * from tkinter import *
import time import time
import os
time = time.time() time = time.time()
client_id = '835127760849993798' #Discord client ID client_id = '835127760849993798' #Discord client ID
RPC = Presence(client_id) RPC = Presence(client_id)
Connected = False Connected = False
#stupid bg fix
scriptpath = os.path.abspath(__file__)
scriptdir = os.path.dirname(scriptpath)
imagepath = os.path.join(scriptdir, "diablo.png")
#Classes #Classes
ClassList = [ ClassList = [
'--Select--', '--Select--',
@ -108,7 +102,7 @@ ActivityList = [
win = Tk() win = Tk()
win.geometry('200x400') win.geometry('200x400')
win.resizable(False, False) win.resizable(False, False)
#win.iconbitmap(default='d3rpc.ico') win.iconbitmap('d3rpc.ico')
win.title('D3RPC - The dumb manual Diablo 3 rich presence.') win.title('D3RPC - The dumb manual Diablo 3 rich presence.')
can = Canvas(win, bg='#21252B', height=400, width=200) #21252B dark #282C34 light can = Canvas(win, bg='#21252B', height=400, width=200) #21252B dark #282C34 light
can.place(relx=0.5, rely=0.5, anchor=CENTER) can.place(relx=0.5, rely=0.5, anchor=CENTER)
@ -125,8 +119,7 @@ chosenGenderFemale.set(PortraitListFemale[1])
chosenGenderMale = StringVar() chosenGenderMale = StringVar()
chosenGenderMale.set(PortraitListMale[1]) chosenGenderMale.set(PortraitListMale[1])
bgdiablo = PhotoImage(file='diablo.png')
bgdiablo = PhotoImage(file=imagepath)
labelDiablo = Label(win, image=bgdiablo) labelDiablo = Label(win, image=bgdiablo)
labelDiablo.place(relx=0.5, rely=0.5, anchor=CENTER) labelDiablo.place(relx=0.5, rely=0.5, anchor=CENTER)