• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Send item to depot offer owner

caquinha

Member
Joined
Aug 8, 2016
Messages
248
Solutions
1
Reaction score
24
I'm using this market system for 8.60
https://otland.net/threads/offline-player-to-player-item-trader-auction-system.51447/

And i need some help to if offer have more then 30 days, it be delete for offers lists and send item back to player depot...
@Stellow made this script to delete offers but it not send item back to owners:

There is a way to convert this script 1.0 to 0.4
https://otland.net/threads/automatic-znote-aac-shop-tfs-1-0.224483/
It send parcel...

Code:
<globalevent name="marketcleaner" type="startup" event="script" value="marketcleaner.lua"/>

marketcleaner.lua
Code:
function onStartup()
   local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
   local days = 30*3600*24
   local nowtime = os.date('*t')
   if(result:getID() ~= -1) then
     while(true)
       local id = result:getDataInt("id")
       local date = result:getDataInt("date")
       local time= os.time(nowtime) - date
       local duedate = time - days
       if duedate >= 0 then
           -- delete offer
           db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
       end
       if not(result:next()) then
           break
       end
   end
   end
   result:free()
end


Anyone know how to help me?
 
Last edited:
Change line:
Code:
while(true) do

Ty, i didnt know this loop syntax...
To noob, i never work with a loop before...
Ty...

But now got new errors:
Code:
[11:56:54.588] >> Initializing game state and binding services...

[11:56:55.776] [Error - GlobalEvent Interface]
[11:56:55.776] data/globalevents/scripts/marketcleaner.lua:onStartup
[11:56:55.776] Description:
[11:56:55.776] data/lib/004-database.lua:100: [Result:free] Result not set!
[11:56:55.776] stack traceback:
[11:56:55.776]    [C]: in function 'error'
[11:56:55.776]    data/lib/004-database.lua:100: in function 'free'
[11:56:55.776]    data/globalevents/scripts/marketcleaner.lua:38: in function <data/globalevents/scripts/marketcleaner.lua:1>

Is something here?
Code:
result:free()

004-database.lua
Code:
function Result:free()
   if(self:getID() == -1) then
       error("[Result:free] Result not set!")
   end

   self:setQuery("")
   local ret = result.free(self:getID())
   self:setID(-1)
   return ret
end
 
self:getID() is getting the id of object "Result"
the script isn't getting the result correctly
it's placed incorrectly
Code:
function onStartup()
    local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
    local days = 30*3600*24
    local nowtime = os.date('*t')
    if(result:getID() ~= -1) then
        while(true)
            local id = result:getDataInt("id")
            local date = result:getDataInt("date")
            local time= os.time(nowtime) - date
            local duedate = time - days
            if duedate >= 0 then
                db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
            end
            if not(result:next()) then
                break
            end
        end
        result:free()
    end
end
this will only free result is result id isnt equal to -1 since it's inside of the if statement now
 
self:getID() is getting the id of object "Result"
the script isn't getting the result correctly
it's placed incorrectly
Code:
function onStartup()
    local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
    local days = 30*3600*24
    local nowtime = os.date('*t')
    if(result:getID() ~= -1) then
        while(true)
            local id = result:getDataInt("id")
            local date = result:getDataInt("date")
            local time= os.time(nowtime) - date
            local duedate = time - days
            if duedate >= 0 then
                db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
            end
            if not(result:next()) then
                break
            end
        end
        result:free()
    end
end
this will only free result is result id isnt equal to -1 since it's inside of the if statement now

Ty, i'll test it...
Apparrent dont have errors, its starts okey... Let me wait 2 days to test it will be deleted
 
Last edited:
Not work, when go to delete item by inactive show me this error

Code:
[13:59:24.176] >> Initializing game state and binding services...
[13:59:24.979] Error during getDataInt(item_id).

[13:59:25.017] [Error - GlobalEvent Interface]
[13:59:25.017] data/globalevents/scripts/marketcleaner.lua:onStartup
[13:59:25.017] Description:
[13:59:25.017] (luaGetCreatureName) Creature not found

