• Luapad - In-game scripting environment with syntax highlighting
    156 replies, posted
[B][highlight]This is an old release! The code can be messy or not as effective as it could be![/highlight][/B] This is an in-game scripting environment with dynamically updating syntax highlighting for Lua. It basically means that if the server has WireMod installed, it also highlights the WireMod functions for you. Same goes with every mod you have installed (or the server). Please note, that if the server doesn't have Luapad, you'll only have cached server-side syntax highlighting, with only some basic serverside functions. However, this doesn't affect the syntax highlighting of client-side functions. This 'script' can be used to code in-game, save the code, load it later, and most importantly: run it client-, and serverside. You can upload code in order to run it on the server, but only if the server has Luapad, and you're an admin. It currently only supports text-files inside the data-folder, because of your security. Maybe I'll add the support of direct Lua-files later, with rawio (Optional feature in v1.10). It probably has some bugs, so tell me about them and I'll try to fix them. And yes, you can code an aimbot, or a wallhack in-game. Type [I]luapad[/I] to console in order to open it. Credits go to the following persons: [B]Andreas "Syranide" Svensson[/B] for Wire Expression 2 Editor, which I heavily modified to work with Lua-syntax. [B]Narkaleptic[/B] for the VTF silk-icons used in this pack. [B]DarKSunrise (me)[/B] for scripting. [B]Levybreak[/B] for updating it (from v.1.11), as I didn't have time for this project. [B]Media:[/B] [url=http://img38.imageshack.us/img38/8199/736201.jpg][img_thumb]http://img38.imageshack.us/img38/8199/736201.jpg[/img_thumb][/url] [B]Known bugs:[/B] No syntax-highlighting for multi-line comments (I'll see if I can do these) Lua-folder has files that are not really there, but instead in addons/AddonName/lua, and therefore making them unable to load (I'm open for suggestions here) [B]Planned features:[/B] Sidebar remembering it's position Autocomplete for functions Using GZip or something to compress cache-files for syntax highlighting Customizable colors on syntax highlighting [B]Downloads:[/B] SVN: [url]http://lua-pad.googlecode.com/svn/trunk/[/url] (thanks Levybreak) garrysmod.org: [url]http://www.garrysmod.org/downloads/?a=view&id=78065[/url] [B]YOU NEED GM_RAWIO MODULE IF YOU WANT TO EDIT LUA-FILES, IT'S NOT INCLUDED FOR SECURITY REASONS[/B]
Looks cool, you should have mentioned that the Original Editor was already made half a year ago and you just customized the Layout / Editor ;) Original one: [url]http://lua-deloper-window.googlecode.com/svn/trunk[/url]
Nice. I'm also suggesting to add a clientside module in order to write to any folder in /garrysmod so you can code on everything ingame. Anyway, got my download :)
huh blurred things WHAT ARE YOU HIDING
[QUOTE=Moo;16193277]huh blurred things WHAT ARE YOU HIDING[/QUOTE] Hax! :V €dit: you forgot to [b]require("datastream")[/b] which makes the whole server-client stuff useless / unuseable :P
[QUOTE=OP]No syntax-highlighting for multi-line comments or strings (I'll see if I can do these) [/QUOTE] This was already noticed, maybe an hour ago at the earliest. Although I missed it when I first read the thread too.
I took the screenshot :v:
The first blurred out item is "clientcrash xd.txt" second one looks like "modelbox.txt" or "nudebox.txt"
[QUOTE=XelaX;16193456]The first blurred out item is "[b]clientcrash xd.txt[/b]" second one looks like "[b]modelbox.txt[/b]" or "nudebox.txt"[/QUOTE] Corrrrrrrect.
[quote=xelax;16193456]the first blurred out item is "clientcrash xd.txt" second one looks like "modelbox.txt" or "nudebox.txt"[/quote] that ape
[QUOTE=DarKSunrise;16191922] [B]Media:[/B] [url=http://img38.imageshack.us/img38/8199/736201.jpg][img_thumb]http://img38.imageshack.us/img38/8199/736201.jpg[/img_thumb][/url][/QUOTE] Excellent, I've wanted something like this for a while. Definitely include rawio support so I can modify actual scripts. Incidentally, there's an error with your code in that screenshot. :v:
[QUOTE=The-Stone;16192757]Looks cool, you should have mentioned that the Original Editor was already made half a year ago and you just customized the Layout / Editor ;) Original one: [url]http://lua-deloper-window.googlecode.com/svn/trunk[/url][/QUOTE] Honestly, I didn't even know that there were one already. And I built this completely from scratch, except for the actual editor (which was made by Syanide for WireMod, and then heavily modified by me to work with Lua-syntax). [QUOTE=The-Stone;16193391]Hax! :V €dit: you forgot to [b]require("datastream")[/b] which makes the whole server-client stuff useless / unuseable :P[/QUOTE] Ah, that was what I was missing, thanks. I'll have it fixed in the next release. [QUOTE=Lexic;16193720]Excellent, I've wanted something like this for a while. Definitely include rawio support so I can modify actual scripts. Incidentally, there's an error with your code in that screenshot. :v:[/QUOTE] Ah, yeah. That LocalPlayer() on the server-code was obviously a mistake. I'll fix that too. [QUOTE=XelaX;16193456]The first blurred out item is "clientcrash xd.txt" second one looks like "modelbox.txt" or "nudebox.txt"[/QUOTE] :ssh:
This will make HUD making 90 times easier, really cool.
Nice work DarKSunrise.
[QUOTE=aVoN;16192996]I'm also suggesting to add a clientside module in order to write to any folder in /garrysmod so you can code on everything ingame.[/QUOTE] Wouldn't that be a big security risk? Or let me ask this question, do you have any ideas on how that could be implemented but not abused by other clientside scripts?
I've added a Rawio-support to the next version, but it's fully optional and only works if you have it installed. This way you could use Rawio while coding safely in singleplayer.
So downloading right now, great job.
Nice Work, but if i Code sth. 640x480 Singleplayer winwowed and bind j gamemode_reload nvm, Good work
New version has been released. [B]Changelog:[/B] Fixed client-to-server uploading Fixed typo in the sample code Fixed not loading files with dots on the filename Fixed something else Added optional rawio-support ( you need to have the module installed in order to use ) Removed 990 useless silk-icons from the download [url=http://www.garrysmod.org/downloads/?a=view&id=73746][img]http://www.garrysmod.org/img/?t=dll&id=73746[/img][/url]
[QUOTE=foszor;16195912]Wouldn't that be a big security risk? Or let me ask this question, do you have any ideas on how that could be implemented but not abused by other clientside scripts?[/QUOTE] Yes, it would. Of course. Limiting to /garrysmod and .lua files could decrease the possibility of adding shit outside of GMod but in fact it's a security hole, yes. It should ONLY be optional, but if installed available for people to use. [editline]07:27PM[/editline] [QUOTE=DarKSunrise;16196651]I've added a Rawio-support to the next version, but it's fully optional and only works if you have it installed. This way you could use Rawio while coding safely in singleplayer.[/QUOTE] Thank you! [editline]07:39PM[/editline] Could you make the sidebar remember the last opened folder? It's annoying to scroll back to the last position everytime.
Requesting a feature where you could run the script on all current clients or a specific client. I often want to try small clientside stuff and want to know what the clients think, restarting the server is really poor way of doing that. To clarify, I (a client) send the script to server (dedicated) and the server uploads the script to client(s) and tells the client(s) to run it. EDIT: Yes, I am lazy to use lua broadcast.
[QUOTE=Python1320;16203048]Requesting a feature where you could run the script on all current clients or a specific client. I often want to try small clientside stuff and want to know what the clients think, restarting the server is really poor way of doing that. To clarify, I (a client) send the script to server (dedicated) and the server uploads the script to client(s) and tells the client(s) to run it. EDIT: Yes, I am lazy to use lua broadcast.[/QUOTE] If this is added don't forget to make it admin only :v:
[QUOTE=aVoN;16192996]Nice. I'm also suggesting to add a clientside module in order to write to any folder in /garrysmod so you can code on everything ingame.[/QUOTE] to develop, the data folder should be enough. autorun? just run them. entities? just put something like that into your entities: RunString(file.Read("dev/lua/entities/your_entity/init.lua")) then have your actual entity under gmod/data/dev/lua/entities/your_entity
Nice :3:
Err... my question is how? I thought you could only read and write text files, not lua files.
[QUOTE=aVoN;16202415]Could you make the sidebar remember the last opened folder? It's annoying to scroll back to the last position everytime.[/QUOTE] I'll see if I can have this done on the next version. [QUOTE=Python1320;16203048]Requesting a feature where you could run the script on all current clients or a specific client. I often want to try small clientside stuff and want to know what the clients think, restarting the server is really poor way of doing that. To clarify, I (a client) send the script to server (dedicated) and the server uploads the script to client(s) and tells the client(s) to run it. EDIT: Yes, I am lazy to use lua broadcast.[/QUOTE] I'll see if I can get this done, shouldn't be too hard. [QUOTE=Entoros;16212791]Err... my question is how? I thought you could only read and write text files, not lua files.[/QUOTE] Nothing stops you from coding Lua in text-files. And now with this optional rawio-support: if you have the module (gm_rawio) installed, you can also load, and save Lua-files.
if you don't have rawio installed, you can't save. Also, there are a lot of vgui/DTree_Node.lua:441: attempt to call method 'FilePopulateCallback' (a nil value) errors.
Very cool addon! Certainly useful.
How is this different than lua developer over at wiremod?
[QUOTE=Lexic;16217821]if you don't have rawio installed, you can't save. Also, there are a lot of vgui/DTree_Node.lua:441: attempt to call method 'FilePopulateCallback' (a nil value) errors.[/QUOTE] Do you get any errors when trying to save? What does it say on the statusbar?
Sorry, you need to Log In to post a reply to this thread.