Signup Now
Results 1 to 7 of 7
  1. #1
    Free User sines's Avatar
    Join Date
    Nov 2014
    Posts
    32
    Reputation
    10
    Rep Power
    0

    Unhappy Exeta res. Need help to change one thing.

    Hello!

    I need this script to just look if X player gets attacked from monster.
    Right now it can be any player.


    So... how to change "^(.+)" to getuseroption('friendname')? I have tried but I dont get it ;( Thanks!

    init start       
    local monstersConsider = {'Juggernaut'}

    table.lower(monstersConsider)
    init end

    auto(200)
    foreach newmessage m do
    if m.type == MSG_STATUSLOG then
    local _, _, _, name = m.content:match('^(.+) loses (%d+) (%l+) due to an attack by ?a?n? (.-)%.$')

    if name and table.find(monstersConsider, name:lower()) and maroundspell('exeta res', 'any', unpack(monstersConsider)) then
    castspell('exeta res')
    end
    end
    end
    Last edited by Imba; 03-13-2017 at 05:02 PM. Reason: lua tags

  2. #2
    Free User sines's Avatar
    Join Date
    Nov 2014
    Posts
    32
    Reputation
    10
    Rep Power
    0
    Bump ;(

  3. #3
    Free User sines's Avatar
    Join Date
    Nov 2014
    Posts
    32
    Reputation
    10
    Rep Power
    0
    Bump Again, someone? please.

  4. #4
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    21
    @sines


    w/ multi char support:
    init start        
    local monstersConsider = {"rat"}
    local friends = {"Bubble", "Cachero"}

    -- don't edit:
    table.lower(friends)
    table.lower(monstersConsider)
    init end

    auto(200)
    foreach newmessage m do
    if m.type == MSG_STATUSLOG then
    local char, _, _, name = m.content:match('^(.+) loses (%d+) (%l+) due to an attack by ?a?n? (.-)%.$')
    if table.find(friends, char:lower()) and name then
    if table.find(monstersConsider, name:lower()) and maroundspell('exeta res', 'any', unpack(monstersConsider)) then
    castspell('exeta res') waitping()
    end
    end
    end
    end
    Last edited by Donatello; 03-13-2017 at 05:30 PM. Reason: fixed a bug.

  5. #5
    Free User sines's Avatar
    Join Date
    Nov 2014
    Posts
    32
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Donatello View Post
    @sines


    w/ multi char support:
    init start        
    local monstersConsider = {"rat"}
    local friends = {"Bubble", "Cachero"}

    -- don't edit:
    table.lower(friends)
    table.lower(monstersConsider)
    init end

    auto(200)
    foreach newmessage m do
    if m.type == MSG_STATUSLOG then
    local char, _, _, name = m.content:match('^(.+) loses (%d+) (%l+) due to an attack by ?a?n? (.-)%.$')
    if table.find(friends, char:lower()) and name then
    if table.find(monstersConsider, name:lower()) and maroundspell('exeta res', 'any', unpack(monstersConsider)) then
    castspell('exeta res') waitping()
    end
    end
    end
    end
    20:06:27 error in Cavebot script Exeta res 4:
    ["if table.find(friends, char:lower()) an..."]:Exeta res 4:14 attempt to index local 'char' (a nil value)


  6. #6
    Free User sines's Avatar
    Join Date
    Nov 2014
    Posts
    32
    Reputation
    10
    Rep Power
    0
    Bump. Please

  7. #7
    Free User sines's Avatar
    Join Date
    Nov 2014
    Posts
    32
    Reputation
    10
    Rep Power
    0
    Bump again

 

 

Posting Permissions

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