Thread: Chatgpt and LUA

Page 1 of 2
1
2
LastLast
  1. #1

    Chatgpt and LUA

    Quote Originally Posted by Ghorron1902 View Post
    ChatGPT doesn't know how to code (LUA or anything else), it's just a fancy chat bot. And you can't rely on any output to be correct.
    So learning with/from it is problematic to begin with.

    That's the thing, it's mostly worked thus far. I think the dropdown might be a little out of it's league though.

    That's where it seems to have the problems.

    It seems to not be propagating the list of images for the dropdown menu. I'm not sure where to put this code. So far, everything else seems to be working right now. All I'm asking is where I would put the code for this to function right.





    I need some help.

    I’ve been working with ChatGDP trying to make my own version of something like kgpanels. Right now, I’m at a stuck point.

    When we first started, I told it I wanted the addon to be able to create a frame when I pushed a button. It took a few hours, but we eventually figured it out and it was working correctly.

    Well, then I told it I wanted to add a functional dropdown menu that would allow me to place art in those created frames. Then we couldn’t get the dropdown to work.

    When we FINALLY got the dropdown to work, the button stopped working.

    Can someone help and tell me where in this code, we messed it up (I also keep getting some errors with <eof>:

    – Create the main frame and set its properties
    local f = CreateFrame(“Frame”, “Jujupopup”, UIParent)
    f:SetPoint(“CENTER”)
    f:SetSize(512, 512)

    f.tex = f:CreateTexture(nil, “BACKGROUND”)
    f.tex:SetAllPoints()
    f.tex:SetTexture(“Interface\Addons\JujuPanels\jujupopup.tga”)
    f:SetMovable(true)
    f:EnableMouse(true)
    f:RegisterForDrag(“LeftButton”)
    f:SetScript(“OnDragStart”, f.StartMoving)
    f:SetScript(“OnDragStop”, f.StopMovingOrSizing)

    – Define the function that creates a new frame
    local function CreateNewFrame()
    local newFrame = CreateFrame(“Frame”, “MyNewFrame”, UIParent)
    newFrame:SetSize(200, 200)
    newFrame:SetPoint(“CENTER”)
    newFrame.texture = newFrame:CreateTexture(nil, “BACKGROUND”)
    newFrame.texture:SetAllPoints(newFrame)
    newFrame:SetMovable(true)
    newFrame:EnableMouse(true)
    newFrame:SetScript(“OnMouseDown”, function(self, button)
    self:StartMoving()
    end)
    newFrame:SetScript(“OnMouseUp”, function(self, button)
    self:StopMovingOrSizing()
    end)
    if f.selectedSkin ~= “none” then
    skins[f.selectedSkin].func(newFrame)
    end
    end

    – Create the button and set its properties
    local button = CreateFrame(“Button”, nil, f, “UIPanelButtonTemplate”)
    button:SetPoint(“CENTER”)
    button:SetSize(128, 32)
    button:SetText(“Create new frame”)
    button:SetNormalTexture(“Interface\Addons\JujuPanels\button.tga”)
    button:SetScript(“OnClick”, function()
    CreateNewFrame()
    end)

    – Define the DropdownMenu object
    local DropdownMenu = {}

    function DropdownMenu.OnClick(self, arg1)
    f.selectedSkin = arg1
    end

    function DropdownMenu.Populate(frame)
    local info = {}
    info.text = “Select a skin”
    info.value = “none”
    info.func = nil
    UIDropDownMenu_AddButton(info, 1)

    info = {}
    info.text = “Skin 1”
    info.value = “skin1”
    info.func = DropdownMenu.OnClick
    UIDropDownMenu_AddButton(info, 1)

    info = {}
    info.text = “Skin 2”
    info.value = “skin2”
    info.func = DropdownMenu.OnClick
    UIDropDownMenu_AddButton(info, 1)

    info = {}
    info.text = “Skin 3”
    info.value = “skin3”
    info.func = DropdownMenu.OnClick
    UIDropDownMenu_AddButton(info, 1)
    end

    – Create the dropdown menu frame and set its properties
    f.skinDropdownFrame = CreateFrame(“Frame”, “SkinDropdownFrame”, f, “UIDropDownMenuTemplate”)
    f.skinDropdownFrame:SetPoint(“BOTTOMLEFT”, button, “TOPLEFT”, 0, 5)
    f.skinDropdownFrame.displayMode = “MENU”
    f.skinDropdownFrame.initialize = DropdownMenu.Populate

    – Set up the button’s click event
    button:SetScript(“OnClick”, CreateNewFrame)

    – Set the default skin
    f.selectedSkin = “none”
    Last edited by taheen74; 2023-03-16 at 05:43 PM.
    "When you've got to get down, but can't find the elevator, you have to do it any way you can. Even if it's with a shovel."- Dark Tower II: Drawing of the Three, Stephen King
    Juju's kgpanels: http://www.curse.com/addons/wow/jujus-kgpanels Juju's blog: http://mouthygoblin.weebly.com/jujus-blog.html#/

  2. #2
    Wait, u have no idea about coding or lua, so u ask AI to do it for u, it works terrible and u searchin for some1 to debug ' not ur ' code?

  3. #3
    Quote Originally Posted by Alduric View Post
    Wait, u have no idea about coding or lua, so u ask AI to do it for u, it works terrible and u searchin for some1 to debug ' not ur ' code?
    Do you have a point, or are you just being insulting just to be insulting? There's not an addon that does exactly what I want it to do, so I decided to try and see if Chatgpt and I could figure it out.

    I'm learning as we're going. Why's this an issue? (Only being rude because you're being rude.)

    Also, I already have an addon, but it's way different from what I'm working on.

    Anyway, it was mostly working until I decided to do the dropdown box. Then it quit creating a frame.
    Last edited by taheen74; 2023-03-16 at 05:06 PM.
    "When you've got to get down, but can't find the elevator, you have to do it any way you can. Even if it's with a shovel."- Dark Tower II: Drawing of the Three, Stephen King
    Juju's kgpanels: http://www.curse.com/addons/wow/jujus-kgpanels Juju's blog: http://mouthygoblin.weebly.com/jujus-blog.html#/

  4. #4
    Quote Originally Posted by taheen74 View Post
    Do you have a point, or are you just being insulting just to be insulting? There's not an addon that does exactly what I want it to do, so I decided to try and see if Chatgpt and I could figure it out.

    I'm learning as we're going. Why's this an issue? (Only being rude because you're being rude.)

    Also, I already have an addon, but it's way different from what I'm working on.
    There is no rudeness.. You're asking someone to do all the work for you, because as you admit yourself have no idea on the coding.
    What did you try yourself? What did you debug already? Etc etc..

  5. #5
    Quote Originally Posted by taheen74 View Post
    Do you have a point, or are you just being insulting just to be insulting? There's not an addon that does exactly what I want it to do, so I decided to try and see if Chatgpt and I could figure it out.

    I'm learning as we're going. Why's this an issue? (Only being rude because you're being rude.)

    Also, I already have an addon, but it's way different from what I'm working on.

    Anyway, it was mostly working until I decided to do the dropdown box. Then it quit creating a frame.
    oh no the human insulted your robots spaghetti code

  6. #6
    Quote Originally Posted by 8bithamster View Post
    There is no rudeness.. You're asking someone to do all the work for you, because as you admit yourself have no idea on the coding.
    What did you try yourself? What did you debug already? Etc etc..
    Actually, I'm not. I'm asking where I went wrong here. There's a difference.

    I'm not asking anyone to rewrite the code. And yes, I've tried this in game.

    It was working fine before I decided to add a dropdown menu. Then it quit creating a new frame when I would hit the "Create new frame" button after I created a dropdown menu. I even have the opacity slider working.

    Every time I make a correction to one thing, something else quits working.

    I've been at this for 4 days.

    And yes, I am getting assistance from AI. You seem more offended by that then anything else.

    This should be simple:

    1) the first frame creates a "Host" type of frame in which the "Create new frame", "texture dropdown", and "Opacity" reside.
    2) there's a button created that when clicked, is supposed to create a new frame.
    3) the dropdown menu is supposed to show a menu of textures that I can put into the newly created frames.
    4) the opacity makes it to where i can adjust how well I want to see the image in game.

    So far, #3 isn't working. And I don't know why.
    "When you've got to get down, but can't find the elevator, you have to do it any way you can. Even if it's with a shovel."- Dark Tower II: Drawing of the Three, Stephen King
    Juju's kgpanels: http://www.curse.com/addons/wow/jujus-kgpanels Juju's blog: http://mouthygoblin.weebly.com/jujus-blog.html#/

  7. #7
    ChatGPT doesn't know how to code (LUA or anything else), it's just a fancy chat bot. And you can't rely on any output to be correct.
    So learning with/from it is problematic to begin with.

  8. #8
    Bloodsail Admiral m4xc4v413r4's Avatar
    10+ Year Old Account
    Join Date
    Aug 2009
    Location
    Home
    Posts
    1,075
    ChatGPT isn't going to be able to make you an addon with any amount of updated API since all the information it has is, by WoW API standards, old. Most changes made in Shadowlands are unknown to it, all changes for Dragonflight are unknown to it, and it probably doesn't even know the difference between old API code and new API code, it just knows code it saw public, good code, bad code, old code, new code.

    This added with the fact that you still need to know how to code to take what it gives you and analyze what it is doing, if you should even be doing it, how to fix the problems, etc. ChatGPT is not a tool for people that don't know how to do something to do something for them. Not yet anyway.

    And from the way you're acting in this thread I can see you're just a new version of a help vampire, one that now has an AI to do for him what other humans denied him.

  9. #9
    - - - Updated - - -

    Quote Originally Posted by Ghorron1902 View Post
    ChatGPT doesn't know how to code (LUA or anything else), it's just a fancy chat bot. And you can't rely on any output to be correct.
    So learning with/from it is problematic to begin with.

    That's the thing, it's mostly worked thus far. I think the dropdown might be a little out of it's league though.

    That's where it seems to have the problems.

    It seems to not be propagating the list for the dropdown menu.
    Last edited by taheen74; 2023-03-16 at 06:54 PM.
    "When you've got to get down, but can't find the elevator, you have to do it any way you can. Even if it's with a shovel."- Dark Tower II: Drawing of the Three, Stephen King
    Juju's kgpanels: http://www.curse.com/addons/wow/jujus-kgpanels Juju's blog: http://mouthygoblin.weebly.com/jujus-blog.html#/

  10. #10
    Scarab Lord
    15+ Year Old Account
    Join Date
    Dec 2008
    Location
    One path
    Posts
    4,907
    It's a helpful tool for code but it won't be much help if you don't know the code you're working with yourself. In other words it'll save you some write-up but you still gotta check it and fix mistakes here and there as it might not completely understand what you're trying to accomplish in the first place.
    If you knew the candle was fire then the meal was cooked a long time ago.

  11. #11
    Any error messages generated within WoW should give you a line number of where it is barfing.

    - - - Updated - - -

    Quote Originally Posted by Ghorron1902 View Post
    ChatGPT doesn't know how to code (LUA or anything else), it's just a fancy chat bot. And you can't rely on any output to be correct.
    So learning with/from it is problematic to begin with.
    Actually, it's been doing a fine job with VBA for me. And it does know how to code ChatGPT is powered by GPT-3.5, soon to be 4. That HAS been trained to code because Microsoft let it go wild on Github.

  12. #12
    Quote Originally Posted by Tiwack View Post
    It's a helpful tool for code but it won't be much help if you don't know the code you're working with yourself. In other words it'll save you some write-up but you still gotta check it and fix mistakes here and there as it might not completely understand what you're trying to accomplish in the first place.
    Oh I went in with the full intentions of probably having to learn some of this stuff as I went (I've off and on dabble over the last 13 or so years so I somewhat understand what the code is supposed to do). It's like the second I tried to add a dropmenu that everything just went to hell.

    I'm not sure if it would just be better to create a different LUA for that function since it doesn't seem to want to work with this code.
    "When you've got to get down, but can't find the elevator, you have to do it any way you can. Even if it's with a shovel."- Dark Tower II: Drawing of the Three, Stephen King
    Juju's kgpanels: http://www.curse.com/addons/wow/jujus-kgpanels Juju's blog: http://mouthygoblin.weebly.com/jujus-blog.html#/

  13. #13
    Moderator Aucald's Avatar
    10+ Year Old Account
    Epic Premium
    Join Date
    Oct 2009
    Location
    Philadelphia, PA-US
    Posts
    45,951
    Quote Originally Posted by taheen74 View Post
    I need some help.

    I’ve been working with ChatGDP trying to make my own version of something like kgpanels. Right now, I’m at a stuck point.

    When we first started, I told it I wanted the addon to be able to create a frame when I pushed a button. It took a few hours, but we eventually figured it out and it was working correctly.

    Well, then I told it I wanted to add a functional dropdown menu that would allow me to place art in those created frames. Then we couldn’t get the dropdown to work.

    When we FINALLY got the dropdown to work, the button stopped working.

    Can someone help and tell me where in this code, we messed it up (I also keep getting some errors with <eof>:
    In my admittedly limited experience with programming/scripting and ChatGPT, I've found that the AI can do *very* specific and narrowly-defined things pretty well - but the more general you get, the more it tends to go awry if not outputting utter nonsense. As for your specific LUA script, I parsed it out and only one thing jumped out to me as an issue, which was an object named "UIDropDownMenu" which seems to be otherwise undefined in your code. It's referred to in the function DropdownMenu.Populate(), and may be a passed object or a contextual value I just don't have available in the snippet. Other than that possible issue it looks pretty solid.

    One additional thing I noted is that there are smartquotes in your text, but I don't know if those are just copy/paste artifacts from Word or Outlook or something. Assuming they're not copy/paste artifacts, you'll definitely want to replace them with standard quote marks as I've found smartquote characters often make compilers and parsers go crazy.
    Last edited by Aucald; 2023-03-16 at 06:21 PM.
    "We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see." ― Tom Stoppard, Rosencrantz and Guildenstern are Dead

  14. #14
    I am Murloc! Sting's Avatar
    15+ Year Old Account
    Join Date
    Aug 2007
    Location
    Your ignore list
    Posts
    5,216
    Wait for GPT-4 to be widely available, from what I've seen it's leaps and bounds ahead of GPT-3 which was already pretty impressive.
    ( ° ͜ʖ͡°)╭∩╮

    Quote Originally Posted by Kokolums View Post
    The fun factor would go up 1000x if WQs existed in vanilla

  15. #15
    Tell me you are too lazy to even look for a solution in StackOverflow without telling me you are too lazy to look for a solution in StackOverflow.

  16. #16
    Quote Originally Posted by azka View Post
    Tell me you are too lazy to even look for a solution in StackOverflow without telling me you are too lazy to look for a solution in StackOverflow.
    I don't even know what that is. Not like I didn't do other searches before coming here.

    Why are some of y'all being so rude?
    "When you've got to get down, but can't find the elevator, you have to do it any way you can. Even if it's with a shovel."- Dark Tower II: Drawing of the Three, Stephen King
    Juju's kgpanels: http://www.curse.com/addons/wow/jujus-kgpanels Juju's blog: http://mouthygoblin.weebly.com/jujus-blog.html#/

  17. #17
    Quote Originally Posted by azka View Post
    Tell me you are too lazy to even look for a solution in StackOverflow without telling me you are too lazy to look for a solution in StackOverflow.
    Efficiency is the point isn't it? If you can get an instant solution from cahtgtp its a better search engine than searching stackoverflow. Its just an extension of the same principle that led you to using stackoverflow over going through official documentations.

  18. #18
    OP I find it amusing and a bit disconcerning that you are offended by the comments when most of them are not rude but just pointing that you are skipping steps in how to achieve what you want.

  19. #19
    Fluffy Kitten Nerph-'s Avatar
    15+ Year Old Account
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    8,845
    Lol @ the replies here. I wasn't going to comment at first because I don't know Lua and can't really help, but felt the need to after people's replies.

    Dude is just trying to learn to code and using tools at his disposal... dafuk is the problem with asking for some help?

  20. #20
    Elemental Lord callipygoustp's Avatar
    7+ Year Old Account
    Join Date
    Jun 2015
    Location
    Buffalo, NY
    Posts
    8,668
    Wow, a lot of misinformation in this thread. Good on you, @taheen74, for giving it a shot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •