Skip to content

Commit

Permalink
Add a method to retrieve the currently used token
Browse files Browse the repository at this point in the history
  • Loading branch information
Snekw committed Feb 26, 2023
1 parent 9b2b397 commit b068316
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ Requires a token from https://tm.snekw.com/map or self hosted version of https:/
### Advanced

* Endpoint - Used if a self hosted version of SNWTM is used. Set to the URL to the API of the self hosted version.

### Restore Web

* Contains methods to retrieve the currently in use token to use to restore the web page if the web page token fails to restore automatically.
5 changes: 5 additions & 0 deletions build-op.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

:: Set here your path to 7-Zip, including 7z.exe
SET zip="C:\Program Files\7-Zip\7z.exe"

IF EXIST SNWTMMap.op (
del SNWTMMap.op
)

%zip% a -mx1 -tzip SNWTMMap.op info.toml src
2 changes: 1 addition & 1 deletion info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "SNWTMMap"
author = "Snekw"
category = "Utilities"
version = "0.0.3"
version = "0.0.4"
siteid = 187

[script]
Expand Down
13 changes: 13 additions & 0 deletions src/tmmap.as
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,16 @@ void Main(){
sleep(delay);
}
}

[SettingsTab name="Restore Web"]
void RenderSettings(){
UI::Text("Click the button below to retrieve the currently used token.");
UI::Text("This is useful if you need to restore the token on the web site.");
if(UI::Button("Copy Token to clipboard")){
IO::SetClipboard(token);
print("Token copied to clipboard");
}
if(UI::Button("Print Token to Log")){
print("Token: " + token);
}
}

0 comments on commit b068316

Please sign in to comment.