Raised This Month: $40 Target: $400
 10% 

TOGs SourcePawn Syntax Converter [MS Excel Based for now]


Post New Thread Reply   
 
Thread Tools Display Modes
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 05-04-2018 , 14:14   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #51

Quote:
Originally Posted by Silvers View Post
Well after seeing that Python script I'm embarrassed to post mine, but then again I tried the python converter on some of my sourcepawn scripts and it broke them deleting parts etc. So mine actually works nearer 99% even though it's not optimized and you could say terrible. I put 73k .sp lines through it with few problems.
I haven't had any issues with that script yet. What exact code was deleted?
__________________
Peace-Maker is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 05-04-2018 , 18:20   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #52

Quote:
Originally Posted by Peace-Maker View Post
I haven't had any issues with that script yet. What exact code was deleted?
I think this or something similar with menus:
PHP Code:
AddToTopMenu(g_hAdminMenu"sm_forcemode_menu"TopMenuObject_ItemHandle_Categoryplayer_commands"sm_forcemode_menu"ADMFLAG_GENERIC); 
It deleted TopMenuObject_Item or some equiv.
__________________
Silvers is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 05-05-2018 , 16:40   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #53

Quote:
Originally Posted by Silvers View Post
I think this or something similar with menus:
PHP Code:
AddToTopMenu(g_hAdminMenu"sm_forcemode_menu"TopMenuObject_ItemHandle_Categoryplayer_commands"sm_forcemode_menu"ADMFLAG_GENERIC); 
It deleted TopMenuObject_Item or some equiv.
That's correct though, since there are seperate AddCategory and AddItem functions on the methodmap.
__________________
Peace-Maker is offline
Dragokas
Senior Member
Join Date: Nov 2017
Location: Ukraine
Old 05-22-2018 , 08:53   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #54

Maybe, it will make life easier for somebody.

===========================================
Batch sm plugins converter to new syntax.
===========================================

Benefits: all-in-one. Simple right click => got new .sp/.smx

Copyrights:

MethodMaps converter by Peace-Maker.
New-syntax converter by ThatOneGuy (port to VB6 by SilverShot and Dragokas).
Batch Script by Dragokas.

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

Installation:

- Install Python: https://www.python.org/downloads/
- Download and unpack SourcePawn compiler for Windows (v.1.8+): https://www.sourcemod.net/downloads.php?branch=dev
- Unpack this archive.
- Edit sp_file_handler.reg to point to your compiler path.
- Apply sp_file_handler.reg by double-click.
- Edit Convert_Syntax.cmd to point "include" in correct folder path of your compiler.
- Make shortcut to file "Convert_Syntax.cmd"
- Press Win + R, enter "Shell:Sendto" and place shortcut in opened window.

Usage:

- Press right mouse click on your old-syntax .sp file => choose "Convert_Syntax".
- Wait for coverting to new syntax (stage 1).
- spcomp.exe will try to compile. If errors appear, you should manually fix them (file "plugin.sp").
- Press any key (enter).
- Wait for coverting to new methodmaps (stage 2).
- spcomp.exe will try to compile. If errors appear, you should manually fix them (file "plugin_mm.sp"):
> Usually it's wrong var. types like:
>> Handle cvar = INVALID_HANDLE; => should be: ConVar cvar;
>> Handle hMenu => should be: Menu hMenu
>> Handle hEvent => should be: Event hEvent e.t.c.

At the end, you will receive:
- plugin.sp.bak (your original file). It will not be overwritten in any situation.
- plugin.sp (after stage 1 - new syntax only)
- plugin_mm.sp (after stage 2 - new syntax + new methodmaps)
- .smx files for each stage.
Attached Files
File Type: zip Batch_Syntax_Converter.zip (51.3 KB, 30 views)
__________________
Expert of CMD/VBS/VB6. Malware analyst.
Dragokas is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 08-07-2018 , 22:45   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #55

Quote:
Originally Posted by Dragokas View Post
Maybe, it will make life easier for somebody...
Hello, can you add Typedefs convert in your script?
Old funcenum is deprecated in SM 1.10
__________________

Please comment on my profile, or I will ignore your friend request.

GitHub | Steam | WARMOD+ | Discord:Kento#2118
rogeraabbccdd is offline
Dragokas
Senior Member
Join Date: Nov 2017
Location: Ukraine
Old 08-08-2018 , 12:12   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #56

Hi, rogeraabbccdd!

My script consist of:
Quote:
Originally Posted by Dragokas
Copyrights:

MethodMaps converter by Peace-Maker.
New-syntax converter by ThatOneGuy (port to VB6 by SilverShot and Dragokas).
You have to ask them.

--
P.S. You have a misprint in your signature.
__________________
Expert of CMD/VBS/VB6. Malware analyst.

Last edited by Dragokas; 08-08-2018 at 12:13.
Dragokas is offline
disawar1
AlliedModders Donor
Join Date: Aug 2011
Location: Russian
Old 09-12-2018 , 14:11   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #57

Hi there. Here the bug report.

Before
PHP Code:
Float:vOrg[3] = {0.00.00.0}
static 
count 
After
PHP Code:
// Invalid syntax
float vOrg[3] = {0.0int 0.0int 0.0}
static 
count 
Valid syntax
PHP Code:
float vOrg[3] = {0.00.00.0}
static 
int count 
__________________
disawar1 aka raziEiL on: Sourcemod, GitHub, Bitbucket, DeviantArt
> Grokking Algorithms!
disawar1 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:27.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode