Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPC
#1
Hello ,
looking for such a script

If npc named 'X' is on screen then
say ('hi')
if npc said 'hi' then
say 'sell xxx [items_name]'
end
end
Reply

#2
Hello.

This will check if npc is talking to you if it says your name on its message, but you can change it.
local NPC_NAME = 'Sam' -- Npc name
local ITEMS = { 'mace', 'spear' } -- Items to sell. It

local npc_dist = findcreature(NPC_NAME)
if npc_dist >= 0 and npc_dist <= 3 then
    getnewmessages()
    say('hi')
    wait(1500, 2200)
    local messages = getnewmessages()
    for _, msg in ipairs(messages) do
        if msg.sender:lower() == NPC_NAME:lower() and string.find(msg.content:lower(), name():lower()) ~= nil then
            for __, item in ipairs(ITEMS) do
                local count = itemcount(item)
                if count > 0 then
                    say('sell ' .. count .. ' ' .. item)
                    wait(800, 1200)
                    say('yes')
                    wait(300, 500)
                end
            end
        end
    end
end

If npc says a specific message, but doesn't says your character name then use this script. But it's not guarantee that it would be talking to you.
local NPC_NAME = 'Sam' -- Npc name
local NPC_WELCOME_MSG = 'Welcome to my store.'
local ITEMS = { 'mace', 'spear' } -- Items to sell. It

local npc_dist = findcreature(NPC_NAME)
if npc_dist >= 0 and npc_dist <= 3 then
    getnewmessages()
    say('hi')
    wait(1500, 2200)
    local messages = getnewmessages()
    for _, msg in ipairs(messages) do
        if msg.sender:lower() == NPC_NAME:lower() and msg.content:lower() == NPC_WELCOME_MSG:lower() then
            for __, item in ipairs(ITEMS) do
                local count = itemcount(item)
                if count > 0 then
                    say('sell ' .. count .. ' ' .. item)
                    wait(800, 1200)
                    say('yes')
                    wait(300, 500)
                end
            end
        end
    end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016