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
function to count new messages
#1
Hi, i'm working on a "auto respond" script, but i don't know how to count new messages on my chat, is there any function for this?
Reply

#2
Hello.

I just replied your private message.

local messages = getnewmessages()
print(#messages) -- prints elements count.

But if you are going to loop, you can use ipairs as well.
local messages = getnewmessages()
for _, msg in ipairs(messages) do
     if msg.content == 'hi' then
          say('hi')
          wait(1000, 1500)
     end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016