1. Post #361
    Map in a box's Avatar
    July 2009
    5,804 Posts
    Currently you can't use filename masks. So you can't do "blah/*.lua", just use say "blah/"

  2. Post #362
    jrj996's Avatar
    July 2009
    1,571 Posts
    Alright. I do pretty much the same thing in my gamemode... here is how you can loop through files and decode them from JSON:

    For this example, going to assume that you have a directoy of data/protectedzones, and they are txt files

    local files = file.Find("data/protectedzones/") -- Generates a table with the value being each file's full filename
    local data
    for _, filename in ipairs(files) do -- loop through the list of files
         data = json.Decode(file.Read(filename)) -- Just turning the information from reading the file back into a LUA table
         table.Print(data) -- This will just spit out what the newly re-assembled table looks like
    end
    
    Still getting the same errors unfortunately :/

  3. Post #363
    TheBigS's Avatar
    April 2010
    411 Posts
    Still getting the same errors unfortunately :/
    Hmm, alright then.

    For the purposes of just testing, did you create a folder in your base LuaServer folder called "data", and then create a folder inside that called "protectedzones", and then inside of that place your file(s)? Only reason I say that is because I noticed in your last few code examples you had your "Protected Zones" directory straight off of the base LuaCraft directory and I just want to rule that out as an issue for troubleshooting purposes.

    Also, maybe we should take a look at your file saving code as maybe that could be the culprit?

  4. Post #364
    jrj996's Avatar
    July 2009
    1,571 Posts
    Hmm, alright then.

    For the purposes of just testing, did you create a folder in your base LuaServer folder called "data", and then create a folder inside that called "protectedzones", and then inside of that place your file(s)? Only reason I say that is because I noticed in your last few code examples you had your "Protected Zones" directory straight off of the base LuaCraft directory and I just want to rule that out as an issue for troubleshooting purposes.

    Also, maybe we should take a look at your file saving code as maybe that could be the culprit?
    Everything I've coded so far is just for testing purposes so I can get the feel for retrieving files this way but here:

    chatcommand.Add("safe",function(pl,cmd,args)
    	if args[1] then
    		if args[3] then
    			local sf = PropertyManager("data/Protected Zones/"..table.concat(args," ",1,2)..".property")
    			sf:SetValue("Name",table.concat(args," ",1,2))
    			sf:SetValue("X",pl:GetPos().x)
    			sf:SetValue("Y",pl:GetPos().y)
    			sf:SetValue("Z",pl:GetPos().z)
    			sf:SetValue("Radius",args[3])
    		else
    			pl:Msg(color.Red,"A radius needs to be defined.")
    		end
    	else
    		pl:Msg(color.Red,"The safe zone needs a name.")
    	end
    end)
    

    I changed the directory before to troubleshoot but unfortunately it didn't change the outcome

  5. Post #365
    Map in a box's Avatar
    July 2009
    5,804 Posts
    Don't prepend it with data/

  6. Post #366
    jrj996's Avatar
    July 2009
    1,571 Posts
    Don't prepend it with data/
    I'm still extremely confused...
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  7. Post #367
    HyperVyper's Avatar
    November 2011
    355 Posts
    Is it possible to code a server to use surface.draw to draw things to a client?

    You know, this stuff?

    I'd figure that would be impossible because anybody running regular Minecraft probably wouldn't have the functionality.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 3 (list)

  8. Post #368
    Noi
    Purrr ~
    Noi's Avatar
    February 2010
    560 Posts
    cam.3d2d feature soon?

  9. Post #369
    jrj996's Avatar
    July 2009
    1,571 Posts
    There's no glon functions? D: How am I supposed to encode tables into an SQL's table?

    Wait, I see the json.encode. I'm just having problems with my SQL though. It doesn't seem to like to return or set things, any help?

    	if iSQL then
    		print("Exists")
    		iSQL:Update("CREATE TABLE IF NOT EXISTS mc_db_player (name varchar(20), data text, skills text)")
    	else
    		print("lolnope")
    	end
    	
    		local que = iSQL:Query("SELECT * FROM mc_db_player")
    	
    hook.Add("player.connect","runsql",function(pl)
    	for k,v in pairs(que) do
    		if v.username then
    			pl.Data = {}
    			pl.Skills = {}
    			local new = iSQL:CreateQuery("UPDATE mc_db_player SET (?,?,?)")
    			new:SetString(1,pl:Name())
    			new:SetString(2,json.Encode(pl.Data))
    			new:SetString(3,json.Encode(pl.Skills))
    			new:Update()
    		else
    			print("nerp")
    		end
    	end
    	PrintTable(que)
    end)
    
    chatcommand.Add("test",function(pl,c,args)
    	iSQL:Update("DROP TABLE mc_db_player")
    end)
    

  10. Post #370

    August 2011
    20 Posts
    There's no glon functions? D: How am I supposed to encode tables into an SQL's table?

    Wait, I see the json.encode. I'm just having problems with my SQL though. It doesn't seem to like to return or set things, any help?

    	if iSQL then
    		print("Exists")
    		iSQL:Update("CREATE TABLE IF NOT EXISTS mc_db_player (name varchar(20), data text, skills text)")
    	else
    		print("lolnope")
    	end
    	
    		local que = iSQL:Query("SELECT * FROM mc_db_player")
    	
    hook.Add("player.connect","runsql",function(pl)
    	for k,v in pairs(que) do
    		if v.username then
    			pl.Data = {}
    			pl.Skills = {}
    			local new = iSQL:CreateQuery("UPDATE mc_db_player SET (?,?,?)")
    			new:SetString(1,pl:Name())
    			new:SetString(2,json.Encode(pl.Data))
    			new:SetString(3,json.Encode(pl.Skills))
    			new:Update()
    		else
    			print("nerp")
    		end
    	end
    	PrintTable(que)
    end)
    
    chatcommand.Add("test",function(pl,c,args)
    	iSQL:Update("DROP TABLE mc_db_player")
    end)
    
    SQL Queries are now threaded.

    iSQL:Query( "SELECT * FROM mc_db_playe", function( results )
    table.Print( results )
    end )
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Winner Winner x 2 (list)

  11. Post #371
    jrj996's Avatar
    July 2009
    1,571 Posts
    SQL Queries are now threaded.
    Awesome, just what we needed!

    I'm glad this didn't die out.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  12. Post #372

    August 2011
    20 Posts
    I never die out....
    I'm currently working on a Minigames Server in LuaCraft.
    http://www.kingsofminecraft.com/boar...o-fever.12858/

    The currently WIP Sever runs on:
    198.100.146.146:25576


    I'm using my own Plugin Framework for this:
    http://forum.luacraft.com/index.php/...sg733.html#new

    Because this helps me very much developing the server.
    I've made almost all Basic Functions yet, currently working on an automatic Spleef System.
    Some private plugins I'm using for this:
    BanZ, CreeperBunDem(Creepers ignite entities around them instead of destroying blocks), EssentialZ (Most basic commands), FrettaZ (The plugin that's containing all the minigame functions), RodZ (Something like WorldEdit, but with some other features), RedZ (Additional Redstone Function (Wireless, etc.)/Bugged cause of a Block():Power() bug from LuaCraft)
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Winner Winner x 1 (list)

  13. Post #373
    jrj996's Avatar
    July 2009
    1,571 Posts
    I can't connect to yours or my server, is it because of the new update?

  14. Post #374

    August 2011
    20 Posts
    Think so, but if you use the newest LuaCraft Client you should definetely be able to join.
    Reply With Quote Edit / Delete Reply Windows 8 Germany Show Events Informative Informative x 1 (list)

  15. Post #375
    jrj996's Avatar
    July 2009
    1,571 Posts
    also am I doing this right? I'm not getting any messages or anything.

    
    hook.Add("player.connect","runsql",function(pl)
    	pl.Data = {}
    	pl.Skills = {}
    
    	iSQL:Query("SELECT * FROM player WHERE id='"..pl:Name().."'",function(results)
    		if results[1][2] && results[1][3] then
    			pl.Data = results[1][2]
    			pl.Skills = results[1][3]
    			print("Player has connected before.")
    		else
    			iSQL:Query("INSERT INTO player (id, data, skills) VALUES ('"..pl:Name().."','"..von.serialize(pl.Data).."','"..von.serialize(pl.Skills).."')")
    			print("Player has never connected, creating new file...")
    		end
    	end)
    	return true
    end)
    

    MySQL Workbench isn't showing any updates either...

  16. Post #376

    August 2011
    20 Posts
    also am I doing this right? I'm not getting any messages or anything.

    
    hook.Add("player.connect","runsql",function(pl)
    	pl.Data = {}
    	pl.Skills = {}
    
    	iSQL:Query("SELECT * FROM player WHERE id='"..pl:Name().."'",function(results)
    		if results[1][2] && results[1][3] then
    			pl.Data = results[1][2]
    			pl.Skills = results[1][3]
    			print("Player has connected before.")
    		else
    			iSQL:Query("INSERT INTO player (id, data, skills) VALUES ('"..pl:Name().."','"..von.serialize(pl.Data).."','"..von.serialize(pl.Skills).."')")
    			print("Player has never connected, creating new file...")
    		end
    	end)
    	return true
    end)
    

    MySQL Workbench isn't showing any updates either...
    Not sure, but try CreateQuery instead of Query when you want to INSERT, DELETE or UPDATE a table.

    EDIT:
    timer.Add("Jump", 1, 13337, function() for k,v in pairs(ent.GetAll()) do v:AddVelocity(Vector(0,0,0.75)) end)
    results in: http://www.youtube.com/watch?v=a38Ma...1&feature=plcp

    :D
    Reply With Quote Edit / Delete Reply Windows 8 Germany Show Events Informative Informative x 1Dumb Dumb x 1 (list)

  17. Post #377

    April 2012
    5 Posts
    Is there any news about Luacraft 1.3.2?

  18. Post #378
    Crashty's Avatar
    January 2012
    57 Posts
    They finally decided to look for more developers

    www.luacraft.com

  19. Post #379
    jrj996's Avatar
    July 2009
    1,571 Posts
    Can someone update this? It had so much potential.

  20. Post #380
    Gold Member
    Sodisna's Avatar
    May 2007
    2,685 Posts
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 1 (list)

  21. Post #381
    Map in a box's Avatar
    July 2009
    5,804 Posts
    The project is on hiatus until we aren't as tired of minecraft. Might come back soon.

  22. Post #382

    December 2012
    5 Posts
    Awesome! this looks sick gonan try it out
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Dumb Dumb x 1 (list)

  23. Post #383

    September 2008
    137 Posts
    Ever considered putting the source code up on a public repository (i.e. github) for other people to contribute?
    Reply With Quote Edit / Delete Reply Windows 7 Norway Show Events Agree Agree x 2 (list)

  24. Post #384
    Map in a box's Avatar
    July 2009
    5,804 Posts
    It's on a repo. It'll be pointless unless the build server is restarted.