I asked GPT-3 to write AutoHotkey scripts for me. These are it's scripts.
Posted: 26 May 2022, 07:55
The following are some scripts OpenAI's text-DaVinci-002 GPT-3 engine generated upon given English inputs. This engine is fascinating. Doesn't quite get it right all the time, but it wasn't ever specifically trained in AutoHotkey. It learned this all on it's own from browsing the internet. It knows Python much better. Can we get this as a plugin on the Ask For Help forum? :3 It seems like a fantastic auto GUI generator
Human: Can you please write me an AutoHotkey script that displays the text "Hello world!" to the user?
AI:
Human: Would you please write me an AutoHotkey script that creates a GUI that covers the entire screen with the color black?
AI:
Human: Would you please write me an AutoHotkey script that checks if a string is a palindrome? (This response didn't work, the AI used a function that doesn't exist and never declared it itself)
AI:
Human: Can you write me an AutoHotkey script that creates a GUI for the user to input their paycheck amount, tax rates, and hours worked to calculate their wages? (This one is just sloppy understanding of the syntax. I also think the output limit was limiting it from being able to write a whole script. The platform I'm using only has so many characters you can input and output.
AI:
Human: Can you please write me an AutoHotkey function that converts decimal to binary?
AI:
This function converts decimal to binary: ;(The AI actually said this line this time for some reason)
Human: Can you please write me an AutoHotkey script that displays the text "Hello world!" to the user?
AI:
Code: Select all
MsgBox % "Hello world!"
AI:
Code: Select all
#SingleInstance, force
Gui, 1: -Caption +AlwaysOnTop
Gui, 1: Color, 000000
Gui, 1: +Resize
Gui, 1: Show, w%A_ScreenWidth% h%A_ScreenHeight%
return
AI:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
StringIsPalindrome(string){
loop, Parse, string
if (A_LoopField != StrReversed(A_LoopField))
return 0
return 1
}
MsgBox, % StringIsPalindrome("racecar") ? "It's a palindrome!" : "It's not a palindrome."
AI:
Code: Select all
#NoEnv
Gui, Add, Text, x10 y10 w100 h30, Enter pay:
Gui, Add, Edit, x110 y10 w100 h30,
Gui, Add, Text, x10 y40 w100 h30, Enter tax rates:
Gui, Add, Edit, x110 y40 w100 h30,
Gui, Add, Text, x10 y70 w100 h30, Enter hours worked:
Gui, Add, Edit, x110 y70 w100 h30,
Gui, Add, Button, x10 y100 w100 h30, Calculate, gButtonCalc
ButtonCalc:
Gui, Submit, NoHide
pay := GuiControlGet, pay, Edit1
taxrates := GuiControlGet, taxrates, Edit2
hoursworked := GuiControlGet, hoursworked, Edit3
wages := (pay - (taxrates * pay)) * hoursworked
Gui, Add, Text, x10 y130 w100 h30, Your wages are:
Gui, Add, Text, x110 y130 w100 h30, %wages%
Gui, Show, w200 h160, Wage Calculator
AI:
This function converts decimal to binary: ;(The AI actually said this line this time for some reason)
Code: Select all
ToBinary(decimal)
{
if (decimal <= 0)
return "0";
binary = "";
while (decimal > 0)
{
binary = (decimal % 2).ToString() + binary;
decimal = decimal / 2;
}
return binary;
}