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
(help) when word "x" in Defalt channel = logout.
#1
Hello, i need a script that get logout when a player says: "player" in some phrase.
in this case, when the otserver starts to spam message like: "account of player x has been banned for cheating".
Something like this.

Thank you!
Reply

#2
try this:

local message = 'account of player has been banned' -- edit

-- Dont edit below this line

local check = getnewmessages()
if check.content == message then

logout()



end
I havent checked the script, also im not sure how .content works exactly because its not explained. Just please test it and let me know. Thanks
Reply

#3
Hello.

Please, you should request scripts on Scripts->Requests.

Barney9 is almost right, but getnewmessages() return the news received messages on the current active channel since last time it was executed.
It returns a table with tables of messages, pretty much like:
{
     { content = 'hello', fullcontent = '19:02 Player: hello', sender = 'Player', time = '19:02' },
     { content = 'sup', fullcontent = '19:02 Player: sup', sender = 'Player', time = '19:02' },
}

So you need to use for loop to check each new message.
local message = 'account of player has been banned' -- edit

-- Dont edit below this line

local messages = getnewmessages()
for _, msg in ipairs(messages) do
     if msg.content == message then
          logout()
     end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016