@anonymous/

WatchfulOddballGnudebugger

Lua

No description

fork
loading
Files
  • main.lua

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.20880489961456994","path":"main.lua","file":{"path":"main.lua","content":{"asEncoding":{"base64":"aWYgbWVzc2FnZV9pZCA9PSBoYXNoKCJ5b3VyaW5mbyIpdGhlbiAKCXNlbGYubGV2ZWxubyA9IG1lc3NhZ2VbMl0KCXNlbGYubXlzdGF0dXMgPSBtZXNzYWdlWzFdCglzZWxmLmxldmVscGxhbiA9IG1lc3NhZ2VbM10KCWlmIG1lc3NhZ2VbMV0gPT0gMCB0aGVuLS1sZXZlbCBpcyBub3QgYXZhaWxhYmxlLiAKCWVsc2VpZiBtZXNzYWdlWzFdID4gMCB0aGVuIC0tbGV2ZWwgaXMgYXZhaWxhYmxlLCBtYWtlIGltYWdlISAKCQlmb3Iga2V5LCB2YWx1ZSBpbiBwYWlycyhzZWxmLmxldmVscGxhbikgZG8KCQkJc2VsZi5wbGFjZWQgPSBzZWxmLnBsYWNlZCArIDEgCgkJCXNlbGYudGlsZXR5cGU9IHswLDAsMCwwfQoJCQlzZWxmLnl2YWx1ZSA9ICgoKHNlbGYucGxhY2VkJTEwKSo2NCkrMTI4KSs2NAoJCQlzZWxmLnh2YWx1ZSA9IChtYXRoLmZsb29yKHNlbGYucGxhY2VkLzEwKSo2NCsxMjgpCgkJCWlmIHZhbHVlID09IDkgb3IgdmFsdWUgPT0gNSBvciB2YWx1ZSA9PSA4IG9yIHZhbHVlID09IDcgb3IgdmFsdWUgPT0gNiB0aGVuCgkJCQlpZiBzZWxmLmxldmVscGxhbltrZXktMTBdID09IG5pbCBvciBzZWxmLmxldmVscGxhbltrZXktMTBdID09IDAgdGhlbgoJCQkJCXNlbGYudGlsZXR5cGVbM10gPSAxIC0tKGxlZnQpCgkJCQllbmQKCQkJCWlmIHNlbGYubGV2ZWxwbGFuW2tleSsxMF0gPT0gbmlsIG9yIHNlbGYubGV2ZWxwbGFuW2tleSsxMF0gPT0gMCB0aGVuCgkJCQkJc2VsZi50aWxldHlwZVs0XSA9IDEgKHJpZ2h0KQoJCQkJZW5kCgkJCQlpZiBzZWxmLmxldmVscGxhbltrZXktMV0gPT0gbmlsIG9yIHNlbGYubGV2ZWxwbGFuW2tleS0xXSA9PSAwIHRoZW4KCQkJCQlzZWxmLnRpbGV0eXBlWzJdID0gMSAtLShkb3duKQoJCQkJZW5kCgkJCQlpZiBzZWxmLmxldmVscGxhbltrZXkrMV0gPT0gbmlsIG9yIHNlbGYubGV2ZWxwbGFuW2tleSsxXSA9PSAwIHRoZW4KCQkJCQlzZWxmLnRpbGV0eXBlWzFdID0gMSAtLSh1cCkKCQkJCWVuZAoJCQkJc2VsZi5wcm9wcyA9IHsgc2VsZi50aWxldHlwZVsxXSxzZWxmLnRpbGV0eXBlWzJdLHNlbGYudGlsZXR5cGVbM10sc2VsZi50aWxldHlwZVs0XSB9CgkJCQlmYWN0b3J5LmNyZWF0ZSgiI3RpbGUiLCB2bWF0aC52ZWN0b3IzKHNlbGYueHZhbHVlLCBzZWxmLnl2YWx1ZSwgMCksIG5pbCwgc2VsZi5wcm9wcywgdm1hdGgudmVjdG9yMyhzZWxmLnRpbGVzY2FsZSAsc2VsZi50aWxlc2NhbGUgLDEpKQoJCQllbmQKCQllbmQKCWVuZA=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
if message_id == hash("yourinfo")then 
	self.levelno = message[2]
	self.mystatus = message[1]
	self.levelplan = message[3]
	if message[1] == 0 then--level is not available. 
	elseif message[1] > 0 then --level is available, make image! 
		for key, value in pairs(self.levelplan) do
			self.placed = self.placed + 1 
			self.tiletype= {0,0,0,0}
			self.yvalue = (((self.placed%10)*64)+128)+64
			self.xvalue = (math.floor(self.placed/10)*64+128)
			if value == 9 or value == 5 or value == 8 or value == 7 or value == 6 then
				if self.levelplan[key-10] == nil or self.levelplan[key-10] == 0 then
					self.tiletype[3] = 1 --(left)
				end
				if self.levelplan[key+10] == nil or self.levelplan[key+10] == 0 then
					self.tiletype[4] = 1 (right)
				end
				if self.levelplan[key-1] == nil or self.levelplan[key-1] == 0 then
					self.tiletype[2] = 1 --(down)
				end
				if self.levelplan[key+1] == nil or self.levelplan[key+1] == 0 then
					self.tiletype[1] = 1 --(up)
				end
				self.props = { self.tiletype[1],self.tiletype[2],self.tiletype[3],self.tiletype[4] }
				factory.create("#tile", vmath.vector3(self.xvalue, self.yvalue, 0), nil, self.props, vmath.vector3(self.tilescale ,self.tilescale ,1))
			end
		end
	end