Results 1 to 4 of 4

Thread: ACtion to move if player on screen (xyz)

  1. #1
    Banned
    Join Date
    Jul 2012
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    20
    Rep Power
    0

    Exclamation ACtion to move if player on screen (xyz)

    So guys, I'm trying to make a action in waypoint like this:,,,


    Code:
    local m = getcreature("Degolador")
        if iscreatureontile(32354 , 32230 , 7) and (m > 0) then
            gotolabel("move1")
        end
    But I can not do.

    What I wanted to do?

    Well if the creature EXACT (Degolador) is in the EXACT sqm which was given above, my char go to the label "move1".

    Do not operate if any one player.

    Could anyone help me? I think I explained straight ^ ^

    Thank you.

  2. #2
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    getcreature("Degolador") does not return an int, so trying to check if m is > 0 will just return nothing.

    do:

    If getcreature("Degolador").x == 32354 and getcreature("Degolador").y == 32230 and getcreature("Degolador").z == 7 then
    gotolabel("move1")
    end


    2.9.1 Creatures Information

    ignorecreature(int id, bool ignore) [void]: Set the creature with id creature id to be ignored by bot actions.
    getcreature(int/string id/name) [userdata]: Returns the data structure for some creature with id or name defined. Parameters shown below, you don't need to index what creature you want to access because it returns a single one.
    getcreatures(string filter) [userdata]: A special type of loop iterator that cycles through all creatures and lets you script various operations on each one of them. You must index what creature you want to access by adding a int starting from 0 to max count of creatures.
    As filter you can pass a combination of conditions defined as follows:
    p: creature must be a player.
    m: creature must be a monster.
    f: creature must be on the same floor as you.
    s: creature must be on the same floor as you and on the visible portion of the screen.
    You can use pointers in the same way of target and follow variables with the additional .count pointer:
    .count [int]: Returns the max amount of creatures got with filter. This parameter doesn't need to be indexed.
    .id [int]: Returns the unique ID of the creature.
    .name [string]: Returns the creature's name.
    .hpperc [int]: Returns the creature's health percentage.
    .x [int]: Returns the creature's x coordinate.
    .y [int]: Returns the creature's y coordinate.
    .z [int]: Returns the creature's z coordinate.
    .direction [string]: Returns the creature's direction name as "n", "s", "w" or "e".
    .outfit [int]: Returns the ID of creature's outfit.
    .speed [int]: Returns the creature's speed.
    .dist [int]: Returns the biggest distance in either x or y between the creature and your character.
    .skull [int]: Returns the creature's skull type id.
    .party [int]: Returns the creature's party type id.
    .waricon [int]: Returns the creature's war banner type id.
    .visible [int]: Returns 1 if the creature is visible, 0 otherwise.
    .walking [int]: Returns 1 if the creature is visible, 0 otherwise.
    .ignored [boolean]: Returns true if creature is being ignored by the targeting system (if ignorecreature() was used on it), false otherwise.
    .hittime [int]: Returns, in milliseconds, the last time the creature dealt damage on other creature.
    .type [int]: Returns the creature type ID.
    .isattackme [boolean]: Returns true if creature is attacking, false otherwise.
    .isplayerattack [boolean]: Returns true if creature is attacking player, false otherwise.
    .ismonster [boolean]: Returns true if creature is a monster, false otherwise.
    .isplayer [boolean]: Returns true if creature is a player, false otherwise.
    .isshootable [boolean]: Returns true can be shot from your position, false otherwise.
    .isreachable [boolean]: Returns true can be reach from your position, false otherwise.
    Last edited by pink_panther; 11-24-2013 at 07:41 AM.

  3. #3
    Banned
    Join Date
    Jul 2012
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    20
    Rep Power
    0
    Quote Originally Posted by pink_panther View Post
    getcreature("Degolador") does not return an int, so trying to check if m is > 0 will just return nothing.

    do:

    If getcreature("Degolador").x == 32354 and getcreature("Degolador").y == 32230 and getcreature("Degolador").z == 7 then
    gotolabel("move1")
    end
    Humm i'll test bro, thanks anyway. i'll post the result XD


    Edit: Wow its work 100% *.* ..

    thanks youuu


    without wanting to be abused, as I would if the case were more than one character?

    If getcreature ("degolador","ronaldo",""). == X ..... then z
    gotolabel ("move1")
    end

    is it ? Thanks bro.
    Last edited by bytpm; 11-24-2013 at 11:51 AM.

  4. #4
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7
    Quote Originally Posted by bytpm View Post
    without wanting to be abused, as I would if the case were more than one character?

    If getcreature ("degolador","ronaldo",""). == X ..... then z
    gotolabel ("move1")
    end

    is it ? Thanks bro.
    No, you need to create a table for it, example:

    Lua Code:
    local PLAYERS = {"Degolador", "Ronaldo"}
     
    for i,j in ipairs(PLAYERS) do
    m = getcreature(j)
    end


    and then just add the rest of the action, like: if m.x == X and m.y == Y ....
    Last edited by Dehan; 11-25-2013 at 09:51 AM.
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

Posting Permissions

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