Lua scripting Issue menu

Shout-Out

User Tag List

Results 1 to 13 of 13
  1. #1
    jbryan9184's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua scripting Issue

    This may be noobish of me, but here is the deal.

    Code:
    function On_Gossip(punit, event, player)
        punit:GossipCreateMenu(100, player)
        punit:GossipMenuAddItem(player,0, "test1", 1, 0)
        punit:GossipMenuAddItem(player,0, "test2", 2, 0)
        punit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(punit, event, player, id, intid, code)
        if(intid == 1) then
            punit:SendChatMessage(12, 0, "hello1")
            player:GossipComplete()
        end
        if(intid == 2) then
            punit:SendChatMessage(12, 0, "hello2")
            player:GossipComplete()
        end
    end
    RegisterGossipEvent(45106, 7, "On_Gossip")(45106, 7,"Gossip_Submenus")
    Have also tried:
    Code:
    RegisterUnitEvent(45106, 7, "On_Gossip")(45106, 7,"Gossip_Submenus")
    The problem is I continually get a attempt to call global 'RegisterGossipEvent' (a nil value) with register gossip and something similar with registerunit.

    Any ideas?
    Last edited by jbryan9184; 07-02-2008 at 11:53 AM.

    Lua scripting Issue
  2. #2
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure you have the Lua++ LuaScripting DLL, and not the regular one?

  3. #3
    jbryan9184's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not entirely sure, where can I find their svn or source for download?

  4. #4
    Kiyoshi's Avatar Member
    Reputation
    28
    Join Date
    Jun 2008
    Posts
    192
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any way to compile the LUA++ LuaScripting .DLL file with AscentEmu? Also what really changes with that engine?

  5. #5
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Their forums: Main Page - Lua++ Forums
    And yeah, you can compile it with Ascent.
    Changes include, more functions, the ability to create npc gossips in lua, and probably more

  6. #6
    jbryan9184's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, just to clarify. I compiled the latest LUAScripting.dll, along with all the others dlls, that comes with arcemu, as of rev 206 which was only a few days ago. Is this not the ++ version or what?

    *EDIT*
    I've checked the LUAengine.cpp, luafunctions.h and luaengine.h that are included with arcemu and they all have coding for gossip commands. *Stumped*
    Last edited by jbryan9184; 07-02-2008 at 12:53 PM.

  7. #7
    Kiyoshi's Avatar Member
    Reputation
    28
    Join Date
    Jun 2008
    Posts
    192
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So all the commands stay the same? It's just added on correct?

  8. #8
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RegisterGossipEvent(45106, 7, "On_Gossip")(45106, 7,"Gossip_Submenus")

    I'm not sure that's how it's done :P

  9. #9
    jbryan9184's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, if you have a suggestion I would love to hear it.

  10. #10
    Flannel007's Avatar Member
    Reputation
    3
    Join Date
    Aug 2007
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function On_Gossip(punit, event, player)
        punit:GossipCreateMenu(100, player, 1) --New integer added, not sure what it does exactly, but it has to do with sending the menu.
        punit:GossipMenuAddItem(0, "test1", 1, 0) --No longer need a player target.
        punit:GossipMenuAddItem(0, "test2", 2, 0)
        punit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(punit, event, player, id, intid, code)
        if(intid == 1) then
            punit:SendChatMessage(12, 0, "hello1")
            player:GossipComplete()
        end
        if(intid == 2) then
            punit:SendChatMessage(12, 0, "hello2")
            player:GossipComplete()
        end
    end
    RegisterUnitGossipEvent(45106, 7, "On_Gossip")
    RegisterUnitGossipEvent(45106, 7,"Gossip_Submenus") --New addition "Unit".
    Last edited by Flannel007; 07-02-2008 at 07:02 PM.

  11. #11
    jbryan9184's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bloody hell... I actually found that post before I checked back here on lua++'s forums flannel and did as it said, thank you though. Now I'm getting "Server has crashed. Reason was: a Privileged Indstruction at 0x111c0551," when the lua engine tries to load the script now. So I figured I'd recompile arcemu with the latest rev, 232 as of now, with the downloaded lua++ files in the luascripting folder. Perfect, but still getting the error. What now?

  12. #12
    markbatt's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this just change the npci to match your npc you want to use.
    if you want to expand further just replace the teleport location with a call to another function.

    the error message you were getting is casses by the lua script not by the dll

    This is a working 4 level menu
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    --*****************************************
    --*UniversalTeleNPC script by Oxin v1.2 *
    --* AspireDev.org *
    --*Made for UniversalWoW(www.universal-wow.com) *
    --*Everyone is free to distribute and modify to their *
    --*needs but please leave the original credits *
    --*****************************************
    local npcid = 200000
    local menunum = 33310
    local menuicon = 4
    local teleicon = 2
    local menu =
    {
    {"Class Trainers",
    {
    {"Paladin", 37, 1160.088257, 371.752472, 355.525665},
    {"Priest", 37, 1160.088257, 371.752472, 355.525665},
    {"Shaman", 37, 1057.267456, 397.039124, 339.991333},
    {"Warrior", 37, 1024.346680, 386.166229, 332.062164},
    {"Rogue", 37, 1011.189636, 391.762573, 336.828796},
    {"Warlock", 37, 1218.062134, 346.329102, 370.863312},
    {"Mage", 37, 1218.062134, 346.329102, 370.863312},
    {"Hunter", 37, 1165.920898, 308.611786, 354.212952},
    {"Druid", 37, 1165.920898, 308.611786, 354.212952}
    }
    },
    {"Profession Trainers",
    {
    {"Leatherworking", 37, 1026.105103, 385.793518, 336.799896},
    {"Enchanting", 37, 1218.062134, 346.329102, 370.863312},
    {"Blacksmithing", 37, 1240.293823, 243.216705, 355.536072},
    {"Engineering", 37, 1240.293823, 243.216705, 355.536072},
    {"Alchemy", 37, 1227.457886, 198.279648, 354.644836},
    {"Tailoring", 37, 1180.818604, 194.865295, 357.214050},
    {"Jewelcrafting", 37, 1178.090942, 206.977142, 372.440460},
    {"Cooking", 37, 1159.221436, 331.393188, 354.312592}
    }
    },
    {"Vendors",
    {
    {"Main Vendors", 37, 1175.451782, 270.882629, 357.752716},
    {"Gems", 37, 1104.128174, 401.164734, 354.609253},
    {"Containers", 37, 1104.128174, 401.164734, 354.609253},
    {"Projectiles", 37, 1104.128174, 401.164734, 354.609253},
    {"Season 3", 37, 1096.719971, 298.905939, 338.617249},
    {"Dungeon Tiers", 37, 1096.719971, 298.905939, 338.617249},
    {"Food", 37, 1159.419434, 214.685043, 357.204498}
    }
    },
    {"Innkeeper", 37, 1180.024780, 211.609070, 357.207306},
    {"Mounts", 37, 1140.919189, 277.717896, 353.954224},
    {"Battlemasters", 37, 99.597717, 344.603516, 333.011078},
    {"Weaponmaster", 37, 1143.361450, 213.367447, 356.382141}
    }

    function TeleNPC_MainMenu(Unit, Player)
    local i = 0
    Unit:GossipCreateMenu(menunum, Player, 0)
    for k,v in pairs(menu) do
    i = i + 1
    if type(v[2]) == "table" then
    Unit:GossipMenuAddItem(menuicon, v[1], i, 0)
    i = i + #(v[2])
    else
    Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    end
    end
    Unit:GossipSendMenu(Player)
    end

    function TeleNPC_SubMenu(Unit, Player, i, Submenu)
    Unit:GossipCreateMenu(menunum-i, Player, 0)
    Unit:GossipMenuAddItem(7, "<--Back", 0, 0)
    for k,v in pairs(Submenu) do
    i = i + 1
    Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    end
    Unit:GossipSendMenu(Player)
    end

    function TeleNPC_OnGossipTalk(Unit, Event, Player)
    TeleNPC_MainMenu(Unit, Player)
    end

    function TeleNPC_OnGossipSelect(Unit, Event, Player, MenuId, Id, Code)
    local i = 0
    if(Id == 0) then
    TeleNPC_MainMenu(Unit,Player)
    else
    for k,v in pairs(menu) do
    i = i + 1
    if (Id == i) then
    if type(v[2]) == "table" then
    TeleNPC_SubMenu(Unit, Player, i, v[2])
    else
    if Player:IsInCombat() then
    Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    else
    Player:Teleport(v[2], v[3], v[4], v[5])
    end
    Unit:GossipComplete(Player)
    end
    return
    elseif (type(v[2]) == "table") then
    for j,w in pairs(v[2]) do
    i = i + 1
    if (Id == i) then
    if Player:IsInCombat() then
    Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    else
    Player:Teleport(w[2], w[3], w[4], w[5])
    end
    Unit:GossipComplete(Player)
    return
    end
    end
    end
    end
    end
    end

    RegisterUnitGossipEvent(npcid, 1, "TeleNPC_OnGossipTalk")
    RegisterUnitGossipEvent(npcid, 2, "TeleNPC_OnGossipSelect")
    Last edited by markbatt; 07-04-2008 at 03:57 PM.

  13. #13
    jbryan9184's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that worked perfectly. Thank you much! +rep!

Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. LUA STealth Script Issue
    By Lakotaness in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 06-17-2008, 01:22 AM
  3. Lua Scripts!
    By danis in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-15-2007, 03:16 PM
  4. How To LUA Script
    By Skuxta in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 12-13-2007, 04:24 AM
  5. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
All times are GMT -5. The time now is 02:36 AM. 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