XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 5 of 5

Thread: If attacked Pm Friends

  1. #1

    Join Date
    May 2013
    Location
    Sweden
    Posts
    21
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    If attacked Pm Friends

    Looking for a script that simply sends a message (if possible)with name of the player(s)attacking me to selected friends.
    Or just a random message.
    Thank you

  2. #2

    Join Date
    May 2014
    Location
    Canada
    Posts
    320
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Change playersToPM and huntingLocation

    lua code:

    -- PM when attacked by PK
    --Version 1.0
    --[[ Made by
    ___ .__ __. ______ ____ ____ .__ __.
    / \ | \ | | / __ \ \ \ / / | \ | |
    / ^ \ | \| | | | | | \ \/ / | \| |
    / /_\ \ | . ` | | | | | \_ _/ | . ` |
    / _____ \ | |\ | | `--' | | | | |\ |
    /__/ \__\ |__| \__| \______/ |__| |__| \__|

    ]]

    --------------------------------------------
    --[[ ------------ CONFIG -------------- ]]--
    --------------------------------------------
    --This is where you say you are in the PM
    huntingLocation = "Mt Sternum"

    --This is who you will PM
    playersToPM = {
    "Rage",
    "Tim"
    }

    --These are what you may say
    helpMessages = {
    "Help im being attacked at " .. huntingLocation .. " by ",
    "PK at " .. huntingLocation .. "!!! fast compadre! ",
    "PLs men, pk at " .. huntingLocation .. "!?! stronk men is named ",
    "Im scurred and cold,,, at " .. huntingLocation .. "! keal the pk known as ",
    "PK at " .. huntingLocation .. ". "
    }

    --------------------------------------------
    --[[ ----- Script -- No need to edit ---- ]]
    --------------------------------------------
    function sendPMs( attacker )
    for i = 1, #playersToPM do
    local messageToUse = math.random(1,#helpMessages)
    Self.PrivateMessage( playersToPM[i], helpMessages[messageToUse] .. attacker )
    --Delay to pm more
    wait(2300,6000)
    end
    end

    playersAttackedMe = {}
    function messageProxyCallback(proxy, message)
    --Creature hits say by a
    --Player hits say by
    --If a player hit us
    if( not string.find( message, "by a ") ) then
    --get the starting index of their name
    start, finish = string.find( message, "by ")
    --Split the string at the finish of by_ + 1
    local playerName = string.sub(message, finish + 1)
    --Get the length of the player message
    local stringLength = string.len(playerName)
    --Cut the . off the string
    playerName = string.sub(playerName, 0, stringLength - 1 )

    --Check if i already PM'd about this pk
    if( not table.find(playersAttackedMe, playerName, false) ) then
    --add pk to attacked me list
    playersAttackedMe[#playersAttackedMe+1] = playerName
    --Dont instantly pm
    wait(3000,4000)
    sendPMs( playerName )
    end
    end

    end
    BattleMessageProxy.OnReceive("BattleMessageProxy", messageProxyCallback)
    Last edited by anoyn; 03-08-2016 at 09:37 PM.

  3. #3
    Lifetime Subscriber
    Join Date
    Aug 2012
    Location
    Stockholm, Sweden
    Posts
    428
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    http://forums.xenobot.net/showthread...essage-Leaders!

    I guess you can think of what to do...
    Belden's Free Scripts
    Belden's Quest Scripts

    Bought Lifetime Subscription from Fractal
    Bought TeamSpeak 3 Service from Sikkness
    Bought Leveling Service from Y2Quakepc2

  4. #4
    l4z's Avatar
    Join Date
    Oct 2015
    Posts
    133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    nice script @anoyn
    How to set to msg on guild chat?

  5. #5

    Join Date
    May 2014
    Location
    Canada
    Posts
    320
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Talking in guild chat not possible. its been on suggestions for awhile.

Posting Permissions

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