PDA

View Full Version : [Release]VB SCAR dynamic commenter[/release]



botmaster
04-03-2007, 08:44 PM
SCAR Commenter v 1.0

This is a simple application designed to dynamically generate comment blocks in SCAR for all those too lazy to do it manually for themselves :D. Originally, I planned on scripting this in SCAR, but apparently SCAR's string functions can't handle the ammount of stress this script would place on it - I tried, and it compiled the SCAR script but SCAR crashed/hung up/killed itself after running it. For more info regarding the "script that crashes SCAR", refer to http://www.villavu.com/forum/showthread.php?t=7987.

So, I decided to port the entire script to VB - with success. At first I couldn't believe how similar VB and SCAR's functions were (well, after "remodelling" some of SCAR's string functions in VB). But in all, it took me less than 30 minutes to port the entire script. Just a matter of "find/replace".

Features:


You can dynamically create comment blocks after a predefined template
You can add your own custom terms of use to the script header
You can add a credits section after the script
Both of the above work by taking their info from files
You can specify wether or not you want to run the TOU/Credits through the commenting engine or just "add them" as is
Special "tags" - more explained below


The header/footer files that you can add can contain specific metadata tags that will be replaced with info taken from the script, for example <scriptname> inserts the name of the script. This can be useful if you want to reuse the files for different scripts but you don't want to edit them over and over. Valid tags to far are <scriptname> and <scriptauthor>. I might add more in later versions (date, time, version, something like that).

Known bugs:

Runtime error if you leave one of the fields blank. Workaround: put in a carriage return.
Runtime error if you specify a nonexistent file or check the option of adding credits/license and leave the file field blank
So far, only errors of the user (runtimes not caused by programatic logic)


I hope this script will be useful to you. If you want the source, please pm me.

EDIT: Nvm about the sources. I f*cked up while reformatting and lost it all. NOOOOO!!!

Smartzkid
04-03-2007, 09:02 PM
*gasp*

Pretty cool, I like it!

EDIT:
[suggestion]
You should make an option to do this to all procedures, that'd be really awesome, but it'd kinda make it more of an autoformatter than a commenter...

\\\\\\hi\\\\\\\\\\\
procedure hi; \\
\\\\\\\\\\\\\\\\\\\

~alex~
04-03-2007, 09:30 PM
wahayy! Got it working in VB then :D Im gunna try this out :D

Very nice man :D good job. you should put some try and catch's in to stop those runtime error's though

botmaster
04-04-2007, 08:40 AM
What runtime errors? Can you please specify where?

The only place it could possibly give a runtime error is if you specified a header/footer file and the file doesn't exist; I think I made it so it would give you an error message before it terminated the program. After the error message, it should give you something like "Runtime error 5 - blablabla".

~alex~
04-05-2007, 07:32 AM
WEel if you leave about the script or version history blank you will get one. There was another one but I can't recreate it lol..

botmaster
05-04-2007, 11:27 AM
I lost the source while reformatting... :eek: . Now I have to make it all over again to fix the bugs. I'm too lazy though so I'll just leave it like it is unless someone knows a good vb disassembler I could use.

Freddy1990
05-07-2007, 10:51 AM
You can't decompile VB -_-

botmaster
05-07-2007, 10:57 AM
You can't decompile VB -_-

Oh f*ck... :eek:. Well, it was a pretty pointless program anyways :D.

Jason2gs
05-13-2007, 05:47 PM
Oooh...

This is cool :D

I'll definitely use this in my script :)

botmaster
08-28-2007, 10:49 AM
Hey, I found a workaround for the runtime errors. Simply enter a blank line if you want to leave a textbox blank. Thus, the "commenting engine" will register a vbCrLf character and it works.

You can later delete the extra lines in SCAR.