sholh
11-16-2015, 08:15 AM
Hi
i wanna script that When any one said (hi,Hello) Auto replay Hi Hello and Alarm
can?
thx alot
sholh
11-28-2015, 04:20 PM
???????????????? bring my post up
jollebollen
12-04-2015, 03:05 AM
guys I think it's safe to say we can bump this forever hehe nobody is using this bot anymore apparently lol and I just bought 30 days XD rekt i guess
Elvang
12-04-2015, 04:28 AM
shadowart I know you have one ;)
shadowart
12-04-2015, 05:31 AM
Edit: Download from my thread (http://forums.xenobot.net/showthread.php?39301-shAdOwArt-s-Lua-Scripts&p=460853&viewfull=1#post460853) to make sure you get the latest version.
Storm70
12-04-2015, 08:41 AM
Alarm = true -- Play an alarm when you receive a message that's likely for you?
Reply = true -- Automatically reply to messages that are likely for you?
ReplyLimit = 3 -- Maximum number of replies per player.
MinLevelForReply = 10 -- Won't reply or log messages from players below this level.
MaxPlayersOnScreen = 1 -- If the number of other players on the screen is higher than this we will not reply to local messages
MinResponseTime = 1500
MaxResponseTime = 3000
DefaultResponses = {"greejk?", "hmm?", "?", "what?", "why y here", "bah"}
-- TheySay list case-insensitive prefixes, exact matches aren't required.
SpecificResponses =
{
{TheySay = {"hi", "hello", "hey"}, WeRespond = {"hi", "hello", "Hello", "ghaz"}},
{TheySay = {"kill", "dont", "don't", "mine", "my", "me"}, WeRespond = {"sry", "sorry"}},
{TheySay = {"bot", "cheat"}, WeRespond = {"i no cheat", "u bot?", "no bot", "lol no", "no", "LOL!!!"}},
{TheySay = {"long", "how long"}, WeRespond = {"few hours", "long", "very long"}},
{TheySay = {"first", "me first", "im first", "i'm first"}, WeRespond = {"?", "no", "what?", "really?"}},
{TheySay = {"?"}, WeRespond = {"im here", "me hunt", "me first", "not leaving"}},
{TheySay = {"leave"}, WeRespond = {"no", "no leave", "no bully"}},
}
---------------------------------------------
-------------- END OF CONFIG ----------------
---------------------------------------------
local function selectResponse(text)
for _, responseData in ipairs(SpecificResponses) do
for _, prefix in ipairs(responseData["TheySay"]) do
if text:match("^"..prefix) then
return responseData["WeRespond"][math.random(1, #responseData["WeRespond"])]
end
end
end
return DefaultResponses[math.random(1, #DefaultResponses)]
end
-- If there's an npc on screen the player might be speaking to it rather than us.
local function npcsOnScreen()
local count = 0
for _, _ in Creature.iNpcs(7) do
count = count + 1
end
return count
end
-- If there's too many players on screen they might be talking to each others. But we'll let the user configure how many that is too many.
local function playersOnScreen()
local count = 0
for name, _ in Creature.iPlayers(7) do
if name ~= Self.Name() then
count = count + 1
end
end
return count
end
local function isSafeToReply()
return (not XenoBot.IsInRealTibia() or npcsOnScreen() == 0) and playersOnScreen() <= MaxPlayersOnScreen
end
-- We also filter out low levels as they often are spamming advertisements.
local function isValidSpeaker(name, level)
return name ~= Self.Name() and level and level > MinLevelForReply
end
-- To avoid spamming we set a maximum number of replies per player.
local responseCounter = {}
local function withinReplyLimit(name)
local repliesAreWithinLimit = (responseCounter[name] or 0) < ReplyLimit
responseCounter[name] = (responseCounter[name] or 0) + 1
return repliesAreWithinLimit
end
local channel = Channel.New("Chat Log", function() end)
-- Replies to local messages
LocalSpeechProxy.OnReceive("Chat Replier", function(_, msgType, speaker, level, text)
local level = tonumber(level)
if msgType == "say" and isValidSpeaker(speaker, level) and isSafeToReply() then
channel:SendOrangeMessage(speaker .. " [" .. level .. "]", text)
if Alarm then alert() end
if Reply and withinReplyLimit(speaker) then
local response = selectResponse(text)
if response then
wait(MinResponseTime, MaxResponseTime)
Self.Say(response, 20)
channel:SendOrangeMessage("You", response)
end
end
end
end)
-- Replies to private messages
PrivateMessageProxy.OnReceive("Chat Replier", function (_, speaker, level, text)
local level = tonumber(level)
if isValidSpeaker(speaker, level) then
channel:SendYellowMessage(speaker .. " [" .. level .. "]", text)
if Alarm then alert() end
if Reply and withinReplyLimit(speaker) then
local response = selectResponse(text)
if response then
wait(MinResponseTime, MaxResponseTime)
Self.PrivateMessage(speaker, response)
channel:SendYellowMessage("You", response)
end
end
end
end)
This may be the stupidest thing you ever read, but when I copy/paste the script in notepad++, all the lines of code go on one single line for example, it all goes on line 1 instead of going from 1-114, it's more than likely my mistake but I do no know what I'm doing wrong?
~this is why I rarely use any LUA because I have always had this problem~
http://i.imgur.com/LkvSBqW.jpg
Or direct link
http://i.imgur.com/LkvSBqW.jpg
Elvang
12-04-2015, 08:48 AM
This may be the stupidest thing you ever read, but when I copy/paste the script in notepad++, all the lines of code go on one single line for example, it all goes on line 1 instead of going from 1-114, it's more than likely my mistake but I do no know what I'm doing wrong?
~this is why I rarely use any LUA because I have always had this problem~
http://i.imgur.com/LkvSBqW.jpg
Or direct link
http://i.imgur.com/LkvSBqW.jpg
Worked for me using Sublime 2.
Storm70
12-04-2015, 10:40 AM
Worked for me using Sublime 2.
Downloaded sublime 2, and did the same thing.
I found my problem (so I think but after tinkering with this for hours and getting absolutely no where and downloading 2 bullshit adobe things) still can't figure it out, but supposedly how I want the code to copy/paste is called "Hard Line Endings" and my stupid shit copy/pastes is called "Text that Reflows" and I can't get it to work for nothing, as in why I never mess with LUA, making my own scripts/learning how to script or anything, because it's a pain in my ass to have to skip lines, put in tabs, and just make sure everything is in the right place.
~I know I can't be the only one out there though with this problem, might just be only one who finally said something~
http://blogs.adobe.com/acrolaw/2007/04/fixing_text_reflow_issues_when_y/
^Is finally where I found what my problem is, I just can't figure it out, going to tinker with it again tomorrow, due to it's 5:37am.
Maybe someone has opinions/suggestions?!
Also I never have mentioned nothing before after using this bot for atleast almost a year now or whatever, but I never mentioned anything because I don't feel like it's XenoBot's place, considering the problem is copy/paste on notepad++ or sublime 2, but really sucks for me cause only way I can use LUA is if I start from scratch/script for myself, or copy/paste each line individually (so in this case 114 different copy/pastes for 1 script), might just stick to what I been doing, as in not using LUA's. Just sucks when you come across great LUA that would help me tremendously like this auto responder.
shadowart
12-04-2015, 10:52 AM
Downloaded sublime 2, and did the same thing.
I found my problem (so I think but after tinkering with this for hours and getting absolutely no where and downloading 2 bullshit adobe things) still can't figure it out, but supposedly how I want the code to copy/paste is called "Hard Line Endings" and my stupid shit copy/pastes is called "Text that Reflows" and I can't get it to work for nothing, as in why I never mess with LUA, making my own scripts/learning how to script or anything, because it's a pain in my ass to have to skip lines, put in tabs, and just make sure everything is in the right place.
~I know I can't be the only one out there though with this problem, might just be only one who finally said something~
http://blogs.adobe.com/acrolaw/2007/04/fixing_text_reflow_issues_when_y/
^Is finally where I found what my problem is, I just can't figure it out, going to tinker with it again tomorrow, due to it's 5:37am.
Maybe someone has opinions/suggestions?!
Try downloading the scripts instead of copying it: http://forums.xenobot.net/showthread.php?39301-shAdOwArt-s-Lua-Scripts&p=460853&viewfull=1#post460853
Storm70
12-04-2015, 10:57 AM
Try downloading the scripts instead of copying it: http://forums.xenobot.net/showthread.php?39301-shAdOwArt-s-Lua-Scripts&p=460853&viewfull=1#post460853
Ffs, I didn't think about downloading. Yes that worked and so far is only way I have been able to get a 100% LUA that I did not have to edit (put in spaces, tabs, etc)... Thanks dude. /facepalm
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.