[13:59:25.017] [Error - GlobalEvent Interface]
[13:59:25.017] data/globalevents/scripts/marketcleaner.lua:onStartup
[13:59:25.017] Description:
[13:59:25.017] data/globalevents/scripts/marketcleaner.lua:24: attempt to concatenate a boolean value
[13:59:25.017] stack traceback:
[13:59:25.017]    data/globalevents/scripts/marketcleaner.lua:24: in function <data/globalevents/scripts/marketcleaner.lua:1>
[13:59:25.246] > Global IP address: 127.0.0.1


script (i'm using 0.4)

Code:
function onStartup()
    local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
    local days = 1*3600*24
    local nowtime = os.date('*t')
    if(result:getID() ~= -1) then
        while(true) do
            local id = result:getDataInt("id")
            local date = result:getDataInt("date")
            local time= os.time(nowtime) - date
            local duedate = time - days
            if duedate >= 0 then
               -- send item back to old owner
               local item = result:getDataInt("item_id")
               local cfg = {
                   TownId = 1,
                   parcelId = 2595,
                   labelId = 2599,
                   mailBoxPos = {x = 65, y = 42, z = 6}
               }
               local parcel = {} -- leave it
               local label = doCreateItemEx(cfg.labelId, 1)

               local parcelNumber = 1
               doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(townid))
               doAddContainerItemEx(parcel[parcelNumber], item )
               doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
               -- delete item
                db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
            end
            if not(result:next()) then
                break
            end
        end
        result:free()
    end
end
 
Try this.
Code:
    function onStartup()
        local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
        local days = 1*3600*24
        local nowtime = os.date('*t')
        if(result:getID() ~= -1) then
            while(true) do
                local id = result:getDataInt("id")
                local date = result:getDataInt("date")
                local cid = result:getDataInt("player")
                local time= os.time(nowtime) - date
                local duedate = time - days
                if duedate >= 0 then
                   -- send item back to old owner
                   local item = result:getDataInt("item_id")
                   local cfg = {
                       TownId = 1,
                       parcelId = 2595,
                       labelId = 2599,
                       mailBoxPos = {x = 65, y = 42, z = 6}
                   }
                   local parcel = {} -- leave it
                   local label = doCreateItemEx(cfg.labelId, 1)

                   local parcelNumber = 1
                   doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
                   doAddContainerItemEx(parcel[parcelNumber], item )
                   doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
                   -- delete item
                    db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
                end
                if not(result:next()) then
                    break
                end
            end
            result:free()
        end
    end
 
Last edited:
Try this.
Code:
    function onStartup()
        local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
        local days = 1*3600*24
        local nowtime = os.date('*t')
        if(result:getID() ~= -1) then
            while(true) do
                local id = result:getDataInt("id")
                local date = result:getDataInt("date")
                local cid = result:getDataInt("player")
                local time= os.time(nowtime) - date
                local duedate = time - days
                if duedate >= 0 then
                   -- send item back to old owner
                   local item = result:getDataInt("item_id")
                   local cfg = {
                       TownId = 1,
                       parcelId = 2595,
                       labelId = 2599,
                       mailBoxPos = {x = 65, y = 42, z = 6}
                   }
                   local parcel = {} -- leave it
                   local label = doCreateItemEx(cfg.labelId, 1)

                   local parcelNumber = 1
                   doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
                   doAddContainerItemEx(parcel[parcelNumber], item )
                   doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
                   -- delete item
                    db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
                end
                if not(result:next()) then
                    break
                end
            end
            result:free()
        end
    end


Code:
[14:26:08.560] >> Initializing game state and binding services...
[14:26:08.695] Error during getDataInt(item_id).

[14:26:08.695] [Error - GlobalEvent Interface]
[14:26:08.695] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:26:08.695] Description:
[14:26:08.695] (luaGetCreatureName) Creature not found

[14:26:08.695] [Error - GlobalEvent Interface]
[14:26:08.695] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:26:08.695] Description:
[14:26:08.695] data/globalevents/scripts/marketcleaner.lua:24: attempt to concatenate a boolean value
[14:26:08.695] stack traceback:
[14:26:08.695]    data/globalevents/scripts/marketcleaner.lua:24: in function <data/globalevents/scripts/marketcleaner.lua:1>
[14:26:08.699] > Global IP address: 127.0.0.1
 
