This code isn’t completed yet, this is a project I started a couple of weeks ago, but I have since been pretty busy and haven’t been able to get back to it yet. I will post comments on updates made to the project if/when I continue it.
using { /Fortnite.com/Devices } # help tested by Snownymous
using { /Verse.org/Native }
using { /EpicGames.com/Temporary/Diagnostics }
using { /Verse.org/Simulation }
log_new_device:=class(log_channel){}
klombo_clicker := class<concrete>(creative_device):
Logger:log = log{Channel:=log_new_device}
@editable
CheckBalance:button_device := button_device{} # Check balance button
@editable
PhysicalClick:button_device := button_device{} # Interacting with Klombo
@editable
NotEnoughBalanceHUDMessage:hud_message_device := hud_message_device{} # Not enough balance hud message
@editable
UpgradeTicksTimer:timer_device := timer_device{} # Time to start upgrade ticks
@editable
ClearResources:item_granter_device := item_granter_device{} # Clear resources (gold)
@editable
ClearScore:score_manager_device := score_manager_device{} # Clear score
# COIN GRANTERS =========================================================================================================================================================================================
@editable
Grant1Coin:item_granter_device := item_granter_device{} # Grant 1 coin
@editable
Grant10Coin:item_granter_device := item_granter_device{} # Grant 10 coin
@editable
Grant100Coin:item_granter_device := item_granter_device{} # Grant 100 coin
@editable
Grant1000Coin:item_granter_device := item_granter_device{} # Grant 1000 coin
@editable
Grant10000Coin:item_granter_device := item_granter_device{} # Grant 10000 coin
@editable
Grant100000Coin:item_granter_device := item_granter_device{} # Grant 100000 coin
@editable
Grant1000000Coin:item_granter_device := item_granter_device{} # Grant 1000000 coin
@editable
Give1Score:score_manager_device := score_manager_device{} # Give 1 Score
@editable
Give10Score:score_manager_device := score_manager_device{} # Give 10 Score
@editable
Give100Score:score_manager_device := score_manager_device{} # Give 100 Score
@editable
Give1000Score:score_manager_device := score_manager_device{} # Give 1000 Score
@editable
Give10000Score:score_manager_device := score_manager_device{} # Give 10000 Score
@editable
Give100000Score:score_manager_device := score_manager_device{} # Give 100000 Score
@editable
Give1000000Score:score_manager_device := score_manager_device{} # Give 1000000 Score
# UPGRADE 1 DEVICES =====================================================================================================================================================================================
@editable
PurchaseUpgrade1Button:button_device := button_device{} # Purchase upgrade 1 button
@editable
Upgrade1Purchased:hud_message_device := hud_message_device{} # Upgrade 1 purchased
@editable
Upgrade1Tick:timer_device := timer_device{} # Upgrade 1 tick
@editable
Tick1Bounce:cinematic_sequence_device := cinematic_sequence_device{} # Upgrade 1 tick bounce
@editable
Amt1Owned:score_manager_device := score_manager_device{} # Amount of upgrade 1 owned
# UPGRADE 2 DEVICES =====================================================================================================================================================================================
@editable
PurchaseUpgrade2Button:button_device := button_device{} # Purchase upgrade 2 button
@editable
Upgrade2Purchased:hud_message_device := hud_message_device{} # Upgrade 2 purchased
@editable
Upgrade2Tick:timer_device := timer_device{} # Upgrade 2 tick
@editable
Tick2Bounce:cinematic_sequence_device := cinematic_sequence_device{} # Uppgrade 2 tick bounce
@editable
Amt2Owned:score_manager_device := score_manager_device{} # Amount of upgrade 2 owned
# UPGRADE 3 DEVICES =====================================================================================================================================================================================
@editable
PurchaseUpgrade3Button:button_device := button_device{} # Purchase upgrade 3 button
@editable
Upgrade3Purchased:hud_message_device := hud_message_device{} # Upgrade 3 purchased
@editable
Upgrade3Tick:timer_device := timer_device{} # Upgrade 3 tick
@editable
Tick3Bounce:cinematic_sequence_device := cinematic_sequence_device{} # Uppgrade 3 tick bounce
@editable
Amt3Owned:score_manager_device := score_manager_device{} # Amount of upgrade 3 owned
# =======================================================================================================================================================================================================
var Balance:float = 0.00 # Player's balance for purchasing upgrades
var BalanceRefresh:float = 0.00 # Mirorr balance var to regrant gold
var CoinsNeeded:float = 0.00 # Tracks the amount of coins the player is needed
var Upgrade1:int = 0 # Amount of upgrade 1 purchased starting amount
var Upgrade1Cost:float = 15.00 # Upgrade 1 starting cost
var Upgrade2:int = 0 # Amount of upgrade 2 purchased starting amount
var Upgrade2Cost:float = 100.00 # Upgrade 2 starting cost
var Upgrade3:int = 0 # Amount of upgrade 3 purchase starting amount
var Upgrade3Cost:float = 1100.00 # Upgrade 3 starting cost
OnBegin<override>()<suspends>:void=
Logger.Print("Verse Device Started!") # Print that the verse program has started
PhysicalClick.InteractedWithEvent.Subscribe(KlomboPet) # Link PhysicalClick to KlomboPet()
UpgradeTicksTimer.SuccessEvent.Subscribe(UpgradeTicks) # Link UpgradeTicksTimer to UpgradeTicks()
CheckBalance.InteractedWithEvent.Subscribe(BalanceCheck) # Link CheckBalance to BalanceCheck()
PurchaseUpgrade1Button.InteractedWithEvent.Subscribe(PurchaseUpgrade1) # Link PurchaseUpgrade1Button to PurchaseUpgrade1()
Upgrade1Tick.SuccessEvent.Subscribe(UpgradeTick1) # Link Upgrade1Tick to UpgradeTick1()
PurchaseUpgrade2Button.InteractedWithEvent.Subscribe(PurchaseUpgrade2) # Link PurchaseUpgrade2Button to PurchaseUpgrade2()
Upgrade2Tick.SuccessEvent.Subscribe(UpgradeTick2) # Link Upgrade2Tick to UpgradeTick2()
PurchaseUpgrade3Button.InteractedWithEvent.Subscribe(PurchaseUpgrade3) # Link PurchaseUpgrade3Button to PurchaseUpgrade3()
Upgrade3Tick.SuccessEvent.Subscribe(UpgradeTick3) # Link Upgrade3Tick to UpgradeTick3()
# CHECK BALANCE
BalanceCheck(Player:player):void=
Logger.Print("Your Current Balance is ${Balance}") # Print the player's current balance
# KLOMBO PET ACTION
KlomboPet(Player:player):void=
set Balance += 1.00 # Add $1.00 to the Player's Balance
Grant1Coin.GrantItem(Player)
Give1Score.Activate(Player)
Logger.Print("+$1.00 TOTAL = ${Balance}") # Logs that the player added $1.00 to their balance
# START LIGHT AMMO GRANTER LOOPS
UpgradeTicks(Player:player):void= # Timer finished counting down trigger granters
Upgrade1Tick.Start(Player) # Upgrade 1 loop start
Upgrade2Tick.Start(Player) # Upgrade 2 loop start
Upgrade3Tick.Start(Player)
UpdateBalance(Player:player):void=
ClearResources.GrantItem(Player) # Clear Gold
ClearScore.Activate(Player) # Clear Score
set BalanceRefresh += Balance # Add balance to balance refresh
loop:
# Fake the subtraction of gold it took to purchase upgrade
if (BalanceRefresh >= 1000000.00): # If player has $1,000,000 give 1,000,000 coins
Grant1000000Coin.GrantItem(Player)
Give1000000Score.Activate(Player)
set BalanceRefresh -= 1000000.00
Logger.Print("1000000 Coins Granted")
else if(BalanceRefresh >= 100000.00): # If player has $100,000 give 100,000 coins
Grant100000Coin.GrantItem(Player)
Give100000Score.Activate(Player)
set BalanceRefresh -= 100000.00
Logger.Print("100000 Coins Granted")
else if(BalanceRefresh >= 10000.00): # If player has $10,000 give 10,000 coins
Grant10000Coin.GrantItem(Player)
Give10000Score.Activate(Player)
set BalanceRefresh -= 10000.00
Logger.Print("10000 Coins Granted")
else if(BalanceRefresh >= 1000.00): # If player has $1,000 give 1,000 coins
Grant1000Coin.GrantItem(Player)
Give1000Score.Activate(Player)
set BalanceRefresh -= 1000.00
Logger.Print("1000 Coins Granted")
else if(BalanceRefresh >= 100.00): # If player has $100 give 1000 coins
Grant100Coin.GrantItem(Player)
Give100Score.Activate(Player)
set BalanceRefresh -= 100.00
Logger.Print("100 Coins Granted")
else if(BalanceRefresh >= 10.00): # If player has $10 give 10 coins
Grant10Coin.GrantItem(Player)
Give10Score.Activate(Player)
set BalanceRefresh -= 10.00
Logger.Print("10 Coins Granted")
else if(BalanceRefresh >= 1.00): # If player has $1 give 1 coins
Grant1Coin.GrantItem(Player)
Give1Score.Activate(Player)
set BalanceRefresh -= 1.00
Logger.Print("1 Coins Granted")
else:
break
GrantCoins(Player:player):void=
loop:
if (CoinsNeeded >= 1000000.00): # If player has $1,000,000 give 1,000,000 coins
Grant1000000Coin.GrantItem(Player)
Give1000000Score.Activate(Player)
set CoinsNeeded -= 1000000.00
else if(CoinsNeeded >= 100000.00): # If player has $100,000 give 100,000 coins
Grant100000Coin.GrantItem(Player)
Give100000Score.Activate(Player)
set CoinsNeeded -= 100000.00
else if(CoinsNeeded >= 10000.00): # If player has $10,000 give 10,000 coins
Grant10000Coin.GrantItem(Player)
Give10000Score.Activate(Player)
set CoinsNeeded -= 10000.00
else if(CoinsNeeded >= 1000.00): # If player has $1,000 give 1,000 coins
Grant1000Coin.GrantItem(Player)
Give1000Score.Activate(Player)
set CoinsNeeded -= 1000.00
else if(CoinsNeeded >= 100.00): # If player has $100 give 1000 coins
Grant100Coin.GrantItem(Player)
Give100Score.Activate(Player)
set CoinsNeeded -= 100.00
else if(CoinsNeeded >= 10.00): # If player has $10 give 10 coins
Grant10Coin.GrantItem(Player)
Give10Score.Activate(Player)
set CoinsNeeded -= 10.00
else if(CoinsNeeded >= 1.00): # If player has $1 give 1 coins
Grant1Coin.GrantItem(Player)
Give1Score.Activate(Player)
set CoinsNeeded -= 1.00
else:
break
# UPGRADE 1 FUNCTIONS ===================================================================================================================================================================================
# UPGRADE 1 PURCHASE
PurchaseUpgrade1(Player:player):void= # Player attempts to purchase upgrade 1
if (Balance < Upgrade1Cost): # Checks if the player's balance is lower than the current upgrade 1 cost
NotEnoughBalanceHUDMessage.Show(option {Player}) # Trigger the hud message to tell the player they do not have enough balance
Logger.Print("Price for Next Purchase: ${Upgrade1Cost}") # Print next upgrade cost to the log
Logger.Print("You have ${Balance}") # Print player's current balance
else: # Player has enough for the upgrade
Logger.Print("Upgrade 1 Purchased") # Print that upgrade 1 has been purchased to the log
Upgrade1Purchased.Show(option {Player}) # Trigger the hud message to tell the player they purchased upgrade 1
set Balance -= Upgrade1Cost # Subtract the current upgrade 1 cost from the player's balance
UpdateBalance(Player)
set Upgrade1 += 1 # Add 1 upgrade 1 to the player
set Upgrade1Cost *= 1.15 # Increase upgrade cost of upgrade 1 when purchased by 1.15x
Amt1Owned.Increment(Player) # Increment upgrade 1 score manager by 1
Logger.Print("You now have: {Upgrade1}") # Print how many upgrade 1s the player has
Logger.Print("Price for Next Purchase: ${Upgrade1Cost}") # Print next upgrade cost to the log
Logger.Print("You have ${Balance}") # Print player's current balance
# UPGRADE 1 TICKS
UpgradeTick1(Player:player):void= # Upgrade 1 granter triggered (10 second loop)
set Balance += Upgrade1 * 1.00 # Add 1 coin for however many Upgrade1's the player owns
set CoinsNeeded += Upgrade1 * 1.00 # Refresh coinsneeded to know how many to grant to the player
GrantCoins(Player)
if (Upgrade1 > 0): # Start bounce animation sequencer for Upgrade 1 Icon
Tick1Bounce.Play()
# =======================================================================================================================================================================================================
# UPGRADE 2 FUNCTIONS ===================================================================================================================================================================================
# UPGRADE 2 PURCHASE
PurchaseUpgrade2(Player:player):void= # Player attempts to purchase upgrade 2
if (Balance < Upgrade2Cost): # Checks if the player's balance is lower than the current 2 cost
NotEnoughBalanceHUDMessage.Show(option {Player}) # Trigger the hud message to tell the player they do not have enough balance
Logger.Print("Price for Next Purchase: ${Upgrade2Cost}") # Print next upgrade cost to the log
Logger.Print("You have ${Balance}") # Print player's current balance
else:
Logger.Print("Upgrade 2 Purchased") # Print that upgrade 2 has been purchased to the log
Upgrade2Purchased.Show(option {Player}) # Trigger the hud message to tell the player they purchased upgrade 2
set Balance -= Upgrade2Cost # Subtract the current upgrade 2 cost from the player's balance
UpdateBalance(Player) # Update player's balance function
set Upgrade2 += 1 # Add 1 upgrade 2 to the player
set Upgrade2Cost *= 1.15 # Increase upgradde cost of upgrade 2 when purchased by 1.15x
Amt2Owned.Increment(Player) # Increment upgrade 2 score manager by 1
Logger.Print("You now have: {Upgrade2}") # Print how many upgrade 2s the player has
Logger.Print("Price for Next Purchase: ${Upgrade2Cost}") # Print next upgrade cost to the log
Logger.Print("You have ${Balance}") # Print player's current balance
# UPGRADE 2 TICKS
UpgradeTick2(Player:player):void= # Upgrade 2 granter triggered (1 second loop)
set Balance += Upgrade2 * 1.00 # Add 1 coin for however many Upgrade2'd the player owns
set CoinsNeeded += Upgrade2 * 1.00 # Refresh coinsneeded to know how many to grant to the player
GrantCoins(Player)
if (Upgrade2 > 0): # Start bounce animation sequencer for Upgrade 2 Icon
Tick2Bounce.Play()
# =======================================================================================================================================================================================================
# UPGRADE 3 FUNCTIONS ===================================================================================================================================================================================
# UPGRADE 3 PURCHASE
PurchaseUpgrade3(Player:player):void= # Player attempts to purchase upgrade 3
if (Balance < Upgrade3Cost): # Checks if the player's balance is lower than the current 3 cost
NotEnoughBalanceHUDMessage.Show(option {Player}) # Trigger the hud message to tell the player they do not have enough balance
Logger.Print("Price for Next Purchase: ${Upgrade3Cost}") # Print next upgrade cost to the log
Logger.Print("You have ${Balance}") # Print player's current balance
else:
Logger.Print("Upgrade 3 Purchased") # Print that upgrade 3 has been purchased to the log
Upgrade3Purchased.Show(option {Player}) # Trigger the hud message to tell the player they purchased upgrade 3
set Balance -= Upgrade3Cost # Subtract the current upgrade 3 cost from the player's balance
UpdateBalance(Player) # Update player's balance function
set Upgrade3 += 1 # Add 1 upgrade 3 to the player
set Upgrade3Cost *= 1.15 # Increase upgradde cost of upgrade 3 when purchased by 1.15x
Amt3Owned.Increment(Player) # Increment upgrade 3 score manager by 1
Logger.Print("You now have: {Upgrade3}") # Print how many upgrade 3s the player has
Logger.Print("Price for Next Purchase: ${Upgrade3Cost}") # Print next upgrade cost to the log
Logger.Print("You have ${Balance}") # Print player's current balance
# UPGRADE 3 TICKS
UpgradeTick3(Player:player):void= # Upgrade 3 granter triggered (1 second loop)
set Balance += Upgrade3 * 8.00 # Add 1 coin for however many Upgrade2'd the player owns
set CoinsNeeded += Upgrade3 * 8.00 # Refresh coinsneeded to know how many to grant to the player
GrantCoins(Player)
if (Upgrade3 > 0): # Start bounce animation sequencer for Upgrade 3 Icon
Tick3Bounce.Play()
# =======================================================================================================================================================================================================