wc3edit.net
https://forum.wc3edit.net/

Return Bug Finder
http://forum.wc3edit.net/useful-tools-f69/return-bug-finder-t20911.html
Page 1 of 5

Author:  owner123 [ April 12th, 2011, 3:42 am ]
Post subject:  Return Bug Finder

Just a tool I made.
It finds if there are 2 consecutive returns in a script, and if there are, gives you the line number. (You still must fix it yourself. For instructions on how refer to this: viewtopic.php?f=64&p=142909#p142909)
You have to use it on the script, not the warcraft map file.
This has been extremely useful to me when finding return bugs. Hope it helps.
If you want the source, pm me.

Just use the browse button to fill in the path to the code you want checked, and press the check button.

2.0 updates:
-There is now a window to open the .j file and edit it via there. This saves you having to JASSCraft the map to fix it.
-You can now open .w3x files to check.
-You now need MPQLib.dll in the folder where the application is.
-Stealers suggestion has been implemented - the errors now show in a listbox, not in messageboxes. (Comments will be ignored later.)
-w3e won't let me upload .dlls, so I packed it into a .zip.

Spoiler:
Attachment:
Return Bug Checker.exe

Attachment:
Return Bug Checker.exe

Attachment:
Return Bug Checker 2.0.zip





Unzip with 7Zip.

Author:  Vegas [ April 12th, 2011, 6:09 am ]
Post subject:  Re: Return Bug Finder

Sounds like a good tool. I was looking for a tool that could check for leaks, anything on that? ;)

Author:  haxorico [ April 12th, 2011, 5:12 pm ]
Post subject:  Re: Return Bug Finder

Nice job owner :)
I was thinking about doing that + making it find errors like this:
Code:
call DisplayTextToPlayer(Player(0),0,0,"This is some text
And this is some more text"

Its on planty of hard-to-crack maps :)
Only way I found (I don't remember where I placed that damn thing) is it checks if the line doesn't start with:
call
loop
endloop
function etc....

Author:  owner123 [ April 12th, 2011, 8:43 pm ]
Post subject:  Re: Return Bug Finder

I will make this later (Unless you're planning to ofc.)
@vegas I don't really know enough about leaks. If you gave me infos I would try :)

Author:  Vegas [ April 12th, 2011, 8:53 pm ]
Post subject:  Re: Return Bug Finder

I used this program before

Leak checker
http://www.thehelper.net/forums/showthr ... eak+finder
You need an account at thehelper.net to download. (Its at the bottom of the page)


Its ok, but misses different leaks.

Author:  haxorico [ April 12th, 2011, 9:51 pm ]
Post subject:  Re: Return Bug Finder

I already have it done, some where xD... I used it long ago when I started with all my "mini misc tools" not everything was posted :P

Author:  owner123 [ April 18th, 2011, 11:32 pm ]
Post subject:  Re: Return Bug Finder

Updated..
Before it found an error if one line said "function x takes y returns z" and the next "return x". Now it doesn't.

Author:  stealer [ April 30th, 2011, 4:28 pm ]
Post subject:  Re: Return Bug Finder

If the line is commented out i think you should ignore the return error.

ex
line 756 //function Fk takes integer i returns unit
line 757 //return i
line 758 //return null
line 759 //endfunction

your program tells me "Return error at line 757 and line 758".

I don't like how it finds 1 return error and then stops, i wish it would compile them all together.



------------
How good is this method (post142909.html#p142909)
Cause i basicly copied it and the map doesn't work.

Very often the thing that it took was not its return value. also some of the functions according to jassCraft seem to not exist when i do a syntax check but if i use find it finds them.....
"Undeclared Function FJ" is what i mean by syntax check thinks they don't exist.

Same map as the one i used for the text out of line.

Author:  owner123 [ April 30th, 2011, 5:10 pm ]
Post subject:  Re: Return Bug Finder

I've used the method before, and it works.
It doesn't find 1 then stop. Example is attached, run it through that.
There might be some sort of other error if it can't find it.

I dunno about the jasscraft errors. Try de-obfuscating the script with RMPQEx first.

Author:  stealer [ May 1st, 2011, 2:37 pm ]
Post subject:  Re: Return Bug Finder

I didn't explain very well.

your program finds the first error it sees and reports it and then pauses.
when you hit the x or ok(?) it then finds the next error it sees and then pauses.
rise and repeat.

haven't tried using rmpqex yet, my internet is pretty bad as of the past week.

Page 1 of 5 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/