ArcEmu Lua Script menu

User Tag List

Results 1 to 5 of 5
  1. #1
    lyonar96's Avatar Sergeant
    Reputation
    5
    Join Date
    Aug 2010
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ArcEmu Lua Script

    I am trying to get an npc to say 1 of 4 phrases every 20 seconds. Here is the code I am using, but when I put it into my ArcEmu scripts folder, it comes up with the error
    Code:
    LuaEngine: Loading scripts...
    scripts\Bartender.lua:1: '<' expected near 'Jenkins'
    LuaEngine: Loaded 131 Lua Scripts
    when I start Arcemu-world.exe
    Here is the .lua code that I used. Its vaguely color coded to help
    Code:
    function Barkeep Jenkins(Unit, Event)
    Unit:RegisterEvent("Barkeep Jenkins_say", 20000, 0)
    end
    
    function Barkeep Jenkins_say(Unit, Event)
    local chance = math.random(1,4)
    if(chance == 1) then
    Unit:SendChatMessage(412, 0, "Fresh Ale! Made this Morning and Shipped by Portal!")
    end
    if(chance == 2) then
    Unit:SendChatMessage(412, 0, "Hey! Fierydiaria! We have your Favourite Bourbon in Stock!")
    end
    if(chance == 3) then
    Unit:SendChatMessage(412, 0, "Come in for a pint!")
    end
    if(chance == 4) then
    unit:SendChatMessage(412, 0, "Need a refreshment?")
    end
    end
    
    function Barkeep Jenkins_Died(Unit, Event)
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(100003, 18, "Barkeep Jenkins"
    RegisterUnitEvent(100003, 4, "Barkeep Jenkins_Died")
    Is there anyone who can help me fix the LuA? Thanks in advance

    EDIT: Incase your wondering, Fierydiaria is one of my GMs

    These ads disappear when you log in.

  2. #2
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    Code:
    function Barkeep_Jenkins(Unit, Event)
    Unit:RegisterEvent("Barkeep_Jenkins_say", 20000, 0)
    end
    
    function Barkeep_Jenkins_say(Unit, Event)
    local chance = math.random(1,4)
    if(chance == 1) then
    Unit:SendChatMessage(412, 0, "Fresh Ale! Made this Morning and Shipped by Portal!")
    end
    if(chance == 2) then
    Unit:SendChatMessage(412, 0, "Hey! Fierydiaria! We have your Favourite Bourbon in Stock!")
    end
    if(chance == 3) then
    Unit:SendChatMessage(412, 0, "Come in for a pint!")
    end
    if(chance == 4) then
    unit:SendChatMessage(412, 0, "Need a refreshment?")
    end
    end
    
    function Barkeep_Jenkins_Died(Unit, Event)
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(100003, 18, "Barkeep_Jenkins"
    RegisterUnitEvent(100003, 4, "Barkeep_Jenkins_Died")


  3. #3
    stoneharry's Avatar Moderator Harry


    Reputation
    1542
    Join Date
    Sep 2007
    Posts
    4,440
    Thanks G/R
    128/114
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's telling you line one near Jenkins, so what Trle94 has done is added a _ in the function names and registers. This is because you can not have a space or else you will get the error you just did.

  4. #4
    lyonar96's Avatar Sergeant
    Reputation
    5
    Join Date
    Aug 2010
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe I worked
    I just started the prosess of learning LuA yesterday (The chunk you see above is from a guide)

    Anyway thanks to both of you

    EDIT: I tried to make some changes to the script, and now it doesn't work :S

    Code:
    function Barkeep_Jenkins(Unit, Event)
    Unit:RegisterEvent("Barkeep_Jenkins_say", 20000, 0)
    end
    
    function Barkeep_Jenkins_say(Unit, Event)
    local chance = math.random(1,4)
    if(chance == 1) then
    Unit:SendChatMessage(412, 0, "Fresh Ale! Made this Morning and Shipped by Portal!")
    end
    if(chance == 2) then
    Unit:SendChatMessage(412, 0, "Hey! Fierydiaria! We have your Favourite Bourbon in Stock!")
    end
    if(chance == 3) then
    Unit:SendChatMessage(412, 0, "Come in for a pint!")
    end
    if(chance == 4) then
    unit:SendChatMessage(412, 0, "Need a refreshment?")
    end
    end
    
    function Barkeep_Jenkins_Died(Unit, Event)
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(100003, 18, "Barkeep_Jenkins")
    RegisterUnitEvent(100003, 4, "Barkeep_Jenkins_Died")
    There are no errors in the arc-emu world.exe, or anywhere. But he just won't say the god-damn lines! Ah well. The NPC Im trying to get this to work for is ID 100003. Any help is appreciated and +Rep to the guy/girl who gets this working
    Last edited by lyonar96; 08-03-2010 at 11:15 AM.

  5. #5
    Hellspawn17's Avatar Member
    Reputation
    1
    Join Date
    Apr 2020
    Posts
    6
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Clear your game cache it's causing you to not see the updated version of the game and database

Similar Threads

  1. [Lua Script] Lua script crashes arcemu-world
    By gillisrofl in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 11-01-2010, 04:08 PM
  2. Replies: 17
    Last Post: 05-01-2010, 09:13 PM
  3. [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
  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 12:58 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search