• LuaServer
    467 replies, posted
[QUOTE=Genesis999;31235542]That'd could be because in the latest version I dont make the call to open the io.[/QUOTE] I tried it in a standalone Lua interpriter (SciTE), and it didn't work there either. Why aren't you on steam? :(
Okay. What's the best way to learn Lua? This has too many possibilities for me to ignore.
[QUOTE=Jacinth;31236615]Okay. What's the best way to learn Lua? This has too many possibilities for me to ignore.[/QUOTE] Think up something to make, and then make it. I suggest making it in Gmod or [url=http://love2d.org/]Löve[/url], since LuaServer doesn't have a lot of functionality yet. Use the [url=http://wiki.garrysmod.com/?title=Wire_Expression2]Gmod wiki[/url], the [url=http://www.lua.org/manual/5.1/]Lua reference manual[/url], or the [url=http://love2d.org/wiki/Main_Page]Löve wiki[/url] for help. EDIT: By the way, here's a Sudoku I made in Löve, if you'd like to take a look: [url=http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Sudoku]http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Sudoku[/url] To look at the code, simply copy the .love file, rename it to .zip, and unzip it. To try the game, download Löve and run Sudoku.love using Love.exe. EDIT: I just committed my multiple script mod to my my SVN if anyone wants to take a look [url=http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Minecraft]http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Minecraft[/url] It doesn't work yet, since I still haven't found a way to find all Lua files in a folder, unless The-Stone can come back and help me, but it does have several useful functions which anyone is welcome to use.
[QUOTE=Divran;31236911]Think up something to make, and then make it. I suggest making it in Gmod or [url=http://love2d.org/]Löve[/url], since LuaServer doesn't have a lot of functionality yet. Use the [url=http://wiki.garrysmod.com/?title=Wire_Expression2]Gmod wiki[/url], the [url=http://www.lua.org/manual/5.1/]Lua reference manual[/url], or the [url=http://love2d.org/wiki/Main_Page]Löve wiki[/url] for help. EDIT: By the way, here's a Sudoku I made in Löve, if you'd like to take a look: [url=http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Sudoku]http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Sudoku[/url] To look at the code, simply copy the .love file, rename it to .zip, and unzip it. To try the game, download Löve and run Sudoku.love using Love.exe. EDIT: I just committed my multiple script mod to my my SVN if anyone wants to take a look [url=http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Minecraft]http://divranspack.googlecode.com/svn/trunk/ divranspack/Non Gmod Things/Minecraft[/url] It doesn't work yet, since I still haven't found a way to find all Lua files in a folder, unless The-Stone can come back and help me, but it does have several useful functions which anyone is welcome to use.[/QUOTE] Very helpful! Thank you. Hopefully by the time LuaServer is really mainstream I'll be able to do something with it.
[QUOTE=Divran;31230989]Thanks, but that doesn't work. io.popen returns nil no matter what file path I give it.[/QUOTE] Yeah too bad, but probably due to what Genesis said. I'm currently not able to test it either since I'm not at home for the next three days but after that I'll put some time into this :)
You have to make it work on 64bit computers. Many Minecrafters have 64bit computers, including me, and they want to blow their brains when they have made great stuff with LuaServer. PS: Im Backplague on Minecraft Forums.
Is this the error you're all getting on 64bit? [code][SEVERE] Unexpected exception java.lang.NoSuchMethodError: lq.d(DDD)D at ff.a(SourceFile:87) at nl.a(SourceFile:93) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:404) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:303) at bq.run(SourceFile:422) [/code]
[QUOTE=Divran;31247328]Is this the error you're all getting on 64bit? [code][SEVERE] Unexpected exception java.lang.NoSuchMethodError: lq.d(DDD)D at ff.a(SourceFile:87) at nl.a(SourceFile:93) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:404) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:303) at bq.run(SourceFile:422) [/code][/QUOTE] Im getting this: [code][SEVERE] Unexpected exception java.lang.UnsatisfiedLinkError: C:\Users\S\Desktop\LuaServer\luajava-1.1.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at org.keplerproject.luajava.LuaState.<clinit>(LuaState.java:1029) at org.keplerproject.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:23) at lua.LuaManager.InitLuaState(LuaManager.java:106) at net.minecraft.server.MinecraftServer.startLua(MinecraftServer.java:70) at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:148) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:274) at bq.run(SourceFile:422)[/code]
[QUOTE=Funley;31247997]Im getting this: [code][SEVERE] Unexpected exception java.lang.UnsatisfiedLinkError: C:\Users\S\Desktop\LuaServer\luajava-1.1.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at org.keplerproject.luajava.LuaState.<clinit>(LuaState.java:1029) at org.keplerproject.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:23) at lua.LuaManager.InitLuaState(LuaManager.java:106) at net.minecraft.server.MinecraftServer.startLua(MinecraftServer.java:70) at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:148) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:274) at bq.run(SourceFile:422)[/code][/QUOTE] Once I get home from working today ( which should be kn about 6ish hours ) I'll have another crack at recompiling the dll for 64 bit, change the parameters in the new command hook and if all goes well upload a new version.
[QUOTE=Genesis999;31257489]Once I get home from working today ( which should be kn about 6ish hours ) I'll have another crack at recompiling the dll for 64 bit, change the parameters in the new command hook and if all goes well upload a new version.[/QUOTE] :D
You might want to extend the hours until Saturday cause I ended up going out drinking with friends. :}
[QUOTE=Genesis999;31265321]You might want to extend the hours until Saturday cause I ended up going out drinking with friends. :}[/QUOTE] D: Well, im going off for the night so im home at Sunday again :) PS: I just got Fraps and i could make a tutorial on how to use the LuaServer, ok?
[QUOTE=Funley;31265760]PS: I just got Fraps and i could make a tutorial on how to use the LuaServer, ok?[/QUOTE] It's probably going to change a lot in the near future, so you'd have to remake the tutorial several times.
[QUOTE=Divran;31265834]It's probably going to change a lot in the near future, so you'd have to remake the tutorial several times.[/QUOTE] Meh.
Are you gonna put the 64bit out already?
Can someone tell me why this doesn't work? [lua] function OnScriptStart() Server.RegisterCommand("/i", "GiveItems", "GenericScript") end function GiveItems(Command) local Player = Server.GetPlayer(Command:GetUser()) Command:GetUser():GetInventory():AddItem(Command:GetArgument(1), Command:GetArgument(2)) PrintToChat("Gave ".. Player.GetUsername() ..", ".. Command:GetArgument(2).. " Of ".. Command:GetArgument(1), 11, Command:GetUser()) end [/lua]
[QUOTE=Jessecar96;31322297]Can someone tell me why this doesn't work? [lua] function OnScriptStart() Server.RegisterCommand("/i", "GiveItems", "GenericScript") end function GiveItems(Command) local Player = Server.GetPlayer(Command:GetUser()) Command:GetUser():GetInventory():AddItem(Command:GetArgument(1), Command:GetArgument(2)) PrintToChat("Gave ".. Player.GetUsername() ..", ".. Command:GetArgument(2).. " Of ".. Command:GetArgument(1), 11, Command:GetUser()) end [/lua][/QUOTE] <code>local Player = Server.GetPlayer(Command:GetUser())</code> that function takes a string but your passing it a player object. <code>PrintToChat("Gave ".. Player.GetUsername()</code> And there you are treating the player object as a table when it is a class just like the command object and should use : instead of .
[QUOTE=Genesis999;31322489][lua]local Player = Server.GetPlayer(Command:GetUser())[/lua] that function takes a string but your passing it a player object. [lua]PrintToChat("Gave ".. Player.GetUsername()[/lua] And there you are treating the player object as a table when it is a class just like the command object and should use : instead of .[/QUOTE] A class is a table, the first argument is just not present when calling it like he did.
Whats the progress with 64bit version? Im really eager to get it and make cool stuff. Im sorry for being so impatient, but this is just so sweet! I cant wait to get this!
Still waiting... PS: The Save button on editing doesnt work. Otherwise i would have edited my last post.
And one more thing. Since the editing doesnt work, i have to make a new post :/ So. When i try to go to the wiki, it doesnt let me in and says "OlympusGaming wiki has a problem." and underneath is this "Can't contact the database server: Access denied for user 'wikiuser'@'localhost' (using password: YES) (localhost)" Just thought id say that. Sorry for all this spam.
I was saving this for when Genesis logs on to steam, but since he never logs on at the same time as me (He's from Australia, I'm from Sweden...) I guess I'll say it here anyway: I'm currently making Lua for Bukkit. It's completely separate from Genesis', although he did inspire me :) And no, Genesis, I did not use any of your code. I wrote it all myself. You are welcome to use ANY of my code, though. :) Just ask. So far I only have basics done: Loading lua files, and a hook system. Still to do is making player, mob, block classes and my own custom file library (I have an epic idea for the file library, by the way :)) Oh and I'm using something called LuaJ, instead of the thing Genesis is using which is called LuaJava. The difference is that LuaJava has a dll that parses the Lua code and some Java code to help you communicate with the dll. It was easy to add classes, but not the kind I want (where you can save variables to it as though it's a table, aka Gmod style), which was nearly completely impossible. LuaJ is pure Java, and so far, it's much easier to use. Might be a little slower, I don't know, but I think it'll work fine for this. And hopefully it's easier to make Gmod style classes.
Sorry for me being such a dumbass, but why is bukkit so popular? Its just a server mod after all, but whats so cool in it?
[QUOTE=Funley;31348244]Sorry for me being such a dumbass, but why is bukkit so popular? Its just a server mod after all, but whats so cool in it?[/QUOTE] It allows you to have as many mods as you want on your server at the same time with no risk of the mods colliding or overwriting each other. Without Bukkit, you have to manually open the server's .jar file and put the mod inside of it, meaning if two mods modify the same file, the last one you copy in will erase the first. With Bukkit, each mod is in its own jar file in a separate folder next to the server's jar file.
[QUOTE=Divran;31351924]It allows you to have as many mods as you want on your server at the same time with no risk of the mods colliding or overwriting each other. Without Bukkit, you have to manually open the server's .jar file and put the mod inside of it, meaning if two mods modify the same file, the last one you copy in will erase the first. With Bukkit, each mod is in its own jar file in a separate folder next to the server's jar file.[/QUOTE] Oh wow thats great! I first thought it was just some lame server admin mod, but this, wow!
It's funny you should mention luaj divan cause the reason I've not updated with anything yet is because I'm reworking luaserver to use that. I've also decided to make it easier I'm going to start supplying the modified jar to make it easier for people.
[QUOTE=Genesis999;31354848]It's funny you should mention luaj divan cause the reason I've not updated with anything yet is because I'm reworking luaserver to use that. I've also decided to make it easier I'm going to start supplying the modified jar to make it easier for people.[/QUOTE] So, is it ok for me to make more or less the same thing as you for Bukkit, then? I'm pretty sure having the mod for Bukkit will be more popular, so not many people will use yours... :( It's too bad we're almost never online at the same time, otherwise we could work together on the Bukkit one. But if you want my source code to make development using LuaJ much easier, just ask the next time we ARE online at the same time. It took me a few days to figure out how to use it :) Maybe we could share source codes and use the best of each in both our projects? That way, we can work together even though we almost never talk :V
Why don't you guys work together, that'd make stuff seem a lot easier on both ends. Even if you're in other time-zones make some type of list to do shat. [sp]I'm sensing rivalry that's why I'm saying this :V [/sp]
I'm definitely gonna test this out.
Either Genesis or Divran, both will be super awesome when they release a LuaServer that works with 64bit computers.
Sorry, you need to Log In to post a reply to this thread.