Posts: 3
Threads: 1
Joined: Jan 2020
Reputation:
0
Would it be possible to make a persistent script that goes into the house on the last one minute serversave message?
then logout, wait 5min for the bot to auto reconnect and say alana sio?
or will the bot shutdown after the character loggs out?
i copied something like this together, would it work?
if ischannelopen("Default")
then
local msg = getmessages()
local count = 0
for _ in pairs(msg)
do
count = count + 1
end
for i = 1, count, 1
do
if string.find(msg[i].fullcontent, "Server will save in one minute. Please log out.") and msg[i].type == 3
then
goto pos xyz
logout
wait(300000)
say ('Alana sio')
end
Posts: 2,936
Threads: 488
Joined: Jul 2018
Reputation:
84
Hello.
You did it correctly!
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
is there a reason this isnt working?
local WPT_LABEL = 'SS'
if ischannelselected("Default") then
local msgs = getnewmessages()
for _, msg in ipairs(msgs) do
if string.find(msg.content, "Server is saving game in 5 minutes.") and msg.type == 3 then
gotolabel(WPT_LABEL)
break
end
end
end
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
Hmm, even on Retrots? i ended up using the loot one you made, changed the message type to 18 (i checked my log to get the server type number)
and changed flash client to gotolabel
Seems to do the same thing. From what i read, it will go to label SS if at any point there is a server message that includes the word server
Need to test tonight.
local ITEMS = { 'Server' }
local messages = getnewmessages('Default') -- Get new messages from Default channel. If your server uses Server Log then change it.
for _, msg in ipairs(messages) do
if msg.type == 18 and string.find(msg.content, '') ~= nil then
local text_lower = msg.content:lower()
for __, item in ipairs(ITEMS) do
if string.find(text_lower, item:lower()) ~= nil then
gotolabel('SS')
flashclient()
return
end
end
end
end
Posts: 2,936
Threads: 488
Joined: Jul 2018
Reputation:
84
02-02-2021, 10:47 PM
(This post was last modified: 02-02-2021, 10:59 PM by Arkilys.)
This section is for Mastercores OTBot only.
You must check what's the message type, it changes according the message color, etc.
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
i got this working.
local ITEMS = { 'Server' }
local messages = getnewmessages('Default') -- Get new messages from Default channel. If your server uses Server Log then change it.
for _, msg in ipairs(messages) do
if msg.type == 18 and string.find(msg.content, '') ~= nil then
local text_lower = msg.content:lower()
for __, item in ipairs(ITEMS) do
if string.find(text_lower, item:lower()) ~= nil then
gotolabel('SS')
flashclient()
return
end
end
end
end