[Lua] Reloading Scripts with a lua script menu

User Tag List

Results 1 to 3 of 3
  1. #1
    thetrueman2's Avatar Active Member
    Reputation
    16
    Join Date
    Nov 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Reloading Scripts with a lua script

    Hello Mmowned

    I'm abit stuck with a lua script, and hoping to find some awnsers. Since arcemu blocked ReloadLuaEngine() from r3089+ there is no way to reload them apart from a restart or console access. then I stumbled across dofile(), which would essentially solve my problems for remote access.

    I've looked into some scripts here and there, and made some edits to http://www.mmowned.com/forums/emulat...e-any-rev.html

    This is what came out:

    Code:
    -- Start Config
    local ID_RELOADER = 98312
    
    function Reloader_Gossip(Unit, event, Player)
     local Playername = Player:GetName()
      if (Player:IsGm() == true) then
        Unit:GossipCreateMenu(13006, Player, 0)
        Unit:GossipMenuAddItem(7, "I would like to reload a Lua Script", 1, 0)
        Unit:GossipMenuAddItem(3, "Nevermind, Goodbye", 3, 0)
        Unit:GossipSendMenu(Player)
      else
        SendWorldMessage("|cffff6060Disconnecting Player: "..Playername..". Reason: Attempt to use GM tool without rights.", 2)
        Player:SoftDisconnect()
      end
    end
    
    function Reloader_Script(Unit, Event, Player, id, intid, code)
     local GMname = Player:GetName()
     
    	if (intid == 1) then
    	  Unit:GossipCreateMenu(14000005, Player, 0)
    	  Unit:GossipMenuAddItem(7, "I understand, Continue", 2, 1)
    	  Unit:GossipMenuAddItem(3, "Nevermind, Goodbye", 3, 0)
    	  Unit:GossipSendMenu(Player)
    	end	
    	
    	if (intid == 2) then
     	 if code ~= nil and code ~= "" then
    	  dofile("scripts/"..code..".lua")
    	 end
    		SendWorldMessage("|cFFFFEBCDGM "..GMname.." initiated server-side reload of "..code..".lua. The Server may experience some lag while this occurs.", 2) 
    		Player:GossipComplete()
    	end  
    	
    	if (intid == 3) then
    		Player:GossipComplete()
    	end
    end
    
    RegisterUnitGossipEvent(ID_RELOADER, 1, "Reloader_Gossip")
    RegisterUnitGossipEvent(ID_RELOADER, 2, "Reloader_Script")
    gossip wise it all works. Only, no matter what I do with it I can't get it to actually reload the script . dofile() seems to be ignoring the other file's existance or do nothing with it whatsoever. Am I doing something wrong or is dofile not working? I'm running Arcemu r3247 with luahyparc.

    ofcourse +Rep to those that try to help

    Thanks in advance
    If you’re going to convict us, convict us of disorganised crime. - Peter Sunde

    [Lua] Reloading Scripts with a lua script
  2. #2
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by thetrueman2 View Post
    Since arcemu blocked ReloadLuaEngine() from r3089+ there is no way to reload them apart from a restart or console access.
    Works fine for me. Using the latest rev.

  3. #3
    thetrueman2's Avatar Active Member
    Reputation
    16
    Join Date
    Nov 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I must've missed they re added it

    +rep to you!
    If you’re going to convict us, convict us of disorganised crime. - Peter Sunde

Similar Threads

  1. [Lua] Reload scripts in-game on the fly, ANY engine, ANY rev
    By Dynashock in forum WoW EMU General Releases
    Replies: 11
    Last Post: 07-09-2010, 01:16 AM
  2. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
  3. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
  4. [Ascent MOD] Reload LUA scripts and Script_bin!
    By Le Froid in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 01-03-2008, 10:29 PM
  5. [Request] Ascent Revision with LUA scripts enabled
    By Greatdrak in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 12-30-2007, 06:04 PM
All times are GMT -5. The time now is 01:11 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