StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Rob  
#1 Posted : Friday, May 31, 2019 12:52:50 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,357
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 418 time(s) in 356 post(s)
If you're having difficulty with a script or finding values of objects within the script, you can enable debugging to be able to examine and step through your script's code.

To start, you must enable V8 script debugging: Options > Advanced > Enable V8 Script Debugging*
(you must restart S+.net after turning on this option!)

You can use any JavaScript debugger that supports connecting to the V8 engine like Visual Studio Code (see here on how to configure VS Code: https://microsoft.github.io/ClearScript/Details/Build.html).

But it's much easier to use Chrome by navigating to: chrome://inspect/#devices

Make sure the Settings window is closed, then go to chrome://inspect/#devices since reloading the scripts engines can sometimes disconnect the Chrome debugger.

Wait few seconds (sometimes up to 10 seconds) for the list to show, you should then see a Remote Target list with StrokesPlus.net.exe, click the inspect link.

This will open a dev tools window; note that since each script is loaded and executed dynamically, you won't see much or anything until a script is executed.

In the script you want to debug, add this line where you want to invoke debugging:
Code:
debugger;

Then execute your action, once that debugger; line is hit in your script, the debugger will show you the script and let you debug.

From there you can browse the action object, for example, and generally just walk step by step through the script to troubleshoot any issues you're having.

You can also go to the Console tab and execute script commands directly. I haven't spent a lot of time using this, but there is a lot one could do!

In the context dropdown, the items listed are the script engines. E0 is the first, E1 would be the second, etc. This generally isn't something which you'll need to worry about, but if you were debugging a script which also had a timer script running, it might show up under the context of a different script engine since you're debugging the first one.

Chrome Dev Tools

Edited by user Wednesday, October 14, 2020 8:08:59 PM(UTC)  | Reason: Not specified

thanks 2 users thanked Rob for this useful post.
Luis Cisneros on 1/5/2021(UTC), niczoom on 2/11/2021(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.