Code:
[14:26:08.560] >> Initializing game state and binding services...
[14:26:08.695] Error during getDataInt(item_id).

[14:26:08.695] [Error - GlobalEvent Interface]
[14:26:08.695] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:26:08.695] Description:
[14:26:08.695] (luaGetCreatureName) Creature not found

[14:26:08.695] [Error - GlobalEvent Interface]
[14:26:08.695] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:26:08.695] Description:
[14:26:08.695] data/globalevents/scripts/marketcleaner.lua:24: attempt to concatenate a boolean value
[14:26:08.695] stack traceback:
[14:26:08.695]    data/globalevents/scripts/marketcleaner.lua:24: in function <data/globalevents/scripts/marketcleaner.lua:1>
[14:26:08.699] > Global IP address: 127.0.0.1
Try this.
Code:
    function onStartup()
        local result = db.getResult("SELECT `id`, `date`, `player` FROM `auction_system` ORDER by `date` ASC;")
        local days = 1*3600*24
        local nowtime = os.date('*t')
        if(result:getID() ~= -1) then
            while(true) do
                local id = result:getDataInt("id")
                local date = result:getDataInt("date")
                local cid = result:getDataInt("player")
                local time= os.time(nowtime) - date
                local duedate = time - days
                if duedate >= 0 then
                   -- send item back to old owner
                   local item = result:getDataInt("item_id")
                   local cfg = {
                       TownId = 1,
                       parcelId = 2595,
                       labelId = 2599,
                       mailBoxPos = {x = 65, y = 42, z = 6}
                   }
                   local parcel = {} -- leave it
                   local label = doCreateItemEx(cfg.labelId, 1)

                   local parcelNumber = 1
                   doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
                   doAddContainerItemEx(parcel[parcelNumber], item )
                   doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
                   -- delete item
                    db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
                end
                if not(result:next()) then
                    break
                end
            end
            result:free()
        end
    end
 
Try this.
Code:
    function onStartup()
        local result = db.getResult("SELECT `id`, `date`, `player` FROM `auction_system` ORDER by `date` ASC;")
        local days = 1*3600*24
        local nowtime = os.date('*t')
        if(result:getID() ~= -1) then
            while(true) do
                local id = result:getDataInt("id")
                local date = result:getDataInt("date")
                local cid = result:getDataInt("player")
                local time= os.time(nowtime) - date
                local duedate = time - days
                if duedate >= 0 then
                   -- send item back to old owner
                   local item = result:getDataInt("item_id")
                   local cfg = {
                       TownId = 1,
                       parcelId = 2595,
                       labelId = 2599,
                       mailBoxPos = {x = 65, y = 42, z = 6}
                   }
                   local parcel = {} -- leave it
                   local label = doCreateItemEx(cfg.labelId, 1)

                   local parcelNumber = 1
                   doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
                   doAddContainerItemEx(parcel[parcelNumber], item )
                   doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
                   -- delete item
                    db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
                end
                if not(result:next()) then
                    break
                end
            end
            result:free()
        end
    end

Code:
[14:36:55.685] >> Initializing game state and binding services...
[14:36:55.801] Error during getDataInt(item_id).

[14:36:55.801] [Error - GlobalEvent Interface]
[14:36:55.801] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:36:55.801] Description:
[14:36:55.801] (luaGetCreatureName) Creature not found

[14:36:55.801] [Error - GlobalEvent Interface]
[14:36:55.801] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:36:55.801] Description:
[14:36:55.801] data/globalevents/scripts/marketcleaner.lua:25: attempt to concatenate a boolean value
[14:36:55.801] stack traceback:
[14:36:55.801]    data/globalevents/scripts/marketcleaner.lua:25: in function <data/globalevents/scripts/marketcleaner.lua:1>
[14:36:55.804] > Global IP address: 127.0.0.1
 
Code:
[14:36:55.685] >> Initializing game state and binding services...
[14:36:55.801] Error during getDataInt(item_id).

