Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Follow the leader

  1. #1
    iBot User
    Join Date
    Dec 2014
    Posts
    9
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    2

    Follow the leader

    Hello, i'm looking for a way to follow a player when it is on screen and when it is not, go back to nearest waypoint in the script so it continues to bot, so it should follow the player once he's seen on screen then when he disappears it should re-continue botting, so to say. oO

    I'm new to this so need some code suggestions. ^^

    If anyone have any ideas if it is possible or think you can help I'm grateful. =)


  2. #2
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    @Madbunny92

    This kinda did the job.
    Lua Code:
     
    local parounds = getcreatures(p)
     
    for i=1,#parounds do
       if parounds[i].party == 4 then
          followcreature(parounds[i].name)
          wait(200,400)
       if follow.id > 0 then
          setcavebot('off')
       else
          setcavebot('on') 
          selectclosestwpt()
       end
       end
    end

  3. #3
    iBot User
    Join Date
    Dec 2014
    Posts
    9
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    2
    Thanks a ton, +rep

  4. #4
    iBot User
    Join Date
    Dec 2014
    Posts
    9
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    2
    Didn't get it to work but thanks for the reply ^^. I put it in as an action and changed name to the one i want my bot to follow. :O

  5. #5
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Madbunny92 View Post
    Didn't get it to work but thanks for the reply ^^. I put it in as an action and changed name to the one i want my bot to follow. :O
    Dont need to change anything, it will look all players around you and follow the one thats leader, like your titel described it.
    And that action worked for me, I will look at it again later

  6. #6
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Madbunny92 View Post
    Didn't get it to work but thanks for the reply ^^. I put it in as an action and changed name to the one i want my bot to follow. :O
    Can also try it like this

    Lua Code:
     
    local parounds = getcreatures(p)
     
    for i=1,#parounds do
       if parounds[i].party == 4 then
          setcavebot('off')
          stopattack()
          followcreature(parounds[i].name)
          wait(200,400)
       while follow.id > 0 do
          setcavebot('off')
          updateworld()
       end
          setcavebot('on') 
          selectclosestwpt()
       end
    end

  7. #7
    iBot User
    Join Date
    Dec 2014
    Posts
    9
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    2
    Thanks, but it didn't work for me not sure why. Could it be my script I'm using? I'm using your code together with Honeycomb Collector thais script. Gona try tweak some more tomorrow with this , hehe. =)

  8. #8
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Madbunny92 View Post
    Thanks, but it didn't work for me not sure why. Could it be my script I'm using? I'm using your code together with Honeycomb Collector thais script. Gona try tweak some more tomorrow with this , hehe. =)
    But tell me exactly what you want the action to do?
    Just follow X person or the leader of a party?
    Because it will follow the leader of a party atm

  9. #9
    iBot User
    Join Date
    Dec 2014
    Posts
    9
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    2
    Yeah just to follow the leader of a party is fine, or follow a specified person, I don't know if it matters, but it wont start to follow the leader on my screen. :/

  10. #10
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Madbunny92 View Post
    Yeah just to follow the leader of a party is fine, or follow a specified person, I don't know if it matters, but it wont start to follow the leader on my screen. :/
    I changed it a little bit, remember to be in party with the player you want to follow when on screen, and that this player needs to be leader of the party else it will not work

    Lua Code:
     
    local parounds = getcreatures('p')
    local leadericon= {4,6,8,10}
     
    for i=1,#parounds do
       for j=1,#leadericon do
          if parounds[i].party == leadericon[j]then
             setcavebot('off')
             settargeting('off')
             setlooting('off')
             stopattack()
          while follow.id == 0 do
             followcreature(parounds[i].name)
             wait(200,400)
             updateworld()
          end
          while follow.id > 0 do
             setcavebot('off')
             settargeting('off')
             setlooting('off')
             updateworld()
          end
             setcavebot('on')
             settargeting('on')
             setlooting('on')
             selectclosestwpt()
          end
       end
    end
    Last edited by Drakke; 01-16-2015 at 08:00 PM.

Posting Permissions

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