From f5850ee63edcf34886cd0df69b3e5da17713a077 Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 1 Apr 2023 18:01:20 -0400 Subject: [PATCH] feat: add check if lua code is mid --- util/util.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/util.go b/util/util.go index 45e33dc..9063160 100644 --- a/util/util.go +++ b/util/util.go @@ -2,10 +2,13 @@ package util import ( "bufio" + "fmt" "io" "strings" + "math/rand" "os" "os/user" + "time" rt "github.com/arnodel/golua/runtime" ) @@ -37,6 +40,15 @@ func DoString(rtm *rt.Runtime, code string) error { // DoFile runs the contents of the file in the Lua runtime. func DoFile(rtm *rt.Runtime, path string) error { + t := time.Now() + if t.Month() == 4 && t.Day() == 1 { + rand.Seed(t.UnixNano()) + p := rand.Intn(100-1) + 1 + + if p >= 72 { + return fmt.Errorf("i dont like you or your lua code") + } + } f, err := os.Open(path) defer f.Close()