[Lua] Codebox not working menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Codebox not working

    Heya all, I've been trying to get a codebox working for a bug report tool but the codeboxes won't show up. I'm using Gua with Aspire rev. 1572 (with the required patch applied to world). The rest of the script works, since a new entry gets made in the database.
    Thanks if you can be of any help.

    Code:
    function BugReport_OnTrigger(item, event, player)
    	BugReportMenu(item, player)
    end
    
    function BugReportMenu(item, player)
    	item:GossipCreateMenu(57003, player, 0)
    	item:GossipMenuAddItem(0, "Report bug. !The first code box asks for the KIND of bug!", 1, 1)
    	item:GossipMenuAddItem(0, "Never mind.", 2, 0)
    	item:GossipSendMenu(player)
    end
    
    function BugReport_OnSelect(item, event, player, id, intid, Code)
    	if (intid == 1) then
    		BUG_KIND = Code
    		item:GossipCreateMenu(57003, player, 0)
    		item:GossipMenuAddItem(0, "Description of the bug.", 3, 1)
    		item:GossipMenuAddItem(0, "Never mind.", 2, 0)
    		item:GossipSendMenu(player)
    	end
    	if (intid == 2) then
    		player:GossipComplete()
    	end
    	if (intid == 3) then
    		BUG_DESCRIPTION = Code
    		item:GossipCreateMenu(57003, player, 0)
    		item:GossipMenuAddItem(0, "Send bug report.", 4, 0)
    		item:GossipMenuAddItem(0, "Never mind.", 2, 0)	
    		item:GossipSendMenu(player)
    	end
    	if (intid == 4) then
    		BugPlayerInfo(player)
    		print(BPlayerClass, BPlayerRace, BPlayerName)
    		if BUG_DESCRIPTION ~= nil and BUG_KIND ~= nil then
    			Execute(1, "INSERT INTO bug_report (`#`,`bugkind`,`description`,`date`,`time`,`class`,`race`,`name`) VALUES ('0','"..BUG_KIND.."','"..BUG_DESCRIPTION.."','"..os.date("%x").."','"..os.date("%X").."','"..BPlayerClass.."','"..BPlayerRace.."','"..BPlayerName.."');")
    		else
    			Execute(1, "INSERT INTO bug_report (`#`,`bugkind`,`description`,`date`,`time`,`class`,`race`,`name`) VALUES ('0','no information available','no information available','"..os.date("%x").."','"..os.date("%X").."','"..BPlayerClass.."','"..BPlayerRace.."','"..BPlayerName.."');")
    		end
    		player:GossipComplete()
    end
    end
    
    RegisterItemGossipEvent(57010, 1, "BugReport_OnTrigger")
    RegisterItemGossipEvent(57010, 2, "BugReport_OnSelect")
    
    function BugPlayerInfo(player)
    	BPlayerClass = player:GetPlayerClass()
    	BPlayerRace = player:GetPlayerRace()
    	BPlayerName = player:GetName()
    	return BPlayerClass, BPlayerRace, BPlayerName
    end

    [Lua] Codebox not working
  2. #2
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    item:GossipMenuAddItem(0, "Description of the bug.", 3, 1)

    Its a long shot but change 1 to a 3.

    item:GossipMenuAddItem(0, "Description of the bug.", 3, 3)

  3. #3
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Vision1000 View Post
    item:GossipMenuAddItem(0, "Description of the bug.", 3, 1)

    Its a long shot but change 1 to a 3.

    item:GossipMenuAddItem(0, "Description of the bug.", 3, 3)
    Thank you for your reply, I have tried what you said but it didn't work unfortunately.

  4. #4
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Update GuaEngine to the latest revision.

  5. #5
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wrote this script on an item gossip

    I entered 2 different values for each menu item, and both variables were saved as the two values i typed in.

    Code:
    function OnGossip(item, player)
      item:GossipCreateMenu(100, player, 0)
      item:GossipMenuAddItem(0, "Test", 55, 1)
      item:GossipMenuAddItem(0, "test2", 56, 1)
      item:GossipSendMenu(player)
    end
    
    function OnSelect(item, event, player, id, intid, code)
        if (intid == 55) then
    	TryOne = code
        end
    
        if (intid == 56) then
    	TryTwo = code
    	player:SendAreaTriggerMessage("The Codes are.. "..TryOne..TryTwo)
        end
    end
    If you were using the examples / learned about the code box from my guide, All of it is from Arcemus stock LuaEngine. I'm not sure what GuaEngine is built off of but maybe it won't work with GuaEngine?

    Edit: *points to gastric*

Similar Threads

  1. LUA script not working
    By pedobear123 in forum World of Warcraft General
    Replies: 12
    Last Post: 09-01-2008, 09:38 AM
  2. Lua portal not working
    By Noobcraft in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 08-14-2008, 06:48 PM
  3. [Help] Lua Script Not Working
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 26
    Last Post: 03-16-2008, 02:13 PM
  4. LUA portals not working
    By roguesownu in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-23-2008, 05:49 PM
  5. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
All times are GMT -5. The time now is 04:01 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search