rice.sk

Created by any name you wish

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.


command /sell <integer> [<integer>]:
	trigger:
		if arg-2 is not set:
			set {%player's uuid%.rice.amt} to item number of player's tool
		else:
			set {%player's uuid%.rice.amt} to arg-2
		if {%player's uuid%.rice.amt} > item number of player's held item:
			set {%player's uuid%.rice.amt} to item number of player's held item
		set {ae} to 0
		set {tl} to 0
		loop {rice.%arg-1%.l} times:
			set {ae} to {ae} + 1
			if {rice.%arg-1%::%{ae}%} is 1 of player's tool:
				set {tl} to {ae}
		if {tl} is 0:
			message "&4That item cannot be sold in this shop."
		else:
			remove {%player's uuid%.rice.amt} of player's tool from player
			loop {%player's uuid%.rice.amt} times:
				set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + {cprice.%arg-1%::%{tl}%}
			message "&aItem sold! You now have $%{%player's uuid%.rice.mon}%"
command /cadd <integer> <integer>:
	permission: rice.op
	trigger:
		set {ae} to 0
		set {tl} to 0
		loop {rice.%arg-2%.l} times:
			set {ae} to {ae} + 1
			if {rice.%arg-2%::%{ae}%} is 1 of player's tool:
				set {tl} to {ae}
		if {tl} is 0:
			if {ae} is 0:
				set {ae} to 1
				set {rice.%arg-2%.l} to 1
			set {rice.%arg-2%::%{ae}%} to 1 of player's tool
			set {cprice.%arg-2%::%{ae}%} to arg-1
			message "&aItem added!"
			set {rice.%arg-2%.l} to {rice.%arg-2%.l} + 1
		else:
			message "&4That item is already in this shop. Try adding it to another shop."
			message "%{tl}%"
command /creset <integer>:
	permission: rice.op
	trigger:
		set {ae} to -1
		set {%player's uuid%.rice.mon} to 0
		loop {rice.%arg-1%.l} + 2 times:
			set {ae} to {ae} + 1
			delete {rice.%arg-1%::%{ae}%}
			delete {cprice.%arg-1%::%{ae}%}
		set {rice.%arg-1%.l} to 0
		message "&aShop deleted!"
command /csearch <string> <integer>:
	trigger:
		set {ae} to 0
		set {rice.%player%.active} to arg-2
		set {tl} to 1
		if {%player's uuid%.bmt} is not set:
			set {%player's uuid%.bmt} to 1
		set (metadata tag "csr" of player) to chest inventory with 6 rows named "Search Results"
		set slot 0 of (metadata tag "csr" of player) to paper named "&aMoney: $%{%player's uuid%.rice.mon}%"
		loop 8 times:
			set {it} to gray glass pane named "&4No items here :("
			set slot {tl} of (metadata tag "csr" of player) to {it}
			set {%player's uuid%.id.%{tl}%} to -5
			add 1 to {tl}
		set slot 8 of (metadata tag "csr" of player) to gold ingot named "&aAmount : %{%player's uuid%.bmt}%"
		loop {rice.%arg-2%.l} - 1 times:
			set {ae} to {ae} + 1
			set {_res} to "%{rice.%arg-2%::%{ae}%}%"
			if {_res} contains arg-1:
				set {it} to {rice.%arg-2%::%{ae}%} named "%{rice.%arg-2%::%{ae}%}%&a. $%{cprice.%arg-2%::%{ae}%}%"
				set slot {tl} of (metadata tag "csr" of player) to {it}
				set {%player's uuid%.id.%{tl}%} to {ae}
				add 1 to {tl}
		loop 60 times:
			set {it} to gray glass pane named "&4No items here :("
			set slot {tl} of (metadata tag "csr" of player) to {it}
			set {%player's uuid%.id.%{tl}%} to -5
			add 1 to {tl}
		open (metadata tag "csr" of player) to player
		set {%player's uuid%.sqr} to arg-1
command /browse <integer> <integer>:
	trigger:
		set {ae} to (arg-1 - 1) * 43
		if {ae} < 0:
			set {ae} to 0
			set {%player%.pg} to 1
		set {rice.%player%.active} to arg-2
		set {%player%.pg} to arg-1
		set {tl} to 1
		if {%player's uuid%.bmt} is not set:
			set {%player's uuid%.bmt} to 1
		set (metadata tag "cbr" of player) to chest inventory with 6 rows named "Search Results"
		set slot 0 of (metadata tag "cbr" of player) to paper named "&aMoney: $%{%player's uuid%.rice.mon}%"
		loop 8 times:
			set {it} to gray glass pane named "&aPage %{%player%.pg}%"
			set slot {tl} of (metadata tag "cbr" of player) to {it}
			set {%player's uuid%.id.%{tl}%} to -5
			add 1 to {tl}
		set slot 8 of (metadata tag "cbr" of player) to gold ingot named "&aAmount : %{%player's uuid%.bmt}%"
		set {al} to {tl}
		loop 43 times:
			add 1 to {ae}
			if {ae} < {rice.%arg-2%.l}:
				set {_res} to "%{rice.%arg-2%::%{ae}%}%"
				set {it} to {rice.%arg-2%::%{ae}%} named "%{rice.%arg-2%::%{ae}%}%&a. $%{cprice.%arg-2%::%{ae}%}%"
				set slot {tl} of (metadata tag "cbr" of player) to {it}
				set {%player's uuid%.id.%{tl}%} to {ae}
			else:
				set {it} to gray glass pane named "&4No items here :("
				set slot {tl} of (metadata tag "cbr" of player) to {it}
				set {%player's uuid%.id.%{tl}%} to -5
			add 1 to {tl}
		set slot 52 of (metadata tag "cbr" of player) to book named "&aPrevious Page"
		set slot 53 of (metadata tag "cbr" of player) to book named "&aNext Page"
		open (metadata tag "cbr" of player) to player
		set {%player's uuid%.sqr} to arg-1
command /cremove <integer> <integer>:
	permission: rice.op
	trigger:
		delete {rice.%arg-2%::%arg-1%}
		delete {cprice.%arg-2%::%arg-1%}
		set {ae} to 0
		set {tl} to 0
		loop {rice.%arg-2%.l} times:
			set {ae} to {ae} + 1
			if {ae} > arg-1:
				set {oe} to {ae} - 1
				set {rice.%arg-2%::%{oe}%} to {rice.%arg-2%::%{ae}%}
				set {cprice.%arg-2%::%{oe}%} to {cprice.%arg-2%::%{ae}%}
		set {rice.%arg-2%.l} to {rice.%arg-2%.l} - 1
		set {ae} to {ae} - 1
		delete {rice.%arg-2%::%{ae}%}
		delete {cprice.%arg-2%::%{ae}%}
		message "&aSuccess!"
command /dmoney <integer>:
	permission: rice.op
	trigger:
		set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + arg-1
		message "&aMoney granted."
command /buy <integer> [<integer>] <integer>:
	trigger:
		if arg-2 is not set:
			set {buyam} to 1
		else:
			if arg-2 > 0:
				if arg 2 > 1000:
					set {buyam} to 1000
				else:
					set {buyam} to arg-2
			else:
				set {buyam} to 1
		if {rice.%arg-3%.l} < arg-1 + 1:
			message "&4What? That doesn't even exist!"
		else:
			set {prcreq} to {cprice.%arg-3%::%arg-1%} * {buyam}
			if {%player's uuid%.rice.mon} > ({prcreq} - 1):
				set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} - {prcreq}
				message "&aItem purchased. You now have $%{%player's uuid%.rice.mon}%"
				loop {buyam} times:
					give player {rice.%arg-3%::%arg 1%}
			else:
				message "&4You don't have enough money."
on join:
	if {%player's uuid%.rice.mon} is not set:
		set {%player's uuid%.rice.mon} to 0
on join:
	if {%player's uuid%.rice.bps} is not set:
		set {%player's uuid%.rice.bps} to 0
command /buybps [<integer>]:
	permission: rice.bpack
	trigger:
		if arg-1 is not set:
			set {wil} to 1
		else:
			if arg-1 > 0:
				set {wil} to arg-1
			else:
				set {wil} to 1
		set {prc} to {wil} * 100
		if {%player's uuid%.rice.mon} > {prc}:
			message "&aPurchase Successful!"
			set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} - {prc}
			set {%player's uuid%.rice.bps} to {%player's uuid%.rice.bps} + {wil}
		else:
			message "&4You don't have enough money."
		set {%player's uuid%.rice.bps} to {%player's uuid%.rice.bps} parsed as integer
		if {%player's uuid%.rice.bps} > {bplm}:
			set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + (({%player's uuid%.rice.bps} - {bplm}) * 100)
			set {%player's uuid%.rice.bps} to {bplm}
command /put:
	permission: rice.bpack
	trigger:
		set {%player's uuid%.rice.bps} to {%player's uuid%.rice.bps} parsed as integer
		if {%player's uuid%.rice.bps} > {bplm}:
			set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + (({%player's uuid%.rice.bps} - {bplm}) * 100)
			set {%player's uuid%.rice.bps} to {bplm}
		set {ae} to 0
		set {tl} to 0
		loop {%player's uuid%.rice.bps} times:
			set {ae} to {ae} + 1
			if {%player's uuid%.rice.bp.%{ae}%} is not set:
				if {tl} is 0:
					set {tl} to {ae}
		if {tl} is not 0:
			set {%player's uuid%.rice.bp.%{tl}%} to player's tool
			remove player's tool from player
			message "&aDeposited. Use /get to get the item back."
		else:
			message "&4Your backpack is full. Use /buybps to buy more slots or take something out."
command /get <integer>:
	permission: rice.bpack
	trigger:
		set {%player's uuid%.rice.bps} to {%player's uuid%.rice.bps} parsed as integer
		if {%player's uuid%.rice.bps} > {bplm}:
			set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + (({%player's uuid%.rice.bps} - {bplm}) * 100)
			set {%player's uuid%.rice.bps} to {bplm}
		if arg-1 > 0:
			if arg-1 < {%player's uuid%.rice.bps} + 1:
				give player {%player's uuid%.rice.bp.%arg-1%}
				delete {%player's uuid%.rice.bp.%arg-1%}
				message "&aItem withdrawn."
			else:
				message "&4Invalid slot ID."
		else:
			message "&4Invalid slot ID."
command /blimit <Integer>:
	permission: rice.op
	trigger:
		set {bplm} to arg-1
		message "&aBackpack limit set!"
		if arg-1 > 30000:
			message "&4Warning: Backpacks of over 30k slots may be quite laggy, and backpacks over 200k slots may crash the server. Please consider lowering the backpack limit."
on load:
	if {bplm} is not set:
		set {bplm} to 10000
command /bsearch <string>:
	permission: rice.bpack
	trigger:
		set {%player's uuid%.bpr} to arg-1
		set {%player's uuid%.rice.bps} to {%player's uuid%.rice.bps} parsed as integer
		if {%player's uuid%.rice.bps} > {bplm}:
			set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + (({%player's uuid%.rice.bps} - {bplm}) * 100)
			set {%player's uuid%.rice.bps} to {bplm}
		set {ae} to 0
		set {tl} to 0
		set (metadata tag "bpacksr" of player) to chest inventory with 6 rows named "Backpack"
		loop {%player's uuid%.rice.bps} times:
			set {ae} to {ae} + 1
			set {_res} to "%{%player's uuid%.rice.bp.%{ae}%}%"
			if {%player's uuid%.rice.bp.%{ae}%} is air:
				delete {%player's uuid%.rice.bp.%{ae}%}
			if {_res} contains arg-1:
				if {%player's uuid%.rice.bp.%{ae}%} is set:
					set slot {tl} of (metadata tag "bpacksr" of player) to {%player's uuid%.rice.bp.%{ae}%}
					set {%player's uuid%.id.%{tl}%} to {ae}
					add 1 to {tl}
		loop 60 times:
			set slot {tl} of (metadata tag "bpacksr" of player) to gray glass pane named "&4No items here :("
			set {%player's uuid%.id.%{tl}%} to -5
			add 1 to {tl}
		open (metadata tag "bpacksr" of player) to player
on inventory click:
	if event-inventory is (metadata tag "bpacksr" of player):
		cancel event
		if {%player's uuid%.id.%index of event-slot%} is not -5:
			execute console command "sudo %player% get %{%player's uuid%.id.%index of event-slot%}%"
			execute console command "sudo %player% bsearch %{%player's uuid%.bpr}%"
	if event-inventory is (metadata tag "csr" of player):
		cancel event
		if event-slot is not air:
			if index of event-slot is 0:
				wait 1 tick
			else if index of event-slot is 8:
				if {%player's uuid%.bmt} is 1:
					set {%player's uuid%.bmt} to 5
				else if {%player's uuid%.bmt} is 5:
					set {%player's uuid%.bmt} to 16
				else if {%player's uuid%.bmt} is 16:
					set {%player's uuid%.bmt} to 32
				else if {%player's uuid%.bmt} is 32:
					set {%player's uuid%.bmt} to 64
				else if {%player's uuid%.bmt} is 64:
					set {%player's uuid%.bmt} to 1
				execute console command "sudo %player% csearch %{%player's uuid%.sqr}% %{rice.%player%.active}%"
			else:
				if event-click type is right mouse button:
					if player has permission "rice.op":
						if {%player's uuid%.id.%index of event-slot%} is not -5:
							execute console command "sudo %player% cremove %{%player's uuid%.id.%index of event-slot%}% %{rice.%player%.active}%"
							execute console command "sudo %player% csearch %{%player's uuid%.sqr}% %{rice.%player%.active}%"
				else:
					if {%player's uuid%.id.%index of event-slot%} is not -5:
						loop {%player's uuid%.bmt} times:
							execute console command "sudo %player% buy %{%player's uuid%.id.%index of event-slot%}% %{rice.%player%.active}%"
						execute console command "sudo %player% csearch %{%player's uuid%.sqr}% %{rice.%player%.active}%"
	if event-inventory is (metadata tag "cbr" of player):
		cancel event
		if event-slot is not air:
			if index of event-slot is 0:
				wait 1 tick
			else if index of event-slot is 8:
				if {%player's uuid%.bmt} is 1:
					set {%player's uuid%.bmt} to 5
				else if {%player's uuid%.bmt} is 5:
					set {%player's uuid%.bmt} to 16
				else if {%player's uuid%.bmt} is 16:
					set {%player's uuid%.bmt} to 32
				else if {%player's uuid%.bmt} is 32:
					set {%player's uuid%.bmt} to 64
				else if {%player's uuid%.bmt} is 64:
					set {%player's uuid%.bmt} to 1
				execute console command "sudo %player% browse %{%player%.pg}% %{rice.%player%.active}%"
			else if index of event-slot is 52:
				execute console command "sudo %player% browse %{%player%.pg} - 1% %{rice.%player%.active}%"
			else if index of event-slot is 53:
				execute console command "sudo %player% browse %{%player%.pg} + 1% %{rice.%player%.active}%"
			else:
				if event-click type is right mouse button:
					if player has permission "rice.op":
						if {%player's uuid%.id.%index of event-slot%} is not -5:
							execute console command "sudo %player% cremove %{%player's uuid%.id.%index of event-slot%}% %{rice.%player%.active}%"
							execute console command "sudo %player% browse %{%player%.pg}% %{rice.%player%.active}%"
				else:
					if {%player's uuid%.id.%index of event-slot%} is not -5:
						loop {%player's uuid%.bmt} times:
							execute console command "sudo %player% buy %{%player's uuid%.id.%index of event-slot%}% %{rice.%player%.active}%"
						execute console command "sudo %player% browse %{%player%.pg}% %{rice.%player%.active}%"
command /bal:
	aliases: /money, /rice, /amb
	trigger:
		message "&aBalance: %{%player's uuid%.rice.mon}%"
command /nameshop <integer> <string>:
	permission: rice.op
	trigger:
		message "&aName Set!"
		set {rice.%arg-1%.name} to arg-2
command /atm:
	permission: rice.atm
	trigger:
		message "&aATM created here!"
		set {riceatm.%target block%.atm} to 1
command /delatm:
	permission: rice.atm
	trigger:
		message "&aATM deleted here!"
		set {riceatm.%target block%.atm} to 0
command /cshop <integer>:
	permission: rice.atm
	trigger:
		message "&aShop created here!"
		set {riceshop.%target block%.isshop} to 1
		set {riceshop.%target block%.shopid} to arg 1
command /rshop:
	permission: rice.atm
	trigger:
		message "&aShop deleted here!"
		set {riceshop.%target block%.isshop} to 0
on join:
	set {rice.%player%.action} to 0
on right click:
	if {riceatm.%event-block%.atm} is 1:
		if {rice.%player%.action} is 1:
			cancel event
		else:
			cancel event
			message "&bWelcome to the ATM!"
			set {rice.%player%.action} to 1
			set {rice.%player%.actid} to 1
			message "&bSay 1 for withdraw, and 2 for deposit."
			message "&bSay cancel to exit."
	else:
		if {riceshop.%event-block%.isshop} is 1:
			if {rice.%player%.action} is 1:
				cancel event
			else:
				cancel event
				message "&bWelcome to %{rice.%{riceshop.%event-block%.shopid}%.name}%!"
				set {rice.%player%.action} to 1
				set {rice.%player%.actid} to 4
				message "&bPlease type your search query in chat to buy something."
				message "&bTo sell an item, left click this shop with the item you would like to sell."
				message "&bOr, to browse, simply say browse."
				message "&bSay cancel to exit."
				set {rice.%player%.actid2} to {riceshop.%event-block%.shopid}
on left click:
	if {riceshop.%event-block%.isshop} is 1:
		if {rice.%player%.action} is 1:
			cancel event
		else:
			cancel event
			message "&aWelcome to %{rice.%{riceshop.%event-block%.shopid}%.name}%!"
			message "&aYou are currently trying to sell your held item."
			message "&aHow many would you like to sell?"
			message "&aIf this was a mistake, say cancel."
			set {rice.%player%.actid} to 5
			set {rice.%player%.actid2} to {riceshop.%event-block%.shopid}
			set {rice.%player%.action} to 1
on chat:
	if {rice.%player%.action} is 1:
		cancel event
		if message is "cancel":
			set {rice.%player%.action} to 0
			message "&4Canceled."
		else:
			if {rice.%player%.actid} is 1:
				if message is "1":
					message "&bPlease specify an amount."
					set {rice.%player%.actid} to 2
				else if message is "2":
					message "&aPlease hold an ATM card, and say 1 when you are ready."
					set {rice.%player%.actid} to 3
			else if {rice.%player%.actid} is 2:
				set {rice.%player%.action} to 0
				set {_a} to floor(message parsed as integer)
				if {_a} > 0:
					if {%player's uuid%.rice.mon} > ({_a} - 1):
						message "&2Success!"
						set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} - {_a}
						set {_b} to light blue dye named "&fATM Card"
						set line 1 of {_b}'s lore to "%{_a}%"
						give player {_b}
					else:
						message "&4You cannot withdraw more money than you have."
				else:
					message "&4You cannot withdraw negative money."
			else if {rice.%player%.actid} is 3:
				set {rice.%player%.action} to 0
				if message is "1":
					if player's tool's name is "&fATM Card":
						message "&2Withdrawing!"
						set {_a} to line 1 of player's tool's lore parsed as integer
						set {%player's uuid%.rice.mon} to {%player's uuid%.rice.mon} + {_a}
						remove player's tool from player
						message "&2New Balance: %{%player's uuid%.rice.mon}%"
					else:
						message "&4Please hold an ATM card."
			else if {rice.%player%.actid} is 4:
				if message is "browse":
					execute console command "sudo %player% browse 1 %{rice.%player%.actid2}%"
				else:
					execute console command "sudo %player% csearch %message% %{rice.%player%.actid2}%"
				set {rice.%player%.action} to 0
			else if {rice.%player%.actid} is 5:
				execute console command "sudo %player% sell %{rice.%player%.actid2}% %message%"
				set {rice.%player%.action} to 0