XenoBot Forums - Powered by vBulletin

User Tag List

Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 51

Thread: [Discussion] Scripter: Variables, Functions, and Events

  1. #11
    sirmate's Avatar
    Join Date
    Dec 2011
    Location
    Poland
    Posts
    83
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raphael View Post
    Also, what about pre-defined creature objects, such Self, Target, Followed, etc...
    Make them by yourself... lazy...
    Code:
    local self = Creature.GetByID(getSelfID())
    local target = Creature.GetByID(getSelfTargetID())
    local followed = Creature.GetByID(getSelfFollowID())
    (๏̯͡๏ )

  2. #12
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sirmate View Post
    Make them by yourself... lazy...
    Code:
    local self = Creature.GetByID(getSelfID())
    local target = Creature.GetByID(getSelfTargetID())
    local followed = Creature.GetByID(getSelfFollowID())
    If I'm not mistaken they already exist.

    this are the relational properties. (can be found on the Creature.lua or Jo3 post)
    Code:
    Creature:isSelf()
    Creature:isTarget()
    Creature:isFollowed()
    an example of using this variables would be.. (using Jo3 example)
    Again if im not mistaken.
    Code:
    local creature = Creature.GetByName("Jo3Bingham")
    
    if (creature:ID() ~= 0) then
        if (creature:isTarget() and creature:WarIcon()) then
            ----use spell or rune
        end
    end
    If everything is fine then Jo3 will die.
    Last edited by Efren; 01-04-2012 at 11:47 PM. Reason: changed the Creature:WarIcon() for creature:WarIcon()

  3. #13
    sirmate's Avatar
    Join Date
    Dec 2011
    Location
    Poland
    Posts
    83
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Angry

    Quote Originally Posted by Efren View Post
    If I'm not mistaken they already exist.

    this are the relational properties. (can be found on the Creature.lua or Jo3 post)
    Code:
    Creature:isSelf()
    Creature:isTarget()
    Creature:isFollowed()
    an example of using this variables would be.. (using Jo3 example)
    Again if im not mistaken.
    Code:
    local creature = Creature.GetByName("Jo3Bingham")
    
    if (creature:ID() ~= 0) then
        if (creature:isTarget() and Creature:WarIcon()) then
            ----use spell or rune
        end
    end
    If everything is fine then Jo3 will die.
    Nope, you're a little wrong.
    By using those functions you currently only check if creature is you itself, your target or creature that you follow.
    He had in mind something like $self, $target, $attacked, $followed in neobot. Those variables was returning creature pointers.

    Also I want to know if there will be some variable or loop like in neobot that would be returning all creatures (players/monsters/npc's) from screen (all floors)?
    (๏̯͡๏ )

  4. #14
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sirmate View Post
    Nope, you're a little wrong.
    By using those functions you currently only check if creature is you itself, your target or creature that you follow.
    He had in mind something like $self, $target, $attacked, $followed in neobot. Those variables was returning creature pointers.

    Also I want to know if there will be some variable or loop like in neobot that would be returning all creatures (players/monsters/npc's) from screen (all floors)?
    Atm i think I'm correct.
    I'll use the same script but with line comments to point out what's happening. (on my opinion)

    Code:
    local creature = Creature.GetByName("Jo3Bingham") -- creature = Jo3Bingham 
    
    -- first If statement is checking the "creature:ID" which means Jo3Bingham ID's, example: Jo3Bingham:ID()
    
    if (creature:ID() ~= 0) then 
        -- sencond If statement is cheking that , Jo3Bingham:isTarget() and Jo3Bingham:WarIcon()
    
        if (creature:isTarget() and Creature:WarIcon()) then
            ----use spell or rune
        end
    end
    I personally thing that way, I might be wrong but, for undestranding always a new lengauge I need an script with comment lines that's pointing out what's happening, I have used LUA on Ot's and on Neobot but those " : " are confusing me alot.

    sirmate, try to point out what's happening on this script for me to understand your way of viewing this script.

  5. #15
    silis's Avatar
    Join Date
    Dec 2011
    Location
    Somewhere Far Beyond
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sirmate View Post
    Also I want to know if there will be some variable or loop like in neobot that would be returning all creatures (players/monsters/npc's) from screen (all floors)?
    This.
    It's really useful to have as much pointers, variables, booleans as possible to expand the possibilities for this bot!
    Moving on from Neo to Xeno!
    ❑ Single
    ❑ Taken
    ✔ Mentally dating a character that doesn't actually exist

  6. #16
    sirmate's Avatar
    Join Date
    Dec 2011
    Location
    Poland
    Posts
    83
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Efren View Post
    ...
    But while you exp your target changes it's not always the same. If you used NeoBot then you should know how $target pointer works.

    Here is my example.
    Code:
    local Target = Creature.GetByID(getSelfTargetID())
    
    if (Target:Name():lower() == 'wyrm' and Target:HealthPercent() >= 10 and Target:isAdjacent()) then
        --[[ CAST EXORI ICO ]]--
    end
    (๏̯͡๏ )

  7. #17
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sirmate View Post
    But while you exp your target changes it's not always the same. If you used NeoBot then you should know how $target pointer works.

    Here is my example.
    Code:
    local Target = Creature.GetByID(getSelfTargetID())
    
    if (Target:Name():lower() == 'wyrm' and Target:HealthPercent() >= 10 and Target:isAdjacent()) then
        --[[ CAST EXORI ICO ]]--
    end
    I don't use neo but I did, Was completely GUI-less, Not atractive.
    Bot's are my baby bitches, Neo bot was ugly as hell, but was able to move very nice. (you know what I mean)

    I don't know who is correct, me or you, or maybe both are, or maybe just you. (But I think Im wrong, for sure lmao xD)

    I just can't wait for the scripter!
    So I'm making non-sence scripts
    Last edited by Efren; 01-05-2012 at 01:36 AM. Reason: lol with the bold part

  8. #18

    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sirmate View Post
    Make them by yourself... lazy...
    Code:
    local self = Creature.GetByID(getSelfID())
    local target = Creature.GetByID(getSelfTargetID())
    local followed = Creature.GetByID(getSelfFollowID())
    There is no fkn GetSelfId() or GetTargetId().
    noob


    Quote Originally Posted by Efren View Post
    If I'm not mistaken they already exist.

    this are the relational properties. (can be found on the Creature.lua or Jo3 post)
    Code:
    Creature:isSelf()
    Creature:isTarget()
    Creature:isFollowed()
    an example of using this variables would be.. (using Jo3 example)
    Again if im not mistaken.
    Code:
    local creature = Creature.GetByName("Jo3Bingham")
    
    if (creature:ID() ~= 0) then
        if (creature:isTarget() and creature:WarIcon()) then
            ----use spell or rune
        end
    end
    If everything is fine then Jo3 will die.
    No dude, this only checks if the creature pointer you have, is the target or you. If you wanted to find the target's pointer, you'd have to either loop through all creatures and check if isTarget() or have a pre-defined pointer assigned to it, which is what I'm asking for.
    Last edited by Raphael; 01-05-2012 at 04:24 PM.

  9. #19
    Technical Support jo3bingham's Avatar
    Join Date
    Dec 2010
    Posts
    697
    Mentioned
    107 Post(s)
    Tagged
    0 Thread(s)
    There will be pointers as such (self, target, etc.). The Creature class, and more, just allows you to have more control over your scripts.

  10. #20
    Lifetime Subscriber Efren's Avatar
    Join Date
    Dec 2010
    Location
    Mexico NL, Monterrey
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raphael View Post
    Quote Originally Posted by sirmate View Post
    Make them by yourself... lazy...
    Code:
    local self = Creature.GetByID(getSelfID())
    local target = Creature.GetByID(getSelfTargetID())
    local followed = Creature.GetByID(getSelfFollowID())
    There is no fkn GetSelfId() or GetTargetId().
    noob
    They exist, Check the Creature.lua
    Code:
    ---------------------------------------------------
    -----------  Relational Properties	---------------
    ---------------------------------------------------
    
    function Creature:isSelf()
    	return self._id == getSelfID()
    end
    
    function Creature:isTarget()
    	return self._id == getSelfTargetID()
    end
    
    function Creature:isFollowed()
    	return self._id == getSelfFollowID()
    end

Posting Permissions

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