flipper-zero-tutorials/js/ai
2024-06-26 11:32:13 -05:00
..
intro.txt ChatGPT training for JavaScript 2024-06-26 11:32:13 -05:00
readme.md ChatGPT training for JavaScript 2024-06-26 11:32:13 -05:00
train2.js ChatGPT training for JavaScript 2024-06-26 11:32:13 -05:00
train3.js ChatGPT training for JavaScript 2024-06-26 11:32:13 -05:00
train.js ChatGPT training for JavaScript 2024-06-26 11:32:13 -05:00

AI for JavaScript

Overview

This project was tested with ChatGPT-4o. The goal of this project is to use AI to generate JavaScript that runs on the Flipper Zero; without requiring the user to be familiar with JavaScript programming.

Directions

  • Step 1. Open Chatgpt.com and make sure you have ChatGPT-4o selected.
  • Step 2. Copy the contents of intro.txt into the Message window of Chat.
  • Step 3. Drag the train*.js files into the Message window.
  • Step 4. Press Ctrl+Enter to get a blank line.
  • Step 5. Request a script to do some feature for the Flipper Zero! Be sure you request something that is in Supported Capabilities of JavaScript; or at least not in the Not Supported for the best results. Example: "Create a JavaScript program for the Flipper Zero that prints 'Hello World' on the screen."
  • Step 6. Click the Copy code button from the response.
  • Step 7. Paste the resulting script into a text file (I named my file ai.js).
  • Step 8. Copy the text file to your Flipper Zero on the SD Card at sd card/apps/Scripts.
  • Step 9. Run the script on the Flipper Zero (Apps, Scripts, yourScript.js).

Troubleshooting

If you get an error displayed on Flipper... Tell ChatGPT

I got error: <message from flipper:4>. 
Line 4 is <contents of line from js file>

Replace the stuff in angle brackets with the actual error message. The end of the error will have a : and line number (4 in this example). Replace the second line with the actual line number reported and the contents of the line (Ctrl+G goes to line in Notepad).

If program runs, but does not give expected result... Tell ChatGPT the result you got and the expected result.

Support

If you have any questions, please ask in my Flipper Zero Discord server. There are also giveaways and other fun things happening there.

Support my work: