XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 7 of 7

Thread: Requesting Pm script when attacked by player!

  1. #1
    undead mage's Avatar
    Join Date
    Jul 2014
    Posts
    53
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Requesting Pm script when attacked by player!

    Like it says in the title can someone please make a script that messages character X when im getting attacked by a player.
    If it's possible it would be great if I could make my own message that it sends to character X and also if possible to send it to multiple characters without spamming of course so I wont get muted. Thanks in advance!
    Last edited by undead mage; 12-10-2015 at 09:28 PM.

  2. #2
    undead mage's Avatar
    Join Date
    Jul 2014
    Posts
    53
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Last edited by undead mage; 12-10-2015 at 09:27 PM.

  3. #3
    undead mage's Avatar
    Join Date
    Jul 2014
    Posts
    53
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Bumpp anyone?

  4. #4

    Join Date
    May 2014
    Location
    Canada
    Posts
    320
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    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)

  5. #5
    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 undead mage View Post
    Like it says in the title can someone please make a script that messages character X when im getting attacked by a player.
    If it's possible it would be great if I could make my own message that it sends to character X and also if possible to send it to multiple characters without spamming of course so I wont get muted. Thanks in advance!
    http://forums.xenobot.net/showthread...d=1#post460853

  6. #6
    undead mage's Avatar
    Join Date
    Jul 2014
    Posts
    53
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by anoyn View Post
    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)
    Thx @anoyn I will test it out tomorrow but I don't get how you're getting the pk's name

    @Elvang ?:P

  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)
    Quote Originally Posted by undead mage View Post
    Thx @anoyn I will test it out tomorrow but I don't get how you're getting the pk's name


    @Elvang ?:P
    Yeah I didn't notice the PM part.

Posting Permissions

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