LUA Code menu

User Tag List

Thread: LUA Code

Results 1 to 2 of 2
  1. #1
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Code

    I am making a Code NPC like WoW with their scratch cards. however I was wondering if it is possible to make the LUA query the database to see if the code is in the database or not?
    Last edited by stoneharry; 05-02-2011 at 04:33 AM. Reason: Added prefix because apparently you can't read the stickied thread saying the rules.

    LUA Code
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    As an addon it would be difficult, not sure if it's actually possible.

    With ArcEmu:

    LuaHypArc:

    WorldDBQuery("Your Query Here")
    CharDBQuery("Your Query Here")

    GetColumn
    GetColumnCount
    GetRowCount
    NextRow

    Example code snippet:
    Code:
    local item = WorldDBQuery("SELECT `quality` FROM `items` WHERE `entry` = '"..code.."';")
    if item ~= nil then -- Check it exists
      item = item:GetColumn(0):GetString()
        if item == 2 then -- if it's got a quality of 2
          player:AddItem(code, 1)
        end
    end
    LuaBridge:

    These are executed on WorldDB or CharacterDB. Both of these are global variables.
    :Query()
    :Execute()
    Last edited by stoneharry; 05-02-2011 at 04:39 AM.

Similar Threads

  1. 25 Hidden Locations Tele's All On 1 NPC!! (LUA CODE)
    By benzkool in forum WoW EMU General Releases
    Replies: 20
    Last Post: 12-11-2008, 01:20 PM
  2. [Teleporter] LUA code!
    By lilbdiablo12 in forum WoW EMU General Releases
    Replies: 13
    Last Post: 10-28-2008, 01:48 PM
  3. [Lua] Problem with my lua code
    By ariax1 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 09-26-2008, 02:45 AM
  4. [Lua] Got a problem with my Lua code.
    By sammiboy in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-25-2008, 09:04 AM
  5. [Help] Need someone to test a lua code
    By dude891 in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-12-2008, 09:59 PM
All times are GMT -5. The time now is 10:12 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