XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: When any one said (hi,Hello) Auto replay Hi Hello and Alarm

  1. #1

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    When any one said (hi,Hello) Auto replay Hi Hello and Alarm

    Hi
    i wanna script that When any one said (hi,Hello) Auto replay Hi Hello and Alarm
    can?
    thx alot

  2. #2

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    bumpp

  3. #3

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ???????????????? bring my post up

  4. #4

    Join Date
    Jul 2015
    Posts
    18
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    bump... needed

  5. #5

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    bumping too =)

  6. #6

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    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

  7. #7
    Moderator Elvang's Avatar
    Join Date
    Dec 2010
    Location
    B.C. Canada
    Posts
    1,365
    Mentioned
    104 Post(s)
    Tagged
    1 Thread(s)
    @shadowart I know you have one

  8. #8
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Edit: Download from my thread to make sure you get the latest version.
    Last edited by shadowart; 12-25-2015 at 12:56 PM.

  9. #9
    Storm70's Avatar
    Join Date
    Jun 2014
    Location
    United States
    Posts
    117
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    lua code:

    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~



    Or direct link
    http://i.imgur.com/LkvSBqW.jpg

  10. #10
    Moderator Elvang's Avatar
    Join Date
    Dec 2010
    Location
    B.C. Canada
    Posts
    1,365
    Mentioned
    104 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Storm70 View Post
    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~



    Or direct link
    http://i.imgur.com/LkvSBqW.jpg
    Worked for me using Sublime 2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •