[FilterScript] [FS]Script Debug
#1

[FS]Script Debug
By =>Sandra<=

What is it:

This filterscript counts all Pawn-functions which are used in a (part) of a script and its counts also the number of brackets and defines.
The original idea is from 'Kaisersouse' requesting in =>THIS<= topic.
Originally he wanted it made in VisualBasics (or php) but because i don't know how Visual Basics or php works, i created it in Pawno :P


Anyway,

How to install and use:
  • Download the filterscript (links are at the bottom of this post).
  • Put the .pwn and .amx files in your 'filterscripts'-folder
  • Place the file "ScriptDebug.txt" into your 'scriptfiles'folder
  • Open your 'server.cfg'
  • Add 'ScriptDebug' after 'filterscripts' and save the file.
  • Now copy a (part of) a script you want to debug and paste it inside the 'ScriptDebug.txt'-file
    • Start your server
    • Type /debug in the console to start debugging.
    Note: This debugging takes a lot of time. It takes about 14 seconds for every 100 lines!

    If you want some more info about 1 single function used in the script, type in the console:
    Quote:

    /searchfunction [function]

    for example:
    Quote:

    /searchfunction SendClientMessage

    .

    This will show:
    • How many times this function is used in the script
    • On which lines you can find this function.
    Screenshots:

    As example i debugged the default "Area51"- gamemode.

    /debug command:


    /searchfunction command:


    If the number of opening-brackets and closing-brackets does not match, you'll get a warning:



    Download:Note: If you download it from pastebin, don't forget to create a new file into your scriptfiles-folder named "ScriptDebug.txt"

    Please don't remove the credits!

    =>Sandra<=
Reply
#2

Great work Sandra!
Reply
#3

great work!
Reply
#4

Awesome! Thank you!

And the name is KaiserSouse
Reply
#5

wow Very Useful for me =)
Reply
#6

PS I'm "testing" it with 15470 lines haha...
Reply
#7

A word of warning expect CPU usage to reach 100%, so only use it on your pc.
4233 Took about 5 minutes

This is really good, however pointless (unless you've got some reasons for using it)

btw "strmid" appears twice.
Reply
#8

Freaking awesome! Nice work!
Reply
#9

Quote:
Originally Posted by kaisersouse
Awesome! Thank you!

And the name is KaiserSouse
Sorry :P

Quote:
Originally Posted by LethaL
btw "strmid" appears twice.
Thank you for noticing.
Fixed and links are updated.
Reply
#10

realy nice ,what am i talking about all your scripts are awesome

Onyx
Reply
#11

only took about 10 minutes to complete. I'm posting the output below as an example. My question is....is the error about mismatched number of brackets correct? I would think the script wouldn't even compile if that was the case.


| ScriptDebug by =>Sandra<= |
| Debug Results: |
| __________________________________________________ _____________|
| Total Lines: 15470 |
| Total Opening brackets: 1414 |
| Total Closing brackets: 1412 |
| Total Defines: 122 |
| __________________________________________________ _____________|
| Warning: The amount of opening brackets and closing brackets |
| does not match! |
| __________________________________________________ _____________|
| |
| PawnFunctions: Times Used: |
|_________________________________________________ _______________|
AddMenuItem 214x
AddStaticVehicle 394x
AddVehicleComponent 246x
AllowAdminTeleport 1x
AllowInteriorWeapons 1x
AllowPlayerTeleport 2x
ApplyAnimation 2x
atan 1x
AttachObjectToPlayer 2x
Ban 2x
BanEx 1x
ChangeVehicleColor 2x
ChangeVehiclePaintJob 29x
ClearAnimations 1x
CreateExplosion 32x
CreateMenu 29x
CreateObject 31x
CreatePickup 89x
CreateVehicle 18x
DestroyMenu 24x
DestroyObject 11x
DestroyPickup 1x
DestroyVehicle 6x
DisablePlayerRaceCheckpoint 10x
EnableStuntBonusForPlayer 1x
EnableTirePopping 1x
fclose 5x
fopen 6x
fread 12x
fremove 2x
fwrite 8x
format 180x
GameModeExit 1x
GameTextForAll 1x
GameTextForPlayer 46x
GangZoneCreate 3x
GangZoneFlashForPlayer 4x
GangZoneShowForPlayer 3x
GangZoneStopFlashForPlayer 1x
GetObjectPos 2x
GetPlayerArmour 1x
GetPlayerFacingAngle 3x
GetPlayerHealth 3x
GetPlayerInterior 8x
GetPlayerMenu 4x
GetPlayerMoney 6x
GetPlayerName 42x
GetPlayerPos 33x
GetPlayerPos 33x
GetPlayerSkin 3x
GetPlayerSpecialAction 1x
GetPlayerState 3x
GetPlayerVehicleID 1x
GetPlayerVirtualWorld 3x
GetPlayerWantedLevel 2x
GetPlayerWeapon 3x
GetVehicleHealth 2x
GetVehicleModel 5x
GetVehiclePos 7x
GetVehicleZAngle 4x
GivePlayerMoney 26x
GivePlayerWeapon 63x
HideMenuForPlayer 6x
IsPlayerAdmin 1x
IsPlayerConnected 69x
IsPlayerInAnyVehicle 6x
IsValidMenu 4x
Kick 9x
LimitGlobalChatRadius 1x
LinkVehicleToInterior 11x
MoveObject 9x
PlayerPlaySound 3x
PlayerSpectatePlayer 2x
PlayerSpectateVehicle 2x
print 45x
printf 65x
PutPlayerInVehicle 4x
random 41x
RemovePlayerFromVehicle 63x
RemovePlayerMapIcon 2x
ResetPlayerMoney 4x
ResetPlayerWeapons 15x
SendClientMessage 771x
SendClientMessageToAll 77x
SendDeathMessage 1x
SetCameraBehindPlayer 65x
SetGameModeText 1x
SetGravity 5x
SetMenuColumnHeader 18x
SetObjectRot 8x
SetPlayerArmour 10x
SetPlayerCameraLookAt 1x
SetPlayerCameraPos 1x
SetPlayerColor 5x
SetPlayerDisabledWeapons 1x
SetPlayerFacingAngle 68x
SetPlayerHealth 10x
SetPlayerInterior 140x
SetPlayerMapIcon 6x
SetPlayerPos 150x
SetPlayerRaceCheckpoint 8x
SetPlayerScore 2x
SetPlayerSkin 6x
SetPlayerSpecialAction 1x
SetPlayerTime 4x
SetPlayerWantedLevel 1x
SetPlayerWeather 2x
SetPlayerWorldBounds 11x
SetSpawnInfo 6x
SetTimer 22x
SetTimerEx 11x
SetVehicleHealth 6x
SetVehicleParamsForPlayer 7x
SetVehiclePos 69x
SetVehicleToRespawn 2x
SetVehicleVirtualWorld 1x
SetVehicleZAngle 19x
SetWorldTime 3x
ShowMenuForPlayer 62x
ShowNameTags 1x
ShowPlayerMarkers 1x
strcmp 10x
strlen 36x
strmid 1x
strval 55x
strfind 1x
strmid 1x
TextDrawAlignment 1x
TextDrawCreate 1x
TextDrawDestroy 1x
TextDrawFont 1x
TextDrawHideForPlayer 3x
TextDrawSetOutline 1x
TogglePlayerClock 1x
TogglePlayerControllable 34x
UsePlayerPedAnims 1x
| __________________________________________________ _____________|
| Debugging Done! |
__________________________________________________ ______________
Reply
#12

Quote:
Originally Posted by kaisersouse
only took about 10 minutes to complete. I'm posting the output below as an example. My question is....is the error about mismatched number of brackets correct? I would think the script wouldn't even compile if that was the case.
Maybe you use (in this case 2) closing brackets inside 1 or multiple strings??

Reply
#13

Yes i tested with
Код:
format(string, sizeof(string), "Brackets }}}}}}}}}}}}}}}} ");
Reply
#14

Quote:
Originally Posted by =>Sandra<=
Quote:
Originally Posted by kaisersouse
only took about 10 minutes to complete. I'm posting the output below as an example. My question is....is the error about mismatched number of brackets correct? I would think the script wouldn't even compile if that was the case.
Maybe you use (in this case 2) closing brackets inside 1 or multiple strings??

I avoid that completely. I'll check the script manually but if its a bug in the FS I'm going to scream :P

Kidding. I have a feeling if the brackets were an issue PAWN would yell at me about it.
Reply
#15

Anyone up for debugging PEN1 or Godfather? =P

WeeDarr
Reply
#16

awsome work sandra as always...
im going to try it with my gamemode
you rock
Reply
#17

It's while you call the native functions of the IRC Plugin but where is the native?
The VM can't find the native functions and give up an rte!
Reply
#18

It's cool but too slow
Reply
#19

Very nice Sandra, I will use it
Reply
#20

Wow! Amazing!

Very nice. Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)