diff --git a/scripts/my_func.lua b/scripts/my_func.lua index 8a186c6..7153e07 100644 --- a/scripts/my_func.lua +++ b/scripts/my_func.lua @@ -2,12 +2,14 @@ function run_event(name) print("run " .. name) if(name == "archivist") then Business.fetch_add(10) - else + elseif(name == "reset") then + Business.fetch_add(-Business.fetch_add(0)) + else Business.fetch_add(1) end end function display_event(name) print("display " .. name) - return Business.fetch_add(0) + return tostring(Business.fetch_add(0)) end \ No newline at end of file diff --git a/src/app/button.ecr b/src/app/button.ecr index 513f862..9f34609 100644 --- a/src/app/button.ecr +++ b/src/app/button.ecr @@ -2,7 +2,7 @@ -
<%= display_event.as(Lua::Function).call(name).as(Float64).to_i32!; %>
+
<%= display_event.as(Lua::Function).call(name).as(String); %>
>