Skip to content
This repository was archived by the owner on Jan 3, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
EasyRP is a small program to use the discord-rpc, to make a custom rich presence/game on discord.
using just an easy config file.

**Usage**
## Usage
- First you need to register a Rich Presence application with discord
- Go here https://discordapp.com/developers/applications/me
- Make a new application **The name of the app will be the main name for the rich presence**
Expand All @@ -25,7 +25,34 @@ For elapsed time set only the StartTimestamp. For remaining time set both.
Though discord seems to only care about hours/minutes/seconds.
As it doesnt go above 24hrs either way ¯\\\_(ツ)\_/¯

**Building**
## Automation (Provided by [bhavyagosai](https://github.com/bhavyagosai))

- Upon running an AHK script you can automate your tasks. In order to do this follow the steps above but you don't need to edit the config file yet.
- Install [AHK](https://www.autohotkey.com/) (Takes up <15 Mb worth of space). Your .ahk scripts would not work without installing this.
- After downloading the [EasyRP release](https://github.com/Pizzabelly/EasyRP/releases) with the AHK scripts **configure the .ahk scripts according to the guidelines provided in each one of them. Please make sure you edit the scripts properly.**<br><br>
- Basically the main script [easyRP.ahk](https://github.com/Pizzabelly/EasyRP/blob/master/easyRP.ahk) does something like this:
- Upon running the script it first opens up the application for you of which you want to show the RP of.
- Next it rewrites the config.ini file with the information provided by you in the script about the app. **This task is necessary because upon doing this easyRP will automatically display the Timestamp to your RP on discord and it will reset everytime you re-run the script. Something which previously had to be done manually through the Epoch timestamp thingy.**
- After setting up the config.ini it runs the easyrp.exe file in hidden mode which ultimately is responsible for your app RP display on discord.
- Finally the script waits till you close your app. As soon as you do that the script closes the easyrp.exe file which was running in hidden mode and terminates the script.
- The script itself runs in a hidden mode so you don't have to worry about anything now!<br><br>Just make different scripts for different apps and then run THOSE SCRIPTS INSTEAD OF INDIVIDUALLY RUNNING YOUR APPS, CONFIGURING THE ini FILE, RUNNING THE easyrp.exe AND THEN CLOSING IT MANUALLY AFTER YOU CLOSE YOUR APP. That ONE Script will do all of that for you!<br><br>
- The [Failsafe.ahk](https://github.com/Pizzabelly/EasyRP/blob/master/show_exe%20(FAILSAFE).ahk) is provided to you as a precaution. If for some reason you want to close the exe file running in the hidden mode, you won't be able to normally cuz DUH, its hidden lol. So you could go Task Manager and End Task it. Instead you can also simply run this script and it will unhide that exe file for you. **The script can preferably also be used to check if any IDLE EXEs are running around, it that ever happpnes.**

<p align=center>
<img src="https://i.imgur.com/YsGjddb.png" width="30%" />
<img src="https://i.imgur.com/NdAd3Wq.png" width="30%" />
<img src="https://i.imgur.com/WbHfCZ5.png" width="30%" />
</p>

Now, running the AHK script instead of your App can be confusing and cumbersome. What you can do is change the ICONS of the individual scripts to those of your apps so that it would look like you are actually running that app itself.
<p align=center>
<img src ="https://i.imgur.com/0H68318.png" >
<br>Something like this
</p>

**Note: You can always manually control the easyrp.exe and the .ahk files from the Task Manager window if any issues occur.**<br><p align=center>Also AHK isn't still supported by Linux :(</p>

## Building
To build EasyRP from source you need the following
- any c++ compiler (cl, g++, clang++, etc)
- Meson
Expand All @@ -49,3 +76,10 @@ To build EasyRP (in the root of the repo)
- ``` ninja -C build ```

Now the EasyRP executable will be under the build directory!
<br><br>

<p align="center">Feel free to contact us regarding anything you need help with!</p>

<p align="center">
<a href="https://GitHub.com/Pizzabelly/EasyRP/issues/new"><b><i>Feel free to open an issue and communicate!</i></b><br></a>
</p>
16 changes: 8 additions & 8 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
ClientID=123456789012345678

[State]
State=
Details=
StartTimestamp=
EndTimestamp=
State= ;Provide the text to display above the Timestamp. (Secondary to DETAILS). Input text spaces allowed
Details= ;Provide the text to display above the STATE. (Primary to STATE). Input text spaces allowed
StartTimestamp= ;provide *Unix time* to display the time since app started. UNIX TIME
EndTimestamp= ;provide *Unix time* to display the end time. (optional). UNIX TIME

[Images]
LargeImage=
LargeImageTooltip=
SmallImage=
SmallImageTooltip=
LargeImage= ;Main image. Just input the name of the image you had on your discord dev portal (without extension)
LargeImageTooltip= ;display text on hovering the large image (optional). Input text spaces allowed
SmallImage= ;displays the corner image (optional). Same as LargeImage attributes
SmallImageTooltip= ;display text on hovering the small image (optional). Input text spaces allowed
66 changes: 66 additions & 0 deletions easyRP.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
;-------------------------------------------------------------**SCRIPT WON'T WORK UNTIL YOU EDIT IT ACCORDING TO YOUR NEEDS!**------------------------------------------------
;-------------------------------------------------------------------**PLEASE READ THE INSTRUCTIONS PROVIDED CAREFULLY**-------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#NoTrayIcon ;Used for removing script icon in the Taskbar System tray.
#Persistent ;Used for persistent background running of script unless stated otherwise.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

;-------------------------------------------------------------------------------**MAIN CODE STARTS HERE**---------------------------------------------------------------------

Time := A_NowUTC
EnvSub, Time, 19700101000000, Seconds ;Creates a variable named "Time" and stores the current time when the script was run.

;Append or add/change path directory of whatever app you want to show the RP of below. Example, for Photoshop the code line below would be something like this: Run, C:\Program Files\Adobe\Adobe Photoshop 2021\Photoshop.exe
Run, <App Path> ;Runs the specified application in the path directory.

;Give the .exe file name of the app you just put the directory of above. Example, for Photoshop the code line below would be something like this: WinWait, ahk_exe Photoshop.exe
;The Process name is basically the name of the .exe file that you run. You can always run the app and check it out in the 'Details' Tab in the 'Task Manager' window if you want.
WinWait, ahk_exe <.exe file name> ;Script waits until the specified process starts running.


;Provide the same .exe name in the brackets.
if WinExist(ahk_exe <.exe file name>) ;Checks if the specified window exists.
{
FileDelete, <config.ini File Path> ;Specify the path of your .ini file here.

FileAppend,
(
[Identifiers]
ClientID= <Specify the ID of the App you created on discord.com/developers/applications/ here>

[State]
State= <User Custom State>
Details= <User Custom Details>
StartTimestamp= %Time%
EndTimestamp=

[Images]
LargeImage= <Specify the name of the Large image that you want which you uploaded on discord.com/developers/applications/>
LargeImageTooltip= <User Custom Large image cursor hover text>
SmallImage= <Specify the name of the Small image that you want which you uploaded on discord.com/developers/applications/>
SmallImageTooltip= <User Custom Small image cursor hover text>
), <config.ini File Path> ;Specify the path of your .ini file here.

Run, <Put easyrp.exe file Path here>, ,Hide ;Runs the easyrp.exe file in a hidden mode.
}


WinWaitClose, ahk_exe <.exe file name> ;Script waits until your main Application closes.

WinShow, ahk_exe easyrp.exe ;Specify the .exe filename of your easyrp.exe(which is the default filename)-Activates the hidden easyrp.exe file which was running in hidden mode.
WinClose, ahk_exe easyrp.exe ;Specify the .exe filename of your easyrp.exe(which is the default filename)-Closes the easyrp.exe file as it is no longer needed to show the RP on discord.

WinWaitClose, ahk_exe easyrp.exe ;Specify the .exe filename of your easyrp.exe(which is the default filename)-Script waits till the easyrp.exe file has closed.

ExitApp ;Terminates the Script.

;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------


;---------------------------------------------------------------**THE CODE WONT WORK WITHOUT INSTALLING AUTOHOTKEY (AHK)**----------------------------------------------------
66 changes: 66 additions & 0 deletions easyRP.ahk.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
;-------------------------------------------------------------**SCRIPT WON'T WORK UNTIL YOU EDIT IT ACCORDING TO YOUR NEEDS!**------------------------------------------------
;-------------------------------------------------------------------**PLEASE READ THE INSTRUCTIONS PROVIDED CAREFULLY**-------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#NoTrayIcon ;Used for removing script icon in the Taskbar System tray.
#Persistent ;Used for persistent background running of script unless stated otherwise.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

;-------------------------------------------------------------------------------**MAIN CODE STARTS HERE**---------------------------------------------------------------------

Time := A_NowUTC
EnvSub, Time, 19700101000000, Seconds ;Creates a variable named "Time" and stores the current time when the script was run.

;Append or add/change path directory of whatever app you want to show the RP of below. Example, for Photoshop the code line below would be something like this: Run, C:\Program Files\Adobe\Adobe Photoshop 2021\Photoshop.exe
Run, <App Path> ;Runs the specified application in the path directory.

;Give the .exe file name of the app you just put the directory of above. Example, for Photoshop the code line below would be something like this: WinWait, ahk_exe Photoshop.exe
;The Process name is basically the name of the .exe file that you run. You can always run the app and check it out in the 'Details' Tab in the 'Task Manager' window if you want.
WinWait, ahk_exe <.exe file name> ;Script waits until the specified process starts running.


;Provide the same .exe name in the brackets.
if WinExist(ahk_exe <.exe file name>) ;Checks if the specified window exists.
{
FileDelete, <config.ini File Path> ;Specify the path of your .ini file here.

FileAppend,
(
[Identifiers]
ClientID= <Specify the ID of the App you created on discord.com/developers/applications/ here>

[State]
State= <User Custom State>
Details= <User Custom Details>
StartTimestamp= %Time%
EndTimestamp=

[Images]
LargeImage= <Specify the name of the Large image that you want which you uploaded on discord.com/developers/applications/>
LargeImageTooltip= <User Custom Large image cursor hover text>
SmallImage= <Specify the name of the Small image that you want which you uploaded on discord.com/developers/applications/>
SmallImageTooltip= <User Custom Small image cursor hover text>
), <config.ini File Path> ;Specify the path of your .ini file here.

Run, <Put easyrp.exe file Path here>, ,Hide ;Runs the easyrp.exe file in a hidden mode.
}


WinWaitClose, ahk_exe <.exe file name> ;Script waits until your main Application closes.

WinShow, ahk_exe easyrp.exe ;Specify the .exe filename of your easyrp.exe(which is the default filename)-Activates the hidden easyrp.exe file which was running in hidden mode.
WinClose, ahk_exe easyrp.exe ;Specify the .exe filename of your easyrp.exe(which is the default filename)-Closes the easyrp.exe file as it is no longer needed to show the RP on discord.

WinWaitClose, ahk_exe easyrp.exe ;Specify the .exe filename of your easyrp.exe(which is the default filename)-Script waits till the easyrp.exe file has closed.

ExitApp ;Terminates the Script.

;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------


;---------------------------------------------------------------**THE CODE WONT WORK WITHOUT INSTALLING AUTOHOTKEY (AHK)**----------------------------------------------------
44 changes: 31 additions & 13 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
EasyRP (Custom Discord Rich Presence) https://github.com/Pizzabelly/EasyRP
1. First you need to register a Rich Presence application with discord
- Go here https://discordapp.com/developers/applications/me
- Make a new application **The name of the app will be the main name for the rich presence**
- Enable rich presence for your app and add some assets
2 Download the latest release of EasyRP from here https://github.com/Pizzabelly/EasyRP/releases
3 Edit the config file with the information from your newly registered app
4 Run easyrp (it should open a cmd window)
- It *should* report errors from your config file (if there are any)
5 Discord should show the game on your profile
- if not, add the exe as a game on discord and the file path should change to your presence

You can edit the config any time while the program is running to change the presence (make sure to save the file)
-------------------------------------------EasyRP (Custom Discord Rich Presence)https://github.com/Pizzabelly/EasyRP----------------------------------------
1. First you need to register a Rich Presence application with discord
- Go here https://discordapp.com/developers/applications/me
- Make a new application **The name of the app will be the main name for the rich presence**
- Enable rich presence for your app and add some assets
2 Download the latest release of EasyRP from here https://github.com/Pizzabelly/EasyRP/releases
3 Edit the config file with the information from your newly registered app
4 Run easyrp (it should open a cmd window)
- It *should* report errors from your config file (if there are any)
5 Discord should show the game on your profile
- if not, add the exe as a game on discord and the file path should change to your presence

You can edit the config any time while the program is running to change the presence (make sure to save the file)



------------------------------------------------------Automation (Provided by bBSempai)https://github.com/bBSempai------------------------------------------------
1.Upon running an AHK script you can automate your tasks. In order to do this follow the steps above but you don't need to edit the config file yet.
2.Install AHK (Takes up <15 Mb worth of space). Your .ahk scripts would not work without installing this.
3.After downloading the EasyRP release with the AHK scripts configure the .ahk scripts according to the guidelines provided in each one of them. Please make sure you edit the scripts properly.

=>Basically the main script easyRP.ahk does something like this:
1)Upon running the script it first opens up the application for you of which you want to show the RP of.
2)Next it rewrites the config.ini file with the information provided by you in the script about the app. This task is necessary because upon doing this easyRP will automatically display the Timestamp to your RP on discord and it will reset everytime you re-run the script. Something which previously had to be done manually through the Epoch timestamp thingy.
3)After setting up the config.ini it runs the easyrp.exe file in hidden mode which ultimately is responsible for your app RP display on discord.
4)Finally the script waits till you close your app. As soon as you do that the script closes the easyrp.exe file which was running in hidden mode and terminates the script.
The script itself runs in a hidden mode so you don't have to worry about anything now!

Just make different scripts for different apps and then run THOSE SCRIPTS INSTEAD OF INDIVIDUALLY RUNNING YOUR APPS, CONFIGURING THE ini FILE, RUNNING THE easyrp.exe AND THEN CLOSING IT MANUALLY AFTER YOU CLOSE YOUR APP. That ONE Script will do all of that for you!

The Failsafe.ahk is provided to you as a precaution. If for some reason you want to close the exe file running in the hidden mode, you won't be able to normally cuz DUH, its hidden lol. So you could go Task Manager and End Task it. Instead you can also simply run this script and it will unhide that exe file for you. The script can preferably also be used to check if any IDLE EXEs are running around, it that ever happpnes.
Loading