Signup Now
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Targetting

  1. #11
    Free User
    Join Date
    Feb 2014
    Posts
    154
    Reputation
    14
    Rep Power
    21
    Quote Originally Posted by StaR View Post
    So your code needs a bit of changing, also when you post a code onto the forum post it in tags, it's easier for everyone to read
    init start
    local Monsters = {'glooth golem', 'rustheap golem', 'walker', 'metal gargoyle'}
    local Glooth = {'glooth bandit', 'glooth brigand'}
    init end


    auto(2000)


    if $standtime > 1000*120 then
    settargeting('yes')
    elseif itemcount("mana potion") <= 75 or itemcount("great health potion") <= 50 then
    settargeting('no')
    elseif maround(20, table.unpack(Monsters)) >= 1 and maround(20, table.unpack(Glooth)) < 4 then
    settargeting('no')
    else
    settargeting('yes')
    end


    if ($hasted == false) and (cancastspell("utani hur")) and not $pzone then
    cast("utani hur")
    end
    Thanks for pointing that out and taking the time to comment

    I have another question. I don't want lines 21-23 as a persistent but rather if conditions are met at line 12 and at line 14. Does this mean I will have to use the same code twice after each condition like I had before or is there a better way?

  2. #12
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    712
    Reputation
    50
    Rep Power
    22
    Quote Originally Posted by gmoney View Post
    Thanks for pointing that out and taking the time to comment

    I have another question. I don't want lines 21-23 as a persistent but rather if conditions are met at line 12 and at line 14. Does this mean I will have to use the same code twice after each condition like I had before or is there a better way?
    Ahh I see what you meant, sorry. Well if they're going to be only happening if lines 12 and 14 are met then they do really need to be a part of this persistent. Yeah you will do, you could make the code into a function if you were planning on using it a lot but in this instance it's not worth it. So you're best just writing it out two times.

    It should be a little like this: (this might be like your first one haha)

    init start
    local Monsters = {'glooth golem', 'rustheap golem', 'walker', 'metal gargoyle'}
    local Glooth = {'glooth bandit', 'glooth brigand'}
    init end

    auto(2000)

    if $standtime > 1000*120 then
    settargeting('yes')

    elseif itemcount("mana potion") <= 75 or itemcount("great health potion") <= 50 then

    settargeting('no')
    if ($hasted == false) and ($pzone == false) and (cancastspell("utani hur")) then
    cast("utani hur")
    end

    elseif maround(20, table.unpack(Monsters)) >= 1 and maround(20, table.unpack(Glooth)) < 4 then

    settargeting('no')
    if ($hasted == false) and (cancastspell("utani hur")) and not $pzone then
    cast("utani hur")
    end

    else
    settargeting('yes')
    end



  3. #13
    Free User
    Join Date
    Feb 2014
    Posts
    154
    Reputation
    14
    Rep Power
    21
    Quote Originally Posted by StaR View Post
    Ahh I see what you meant, sorry. Well if they're going to be only happening if lines 12 and 14 are met then they do really need to be a part of this persistent. Yeah you will do, you could make the code into a function if you were planning on using it a lot but in this instance it's not worth it. So you're best just writing it out two times.

    It should be a little like this: (this might be like your first one haha)
    Nice! That's exactly what I was going for. Or maybe this would work as well?

    if $targetting == false and (cancastspell("utani hur")) and not $pzone then 
    cast("utani hur")
    end
    Last edited by gmoney; 03-12-2015 at 06:00 AM.

  4. #14
    Free User
    Join Date
    Feb 2014
    Posts
    154
    Reputation
    14
    Rep Power
    21
    Quote Originally Posted by gmoney View Post

    if $targetting == false and (cancastspell("utani hur")) and not $pzone then 
    cast("utani hur")
    end
    Or should it be

    if not $targetting and (cancastspell("utani hur")) and not $pzone then 
    cast("utani hur")
    end
    Last edited by gmoney; 03-12-2015 at 06:17 AM.

  5. #15
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    712
    Reputation
    50
    Rep Power
    22
    Quote Originally Posted by gmoney View Post
    Or should it be

    if not $targetting and (cancastspell("utani hur")) and not $pzone then 
    cast("utani hur")
    end
    Yeah you have the right idea, you just need to add something that checks if the character is hasted as well or your character will be spamming utani hur. If targeting either on or off there is a utani hur checker thing, so that variable is always going to be true, then if cancast('utani hur') that variable will be true after about 3 seconds of casting +/- and not $pzone just basically means not dp.. So it will be casting utani hur all the time.

    So what you said will work, just add (not $hasted)

    e.g
    if not $hasted and not $targetting and (cancastspell("utani hur")) and not $pzone
    then
    cast("utani hur")
    end



  6. #16
    Free User
    Join Date
    Feb 2014
    Posts
    154
    Reputation
    14
    Rep Power
    21
    Quote Originally Posted by StaR View Post
    Yeah you have the right idea, you just need to add something that checks if the character is hasted as well or your character will be spamming utani hur. If targeting either on or off there is a utani hur checker thing, so that variable is always going to be true, then if cancast('utani hur') that variable will be true after about 3 seconds of casting +/- and not $pzone just basically means not dp.. So it will be casting utani hur all the time.

    So what you said will work, just add (not $hasted)

    e.g
    if not $hasted and not $targetting and (cancastspell("utani hur")) and not $pzone
    then
    cast("utani hur")
    end
    Ahh yes of course, silly me. Once again, thank you StaR

 

 

Posting Permissions

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