Jump to content
×
×
  • Create New...
  • 0

ERROR mysql_query Event Points


MORTE

Question

Use game core 40k and files with vrunner

Need urgent help, please someone help me!

questlib.lua

-- MySQL
mysql_query = function(query)
    if not pre then
        local rt = io.open('CONFIG','r'):read('*all')
        pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
    end
    math.randomseed(os.time())
    local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
    --os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- f? MySQL51
	os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- f? MySQL55
    for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi);
    for i = 2, table.getn(t) do table.foreach(t[i],function(a,b)
        out[i-1]               = out[i-1] or {}
        out[i-1][a]            = tonumber(b) or b or 'NULL'
        out[t[1][a]]           = out[t[1][a]] or {}
        out[t[1][a]][i-1]      = tonumber(b) or b or 'NULL'
    end) end
    return out
end

quest

quest test begin
    state start begin
        when 20095.chat."Event Points" begin
        say("event points go? ")
        local s = select("Yes", "No")
            if s == 1 then
                local value = 1
                mysql_query('UPDATE player.player SET points = points+'..value..' WHERE id = '..pc.get_player_id()..' LIMIT 1')
                chat("+1 point!")
            elseif s == 2 then
                return
            end --if
        end -- w
    end -- s
end -- q

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Here has the following functions in C ++

 

mysql.query

mysql.direct_query

mysql.update

mysql.real_escape_string

mysql.get_table_postfix

 

go to game / src

 

open queslua.cpp

 

under

RegisterDragonSoulFunctionTable();

add

RegisterMysqlFunctionTable();

open queslua.h

 

under

extern void RegisterDragonSoulFunctionTable();

add

extern void RegisterMysqlFunctionTable();

add in the makefile 

questlua_mysql.cpp

Download the file

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

VirusTotal

 

Hidden Content

    Give reaction to this post to see the hidden content.

  • Angry 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 2

      Problem freebsd

    2. 0

      Making chain quest

    3. 4

      Ludus2: a metin2-like browser game

    4. 6
    5. 9

      Help in implementing a switch bot

    6. 0

      Special Inventory System Can't Sell To Npc's

    7. 0

      ROV2.GLOBAL | International | Server start 14.05.2022

    8. 75

      Services - System Ard [C ++ / Python / Lua]

  • Recently Browsing

    • No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.