GHATGPT / LUA generation ... menu

User Tag List

Results 1 to 9 of 9
  1. #1
    DickFiddler's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GHATGPT / LUA generation ...

    Hi Guys.

    We want an addon for WotLK 335a Trinitycore ... so lets try with ChatGPT3.5

    A description of the desired addon, and the generated code are below. Cannot get it to run (tried different clients and servers - its the code not the setup (later... wrong!)).
    A TOC file and LUA file were added to the addons folder (/AuctionBot). The addon is visible in the addon screen, and selected. All other addons turned off.


    Hi Mike! (<<my name for ChatGPT)
    We were thinking about a WoW addon.
    The target client is WoW335a.
    The addon in question detects when people offer items for sale with a message such as "WTS [linked item]" into a specified chat channel, and will proceed to auction the item, verbally, into the channel with the message "THANKS SIR! NOW AUCTIONING - [linked object]. Who will start me off at 1g?". The addon will then detect bids from other players in the form "1000g" or "50 gold" (for 1000 or 50 gold), or "10s" (for 10 silver) or "1c" (for 1 copper) noting the bidding [player name]. The addon will prompt 3 times for more bids with "Any more for [linked item] - currently [highest bid]." On a winning bid (the highest bid after 30 seconds of no bids) the addon announces "THANK YOU [player name]. You win [linked item] for [highest bid]." Humans would then arrange the collection, delivery and payment.
    The generated code (which I asked for a terse version of) below:

    1. AuctionBot.toc

    Code:
    ## Interface: 30300
    ## Title: AuctionBot
    ## Version: 0.1
    ## Author: ChatGPT / LitchLight III / TheFiddler
    ## Notes: Automated bidding and selling process for Guild Items. Say wts [itemlink] into guild chat!
    ## Dependencies: 
    
    AuctionBot.lua


    2. AuctionBot.lua ...

    HTML Code:
    local G = "GUILD"
    local function AIL(event, m, a, _, _, _, _, _, c, _, _, g)
        if c == G and string.find(m, "wts %[(.-)%]") then
            local i = string.match(m, "|H(.-)|h")
            if i then
                SendChatMessage("THX SIR! NOW AUCTIONING - "..i..". Who will start me off at 1g?", G)
                local p, b, t = nil, 0, 30
                local function ABP()
                    t = t - 1
                    if t == 0 then
                        if b > 0 then
                            SendChatMessage("THX "..p..". YOU WIN "..i.." FOR "..b, G)
                            -- TODO: Arrange collection, delivery and payment.
                        else
                            SendChatMessage("NO BIDS FOR "..i, G)
                        end
                    elseif t == 10 or t == 20 then
                        SendChatMessage("ANY MORE FOR "..i.." - CURRENTLY "..b, G)
                    end
                end
                local f = CreateFrame("Frame")
                f:SetScript("OnUpdate", function() ABP() end)
                f:SetScript("OnEvent", function(_, e, b, n) if e == "CHAT_MSG_CHANNEL" and n ~= a and c == G and tonumber(b) then if tonumber(b) > b then p, b = n, tonumber(b) end end end)
                f:RegisterEvent("CHAT_MSG_CHANNEL")
            end
        end
    end
    
    local f = CreateFrame("Frame")
    f:RegisterEvent("CHAT_MSG_CHANNEL")
    f:SetScript("OnEvent", AIL)
    Is there anything obvious?

    Richard.
    Last edited by DickFiddler; 03-27-2023 at 01:56 PM.

    GHATGPT / LUA generation ...
  2. #2
    DickFiddler's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's another try (read "FAIL!") ...


    ME:

    Hi Mike!
    We were thinking about a WoW addon.
    The target client is WoW335a.
    The addon in question detects when people offer items for sale with a message such as "WTS [linked item]" into a specified chat channel, and will proceed to auction the item, verbally, into the channel with the message "THANKS SIR! NOW AUCTIONING - [linked object]. Who will start me off at 1g?". The addon will then detect bids from other players in the form "1000g" or "50 gold" (for 1000 or 50 gold), or "10s" (for 10 silver) or "1c" (for 1 copper) noting the bidding [player name]. The addon will prompt 3 times for more bids with "Any more for [linked item] - currently [highest bid]." On a winning bid (the highest bid after 30 seconds of no bids) the addon announces "THANK YOU [player name]. You win [linked item] for [highest bid]." Humans would then arrange the collection, delivery and payment.

    We have a .toc file so far (File 1) ...

    ## Interface: 30300
    ## Title: Guild AuctionBot
    ## Version: 0.1
    ## Author: ChatGPT / LitchLight III
    ## Notes: Automated bidding and selling process for in-game items.
    ## Dependencies:

    AuctionBot.lua



    MIKE:

    Hi there! It sounds like you're planning to create an interesting WoW addon that can automate the auction process for in-game items.

    I see that you've started with creating a .toc file. This file is used by WoW to identify the addon and provide information about it, such as the version number and author.

    Next, you will need to create the AuctionBot.lua file that contains the actual code for your addon. This file will need to listen for chat messages in the specified channel and parse them to identify when someone is offering an item for sale.

    Once the item is identified, you will need to use the WoW API functions to create an auction for the item and manage the bidding process. You can use the SendChatMessage function to announce the auction to the channel and prompt for bids.

    To manage the bidding process, you will need to track the current highest bid and the bidder's name. You can use the SetAuctionBid function to place bids and the GetNumAuctionItems and GetAuctionItemInfo functions to retrieve information about the auction.

    Finally, you will need to determine when the auction has ended and announce the winner to the channel. You can use the OnAuctionClosed event to detect when an auction has ended and the highest bidder is the winner.

    I hope this information helps you get started with your addon development. Good luck!


    ME:
    The auction will take place only in a chat channel ... no items will be listed on the auctionhouse. The process is a game to be played by guild members in the /guild channel.

    MIKE:
    Thanks for the clarification! If the auction will take place only in a chat channel and not on the auction house, then you will not need to use the WoW API functions for creating and managing auctions. Instead, you can focus on listening for chat messages, parsing them, and announcing the auction and bids in the guild channel.

    To listen for chat messages, you can use the ChatFrame_OnEvent function, which is called whenever a chat message is received. You can then use string manipulation functions such as string.find and string.match to identify when someone is offering an item for sale and extract the item name.

    To announce the auction and bids, you can use the SendChatMessage function with the guild channel as the first argument. You can format the messages to include the item name, current highest bid, and bidder's name as appropriate.

    To manage the bidding process, you will need to track the current highest bid and the bidder's name, and use a timer to determine when the auction has ended. You can use the C_Timer.NewTimer function to create a timer, and when the timer expires, you can announce the winner to the guild channel.

    Remember to also include error checking and validation to ensure that the addon handles unexpected situations gracefully and does not cause any problems for the players.




    ME:
    Understood.
    Mike ... can you please produce the code for the .lua file?
    Please use short variable and function names (for instance "auctionItem" would be "aI"). Please do not include comments (to save space).
    [^^ This was done because of the low token limit on GPT3.5 free).


    MIKE:

    Certainly! Here's an example of the code you could use in your AuctionBot.lua file. Please note that this is just a basic outline and you will need to customize it based on your specific requirements:
    Code:
    local aI -- auction item
    local hB -- highest bid
    local hBN -- highest bidder name
    local t -- timer
    
    local function StartAuction(itemLink)
      aI = itemLink
      hB = 0
      hBN = nil
      SendChatMessage("THANKS SIR! NOW AUCTIONING - "..aI..". Who will start me off at 1g?", "GUILD")
      t = C_Timer.NewTimer(30, function()
        if hBN then
          SendChatMessage("THANK YOU "..hBN..". You win "..aI.." for "..hB.."!", "GUILD")
          aI = nil
          hB = nil
          hBN = nil
          t = nil
        else
          SendChatMessage("No bids for "..aI..". Auction cancelled.", "GUILD")
          aI = nil
          hB = nil
          hBN = nil
          t = nil
        end
      end)
    end
    
    local function UpdateBid(bidder, amount)
      local gold, silver, copper = string.match(amount, "(%d+)g?%s?(%d*)s?%s?(%d*)c?")
      local total = tonumber(gold or 0) * 10000 + tonumber(silver or 0) * 100 + tonumber(copper or 0)
      if total <= hB then
        SendChatMessage("Sorry "..bidder..", your bid of "..amount.." is not high enough. Current highest bid is "..hB.."g by "..hBN..".", "GUILD")
      else
        hB = total
        hBN = bidder
        SendChatMessage("BID ACCEPTED! "..bidder.." bids "..amount.." for "..aI..".", "GUILD")
        SendChatMessage("Any more for "..aI.." - currently "..hB.."g by "..hBN.."?", "GUILD")
        t:Cancel()
        t = C_Timer.NewTimer(30, function()
          if hBN then
            SendChatMessage("THANK YOU "..hBN..". You win "..aI.." for "..hB.."!", "GUILD")
            aI = nil
            hB = nil
            hBN = nil
            t = nil
          else
            SendChatMessage("No bids for "..aI..". Auction cancelled.", "GUILD")
            aI = nil
            hB = nil
            hBN = nil
            t = nil
          end
        end)
      end
    end
    
    local function OnEvent(self, event, message, author, ...)
      if event == "CHAT_MSG_GUILD" then
        local itemLink = string.match(message, "|c%x+|Hitem:%d+:%d+:%d+:%d+|h%[.+%]")
        if itemLink then
          StartAuction(itemLink)
        else
          local bidder, amount = string.match(message, "^(%S+) bids (%S+) for "..(aI or ""))
          if bidder and amount then
            UpdateBid(bidder, amount)
          end
        end
      end
    end
    
    local frame = CreateFrame("Frame")
    frame:RegisterEvent("CHAT_MSG_GUILD")
    frame:SetScript("OnEvent", OnEvent)

  3. #3
    stoneharry's Avatar Moderator Harry


    Reputation
    1614
    Join Date
    Sep 2007
    Posts
    4,558
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It's getting you scripts that are 80-90% of the way there, but not quite feature complete. Reading these scripts are pretty horrendous because it is using 1-2 letter variable names.

  4. #4
    CreativeXtent's Avatar Moderator Authenticator enabled
    Reputation
    580
    Join Date
    Jun 2011
    Posts
    1,595
    Thanks G/R
    245/148
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can ask chatgpt to name them better. it works nice
    "the true wow experience is Maclone"

  5. #5
    DickFiddler's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    First, this is very kind of both of you to read through ^^ this. Thanks.

    I hope you get a go with ChatGPT ... it's a great tool but yes ... there are limitations.

    One of these limitations is the hard 2048 "token" limit for its returns. A token, in this context, is a word or symbol - the medium "Mike" uses to express ideas. Long variable names are token intensive. Without the measures to compress his output the LUA he generates breaches this hard limit and crashes the chat ... or just terminates half way through a program output. In retrospect I should have left his comments in, however he is able to re-comment the code if you are a GPT user, as CX ^^ says. Just paste the code back to him and ask him to add code comments.

    If you discover a way to coax ChatGPT into producing all the bits we need for a working addon, it would be extremely helpful if you would share it! Also ... we actually want this addon for use as a guild activity;

    1. New member says into guild chat "wts [linked-item]"
    2. Addon handles the auction process as per the way TriviaBot (addon) manages a quiz.
    3. Guild officers manage the transaction ... which we take super seriously. Money is no object. Man hours are sacrificed. The item will reach the high bidder or "heads will roll!"
    4. We get super serious with anyone who fails to pay or deliver ... Polite messages, Threats, Finally a Bounty is offered ... "WANTED: Dead not alive! Screenshots of this person dead on the floor. BG + Dungeon Wipes are OK. One reward per player. T&C apply."
    5. Perhaps the auctions stop while there are outstanding warrants?

    Richard.
    Last edited by DickFiddler; 03-20-2023 at 08:33 PM.

  6. #6
    CreativeXtent's Avatar Moderator Authenticator enabled
    Reputation
    580
    Join Date
    Jun 2011
    Posts
    1,595
    Thanks G/R
    245/148
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    funny enough, i use AI and def chatgpt daily.
    token issues are bypassed pretty easy. split code into sections for full responses and have it listed in order
    "the true wow experience is Maclone"

  7. Thanks stoneharry (1 members gave Thanks to CreativeXtent for this useful post)
  8. #7
    DickFiddler's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Understood.

    I will have another try tomoz...

    Annnd ... GPT has lost its memory ... taking all user notes with it! hahahah

    A useful chat with GPT this morning about generating larger programs... should have done that earlier.


    Idea: Any of you guys SHARE a GPT account? Thought that might be interesting.
    Idea: [HARDCORE] addon ... Tracking players that want to try lvl 1- max with no deaths?
    Idea: Running Playerbots? Wouldn't it be great if they could communicate via ChatGPT!
    Idea: Not running playerbots? Fine ... why not let all the npcs have a line in GPT chatter?

    ^^ just me thinking.

    Am still into this ... let me know if you want other short addons that might be generated... it will be a while I'm waiting for "Mike" to regain his memories lol
    Last edited by DickFiddler; 03-22-2023 at 01:51 AM.

  9. #8
    DickFiddler's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So ... What we have thus far;

    (NB This is not a working addon ... rather a sketch of what one might look like...)

    Code:
    --[[
    	AuctionBot
    	Version: 0.1
    	Author(s): ChatGPT / LitchLightIII / TheFiddler
    	Revision: No.
    	URL: http://youwillbemine/
    
    	This is an addon for World of Warcraft that conducts an auction within
    	a specified chat channel.
    
    	License:
    		Vapourware. Now you see it ... Now you don't!
    
    	Note:
    		Yes. 
    --]]
    
    local testmessage = "WTS |cff0070dd|Hitem:12345|h[Example Item]|h|r"
    local itemLink = string.match(testmessage, "|%x+|Hitem:%d+")
    print("@AuctionBot test link IV ... " .. itemLink)
    local thinking = 0
    
    
    if type(GetChannelMessage) == "function" then
    print("@GetChannelMessage ... Pass." .. itemLink)
    else
    print("@GetChannelMessage ... Fail." .. itemLink)
    end
    
    
    local function StartPrivateAuction(self, itemLink, itemName, itemSellPrice, channelName, channelNumber, author)
        -- Announce the item for sale in the Trade channel
    print("@StartPrivateAuction ... channelNumber ==  " .. channelNumber) 
        
        SendChatMessage("THANK YOU SIR! NOW AT AUCTION - " .. itemLink .. ". Who will start me off at 1g?", "CHANNEL", nil, channelNumber)
        
        -- Wait for bids
        local highestBid = 0
        local highestBidder = nil
        local timeLeft = 30
        
        while timeLeft > 0 do
            timeLeft = timeLeft - 1
            if highestBidder ~= nil then
                SendChatMessage("Any more bids for " .. itemLink .. " - currently " .. GetCoinTextureString(highestBid) .. " from " .. highestBidder .. "?", "CHANNEL", nil, channelNumber)
            else
                SendChatMessage("Any bids for " .. itemLink .. " - starting at 1g?", "CHANNEL", nil, channelNumber)
            end
            
            -- Check for new messages in the trade channel and parse any bids
            local newBid = false
            local newBidAmount = 0
            local newBidder = nil
            local chatIndex = 1
            while true do
                local message = select(2, GetChannelMessage(channelNumber, chatIndex))
                if message == nil then
                    break
                end
                
                local bidAmount = string.match(message, "(%d+)([sgcp])")
                if bidAmount ~= nil then
                    newBid = true
                    newBidAmount = tonumber(bidAmount)
                    newBidder = string.match(message, "%[(.+)%]")
                    if newBidder == nil then
                        newBidder = "unknown"
                    end
                    
                    if string.find(message, "bid") ~= nil or string.find(message, "BID") ~= nil then
                        break
                    end
                end
                
                chatIndex = chatIndex + 1
            end
            
            -- Handle new bid if there is one
            if newBid and newBidAmount > highestBid then
                highestBid = newBidAmount
                highestBidder = newBidder
                timeLeft = 30
                
                SendChatMessage("New bid of " .. GetCoinTextureString(newBidAmount) .. " from " .. newBidder .. " for " .. itemLink .. ".", "CHANNEL", nil, channelNumber)
            end
            
            -- Exit loop if there have been no new bids for 30 seconds
            if not newBid and timeLeft <= 0 then
                break
            end
            
            -- Wait one second before checking for bids again
            coroutine.yield(1)
        end
        
        -- No more bids, announce the winner
        if highestBidder ~= nil then
            SendChatMessage("THANK YOU " .. highestBidder .. "! You win " .. itemLink .. " for " .. GetCoinTextureString(highestBid) .. ".", "CHANNEL", nil, channelNumber)
        else
            SendChatMessage("No bids received for " .. itemLink .. ".", "CHANNEL", nil, channelNumber)
        end
    end
    
    
    
    
    
    local function OnChatMessage(self, event, message, author, language, channel, target, flags, unknown, channelNumber, channelName, unknown2, counter, guid)
    
    print("@OnChatMessage ... Message detected: " .. message .. " " .. author .. " " .. channelName .. " " .. channelNumber)
    
    
    if channelNumber == 2 then
    
    print("@context.match ... channelNumber ==  " .. channelNumber) 
    
    if (message:lower():find("^%s*wts") == 1) then
    
    
    print("@string.match ... Message Recognised: " .. message) 
    
    -- The message is a trade offer, extract the item link from the message and start the auction
    		local itemLink = string.match(message, "|%x+|Hitem:%d+")
    			if itemLink then
    				local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(itemLink)
    					if itemName then
    					
    print("@StartPrivateAuction ... Starting Private Auction... ")
    
    -- Start the auction for the item
    thinking = StartPrivateAuction(self, itemLink, itemName, itemSellPrice, channelName, channelNumber, author)
    
    print("@thinking = " .. thinking)
    
    					end
    			end
    		end
    end
    
     -- 
    end
    
    function GetChannelMessage(channelNumber, messageIndex)
        local channelName = GetChannelName(channelNumber)
        local numMessages = GetNumMessages(channelNumber)
        local message = ""
    
        for i = 1, numMessages do
    print("@GetChannelMessage ... i = " .. i)     
            local msg = GetChatMessage(i, channelName)
            -- Check if the message is relevant to your purpose
            if (msg) then
                -- Do something with the relevant message
    print("@GetChannelMessage ... msg = " .. msg)            
                message = msg
            end
        end
    
        return message
    end
    
    
    function GetNumMessages()
       local numMessages = 0
       local index = 1
       local message = ""
    
       -- iterate through trade channel messages until there are no more
       while true do
          message, _, _, _, _, _, _, _, _, _, _ = GetChannelMessage(2, index)
          if message == nil then
             break
          end
          numMessages = numMessages + 1
          index = index + 1
       end
    
       return numMessages
    end
    
    
    
    
    
    
    
    
    local frame = CreateFrame("Frame")
    frame:RegisterEvent("CHAT_MSG_CHANNEL")
    frame:SetScript("OnEvent", OnChatMessage)
    You will notice that there's alot missing in terms of the API - stuff "Mike" thinks will work simply has no basis in Trinitycore's implementation.

    The program he is trying to write steps through the "trade channel" (/guild is slightly borked here cos of another thing running that traps /guild chatter).

    Not possible with TC?

    Anyhoo hope you are well.

    R.


    Thinking ...

  10. #9
    oliviarodrigo1's Avatar Member
    Reputation
    1
    Join Date
    Sep 2023
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fake ChatGPT App Goes Viral, Charges $7.99 for ‘Ad Free’ Subscription

    ChatGPT has created quite a buzz among online communities, but threat actors too seem to be making the most of the obsession around the chatbot. A fake ChatGPT app has emerged on the Apple App Store — pretending to be ChatGPT while deploying a paid subscription to the free version of the chatbot.

    The alleged fake ChatGPT app is charging users as much as $7.99 for weekly subscriptions to a service that already exists for free.

    The makers behind the alleged fake ChatGPT app, “Social Media Apps & Game Sports health Run Hiking Running fitness tracking,” are also running other apps on the App Store that are equally shady and emit a malicious campaign, wrote MacRumors editor Sami Fathi.

    While it is not new that threat actors mimic websites and apps to lure victims into revealing their data, imitating ChatGPT could be tricky as it is an AI-driven app sophisticated enough to provide accurate answers to queries, among doing other multiple tasks as instructed.

    Developed by OpenAI, ChatGPT (Generative Pre-trained Transformer) is a conversational language model introduced in 2018 and was launched in November 2022.

    Utilizing the formidable GPT-3 architecture as a foundation, this generative pre-trained transformer has been fine-tuned utilizing a combination of supervised and reinforcement learning techniques for an unparalleled user experience.

    ChatGPT is trained to generate text in a conversational style and can be fine-tuned for a variety of language generation tasks such as dialogue systems, chatbots, and text completion. It can be used to generate human-like responses to prompts.

    The model is pre-trained on a large dataset of conversational text, so it has a good understanding of how human conversations work, which makes it well-suited for building conversational AI systems.

    ChatGPT is freely accessible to those with an OpenAI account, however, its popularity has attracted unscrupulous individuals looking to profit off its name If you want get more information read cybersecurity news
    cybersecurity news

Similar Threads

  1. LUA Script Generator 1.3
    By fastelf in forum WoW EMU Programs
    Replies: 26
    Last Post: 08-22-2010, 03:35 PM
  2. [Share] Geyser [Lua Generator] Verison 1.0.4
    By Jesus Beams in forum WoW EMU Programs
    Replies: 18
    Last Post: 12-02-2008, 12:50 AM
  3. [Share] Lua Script Generator! Bosses and More [EPIC]
    By MisterEMU in forum WoW EMU Programs
    Replies: 23
    Last Post: 11-10-2008, 02:30 AM
All times are GMT -5. The time now is 04:13 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search