mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	feat: add check if lua code is mid
This commit is contained in:
		
							parent
							
								
									99d736158f
								
							
						
					
					
						commit
						f5850ee63e
					
				
							
								
								
									
										12
									
								
								util/util.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								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() | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user