AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   TOGs SourcePawn Syntax Converter [MS Excel Based for now] (https://forums.alliedmods.net/showthread.php?t=290805)

Neuro Toxin 02-14-2017 02:40

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
A php site would be nice

404UserNotFound 02-14-2017 15:21

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Yes, a PHP site would indeed be wonderful. Upload source code, convert. Problem is, someone could set the site up to harvest any source code entered into it which would mean bad things for private plugins that are entered in.

headline 02-14-2017 15:27

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by abrandnewday (Post 2495279)
You can make Notepad++ plugins too. Notepad++ can also run scripts though I'm not sure what language the scripts use.

Not sure why something couldn't be made in the format of one of those two options.

I mean, online compilers probably do that anyway lol
Just keep the php site open source, and no problem

Neuro Toxin 02-14-2017 15:40

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Or use Javascript instead.

404UserNotFound 02-14-2017 16:48

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by Headline (Post 2495448)
I mean, online compilers probably do that anyway lol
Just keep the php site open source, and no problem

S'why I don't use online compilers. I keep a "clean" (unmodified) SourceMod install in a folder with new syntax-updated versions of many includes from these forums (updated by me, added for compatibility so I can compile things with custom includes) that I use for compiling my own plugins. Drag and drop the .sp file on compile.exe for a "test" compile so I can check for errors (because compile.exe's console window stays up). If I know something is fine, I'll drop it onto spcomp.exe for a speedy compile with no console window just to generate the .smx file in the same folder (another nice benefit, doesn't put them in /scripting/compiled).

ThatOneGuy 02-15-2017 09:09

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by abrandnewday (Post 2495462)
S'why I don't use online compilers. I keep a "clean" (unmodified) SourceMod install in a folder with new syntax-updated versions of many includes from these forums (updated by me, added for compatibility so I can compile things with custom includes) that I use for compiling my own plugins. Drag and drop the .sp file on compile.exe for a "test" compile so I can check for errors (because compile.exe's console window stays up). If I know something is fine, I'll drop it onto spcomp.exe for a speedy compile with no console window just to generate the .smx file in the same folder (another nice benefit, doesn't put them in /scripting/compiled).

You could instead use Notepad++ to compile for you (since you already mentioned you use it). Install the NPPExec addon from the plugin manager. Follow instructions here: https://forums.alliedmods.net/showpo...&postcount=164

With NPP doing the compiling, it will stay in the NPP console and you can double click the error/warning to go straight to the line it came from. Then, map the macro to a shortcut key. So, when all is said and done, I press ctrl+shift+b to compile a script that is anywhere and the .smx will appear next to it in the same folder. Note: The includes will need to be in the include folder relative to your compiler path.

Currently, I run this script to compile:
Spoiler


I used to run a simpler script but found that on windows, pseudo mapped locations (through vsubst) seemed to add an extra slash, where it didnt for full paths. So, hence the checking for the slash at the end before adding it.

-----------------------------------------------

As far as converting the whole thing to PHP, I was planning on doing it some time, but am too busy until around April, so it likely wouldnt happen until then. As far as exporting the code for you:


When April comes around, I'll check back in on this, unless someone else beats me to it. Perhaps we can get a github repo going with a PHP or java version created.

404UserNotFound 02-15-2017 11:51

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by ThatOneGuy (Post 2495578)
You could instead use Notepad++ to compile for you (since you already mentioned you use it). Install the NPPExec addon from the plugin manager. Follow instructions here: https://forums.alliedmods.net/showpo...&postcount=164

With NPP doing the compiling, it will stay in the NPP console and you can double click the error/warning to go straight to the line it came from. Then, map the macro to a shortcut key. So, when all is said and done, I press ctrl+shift+b to compile a script that is anywhere and the .smx will appear next to it in the same folder. Note: The includes will need to be in the include folder relative to your compiler path.

Currently, I run this script to compile:
Spoiler

So do I except I modified mine ages ago and shrunk it down after removing useless shit. Should've noted that drag & drop was my OLD method until I started using that script about....fuck I forget when, it's been a while.
Spoiler

ThatOneGuy 02-15-2017 20:58

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by abrandnewday (Post 2495606)
So do I except I modified mine ages ago and shrunk it down after removing useless shit. Should've noted that drag & drop was my OLD method until I started using that script about....fuck I forget when, it's been a while.

Yup...that is what mine looked like until recently when my vsubst drives were causing the path to have a double / near the end if in root mapped folder of the vsubst "drive". For 98% of users out there, the shorter version is all that is needed.

nergal 05-13-2017 20:22

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
why not just a transcompiler written in Python?

ThatOneGuy 05-13-2017 20:51

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by nergal (Post 2520376)
why not just a transcompiler written in Python?

Firstly because I didnt know VBA -> Python translators exist (though I just looked and there is one). Secondly, because I have only learned basic python and have issues getting the proper tools set up to even utilize python. Also, then I assume you couldnt make a web based program for converting? Good idea though...would you be willing to take that on? I found this one here: http://vb2py.sourceforge.net/


All times are GMT -4. The time now is 19:45.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.