[14:36:55.801] [Error - GlobalEvent Interface]
[14:36:55.801] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:36:55.801] Description:
[14:36:55.801] (luaGetCreatureName) Creature not found

[14:36:55.801] [Error - GlobalEvent Interface]
[14:36:55.801] data/globalevents/scripts/marketcleaner.lua:onStartup
[14:36:55.801] Description:
[14:36:55.801] data/globalevents/scripts/marketcleaner.lua:25: attempt to concatenate a boolean value
[14:36:55.801] stack traceback:
[14:36:55.801]    data/globalevents/scripts/marketcleaner.lua:25: in function <data/globalevents/scripts/marketcleaner.lua:1>
[14:36:55.804] > Global IP address: 127.0.0.1
idk then :(
The only thing i could tell you is.
Just to test the values.
Code:
    function onStartup()
        local result = db.getResult("SELECT `id`, `date`, `player` FROM `auction_system` ORDER by `date` ASC;")
        local days = 1*3600*24
        local nowtime = os.date('*t')
        if(result:getID() ~= -1) then
            while(true) do
                local id = result:getDataInt("id")
                local date = result:getDataInt("date")
                local cid = result:getDataInt("player")
                local time= os.time(nowtime) - date
                local duedate = time - days
                if duedate >= 0 then
                   -- send item back to old owner
                   local item = result:getDataInt("item_id")
                   local cfg = {
                       TownId = 1,
                       parcelId = 2595,
                       labelId = 2599,
                       mailBoxPos = {x = 65, y = 42, z = 6}
                   }
                   local parcel = {} -- leave it
                   local label = doCreateItemEx(cfg.labelId, 1)

                   local parcelNumber = 1
                  -- doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
                  print(cid, getCreatureName(cid), getTownName(cfg.TownId))
                   doAddContainerItemEx(parcel[parcelNumber], item )
                   doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
                   -- delete item
                    db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
                end
                if not(result:next()) then
                    break
                end
            end
            result:free()
        end
    end
 
idk then :(
The only thing i could tell you is.
Just to test the values.
Code:
    function onStartup()
        local result = db.getResult("SELECT `id`, `date`, `player` FROM `auction_system` ORDER by `date` ASC;")
        local days = 1*3600*24
        local nowtime = os.date('*t')
        if(result:getID() ~= -1) then
            while(true) do
                local id = result:getDataInt("id")
                local date = result:getDataInt("date")
                local cid = result:getDataInt("player")
                local time= os.time(nowtime) - date
                local duedate = time - days
                if duedate >= 0 then
                   -- send item back to old owner
                   local item = result:getDataInt("item_id")
                   local cfg = {
                       TownId = 1,
                       parcelId = 2595,
                       labelId = 2599,
                       mailBoxPos = {x = 65, y = 42, z = 6}
                   }
                   local parcel = {} -- leave it
                   local label = doCreateItemEx(cfg.labelId, 1)

                   local parcelNumber = 1
                  -- doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
                  print(cid, getCreatureName(cid), getTownName(cfg.TownId))
                   doAddContainerItemEx(parcel[parcelNumber], item )
                   doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
                   -- delete item
                    db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
                end
                if not(result:next()) then
                    break
                end
            end
            result:free()
        end
    end


Code:
[17:46:01.689] >> Initializing game state and binding services...
[17:46:03.385] Error during getDataInt(item_id).

[17:46:03.413] [Error - GlobalEvent Interface]
[17:46:03.413] data/globalevents/scripts/marketcleaner.lua:onStartup
[17:46:03.413] Description:
[17:46:03.422] (luaGetCreatureName) Creature not found
3

Carlin

[17:46:03.423] [Error - GlobalEvent Interface]
[17:46:03.423] data/globalevents/scripts/marketcleaner.lua:onStartup
[17:46:03.423] Description:
[17:46:03.423] (luaDoAddContainerItemEx) Container not found

[17:46:03.424] [Error - GlobalEvent Interface]
[17:46:03.424] data/globalevents/scripts/marketcleaner.lua:onStartup
[17:46:03.424] Description:
[17:46:03.425] (luaDoTeleportThing) Thing not found
[17:46:03.647] > Global IP address: 127.0.0.1
 
marketcleaner.lua
Code:
function onStartup()
   local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
   local days = 30*3600*24
   local nowtime = os.date('*t')
   if(result:getID() ~= -1) then
     while(true)
       local id = result:getDataInt("id")
       local date = result:getDataInt("date")
       local time= os.time(nowtime) - date
       local duedate = time - days
       if duedate >= 0 then
           -- delete offer
           db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
       end
       if not(result:next()) then
           break
       end
   end
   end
   result:free()
end

this its your currently market cleaner script?
 
you need to add this

local itemid = result:getDataInt("item_id") << --- the item.
local count = result:getDataInt("count") << --- the count of the item.
local playerid = result:getDataInt("player") << --- the id of the player.

if duedate >= 0 then
-- delete offer
db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
db.executeQuery() = you need to check your database to check all the params of the player-depotitems.

INSERT INTO `player_depotitems`(`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6])

value 1 = " .. playerid .. "
value 2 = " nothing.
value 3 = " THE PID OF THE DEPOT
value 4 = " .. itemid .. "
value 5 = " .. count .. "
value 6 = nothing.


post your Player_depotitems PARAMS And your DEPOT PID where you want to send the items.
if your server have towns with direfents depots

we need to modify here =
CREATE TABLE `auction_system` (
`id` int(11) NOT NULL auto_increment,
`player` int(11),
`item_id` int(11),
`item_name` varchar(255),
`count` int(11),
`cost` int(11),
`date` int(11),
`TOWN_ID` int(11), <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
Last edited:
marketcleaner.lua
Code:
function onStartup()
   local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
   local days = 30*3600*24
   local nowtime = os.date('*t')
   if(result:getID() ~= -1) then
     while(true)
       local id = result:getDataInt("id")
       local date = result:getDataInt("date")
       local time= os.time(nowtime) - date
       local duedate = time - days
       if duedate >= 0 then
           -- delete offer
           db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
       end
       if not(result:next()) then
           break
       end
   end
   end
   result:free()
end

this its your currently market cleaner script?

No bro thats my actual script:
Code:
function onStartup()
    local result = db.getResult("SELECT `id`, `date`, `player` FROM `auction_system` ORDER by `date` ASC;")
    local days = 1*3600*24
    local nowtime = os.date('*t')
    if(result:getID() ~= -1) then
        while(true) do
            local id = result:getDataInt("id")
            local date = result:getDataInt("date")
            local cid = result:getDataInt("player")
            local time= os.time(nowtime) - date
            local duedate = time - days
            if duedate >= 0 then
               -- send item back to old owner
               local item = result:getDataInt("item_id")
               local cfg = {
                   TownId = 1,
                   parcelId = 2595,
                   labelId = 2599,
                   mailBoxPos = {x = 65, y = 42, z = 6}
               }
               local parcel = {} -- leave it
               local label = doCreateItemEx(cfg.labelId, 1)

               local parcelNumber = 1
              -- doSetItemText(label, getCreatureName(cid).. "\n" ..getTownName(cfg.TownId))
              print(cid, getCreatureName(cid), getTownName(cfg.TownId))
               doAddContainerItemEx(parcel[parcelNumber], item )
               doTeleportThing(parcel[parcelNumber], cfg.mailBoxPos)
               -- delete item
                db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
            end
            if not(result:next()) then
                break
            end
        end
        result:free()
    end
end

This error when start
Code:
[0:20:41.474] [Error - LuaInterface::loadFile] cannot open data/globalevents/scripts/marketcleaner.lua: No such file or directory
[0:20:41.474] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/marketcleaner.lua)
[0:20:41.474] cannot open data/globalevents/scripts/marketcleaner.lua: No such file or directory

When try to send (when expire the date)
Code:
[17:46:01.689] >> Initializing game state and binding services...
[17:46:03.385] Error during getDataInt(item_id).

[17:46:03.413] [Error - GlobalEvent Interface]
[17:46:03.413] data/globalevents/scripts/marketcleaner.lua:onStartup
[17:46:03.413] Description:
[17:46:03.422] (luaGetCreatureName) Creature not found
3

Carlin

[17:46:03.423] [Error - GlobalEvent Interface]
[17:46:03.423] data/globalevents/scripts/marketcleaner.lua:onStartup
[17:46:03.423] Description:
[17:46:03.423] (luaDoAddContainerItemEx) Container not found

[17:46:03.424] [Error - GlobalEvent Interface]
[17:46:03.424] data/globalevents/scripts/marketcleaner.lua:onStartup
[17:46:03.424] Description:
[17:46:03.425] (luaDoTeleportThing) Thing not found
[17:46:03.647] > Global IP address: 127.0.0.1

you need to add this

local itemid = result:getDataInt("item_id") << --- the item.
local count = result:getDataInt("count") << --- the count of the item.
local playerid = result:getDataInt("player") << --- the id of the player.

if duedate >= 0 then
-- delete offer
db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
db.executeQuery() = you need to check your database to check all the params of the player-depotitems.

INSERT INTO `player_depotitems`(`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6])

value 1 = " .. playerid .. "
value 2 = " nothing.
value 3 = " THE PID OF THE DEPOT
value 4 = " .. itemid .. "
value 5 = " .. count .. "
value 6 = nothing.


post your Player_depotitems PARAMS And your DEPOT PID where you want to send the items.
if your server have towns with direfents depots

we need to modify here =
CREATE TABLE `auction_system` (
`id` int(11) NOT NULL auto_increment,
`player` int(11),
`item_id` int(11),
`item_name` varchar(255),
`count` int(11),
`cost` int(11),
`date` int(11),
`TOWN_ID` int(11), <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

That is in script, without the part TOWNID in DB, town id always gonna be 1, is the main city
 
[0:20:41.474] cannot open data/globalevents/scripts/marketcleaner.lua: No such file or directory !
CHECK YOUR GLOBALEVENT.XML.
and the script its sending a PARCEL with the items to the player, post me your DEPOT pid of the city and i can make to send the items without parcel.
 
[0:20:41.474] cannot open data/globalevents/scripts/marketcleaner.lua: No such file or directory !
CHECK YOUR GLOBALEVENT.XML.
and the script its sending a PARCEL with the items to the player, post me your DEPOT pid of the city and i can make to send the items without parcel.

I want it too...
But i don't understand
What is this pid of the city, where could i found it?
 
go to your ot login on your character, clean your DEPOT, create a new item example = plate legs, save this item into your depot, Log out, NOW go to your database, player_depotitems search for your plate legs "ID" and there its ID, ITEM ID, SID, PID<<<
that pid its the PID of the depot where you save the plate legs
 
[0:20:41.474] cannot open data/globalevents/scripts/marketcleaner.lua: No such file or directory !
CHECK YOUR GLOBALEVENT.XML.
and the script its sending a PARCEL with the items to the player, post me your DEPOT pid of the city and i can make to send the items without parcel.

I'm sorry to this idiot error, i was almost sleeping :D

go to your ot login on your character, clean your DEPOT, create a new item example = plate legs, save this item into your depot, Log out, NOW go to your database, player_depotitems search for your plate legs "ID" and there its ID, ITEM ID, SID, PID<<<
that pid its the PID of the depot where you save the plate legs

sid | pid | itemtype | count
104 | 101 | 2647 | 1

so pid is 101
I'm courious now, what is this pid and this sid?
 
I'm sorry to this idiot error, i was almost sleeping :D



sid | pid | itemtype | count
104 | 101 | 2647 | 1

so pid is 101
I'm courious now, what is this pid and this sid?

Now the script its working? its sending parcel to depot?
Pid is the number of the slot where is the items, example = (pid 1 = left hand) (pid 2 = right hand) etc
pid 101 = depot 1
pid 102 = depot 2 ETC ETC
SID < is the count into the PID
for example if you have 5 "plate armor" on the depot with the "PID" 101 then
plate armor (1) = pid 101, sid 101<
plate armor (2) = pid 101, sid 102<
plate armor (3) = pid 101, sid 103<
plate armor (4) = pid 101, sid 104<
plate armor (5) = pid 101, sid 105< ETC ETC

tell me if the script work, to add the part to send the items without using parcels
 
Back
Top