Skip to content

Commit 5ccae53

Browse files
committed
Bug Fixes + Added Pastebin Alternative
- It is now possible to save code lists as local files instead of exporting to Pastebin - Bug Fixing - Removed unneeded settings
1 parent 7da333e commit 5ccae53

File tree

1 file changed

+49
-18
lines changed

1 file changed

+49
-18
lines changed

SpikeCodeRedeem.dsc

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# - You should have received a copy of the GNU Affero General Public License
1717
# - along with this program. If not, see https://spikey.biz/karga.
1818

19+
# + License End +
20+
1921
# +---------------------------------+
2022
# | |
2123
# | Redeemable Codes |
@@ -25,16 +27,16 @@
2527
# | |
2628
# +---------------------------------+
2729
#
28-
# @Spikehidden
29-
# @date 2022/MM/dd
30-
# @denizen-build version
31-
# @script-version 0.1-ALPHA
30+
# @author Spikehidden
31+
# @date 2022/06/10
32+
# @denizen-build 1.2.4-SNAPSHOT (build 1766-REL)
33+
# @script-version 1.0
3234
#
3335
# + REQUIREMENTS +
34-
# - List of required Plugins
36+
# - None
3537
#
3638
# + Required or recommended for some features +
37-
# - List of required Plugins for optional features
39+
# - A Pastebin Account + DevKey if you want to use that feature.
3840
#
3941
# + CONTACT +
4042
#
@@ -54,16 +56,11 @@ SpikeCodeRedeemData:
5456
# ------ Pastebin ------
5557
# Do you want to use private or public pastes on Pastebin.com ?
5658
# You can find more info in the readme at https://github.com/spikehidden/CodeRedeemScript
57-
# Default is true as it is recommended to use this feature when bulk creating codes!
58-
UsePastebin: true
59+
# Default is false as it is not recommended to use this feature when bulk creating codes!
60+
UsePastebin: false
5961
# Put your pastebin devKey in here as it's not possible to retrieve it from the "secrets.secret" file at the moment.
6062
# As soon as it is possible we'll do it that way.
61-
devKey: pyUudImyS3eAEAy5DcVmbMzAh3S7CJMH
62-
63-
# If it is a public or unlisted paste you don't need to have a user key nor a dev key.
64-
# But it will ONLY allow the use of md5 hashes as public pastes can be viewed by anyone.
65-
## NOT RECOMMEND TO USE PUBLIC PASTES AS EVERYONE COULD SEE THE CODES EVEN THOUGH THEY ARE ENCRYPTED!
66-
IsPublic: false
63+
devKey: Put Your Key Here!
6764

6865
# ------ Debug & Log ------
6966
# Shall redemption be logged?
@@ -87,8 +84,8 @@ SpikeCodeRedeemUpdate:
8784
Github:
8885
profile: Spikehidden
8986
respository: CodeRedeemScript
90-
filename: XXX
91-
version: XXX
87+
filename: SpikeCodeRedeem.dsc
88+
version: 1.0
9289

9390
# ++++++ Tasks ++++++
9491
# + Create Code Task +
@@ -153,6 +150,18 @@ SpikeCodeSendPastebin:
153150
- narrate 'You have disabled the use of Pastebin! So you will not be able to get a list of all codes! Please enable it and get a Pastebin dev key!'
154151
- narrate 'Run "/getlist <&lb><&lt>code group ID<&gt><&rb> (<&lt>format<&gt>)" to get the List of codes!'
155152

153+
SpikeCodeRedeemCreateList:
154+
type: task
155+
definitions: player|paste_name|paste_content|format|paste_format
156+
script:
157+
- choose <[format]>:
158+
- case list:
159+
- ~log <[paste_content]> type:none file:plugins/denizen/spikehidden/code_redeem/codes/<[paste_name]>.txt
160+
- case wizebot:
161+
- ~log <[paste_content]> type:none file:plugins/denizen/spikehidden/code_redeem/codes/<[paste_name]>.csv
162+
- default:
163+
- ~log <[paste_content]> type:none file:plugins/denizen/spikehidden/code_redeem/codes/<[paste_name]>.txt
164+
156165
# ++++++ World ++++++
157166
SpikeCodeRedeemSystem:
158167
type: world
@@ -531,7 +540,7 @@ SpikeCodeRedeemBulkCreate:
531540
- determine <player.has_permission[spikehidden.admin]>||<context.server>||<player.has_permission[spikehidden.coderedeem.admin]>||<player.has_permission[spikehidden.coderedeem.codes]>
532541
tab completions:
533542
# Code group
534-
1: <server.flag[redeemableCodeGroups].as_list.if_null[<&lt>Code Group Name<&gt>]>
543+
1: <&lt>Code_Group_Name<&gt>
535544
# amount of codes
536545
2: 1|2|3|4|5|10|100|1000
537546
# format
@@ -553,6 +562,7 @@ SpikeCodeRedeemBulkCreate:
553562
- define command <[args].get[4].if_null[null]>
554563
- define format <[args].get[3].if_null[null]>
555564
- define prefix <[args].get[5].if_null[<empty>]>
565+
- define UsePastebin <script[SpikeCodeRedeemData].data_key[UsePastebin].if_null[false]>
556566
# - define permission <context.args.get[5].if_null[null]>
557567
- define permission null
558568
- define amount 1
@@ -599,7 +609,28 @@ SpikeCodeRedeemBulkCreate:
599609
# If so set the permission.
600610
- else:
601611
- define msg 'The group "<[group]>" with <[amount]> possible redemption was created!'
602-
- run SpikeCodeSendPastebin def:<player>|<[group]>|<server.flag[redeemableGroups.<[group]>.codes].separated_by[<&nl>]>|<[format]>
612+
- if <[UsePastebin]>:
613+
- choose <[format]>:
614+
- case list:
615+
- run SpikeCodeSendPastebin def:<player>|<[group]>|<server.flag[redeemableGroups.<[group]>.codes].separated_by[<&nl>]>|<[format]>
616+
- case wizebot:
617+
- define csv "<list[Your Information;Your description;Extra]>"
618+
- foreach <server.flag[redeemableGroups.<[group]>.codes]> as:data:
619+
- define "csv:->:<[data]>;Use the code together with <&dq>/redeem<&dq> on the Minecraft Server.;<empty>"
620+
- run SpikeCodeSendPastebin def:<player>|<[group]>|<[csv].separated_by[<&nl>]>|<[format]>
621+
- default:
622+
- run SpikeCodeSendPastebin def:<player>|<[group]>|<server.flag[redeemableGroups.<[group]>.codes].separated_by[<&nl>]>|list
623+
- else:
624+
- choose <[format]>:
625+
- case list:
626+
- run SpikeCodeRedeemCreateList def:<player>|<[group]>|<server.flag[redeemableGroups.<[group]>.codes].separated_by[<&nl>]>|<[format]>
627+
- case wizebot:
628+
- define csv "<list[Your Information;Your description;Extra]>"
629+
- foreach <server.flag[redeemableGroups.<[group]>.codes]> as:data:
630+
- define "csv:->:<[data]>;Use the code together with <&dq>/redeem<&dq> on the Minecraft Server.;<empty>"
631+
- run SpikeCodeRedeemCreateList def:<player>|<[group]>|<[csv].separated_by[<&nl>]>|<[format]>
632+
- default:
633+
- run SpikeCodeRedeemCreateList def:<player>|<[group]>|<server.flag[redeemableGroups.<[group]>.codes].separated_by[<&nl>]>|list
603634
- narrate <[msg]>
604635

605636
SpikeCodeRedeemCommandGroup:

0 commit comments

Comments
 (0)