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
do action if receive "x" message in private
#1
Hello.
I need a script that will stop attacking the target I have, and close the client if receive an "x" message privately.

I also need a script that sends an "x" message to "x" player if it is attacked by a pk.

It is possible?


thanks for everything
Reply

#2
Hello.

I didn't tested, but should work. Try it before leaving your character afk using those scripts.

Script #1
local PLAYER = 'Main char'
local MESSAGE = 'xlog now'

if connected() then
    local last_pm = getlastprivatemessage()
    if last_pm.visible and last_pm.sender:lower() == PLAYER:lower() and last_pm.content:lower() == MESSAGE:lower() then
        stopattack()
        stop()
        xlog()    
    end
end

Script #2
local PLAYER = 'Main char'
local MESSAGE = 'is attacking me' -- Message will be like PK name is attacking me
local MIN_DELAY = 5000 -- Delay between messages.

if connected() then
    LAST_MSG_TIME = LAST_MSG_TIME or 1
    if runningtime() >= (LAST_MSG_TIME + MIN_DELAY) then
        local creatures = getcreatures('pf')
        for _, creature in ipairs(creatures) do
            if creature.isattackme then
                say('*' .. PLAYER ..  '* ' .. creature.name .. ' ' .. MESSAGE)
                LAST_MSG_TIME = runningtime()
                break
            end
        end
    end
end
Reply

#3
thank you so much! I will test soon and give feedback
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Smile" title="Smile" class="smilie smilie_1" />
Reply

#4
Heart 
Hello, this error is happening on the console in script #2


14:17:24 - Core:Lua:ExecuteScript
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Big Grin" title="Big Grin" class="smilie smilie_4" />oString
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Tongue" title="Tongue" class="smilie smilie_5" />ersistent01: 11: attempt to call field 'name' (a string value)

can you help me with this?
Reply

#5
Try again, just fixed it.
Reply

#6
Thanks! its working!!
Reply

#7
Hello, seccond script is not working anymore, can you help me? i dont know whats happening
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016