strat3g Posted March 10, 2021 Share Posted March 10, 2021 Hello. Ive been banned recently because I used that script which one for sure not working. Msgcheck appeared just in server log window so it seems like system msg. I was suprised because if I remember correctly it appeared in default window also. I made screenshoots so if needed I will send you. Could you fix that script? Would be nice, thanks. auto(100) if not g_game.isOnline() then return end local messagesToDetect = {"[English]", "msgheck", "bot"} -- which words should it look for? local respondToMessage = false -- should it respond if trigger word is found? local messageToRespond = "im here" -- what should it respond? local pauseBot = false -- should it pause the bot? local playAlarm = true -- should it play alarm? connect("g_game", "onTalkMessage", checkBotMessage) function checkBotMessage(name, level, mode, message, channelId, creaturePos) for _, messageToDetect in pairs(messagesToDetect) do if string.find(message, messageToDetect, 1, true) then if respondToMessage then g_game.talk(messageToRespond) end if pauseBot then setOption("Global/BotPaused", "true") end if playAlarm then for i = 1, 5 do playSound("alarm.wav") sleep(1000) end end return end end end Link to comment Share on other sites More sharing options...
oski121 Posted March 10, 2021 Share Posted March 10, 2021 you have100% right i checked this script also with raid, event, lottery and kick warrning which are red as well like a Msg check on server log and doesn't work, Zelek maybe you can add alert in bot for msg check? it possible? Link to comment Share on other sites More sharing options...
zakne11 Posted March 10, 2021 Share Posted March 10, 2021 it's work as it should, you just take ready script. add second function for system messages connect("g_game", "onTextMessage", checkBotText) function checkBotText(mode, message) Link to comment Share on other sites More sharing options...
strat3g Posted March 10, 2021 Author Share Posted March 10, 2021 1 hour ago, zakne11 said: it's work as it should, you just take ready script. add second function for system messages connect("g_game", "onTextMessage", checkBotText) function checkBotText(mode, message) Thank you mate! I already tested it on system msgs like Lottery, 15min kick msg etc. and it worked for me. I replaced these 2 lines and it worked. Link to comment Share on other sites More sharing options...
zakne11 Posted March 10, 2021 Share Posted March 10, 2021 to get universal get both working together Link to comment Share on other sites More sharing options...
Greksx Posted March 10, 2021 Share Posted March 10, 2021 3 hours ago, zakne11 said: it's work as it should, you just take ready script. add second function for system messages connect("g_game", "onTextMessage", checkBotText) function checkBotText(mode, message) can you write the full function again ? Link to comment Share on other sites More sharing options...
zakne11 Posted March 11, 2021 Share Posted March 11, 2021 auto(100) if not g_game.isOnline() then return end local messagesToDetect = {""} -- which words should it look for? local respondToMessage = false -- should it respond if trigger word is found? local messageToRespond = "im here" -- what should it respond? local pauseBot = false -- should it pause the bot? local playAlarm = true -- should it play alarm? connect("g_game", "onTalkMessage", checkBotMessage) connect("g_game", "onTextMessage", checkBotText) function checkBotMessage(name, level, mode, message, channelId, creaturePos) for _, messageToDetect in pairs(messagesToDetect) do if string.find(name, messageToDetect, 1, true) then if respondToMessage then g_game.talk(messageToRespond) end if pauseBot then setOption("Global/BotPaused", "true") end if playAlarm then for i = 1, 3 do playSound("alarm.wav") sleep(1000) end end return end end end function checkBotText(mode, message) for _, messageToDetect in pairs(messagesToDetect) do if string.find(message, messageToDetect, 1, true) then if respondToMessage then g_game.talk(messageToRespond) end if pauseBot then setOption("Global/BotPaused", "true") end if playAlarm then for i = 1, 3 do playSound("alarm.wav") sleep(1000) end end return end end end 1 Link to comment Share on other sites More sharing options...
Recommended Posts