Results 1 to 9 of 9

Thread: [Help Request]Call for function/run action from waypoint action

  1. #1
    Normal User
    Join Date
    Dec 2012
    Location
    Sweden
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    [Help Request]Call for function/run action from waypoint action

    I want to run an action/function or what it's called from an waypoint action.

    What I have right now:
    Actions//List//OpenDepot
    Code:
    function OpenDepot()
        while IS_CHEST_OPEN == false
        do
        reachgrounditem("depot")
        wait(2000,3000)
        openitem("depot")
        wait(1500,2500)
        openitem("locker")
        wait(1500,2500)
        end
    return
    end
    Waypoint action:
    Code:
    $OpenDepot()
    If this is totaly wrong could you give me an example how it's done?

  2. #2
    iBot User
    Join Date
    Jun 2012
    Location
    Netherlands
    Posts
    62
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    5 Post(s)
    Reputation
    10
    Rep Power
    5
    Have you tried calling the function without the $? I'm not used to write LUA so I might be wrong, though I haven't seen it in actions/hotkeys from other people.

  3. #3
    Normal User mattos123's Avatar
    Join Date
    Sep 2012
    Location
    Brasil
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    12
    Rep Power
    5
    reachgrounditem("depot")
    wait(1000,2000)
    openitem("depot")
    wait(1000,2000)
    openitem(3502, "locker")

    try this
    Last edited by mattos123; 03-18-2013 at 02:52 PM.
    Se ontem fosse anti-ontem, e hoje fosse ontem, hoje seria oque ?





    ~O amanhã


  4. #4
    Normal User
    Join Date
    Dec 2012
    Location
    Sweden
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Quote Originally Posted by mattos123 View Post
    reachgrounditem("depot")
    wait(1000,2000)
    openitem("depot")
    wait(1000,2000)
    openitem(3502, "locker")

    try this at ur waypoint action
    I know that will work. But I want to have an function for it that I can call for from a waypoint action.

  5. #5
    Normal User
    Join Date
    Dec 2012
    Location
    Sweden
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    I got it to work now BUT now it's stuck in an loop for some reason.

    waypoint action:
    Code:
    OpenDepot()
    Actions//setup:
    Code:
    function OpenDepot(IS_CHEST_OPEN)
        local IS_CHEST_OPEN = getcontainer("depot chest").open
        while IS_CHEST_OPEN == false
        do
        reachgrounditem("depot")
        wait(2000,3000)
        openitem("depot")
        wait(1500,2500)
        openitem("locker")
        wait(1500,2500)
        end
    end

  6. #6
    Normal User mattos123's Avatar
    Join Date
    Sep 2012
    Location
    Brasil
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    12
    Rep Power
    5
    because, what u are trying to make is an "function" for a library , in that case,

    go to iBot>library>standard > last line of file , paste this
    function OPENDEPOT(IS_CHEST_OPEN)
    local IS_CHEST_OPEN = getcontainer("depot chest").open
    while IS_CHEST_OPEN == false
    do
    reachgrounditem("depot")
    wait(1000,2000)
    openitem("depot")
    wait(1000,2000)
    openitem(3502, "locker")
    end
    end


    after doing it, restart ur iBot.exe
    add a waypoint with this action on it
    "opendepot()"
    i think that will work
    Last edited by mattos123; 03-18-2013 at 03:37 PM.
    Se ontem fosse anti-ontem, e hoje fosse ontem, hoje seria oque ?





    ~O amanhã


  7. #7
    Normal User
    Join Date
    Dec 2012
    Location
    Sweden
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Quote Originally Posted by mattos123 View Post
    because, what u are trying to make is an "function" for a library , in that case,

    go to iBot>library>standard > last line of file , paste this
    function OPENDEPOT(IS_CHEST_OPEN)
    local IS_CHEST_OPEN = getcontainer("depot chest").open
    while IS_CHEST_OPEN == false
    do
    reachgrounditem("depot")
    wait(1000,2000)
    openitem("depot")
    wait(1000,2000)
    openitem(3502, "locker")
    end
    end


    after doing it, restart ur iBot.exe
    add a waypoint with this action on it
    "opendepot()"
    i think that will work
    Thanks!

    But what if I don't want to make an function for an libary and just have the function in the setup in actions?

  8. #8
    iBot User
    Join Date
    Jun 2012
    Location
    Netherlands
    Posts
    62
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    5 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by Supreme Allah View Post
    Thanks!

    But what if I don't want to make an function for an libary and just have the function in the setup in actions?
    That should be possible. Try it out. If it doesn't work, do what mattos123 said by adding your function to standard.lua, or, if you are planning on adding more functions you can create your own library.

  9. #9
    Normal User mattos123's Avatar
    Join Date
    Sep 2012
    Location
    Brasil
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    12
    Rep Power
    5
    Quote Originally Posted by Supreme Allah View Post
    Thanks!

    But what if I don't want to make an function for an libary and just have the function in the setup in actions?
    1st: create an action: set this actions this name > Depositer From Action
    paste this on the action
        local IS_CHEST_OPEN = getcontainer("depot chest").open
    while IS_CHEST_OPEN == false
    do
    reachgrounditem("depot")
    wait(1000,2000)
    openitem("depot")
    wait(1000,2000)
    openitem(3502, "locker")
    end
    end


    2nd: on the waypoint action set this:
    setsettings("Settings\\Actions\\List\\Depositer From Action\\Enabled", "Yes")


    3rd on next wpt after the one with the action , create a stand wpt , after that one create an action wpt and write this in
    setsettings("Settings\\Actions\\List\\Depositer From Action\\Enabled", "No")



    elseif (xd ) that dont work, write on post
    Se ontem fosse anti-ontem, e hoje fosse ontem, hoje seria oque ?





    ~O amanhã


Posting Permissions

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